// This C++ source file was generated by the ASN.1 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 "RUA_IEs.hh" namespace RUA__IEs { /* Global variable definitions */ // No XER for CN__DomainIndicator const TTCN_JSONdescriptor_t CN__DomainIndicator_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CN__DomainIndicator_oer_ext_arr_[0] = {}; const int CN__DomainIndicator_oer_p_[0] = {}; const TTCN_OERdescriptor_t CN__DomainIndicator_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CN__DomainIndicator_oer_ext_arr_, 0, CN__DomainIndicator_oer_p_}; static const Per_Constraint CN__DomainIndicator_per_cons_; const ASN_PERdescriptor_t CN__DomainIndicator_per_ = { &CN__DomainIndicator_per_cons_ }; const TTCN_Typedescriptor_t CN__DomainIndicator_descr_ = { "@RUA-IEs.CN-DomainIndicator", &ENUMERATED_ber_, NULL, NULL, NULL, &CN__DomainIndicator_json_, &CN__DomainIndicator_oer_, &CN__DomainIndicator_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CN__DomainIndicator_default_coding(""); // No XER for CSGMembershipStatus const TTCN_JSONdescriptor_t CSGMembershipStatus_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CSGMembershipStatus_oer_ext_arr_[0] = {}; const int CSGMembershipStatus_oer_p_[0] = {}; const TTCN_OERdescriptor_t CSGMembershipStatus_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CSGMembershipStatus_oer_ext_arr_, 0, CSGMembershipStatus_oer_p_}; static const Per_Constraint CSGMembershipStatus_per_cons_; const ASN_PERdescriptor_t CSGMembershipStatus_per_ = { &CSGMembershipStatus_per_cons_ }; const TTCN_Typedescriptor_t CSGMembershipStatus_descr_ = { "@RUA-IEs.CSGMembershipStatus", &ENUMERATED_ber_, NULL, NULL, NULL, &CSGMembershipStatus_json_, &CSGMembershipStatus_oer_, &CSGMembershipStatus_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CSGMembershipStatus_default_coding(""); // No XER for Establishment__Cause const TTCN_JSONdescriptor_t Establishment__Cause_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Establishment__Cause_oer_ext_arr_[0] = {}; const int Establishment__Cause_oer_p_[0] = {}; const TTCN_OERdescriptor_t Establishment__Cause_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Establishment__Cause_oer_ext_arr_, 0, Establishment__Cause_oer_p_}; static const Per_Constraint Establishment__Cause_per_cons_; const ASN_PERdescriptor_t Establishment__Cause_per_ = { &Establishment__Cause_per_cons_ }; const TTCN_Typedescriptor_t Establishment__Cause_descr_ = { "@RUA-IEs.Establishment-Cause", &ENUMERATED_ber_, NULL, NULL, NULL, &Establishment__Cause_json_, &Establishment__Cause_oer_, &Establishment__Cause_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Establishment__Cause_default_coding(""); // No XER for Context__ID const int Context__ID_oer_ext_arr_[0] = {}; const int Context__ID_oer_p_[0] = {}; const TTCN_OERdescriptor_t Context__ID_oer_ = { -1, TRUE, 24, FALSE, 0, 0, Context__ID_oer_ext_arr_, 0, Context__ID_oer_p_}; static Per_Integer_Constraint Context__ID_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(24), FALSE); static Per_BitString_Constraint Context__ID_per_cons_(FALSE, &Context__ID_size_per_cons_); const ASN_PERdescriptor_t Context__ID_per_ = { &Context__ID_per_cons_ }; const TTCN_Typedescriptor_t Context__ID_descr_ = { "@RUA-IEs.Context-ID", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Context__ID_oer_, &Context__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Context__ID_default_coding(""); const ASN_Tag_t IntraDomainNasNodeSelector_version_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t IntraDomainNasNodeSelector_version_ber_ = { 1u, IntraDomainNasNodeSelector_version_tag_ }; // No XER for IntraDomainNasNodeSelector_version const TTCN_JSONdescriptor_t IntraDomainNasNodeSelector_version_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int IntraDomainNasNodeSelector_version_oer_ext_arr_[0] = {}; const int IntraDomainNasNodeSelector_version_oer_p_[0] = {}; const TTCN_OERdescriptor_t IntraDomainNasNodeSelector_version_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IntraDomainNasNodeSelector_version_oer_ext_arr_, 0, IntraDomainNasNodeSelector_version_oer_p_}; static const Per_Constraint IntraDomainNasNodeSelector_version_per_cons_; const ASN_PERdescriptor_t IntraDomainNasNodeSelector_version_per_ = { &IntraDomainNasNodeSelector_version_per_cons_ }; const TTCN_Typedescriptor_t IntraDomainNasNodeSelector_version_descr_ = { "@RUA-IEs.IntraDomainNasNodeSelector.version", &IntraDomainNasNodeSelector_version_ber_, NULL, NULL, NULL, &IntraDomainNasNodeSelector_version_json_, &IntraDomainNasNodeSelector_version_oer_, &IntraDomainNasNodeSelector_version_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t IntraDomainNasNodeSelector_version_release99_cn__Type_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_ber_ = { 1u, IntraDomainNasNodeSelector_version_release99_cn__Type_tag_ }; // No XER for IntraDomainNasNodeSelector_version_release99_cn__Type const TTCN_JSONdescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int IntraDomainNasNodeSelector_version_release99_cn__Type_oer_ext_arr_[0] = {}; const int IntraDomainNasNodeSelector_version_release99_cn__Type_oer_p_[0] = {}; const TTCN_OERdescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IntraDomainNasNodeSelector_version_release99_cn__Type_oer_ext_arr_, 0, IntraDomainNasNodeSelector_version_release99_cn__Type_oer_p_}; static const Per_Constraint IntraDomainNasNodeSelector_version_release99_cn__Type_per_cons_; const ASN_PERdescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_per_ = { &IntraDomainNasNodeSelector_version_release99_cn__Type_per_cons_ }; const TTCN_Typedescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_descr_ = { "@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type", &IntraDomainNasNodeSelector_version_release99_cn__Type_ber_, NULL, NULL, NULL, &IntraDomainNasNodeSelector_version_release99_cn__Type_json_, &IntraDomainNasNodeSelector_version_release99_cn__Type_oer_, &IntraDomainNasNodeSelector_version_release99_cn__Type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t Gsm__map__IDNNS_routingbasis_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_per_ = { &Gsm__map__IDNNS_routingbasis_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis", &Gsm__map__IDNNS_routingbasis_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_json_, &Gsm__map__IDNNS_routingbasis_oer_, &Gsm__map__IDNNS_routingbasis_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for RoutingParameter const int RoutingParameter_oer_ext_arr_[0] = {}; const int RoutingParameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t RoutingParameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, RoutingParameter_oer_ext_arr_, 0, RoutingParameter_oer_p_}; static Per_Integer_Constraint RoutingParameter_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(10), FALSE); static Per_BitString_Constraint RoutingParameter_per_cons_(FALSE, &RoutingParameter_size_per_cons_); const ASN_PERdescriptor_t RoutingParameter_per_ = { &RoutingParameter_per_cons_ }; const TTCN_Typedescriptor_t RoutingParameter_descr_ = { "@RUA-IEs.RoutingParameter", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &RoutingParameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RoutingParameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter const int Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI.routingparameter", &Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_localPTMSI_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_localPTMSI_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_localPTMSI_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_localPTMSI const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_localPTMSI_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_localPTMSI_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_localPTMSI_oer_p_[1] = {0}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_localPTMSI_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_localPTMSI_oer_ext_arr_, 1, Gsm__map__IDNNS_routingbasis_localPTMSI_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_localPTMSI_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_localPTMSI_per_ = { &Gsm__map__IDNNS_routingbasis_localPTMSI_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_localPTMSI_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI", &Gsm__map__IDNNS_routingbasis_localPTMSI_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_localPTMSI_json_, &Gsm__map__IDNNS_routingbasis_localPTMSI_oer_, &Gsm__map__IDNNS_routingbasis_localPTMSI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_localPTMSI_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter const int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN.routingparameter", &Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_oer_p_[1] = {0}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_oer_ext_arr_, 1, Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_per_ = { &Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN", &Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_json_, &Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_oer_, &Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter const int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN.routingparameter", &Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_oer_p_[1] = {0}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_oer_ext_arr_, 1, Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_per_ = { &Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN", &Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_json_, &Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_oer_, &Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter const int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging.routingparameter", &Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_oer_p_[1] = {0}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_oer_ext_arr_, 1, Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_per_ = { &Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging", &Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_json_, &Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_oer_, &Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter const int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent.routingparameter", &Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_tag_[] = { { ASN_TAG_CONT, 4u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_oer_p_[1] = {0}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_oer_ext_arr_, 1, Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_per_ = { &Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent", &Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_json_, &Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_oer_, &Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_iMEI_routingparameter const int Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI.routingparameter", &Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_iMEI_tag_[] = { { ASN_TAG_CONT, 5u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_iMEI_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_iMEI_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_iMEI const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_iMEI_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_iMEI_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_iMEI_oer_p_[1] = {0}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_iMEI_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_iMEI_oer_ext_arr_, 1, Gsm__map__IDNNS_routingbasis_iMEI_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_iMEI_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_iMEI_per_ = { &Gsm__map__IDNNS_routingbasis_iMEI_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_iMEI_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI", &Gsm__map__IDNNS_routingbasis_iMEI_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_iMEI_json_, &Gsm__map__IDNNS_routingbasis_iMEI_oer_, &Gsm__map__IDNNS_routingbasis_iMEI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_iMEI_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_spare2_routingparameter_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_spare2_routingparameter_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_spare2_routingparameter_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_spare2_routingparameter const int Gsm__map__IDNNS_routingbasis_spare2_routingparameter_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_spare2_routingparameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_spare2_routingparameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_spare2_routingparameter_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_spare2_routingparameter_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2.routingparameter", &Gsm__map__IDNNS_routingbasis_spare2_routingparameter_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Gsm__map__IDNNS_routingbasis_spare2_routingparameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_spare2_routingparameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_spare2_tag_[] = { { ASN_TAG_CONT, 6u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_spare2_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_spare2_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_spare2 const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_spare2_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_spare2_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_spare2_oer_p_[1] = {0}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_spare2_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_spare2_oer_ext_arr_, 1, Gsm__map__IDNNS_routingbasis_spare2_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_spare2_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_spare2_per_ = { &Gsm__map__IDNNS_routingbasis_spare2_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_spare2_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2", &Gsm__map__IDNNS_routingbasis_spare2_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_spare2_json_, &Gsm__map__IDNNS_routingbasis_spare2_oer_, &Gsm__map__IDNNS_routingbasis_spare2_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_spare2_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_spare1_routingparameter_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_spare1_routingparameter_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_spare1_routingparameter_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_spare1_routingparameter const int Gsm__map__IDNNS_routingbasis_spare1_routingparameter_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_spare1_routingparameter_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_spare1_routingparameter_oer_ = { -1, TRUE, 10, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_spare1_routingparameter_oer_ext_arr_, 0, Gsm__map__IDNNS_routingbasis_spare1_routingparameter_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1.routingparameter", &Gsm__map__IDNNS_routingbasis_spare1_routingparameter_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Gsm__map__IDNNS_routingbasis_spare1_routingparameter_oer_, &RoutingParameter_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_spare1_routingparameter_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_routingbasis_spare1_tag_[] = { { ASN_TAG_CONT, 7u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_routingbasis_spare1_ber_ = { 1u, Gsm__map__IDNNS_routingbasis_spare1_tag_ }; // No XER for Gsm__map__IDNNS_routingbasis_spare1 const TTCN_JSONdescriptor_t Gsm__map__IDNNS_routingbasis_spare1_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_routingbasis_spare1_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_routingbasis_spare1_oer_p_[1] = {0}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_routingbasis_spare1_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_routingbasis_spare1_oer_ext_arr_, 1, Gsm__map__IDNNS_routingbasis_spare1_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_routingbasis_spare1_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_routingbasis_spare1_per_ = { &Gsm__map__IDNNS_routingbasis_spare1_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_routingbasis_spare1_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1", &Gsm__map__IDNNS_routingbasis_spare1_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_routingbasis_spare1_json_, &Gsm__map__IDNNS_routingbasis_spare1_oer_, &Gsm__map__IDNNS_routingbasis_spare1_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_spare1_default_coding(""); UNIVERSAL_CHARSTRING Gsm__map__IDNNS_routingbasis_default_coding(""); const ASN_Tag_t Gsm__map__IDNNS_dummy_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t Gsm__map__IDNNS_dummy_ber_ = { 1u, Gsm__map__IDNNS_dummy_tag_ }; // No XER for Gsm__map__IDNNS_dummy const int Gsm__map__IDNNS_dummy_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_dummy_oer_p_[0] = {}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_dummy_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_dummy_oer_ext_arr_, 0, Gsm__map__IDNNS_dummy_oer_p_}; const TTCN_Typedescriptor_t Gsm__map__IDNNS_dummy_descr_ = { "@RUA-IEs.Gsm-map-IDNNS.dummy", &Gsm__map__IDNNS_dummy_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, NULL, &BOOLEAN_json_, &Gsm__map__IDNNS_dummy_oer_, &BOOLEAN_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_dummy_default_coding(""); // No XER for Gsm__map__IDNNS const TTCN_JSONdescriptor_t Gsm__map__IDNNS_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Gsm__map__IDNNS_oer_ext_arr_[0] = {}; const int Gsm__map__IDNNS_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t Gsm__map__IDNNS_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Gsm__map__IDNNS_oer_ext_arr_, 2, Gsm__map__IDNNS_oer_p_}; static const Per_Constraint Gsm__map__IDNNS_per_cons_; const ASN_PERdescriptor_t Gsm__map__IDNNS_per_ = { &Gsm__map__IDNNS_per_cons_ }; const TTCN_Typedescriptor_t Gsm__map__IDNNS_descr_ = { "@RUA-IEs.Gsm-map-IDNNS", &SEQUENCE_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_json_, &Gsm__map__IDNNS_oer_, &Gsm__map__IDNNS_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Gsm__map__IDNNS_default_coding(""); const ASN_Tag_t IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_ber_ = { 1u, IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_tag_ }; // No XER for IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS const int IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_oer_ext_arr_[0] = {}; const int IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_oer_ext_arr_, 2, IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_oer_p_}; const TTCN_Typedescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_ = { "@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type.gsm-Map-IDNNS", &IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_ber_, NULL, NULL, NULL, &Gsm__map__IDNNS_json_, &IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_oer_, &Gsm__map__IDNNS_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_default_coding(""); // No XER for Ansi__41__IDNNS const int Ansi__41__IDNNS_oer_ext_arr_[0] = {}; const int Ansi__41__IDNNS_oer_p_[0] = {}; const TTCN_OERdescriptor_t Ansi__41__IDNNS_oer_ = { -1, TRUE, 14, FALSE, 0, 0, Ansi__41__IDNNS_oer_ext_arr_, 0, Ansi__41__IDNNS_oer_p_}; static Per_Integer_Constraint Ansi__41__IDNNS_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(14), FALSE); static Per_BitString_Constraint Ansi__41__IDNNS_per_cons_(FALSE, &Ansi__41__IDNNS_size_per_cons_); const ASN_PERdescriptor_t Ansi__41__IDNNS_per_ = { &Ansi__41__IDNNS_per_cons_ }; const TTCN_Typedescriptor_t Ansi__41__IDNNS_descr_ = { "@RUA-IEs.Ansi-41-IDNNS", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &Ansi__41__IDNNS_oer_, &Ansi__41__IDNNS_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Ansi__41__IDNNS_default_coding(""); const ASN_Tag_t IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_ber_ = { 1u, IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_tag_ }; // No XER for IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS const int IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_oer_ext_arr_[0] = {}; const int IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_oer_p_[0] = {}; const TTCN_OERdescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_oer_ = { -1, TRUE, 14, FALSE, 0, 0, IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_oer_ext_arr_, 0, IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_oer_p_}; const TTCN_Typedescriptor_t IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_ = { "@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type.ansi-41-IDNNS", &IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_ber_, NULL, NULL, NULL, &BITSTRING_json_, &IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_oer_, &Ansi__41__IDNNS_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_default_coding(""); UNIVERSAL_CHARSTRING IntraDomainNasNodeSelector_version_release99_cn__Type_default_coding(""); const ASN_Tag_t IntraDomainNasNodeSelector_version_release99_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t IntraDomainNasNodeSelector_version_release99_ber_ = { 1u, IntraDomainNasNodeSelector_version_release99_tag_ }; // No XER for IntraDomainNasNodeSelector_version_release99 const TTCN_JSONdescriptor_t IntraDomainNasNodeSelector_version_release99_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int IntraDomainNasNodeSelector_version_release99_oer_ext_arr_[0] = {}; const int IntraDomainNasNodeSelector_version_release99_oer_p_[1] = {0}; const TTCN_OERdescriptor_t IntraDomainNasNodeSelector_version_release99_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IntraDomainNasNodeSelector_version_release99_oer_ext_arr_, 1, IntraDomainNasNodeSelector_version_release99_oer_p_}; static const Per_Constraint IntraDomainNasNodeSelector_version_release99_per_cons_; const ASN_PERdescriptor_t IntraDomainNasNodeSelector_version_release99_per_ = { &IntraDomainNasNodeSelector_version_release99_per_cons_ }; const TTCN_Typedescriptor_t IntraDomainNasNodeSelector_version_release99_descr_ = { "@RUA-IEs.IntraDomainNasNodeSelector.version.release99", &IntraDomainNasNodeSelector_version_release99_ber_, NULL, NULL, NULL, &IntraDomainNasNodeSelector_version_release99_json_, &IntraDomainNasNodeSelector_version_release99_oer_, &IntraDomainNasNodeSelector_version_release99_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IntraDomainNasNodeSelector_version_release99_default_coding(""); const ASN_Tag_t IntraDomainNasNodeSelector_version_later_futurecoding_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t IntraDomainNasNodeSelector_version_later_futurecoding_ber_ = { 1u, IntraDomainNasNodeSelector_version_later_futurecoding_tag_ }; // No XER for IntraDomainNasNodeSelector_version_later_futurecoding const int IntraDomainNasNodeSelector_version_later_futurecoding_oer_ext_arr_[0] = {}; const int IntraDomainNasNodeSelector_version_later_futurecoding_oer_p_[0] = {}; const TTCN_OERdescriptor_t IntraDomainNasNodeSelector_version_later_futurecoding_oer_ = { -1, TRUE, 15, FALSE, 0, 0, IntraDomainNasNodeSelector_version_later_futurecoding_oer_ext_arr_, 0, IntraDomainNasNodeSelector_version_later_futurecoding_oer_p_}; static Per_Integer_Constraint IntraDomainNasNodeSelector_version_later_futurecoding_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(15), FALSE); static Per_BitString_Constraint IntraDomainNasNodeSelector_version_later_futurecoding_per_cons_(FALSE, &IntraDomainNasNodeSelector_version_later_futurecoding_size_per_cons_); const ASN_PERdescriptor_t IntraDomainNasNodeSelector_version_later_futurecoding_per_ = { &IntraDomainNasNodeSelector_version_later_futurecoding_per_cons_ }; const TTCN_Typedescriptor_t IntraDomainNasNodeSelector_version_later_futurecoding_descr_ = { "@RUA-IEs.IntraDomainNasNodeSelector.version.later.futurecoding", &IntraDomainNasNodeSelector_version_later_futurecoding_ber_, NULL, NULL, NULL, &BITSTRING_json_, &IntraDomainNasNodeSelector_version_later_futurecoding_oer_, &IntraDomainNasNodeSelector_version_later_futurecoding_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IntraDomainNasNodeSelector_version_later_futurecoding_default_coding(""); const ASN_Tag_t IntraDomainNasNodeSelector_version_later_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t IntraDomainNasNodeSelector_version_later_ber_ = { 1u, IntraDomainNasNodeSelector_version_later_tag_ }; // No XER for IntraDomainNasNodeSelector_version_later const TTCN_JSONdescriptor_t IntraDomainNasNodeSelector_version_later_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int IntraDomainNasNodeSelector_version_later_oer_ext_arr_[0] = {}; const int IntraDomainNasNodeSelector_version_later_oer_p_[1] = {0}; const TTCN_OERdescriptor_t IntraDomainNasNodeSelector_version_later_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IntraDomainNasNodeSelector_version_later_oer_ext_arr_, 1, IntraDomainNasNodeSelector_version_later_oer_p_}; static const Per_Constraint IntraDomainNasNodeSelector_version_later_per_cons_; const ASN_PERdescriptor_t IntraDomainNasNodeSelector_version_later_per_ = { &IntraDomainNasNodeSelector_version_later_per_cons_ }; const TTCN_Typedescriptor_t IntraDomainNasNodeSelector_version_later_descr_ = { "@RUA-IEs.IntraDomainNasNodeSelector.version.later", &IntraDomainNasNodeSelector_version_later_ber_, NULL, NULL, NULL, &IntraDomainNasNodeSelector_version_later_json_, &IntraDomainNasNodeSelector_version_later_oer_, &IntraDomainNasNodeSelector_version_later_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IntraDomainNasNodeSelector_version_later_default_coding(""); UNIVERSAL_CHARSTRING IntraDomainNasNodeSelector_version_default_coding(""); // No XER for IntraDomainNasNodeSelector const TTCN_JSONdescriptor_t IntraDomainNasNodeSelector_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int IntraDomainNasNodeSelector_oer_ext_arr_[0] = {}; const int IntraDomainNasNodeSelector_oer_p_[1] = {0}; const TTCN_OERdescriptor_t IntraDomainNasNodeSelector_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IntraDomainNasNodeSelector_oer_ext_arr_, 1, IntraDomainNasNodeSelector_oer_p_}; static const Per_Constraint IntraDomainNasNodeSelector_per_cons_; const ASN_PERdescriptor_t IntraDomainNasNodeSelector_per_ = { &IntraDomainNasNodeSelector_per_cons_ }; const TTCN_Typedescriptor_t IntraDomainNasNodeSelector_descr_ = { "@RUA-IEs.IntraDomainNasNodeSelector", &SEQUENCE_ber_, NULL, NULL, NULL, &IntraDomainNasNodeSelector_json_, &IntraDomainNasNodeSelector_oer_, &IntraDomainNasNodeSelector_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IntraDomainNasNodeSelector_default_coding(""); const TTCN_Typedescriptor_t& RANAP__Message_descr_ = OCTETSTRING_descr_; UNIVERSAL_CHARSTRING RANAP__Message_default_coding(""); // No XER for Cause const TTCN_JSONdescriptor_t Cause_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Cause_oer_ext_arr_[0] = {}; const int Cause_oer_p_[0] = {}; const TTCN_OERdescriptor_t Cause_oer_ = { -1, TRUE, -1, TRUE, 4, 0, Cause_oer_ext_arr_, 0, Cause_oer_p_}; static const Per_Constraint Cause_per_cons_; const ASN_PERdescriptor_t Cause_per_ = { &Cause_per_cons_ }; const TTCN_Typedescriptor_t Cause_descr_ = { "@RUA-IEs.Cause", &CHOICE_ber_, NULL, NULL, NULL, &Cause_json_, &Cause_oer_, &Cause_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for CauseRadioNetwork const TTCN_JSONdescriptor_t CauseRadioNetwork_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CauseRadioNetwork_oer_ext_arr_[0] = {}; const int CauseRadioNetwork_oer_p_[0] = {}; const TTCN_OERdescriptor_t CauseRadioNetwork_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CauseRadioNetwork_oer_ext_arr_, 0, CauseRadioNetwork_oer_p_}; static const Per_Constraint CauseRadioNetwork_per_cons_; const ASN_PERdescriptor_t CauseRadioNetwork_per_ = { &CauseRadioNetwork_per_cons_ }; const TTCN_Typedescriptor_t CauseRadioNetwork_descr_ = { "@RUA-IEs.CauseRadioNetwork", &ENUMERATED_ber_, NULL, NULL, NULL, &CauseRadioNetwork_json_, &CauseRadioNetwork_oer_, &CauseRadioNetwork_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CauseRadioNetwork_default_coding(""); const ASN_Tag_t Cause_radioNetwork_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t Cause_radioNetwork_ber_ = { 1u, Cause_radioNetwork_tag_ }; // No XER for Cause_radioNetwork const int Cause_radioNetwork_oer_ext_arr_[0] = {}; const int Cause_radioNetwork_oer_p_[0] = {}; const TTCN_OERdescriptor_t Cause_radioNetwork_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Cause_radioNetwork_oer_ext_arr_, 0, Cause_radioNetwork_oer_p_}; const TTCN_Typedescriptor_t Cause_radioNetwork_descr_ = { "@RUA-IEs.Cause.radioNetwork", &Cause_radioNetwork_ber_, NULL, NULL, NULL, &CauseRadioNetwork_json_, &Cause_radioNetwork_oer_, &CauseRadioNetwork_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Cause_radioNetwork_default_coding(""); // No XER for CauseTransport const TTCN_JSONdescriptor_t CauseTransport_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CauseTransport_oer_ext_arr_[0] = {}; const int CauseTransport_oer_p_[0] = {}; const TTCN_OERdescriptor_t CauseTransport_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CauseTransport_oer_ext_arr_, 0, CauseTransport_oer_p_}; static const Per_Constraint CauseTransport_per_cons_; const ASN_PERdescriptor_t CauseTransport_per_ = { &CauseTransport_per_cons_ }; const TTCN_Typedescriptor_t CauseTransport_descr_ = { "@RUA-IEs.CauseTransport", &ENUMERATED_ber_, NULL, NULL, NULL, &CauseTransport_json_, &CauseTransport_oer_, &CauseTransport_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CauseTransport_default_coding(""); const ASN_Tag_t Cause_transport_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t Cause_transport_ber_ = { 1u, Cause_transport_tag_ }; // No XER for Cause_transport const int Cause_transport_oer_ext_arr_[0] = {}; const int Cause_transport_oer_p_[0] = {}; const TTCN_OERdescriptor_t Cause_transport_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Cause_transport_oer_ext_arr_, 0, Cause_transport_oer_p_}; const TTCN_Typedescriptor_t Cause_transport_descr_ = { "@RUA-IEs.Cause.transport", &Cause_transport_ber_, NULL, NULL, NULL, &CauseTransport_json_, &Cause_transport_oer_, &CauseTransport_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Cause_transport_default_coding(""); // No XER for CauseProtocol const TTCN_JSONdescriptor_t CauseProtocol_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CauseProtocol_oer_ext_arr_[0] = {}; const int CauseProtocol_oer_p_[0] = {}; const TTCN_OERdescriptor_t CauseProtocol_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CauseProtocol_oer_ext_arr_, 0, CauseProtocol_oer_p_}; static const Per_Constraint CauseProtocol_per_cons_; const ASN_PERdescriptor_t CauseProtocol_per_ = { &CauseProtocol_per_cons_ }; const TTCN_Typedescriptor_t CauseProtocol_descr_ = { "@RUA-IEs.CauseProtocol", &ENUMERATED_ber_, NULL, NULL, NULL, &CauseProtocol_json_, &CauseProtocol_oer_, &CauseProtocol_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CauseProtocol_default_coding(""); const ASN_Tag_t Cause_protocol_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t Cause_protocol_ber_ = { 1u, Cause_protocol_tag_ }; // No XER for Cause_protocol const int Cause_protocol_oer_ext_arr_[0] = {}; const int Cause_protocol_oer_p_[0] = {}; const TTCN_OERdescriptor_t Cause_protocol_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Cause_protocol_oer_ext_arr_, 0, Cause_protocol_oer_p_}; const TTCN_Typedescriptor_t Cause_protocol_descr_ = { "@RUA-IEs.Cause.protocol", &Cause_protocol_ber_, NULL, NULL, NULL, &CauseProtocol_json_, &Cause_protocol_oer_, &CauseProtocol_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Cause_protocol_default_coding(""); // No XER for CauseMisc const TTCN_JSONdescriptor_t CauseMisc_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CauseMisc_oer_ext_arr_[0] = {}; const int CauseMisc_oer_p_[0] = {}; const TTCN_OERdescriptor_t CauseMisc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CauseMisc_oer_ext_arr_, 0, CauseMisc_oer_p_}; static const Per_Constraint CauseMisc_per_cons_; const ASN_PERdescriptor_t CauseMisc_per_ = { &CauseMisc_per_cons_ }; const TTCN_Typedescriptor_t CauseMisc_descr_ = { "@RUA-IEs.CauseMisc", &ENUMERATED_ber_, NULL, NULL, NULL, &CauseMisc_json_, &CauseMisc_oer_, &CauseMisc_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CauseMisc_default_coding(""); const ASN_Tag_t Cause_misc_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t Cause_misc_ber_ = { 1u, Cause_misc_tag_ }; // No XER for Cause_misc const int Cause_misc_oer_ext_arr_[0] = {}; const int Cause_misc_oer_p_[0] = {}; const TTCN_OERdescriptor_t Cause_misc_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Cause_misc_oer_ext_arr_, 0, Cause_misc_oer_p_}; const TTCN_Typedescriptor_t Cause_misc_descr_ = { "@RUA-IEs.Cause.misc", &Cause_misc_ber_, NULL, NULL, NULL, &CauseMisc_json_, &Cause_misc_oer_, &CauseMisc_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Cause_misc_default_coding(""); UNIVERSAL_CHARSTRING Cause_default_coding(""); // No XER for CriticalityDiagnostics const TTCN_JSONdescriptor_t CriticalityDiagnostics_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CriticalityDiagnostics_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics_oer_p_[5] = {0, 1, 2, 3, 4}; const TTCN_OERdescriptor_t CriticalityDiagnostics_oer_ = { -1, TRUE, -1, TRUE, 5, 0, CriticalityDiagnostics_oer_ext_arr_, 5, CriticalityDiagnostics_oer_p_}; static const Per_Constraint CriticalityDiagnostics_per_cons_; const ASN_PERdescriptor_t CriticalityDiagnostics_per_ = { &CriticalityDiagnostics_per_cons_ }; const TTCN_Typedescriptor_t CriticalityDiagnostics_descr_ = { "@RUA-IEs.CriticalityDiagnostics", &SEQUENCE_ber_, NULL, NULL, NULL, &CriticalityDiagnostics_json_, &CriticalityDiagnostics_oer_, &CriticalityDiagnostics_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t CriticalityDiagnostics_procedureCode_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t CriticalityDiagnostics_procedureCode_ber_ = { 1u, CriticalityDiagnostics_procedureCode_tag_ }; // No XER for CriticalityDiagnostics_procedureCode const int CriticalityDiagnostics_procedureCode_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics_procedureCode_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics_procedureCode_oer_ = { 1, FALSE, -1, FALSE, 0, 0, CriticalityDiagnostics_procedureCode_oer_ext_arr_, 0, CriticalityDiagnostics_procedureCode_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics_procedureCode_descr_ = { "@RUA-IEs.CriticalityDiagnostics.procedureCode", &CriticalityDiagnostics_procedureCode_ber_, NULL, NULL, NULL, &INTEGER_json_, &CriticalityDiagnostics_procedureCode_oer_, &RUA__CommonDataTypes::ProcedureCode_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics_procedureCode_default_coding(""); const ASN_Tag_t CriticalityDiagnostics_triggeringMessage_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t CriticalityDiagnostics_triggeringMessage_ber_ = { 1u, CriticalityDiagnostics_triggeringMessage_tag_ }; // No XER for CriticalityDiagnostics_triggeringMessage const int CriticalityDiagnostics_triggeringMessage_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics_triggeringMessage_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics_triggeringMessage_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CriticalityDiagnostics_triggeringMessage_oer_ext_arr_, 0, CriticalityDiagnostics_triggeringMessage_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics_triggeringMessage_descr_ = { "@RUA-IEs.CriticalityDiagnostics.triggeringMessage", &CriticalityDiagnostics_triggeringMessage_ber_, NULL, NULL, NULL, &RUA__CommonDataTypes::TriggeringMessage_json_, &CriticalityDiagnostics_triggeringMessage_oer_, &RUA__CommonDataTypes::TriggeringMessage_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics_triggeringMessage_default_coding(""); const ASN_Tag_t CriticalityDiagnostics_procedureCriticality_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t CriticalityDiagnostics_procedureCriticality_ber_ = { 1u, CriticalityDiagnostics_procedureCriticality_tag_ }; // No XER for CriticalityDiagnostics_procedureCriticality const int CriticalityDiagnostics_procedureCriticality_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics_procedureCriticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics_procedureCriticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CriticalityDiagnostics_procedureCriticality_oer_ext_arr_, 0, CriticalityDiagnostics_procedureCriticality_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics_procedureCriticality_descr_ = { "@RUA-IEs.CriticalityDiagnostics.procedureCriticality", &CriticalityDiagnostics_procedureCriticality_ber_, NULL, NULL, NULL, &RUA__CommonDataTypes::Criticality_json_, &CriticalityDiagnostics_procedureCriticality_oer_, &RUA__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics_procedureCriticality_default_coding(""); // No XER for CriticalityDiagnostics__IE__List const TTCN_JSONdescriptor_t CriticalityDiagnostics__IE__List_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CriticalityDiagnostics__IE__List_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics__IE__List_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics__IE__List_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CriticalityDiagnostics__IE__List_oer_ext_arr_, 0, CriticalityDiagnostics__IE__List_oer_p_}; static Per_Integer_Constraint CriticalityDiagnostics__IE__List_per_cons_(new INTEGER(1), new INTEGER(256), FALSE); const ASN_PERdescriptor_t CriticalityDiagnostics__IE__List_per_ = { &CriticalityDiagnostics__IE__List_per_cons_ }; const TTCN_Typedescriptor_t CriticalityDiagnostics__IE__List_descr_ = { "@RUA-IEs.CriticalityDiagnostics-IE-List", &SEQUENCE_ber_, NULL, NULL, NULL, &CriticalityDiagnostics__IE__List_json_, &CriticalityDiagnostics__IE__List_oer_, &CriticalityDiagnostics__IE__List_per_, &CriticalityDiagnostics__IE__List_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t CriticalityDiagnostics__IE__List_0_iECriticality_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t CriticalityDiagnostics__IE__List_0_iECriticality_ber_ = { 1u, CriticalityDiagnostics__IE__List_0_iECriticality_tag_ }; // No XER for CriticalityDiagnostics__IE__List_0_iECriticality const int CriticalityDiagnostics__IE__List_0_iECriticality_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics__IE__List_0_iECriticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics__IE__List_0_iECriticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CriticalityDiagnostics__IE__List_0_iECriticality_oer_ext_arr_, 0, CriticalityDiagnostics__IE__List_0_iECriticality_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics__IE__List_0_iECriticality_descr_ = { "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE.iECriticality", &CriticalityDiagnostics__IE__List_0_iECriticality_ber_, NULL, NULL, NULL, &RUA__CommonDataTypes::Criticality_json_, &CriticalityDiagnostics__IE__List_0_iECriticality_oer_, &RUA__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics__IE__List_0_iECriticality_default_coding(""); const ASN_Tag_t CriticalityDiagnostics__IE__List_0_iE__ID_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t CriticalityDiagnostics__IE__List_0_iE__ID_ber_ = { 1u, CriticalityDiagnostics__IE__List_0_iE__ID_tag_ }; // No XER for CriticalityDiagnostics__IE__List_0_iE__ID const int CriticalityDiagnostics__IE__List_0_iE__ID_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics__IE__List_0_iE__ID_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics__IE__List_0_iE__ID_oer_ = { 2, FALSE, -1, FALSE, 0, 0, CriticalityDiagnostics__IE__List_0_iE__ID_oer_ext_arr_, 0, CriticalityDiagnostics__IE__List_0_iE__ID_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics__IE__List_0_iE__ID_descr_ = { "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE.iE-ID", &CriticalityDiagnostics__IE__List_0_iE__ID_ber_, NULL, NULL, NULL, &INTEGER_json_, &CriticalityDiagnostics__IE__List_0_iE__ID_oer_, &RUA__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics__IE__List_0_iE__ID_default_coding(""); // No XER for TypeOfError const TTCN_JSONdescriptor_t TypeOfError_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int TypeOfError_oer_ext_arr_[0] = {}; const int TypeOfError_oer_p_[0] = {}; const TTCN_OERdescriptor_t TypeOfError_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TypeOfError_oer_ext_arr_, 0, TypeOfError_oer_p_}; static const Per_Constraint TypeOfError_per_cons_; const ASN_PERdescriptor_t TypeOfError_per_ = { &TypeOfError_per_cons_ }; const TTCN_Typedescriptor_t TypeOfError_descr_ = { "@RUA-IEs.TypeOfError", &ENUMERATED_ber_, NULL, NULL, NULL, &TypeOfError_json_, &TypeOfError_oer_, &TypeOfError_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TypeOfError_default_coding(""); const ASN_Tag_t CriticalityDiagnostics__IE__List_0_typeOfError_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t CriticalityDiagnostics__IE__List_0_typeOfError_ber_ = { 1u, CriticalityDiagnostics__IE__List_0_typeOfError_tag_ }; // No XER for CriticalityDiagnostics__IE__List_0_typeOfError const int CriticalityDiagnostics__IE__List_0_typeOfError_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics__IE__List_0_typeOfError_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics__IE__List_0_typeOfError_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CriticalityDiagnostics__IE__List_0_typeOfError_oer_ext_arr_, 0, CriticalityDiagnostics__IE__List_0_typeOfError_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics__IE__List_0_typeOfError_descr_ = { "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE.typeOfError", &CriticalityDiagnostics__IE__List_0_typeOfError_ber_, NULL, NULL, NULL, &TypeOfError_json_, &CriticalityDiagnostics__IE__List_0_typeOfError_oer_, &TypeOfError_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics__IE__List_0_typeOfError_default_coding(""); // No XER for CriticalityDiagnostics__IE__List_0 const TTCN_JSONdescriptor_t CriticalityDiagnostics__IE__List_0_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CriticalityDiagnostics__IE__List_0_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics__IE__List_0_oer_p_[4] = {0, 1, 2, 3}; const TTCN_OERdescriptor_t CriticalityDiagnostics__IE__List_0_oer_ = { -1, TRUE, -1, TRUE, 4, 0, CriticalityDiagnostics__IE__List_0_oer_ext_arr_, 4, CriticalityDiagnostics__IE__List_0_oer_p_}; static const Per_Constraint CriticalityDiagnostics__IE__List_0_per_cons_; const ASN_PERdescriptor_t CriticalityDiagnostics__IE__List_0_per_ = { &CriticalityDiagnostics__IE__List_0_per_cons_ }; const TTCN_Typedescriptor_t CriticalityDiagnostics__IE__List_0_descr_ = { "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE", &SEQUENCE_ber_, NULL, NULL, NULL, &CriticalityDiagnostics__IE__List_0_json_, &CriticalityDiagnostics__IE__List_0_oer_, &CriticalityDiagnostics__IE__List_0_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 const TTCN_JSONdescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_oer_ext_arr_, 0, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_oer_p_}; static Per_Integer_Constraint _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_per_ = { &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_per_cons_ }; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_descr_ = { "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_json_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_oer_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_per_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_ber_ = { 1u, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_tag_ }; // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_oer_ext_arr_, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_oer_p_}; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.id", &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_oer_, &RUA__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_default_coding(""); const ASN_Tag_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_ber_ = { 1u, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_tag_ }; // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_oer_ext_arr_, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.criticality", &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_ber_, NULL, NULL, NULL, &RUA__CommonDataTypes::Criticality_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_oer_, &RUA__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_default_coding(""); // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type const TTCN_JSONdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_per_ = { &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_oer_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_ber_ = { 1u, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_tag_ }; // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue", &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_oer_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_default_coding(""); // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1 const TTCN_JSONdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_oer_ext_arr_, 3, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_oer_p_}; static const Per_Constraint _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_per_cons_; const ASN_PERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_per_ = { &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_per_cons_ }; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_oer_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_default_coding(""); // No XER for _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0 const int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_oer_ext_arr_, 3, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_oer_p_}; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_descr_ = { "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_json_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_oer_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_default_coding(""); const ASN_Tag_t CriticalityDiagnostics__IE__List_0_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t CriticalityDiagnostics__IE__List_0_iE__Extensions_ber_ = { 1u, CriticalityDiagnostics__IE__List_0_iE__Extensions_tag_ }; // No XER for CriticalityDiagnostics__IE__List_0_iE__Extensions const int CriticalityDiagnostics__IE__List_0_iE__Extensions_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics__IE__List_0_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics__IE__List_0_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CriticalityDiagnostics__IE__List_0_iE__Extensions_oer_ext_arr_, 0, CriticalityDiagnostics__IE__List_0_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_ = { "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE.iE-Extensions", &CriticalityDiagnostics__IE__List_0_iE__Extensions_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_json_, &CriticalityDiagnostics__IE__List_0_iE__Extensions_oer_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_per_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics__IE__List_0_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING CriticalityDiagnostics__IE__List_0_default_coding(""); UNIVERSAL_CHARSTRING CriticalityDiagnostics__IE__List_default_coding(""); const ASN_Tag_t CriticalityDiagnostics_iEsCriticalityDiagnostics_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t CriticalityDiagnostics_iEsCriticalityDiagnostics_ber_ = { 1u, CriticalityDiagnostics_iEsCriticalityDiagnostics_tag_ }; // No XER for CriticalityDiagnostics_iEsCriticalityDiagnostics const int CriticalityDiagnostics_iEsCriticalityDiagnostics_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics_iEsCriticalityDiagnostics_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics_iEsCriticalityDiagnostics_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CriticalityDiagnostics_iEsCriticalityDiagnostics_oer_ext_arr_, 0, CriticalityDiagnostics_iEsCriticalityDiagnostics_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_ = { "@RUA-IEs.CriticalityDiagnostics.iEsCriticalityDiagnostics", &CriticalityDiagnostics_iEsCriticalityDiagnostics_ber_, NULL, NULL, NULL, &CriticalityDiagnostics__IE__List_json_, &CriticalityDiagnostics_iEsCriticalityDiagnostics_oer_, &CriticalityDiagnostics__IE__List_per_, &CriticalityDiagnostics__IE__List_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics_iEsCriticalityDiagnostics_default_coding(""); // No XER for _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 const TTCN_JSONdescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_oer_ext_arr_, 0, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_oer_p_}; static Per_Integer_Constraint _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_per_ = { &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_per_cons_ }; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_descr_ = { "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_json_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_oer_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_per_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_ber_ = { 1u, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_tag_ }; // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_oer_ext_arr_, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_oer_p_}; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.id", &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_oer_, &RUA__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_default_coding(""); const ASN_Tag_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_ber_ = { 1u, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_tag_ }; // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_oer_ext_arr_, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.criticality", &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_ber_, NULL, NULL, NULL, &RUA__CommonDataTypes::Criticality_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_oer_, &RUA__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_default_coding(""); // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type const TTCN_JSONdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_per_ = { &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_oer_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_ber_ = { 1u, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_tag_ }; // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue", &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_oer_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_default_coding(""); // No XER for _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2 const TTCN_JSONdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_oer_ext_arr_, 3, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_oer_p_}; static const Per_Constraint _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_per_cons_; const ASN_PERdescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_per_ = { &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_per_cons_ }; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_descr_ = { "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_json_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_oer_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_default_coding(""); // No XER for _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0 const int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_oer_ext_arr_[0] = {}; const int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_oer_ext_arr_, 3, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_oer_p_}; const TTCN_Typedescriptor_t _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_descr_ = { "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_json_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_oer_, &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_default_coding(""); const ASN_Tag_t CriticalityDiagnostics_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 4u }}; const ASN_BERdescriptor_t CriticalityDiagnostics_iE__Extensions_ber_ = { 1u, CriticalityDiagnostics_iE__Extensions_tag_ }; // No XER for CriticalityDiagnostics_iE__Extensions const int CriticalityDiagnostics_iE__Extensions_oer_ext_arr_[0] = {}; const int CriticalityDiagnostics_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t CriticalityDiagnostics_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CriticalityDiagnostics_iE__Extensions_oer_ext_arr_, 0, CriticalityDiagnostics_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t CriticalityDiagnostics_iE__Extensions_descr_ = { "@RUA-IEs.CriticalityDiagnostics.iE-Extensions", &CriticalityDiagnostics_iE__Extensions_ber_, NULL, NULL, NULL, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_json_, &CriticalityDiagnostics_iE__Extensions_oer_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_per_, &_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING CriticalityDiagnostics_default_coding(""); TTCN_Module module_object("RUA-IEs", __DATE__, __TIME__, NULL, pre_init_module); 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 */ CN__DomainIndicator::CN__DomainIndicator() { enum_value = UNBOUND_VALUE; } CN__DomainIndicator::CN__DomainIndicator(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RUA-IEs.CN-DomainIndicator with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } CN__DomainIndicator::CN__DomainIndicator(enum_type other_value) { enum_value = other_value; } CN__DomainIndicator::CN__DomainIndicator(const CN__DomainIndicator& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); enum_value = other_value.enum_value; } CN__DomainIndicator& CN__DomainIndicator::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RUA-IEs.CN-DomainIndicator.", other_value); enum_value = (enum_type)other_value; return *this; } CN__DomainIndicator& CN__DomainIndicator::operator=(enum_type other_value) { enum_value = other_value; return *this; } CN__DomainIndicator& CN__DomainIndicator::operator=(const CN__DomainIndicator& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); enum_value = other_value.enum_value; return *this; } boolean CN__DomainIndicator::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CN-DomainIndicator comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean CN__DomainIndicator::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); return enum_value == other_value; } boolean CN__DomainIndicator::operator==(const CN__DomainIndicator& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); return enum_value == other_value.enum_value; } boolean CN__DomainIndicator::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CN-DomainIndicator comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean CN__DomainIndicator::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); return enum_value < other_value; } boolean CN__DomainIndicator::operator<(const CN__DomainIndicator& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); return enum_value < other_value.enum_value; } boolean CN__DomainIndicator::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CN-DomainIndicator comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean CN__DomainIndicator::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); return enum_value > other_value; } boolean CN__DomainIndicator::operator>(const CN__DomainIndicator& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); return enum_value > other_value.enum_value; } const char *CN__DomainIndicator::enum_to_str(enum_type enum_par) { switch (enum_par) { case cs__domain: return "cs_domain"; case ps__domain: return "ps_domain"; default: return ""; } } CN__DomainIndicator::enum_type CN__DomainIndicator::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "cs_domain")) return cs__domain; if (!strcmp(str_par, "ps_domain")) return ps__domain; } return UNKNOWN_VALUE; } boolean CN__DomainIndicator::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int CN__DomainIndicator::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CN-DomainIndicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int CN__DomainIndicator::enum2int(const CN__DomainIndicator& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CN-DomainIndicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void CN__DomainIndicator::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RUA-IEs.CN-DomainIndicator.", int_val); enum_value = (enum_type)int_val; } CN__DomainIndicator::operator CN__DomainIndicator::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RUA-IEs.CN-DomainIndicator."); return enum_value; } void CN__DomainIndicator::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void CN__DomainIndicator::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RUA-IEs.CN-DomainIndicator"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RUA-IEs.CN-DomainIndicator."); } } void CN__DomainIndicator::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); text_buf.push_int(enum_value); } void CN__DomainIndicator::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RUA-IEs.CN-DomainIndicator.", enum_value); } void CN__DomainIndicator::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CN__DomainIndicator::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CN__DomainIndicator::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { BER_encode_chk_enum_valid(p_td, is_valid_enum(enum_value), enum_value); new_tlv=BER_encode_TLV_INTEGER(p_coding, enum_value); } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CN__DomainIndicator::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { enum_value = UNBOUND_VALUE; BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec("While decoding ENUMERATED type @RUA-IEs.CN-DomainIndicator: "); int tmp_mfr; if (BER_decode_TLV_INTEGER(stripped_tlv, L_form, tmp_mfr)) { BER_decode_chk_enum_valid(p_td, is_valid_enum(tmp_mfr), tmp_mfr); enum_value = (enum_type)tmp_mfr; return TRUE; } else return FALSE; } int CN__DomainIndicator::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); return -1; } if (p_td.json->use_null) { return p_tok.put_next_token(JSON_TOKEN_LITERAL_NULL); } char* tmp_str; if (p_td.json->as_number) { tmp_str = mprintf("%d", enum_value); } else { boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (p_td.json->enum_texts[i].index == enum_value) { tmp_str = mprintf("\"%s\"", p_td.json->enum_texts[i].text); text_found = true; break; } } if (!text_found) { tmp_str = mprintf("\"%s\"", enum_to_str(enum_value)); } } int enc_len = p_tok.put_next_token(p_td.json->as_number ? JSON_TOKEN_NUMBER : JSON_TOKEN_STRING, tmp_str); Free(tmp_str); return enc_len; } int CN__DomainIndicator::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { json_token_t token = JSON_TOKEN_NONE; char* value = 0; size_t value_len = 0; boolean error = FALSE; size_t dec_len = 0; boolean use_default = FALSE; if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return dec_len; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { value = const_cast(p_td.json->default_value.str); value_len = strlen(value); use_default = TRUE; } else { dec_len = p_tok.get_next_token(&token, &value, &value_len); } if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_LITERAL_NULL == token && p_td.json->use_null) { enum_value = cs__domain; } else if (!p_td.json->use_null && ((JSON_TOKEN_STRING == token && !p_td.json->as_number) || use_default)) { if (use_default || (value_len > 2 && value[0] == '\"' && value[value_len - 1] == '\"')) { if (!use_default) value[value_len - 1] = 0; boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (strcmp(p_td.json->enum_texts[i].text, value + (use_default ? 0 : 1)) == 0) { enum_value = static_cast(p_td.json->enum_texts[i].index); text_found = true; break; } } if (!text_found) { enum_value = str_to_enum(value + (use_default ? 0 : 1)); } if (!use_default) value[value_len - 1] = '\"'; if (UNKNOWN_VALUE == enum_value) { error = TRUE; } } else { error = TRUE; } } else if (!p_td.json->use_null && JSON_TOKEN_NUMBER == token && p_td.json->as_number) { char* value_str = mcopystrn(value, value_len); int number = atoi(value_str); if (strchr(value_str, '.') != NULL || strchr(value_str, 'e') != NULL || strchr(value_str, 'E') != NULL) { error = TRUE; } else if (is_valid_enum(number)) { enum_value = static_cast(number); } else { error = TRUE; } Free(value_str); } else { enum_value = UNBOUND_VALUE; return JSON_ERROR_INVALID_TOKEN; } if (error) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FORMAT_ERROR, p_td.json->as_number ? "number" : "string", "enumerated"); enum_value = UNBOUND_VALUE; return JSON_ERROR_FATAL; } return (int)dec_len; } int CN__DomainIndicator::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); return -1; } if (enum_value >= 0 && enum_value < 128) { char c = enum_value; p_buf.put_c(c); } else { INTEGER intval(enum_value); TTCN_Buffer buf; intval.OER_encode(INTEGER_descr_, buf); unsigned char* uc = const_cast(buf.get_data()); *uc |= 1 << 7; p_buf.put_buf(buf); } return 0; } int CN__DomainIndicator::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); if (!(uc[0] & 0x80)) { if (is_valid_enum(uc[0])) { enum_value = static_cast(uc[0]); } else { enum_value = UNKNOWN_VALUE; } p_buf.increase_pos(1); } else { unsigned char* uc2 = const_cast(p_buf.get_read_data()); uc2[0] &= ~0x80; INTEGER intval; intval.OER_decode(INTEGER_descr_, p_buf, p_oer); if (is_valid_enum(intval.get_val().get_val())) { enum_value = static_cast(intval.get_val().get_val()); } else { enum_value = UNKNOWN_VALUE; } } return 0; } void CN__DomainIndicator::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; switch (enum_value) { case cs__domain: enc_val = 0; break; case ps__domain: enc_val = 1; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @RUA-IEs.CN-DomainIndicator."); } INTEGER::PER_encode_int(p_buf, enc_val, 1); } void CN__DomainIndicator::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { INTEGER dec_val; dec_val.PER_decode_unaligned_constrained(p_buf, 1, FALSE); int dec_int = dec_val; switch (dec_int) { case 0: enum_value = cs__domain; break; case 1: enum_value = ps__domain; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @RUA-IEs.CN-DomainIndicator.", dec_int); break; } } void CN__DomainIndicator_template::copy_template(const CN__DomainIndicator_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; 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 CN__DomainIndicator_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 CN__DomainIndicator_template(*other_value.implication_.precondition); implication_.implied_template = new CN__DomainIndicator_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 enumerated type @RUA-IEs.CN-DomainIndicator."); } } CN__DomainIndicator_template::CN__DomainIndicator_template() { } CN__DomainIndicator_template::CN__DomainIndicator_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CN__DomainIndicator_template::CN__DomainIndicator_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!CN__DomainIndicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RUA-IEs.CN-DomainIndicator with unknown numeric value %d.", other_value); single_value = (CN__DomainIndicator::enum_type)other_value; } CN__DomainIndicator_template::CN__DomainIndicator_template(CN__DomainIndicator::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } CN__DomainIndicator_template::CN__DomainIndicator_template(const CN__DomainIndicator& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == CN__DomainIndicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator."); single_value = other_value.enum_value; } CN__DomainIndicator_template::CN__DomainIndicator_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CN__DomainIndicator::enum_type)(const CN__DomainIndicator&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RUA-IEs.CN-DomainIndicator from an unbound optional field."); } } CN__DomainIndicator_template::CN__DomainIndicator_template(CN__DomainIndicator_template* p_precondition, CN__DomainIndicator_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CN__DomainIndicator_template::CN__DomainIndicator_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CN__DomainIndicator_template::CN__DomainIndicator_template(const CN__DomainIndicator_template& other_value) : Base_Template() { copy_template(other_value); } CN__DomainIndicator_template::~CN__DomainIndicator_template() { clean_up(); } boolean CN__DomainIndicator_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean CN__DomainIndicator_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != CN__DomainIndicator::UNBOUND_VALUE; } void CN__DomainIndicator_template::clean_up() { switch (template_selection) { 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; } CN__DomainIndicator_template& CN__DomainIndicator_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CN__DomainIndicator_template& CN__DomainIndicator_template::operator=(int other_value) { if (!CN__DomainIndicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RUA-IEs.CN-DomainIndicator.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (CN__DomainIndicator::enum_type)other_value; return *this; } CN__DomainIndicator_template& CN__DomainIndicator_template::operator=(CN__DomainIndicator::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } CN__DomainIndicator_template& CN__DomainIndicator_template::operator=(const CN__DomainIndicator& other_value) { if (other_value.enum_value == CN__DomainIndicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CN-DomainIndicator to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } CN__DomainIndicator_template& CN__DomainIndicator_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CN__DomainIndicator::enum_type)(const CN__DomainIndicator&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RUA-IEs.CN-DomainIndicator."); } return *this; } CN__DomainIndicator_template& CN__DomainIndicator_template::operator=(const CN__DomainIndicator_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CN__DomainIndicator_template::match(CN__DomainIndicator::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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)) 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 enumerated type @RUA-IEs.CN-DomainIndicator."); } return FALSE; } boolean CN__DomainIndicator_template::match(const CN__DomainIndicator& other_value, boolean) const { if (other_value.enum_value == CN__DomainIndicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RUA-IEs.CN-DomainIndicator with an unbound value."); return match(other_value.enum_value); } CN__DomainIndicator::enum_type CN__DomainIndicator_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RUA-IEs.CN-DomainIndicator."); return single_value; } void CN__DomainIndicator_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CN__DomainIndicator_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RUA-IEs.CN-DomainIndicator."); } } CN__DomainIndicator_template& CN__DomainIndicator_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RUA-IEs.CN-DomainIndicator."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RUA-IEs.CN-DomainIndicator."); return value_list.list_value[list_index]; } void CN__DomainIndicator_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(CN__DomainIndicator::enum_to_str(single_value), single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_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 CN__DomainIndicator_template::log_match(const CN__DomainIndicator& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void CN__DomainIndicator_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RUA-IEs.CN-DomainIndicator."); } } void CN__DomainIndicator_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (CN__DomainIndicator::enum_type)text_buf.pull_int().get_val(); if (!CN__DomainIndicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RUA-IEs.CN-DomainIndicator.", single_value); 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 CN__DomainIndicator_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RUA-IEs.CN-DomainIndicator."); } } boolean CN__DomainIndicator_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CN__DomainIndicator_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 i=0; iget_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: { CN__DomainIndicator_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { CN__DomainIndicator::enum_type enum_val = CN__DomainIndicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!CN__DomainIndicator::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RUA-IEs.CN-DomainIndicator."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { CN__DomainIndicator_template* precondition = new CN__DomainIndicator_template; precondition->set_param(*m_p->get_elem(0)); CN__DomainIndicator_template* implied_template = new CN__DomainIndicator_template; implied_template->set_param(*m_p->get_elem(1)); *this = CN__DomainIndicator_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RUA-IEs.CN-DomainIndicator"); } is_ifpresent = param.get_ifpresent(); } void CN__DomainIndicator_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_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; 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 : "@RUA-IEs.CN-DomainIndicator"); } CSGMembershipStatus::CSGMembershipStatus() { enum_value = UNBOUND_VALUE; } CSGMembershipStatus::CSGMembershipStatus(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RUA-IEs.CSGMembershipStatus with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } CSGMembershipStatus::CSGMembershipStatus(enum_type other_value) { enum_value = other_value; } CSGMembershipStatus::CSGMembershipStatus(const CSGMembershipStatus& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); enum_value = other_value.enum_value; } CSGMembershipStatus& CSGMembershipStatus::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RUA-IEs.CSGMembershipStatus.", other_value); enum_value = (enum_type)other_value; return *this; } CSGMembershipStatus& CSGMembershipStatus::operator=(enum_type other_value) { enum_value = other_value; return *this; } CSGMembershipStatus& CSGMembershipStatus::operator=(const CSGMembershipStatus& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); enum_value = other_value.enum_value; return *this; } boolean CSGMembershipStatus::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CSGMembershipStatus comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean CSGMembershipStatus::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); return enum_value == other_value; } boolean CSGMembershipStatus::operator==(const CSGMembershipStatus& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); return enum_value == other_value.enum_value; } boolean CSGMembershipStatus::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CSGMembershipStatus comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean CSGMembershipStatus::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); return enum_value < other_value; } boolean CSGMembershipStatus::operator<(const CSGMembershipStatus& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); return enum_value < other_value.enum_value; } boolean CSGMembershipStatus::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CSGMembershipStatus comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean CSGMembershipStatus::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); return enum_value > other_value; } boolean CSGMembershipStatus::operator>(const CSGMembershipStatus& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); return enum_value > other_value.enum_value; } const char *CSGMembershipStatus::enum_to_str(enum_type enum_par) { switch (enum_par) { case member: return "member"; case non__member: return "non_member"; default: return ""; } } CSGMembershipStatus::enum_type CSGMembershipStatus::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "member")) return member; if (!strcmp(str_par, "non_member")) return non__member; } return UNKNOWN_VALUE; } boolean CSGMembershipStatus::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int CSGMembershipStatus::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CSGMembershipStatus.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int CSGMembershipStatus::enum2int(const CSGMembershipStatus& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CSGMembershipStatus.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void CSGMembershipStatus::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RUA-IEs.CSGMembershipStatus.", int_val); enum_value = (enum_type)int_val; } CSGMembershipStatus::operator CSGMembershipStatus::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RUA-IEs.CSGMembershipStatus."); return enum_value; } void CSGMembershipStatus::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void CSGMembershipStatus::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RUA-IEs.CSGMembershipStatus"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RUA-IEs.CSGMembershipStatus."); } } void CSGMembershipStatus::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); text_buf.push_int(enum_value); } void CSGMembershipStatus::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RUA-IEs.CSGMembershipStatus.", enum_value); } void CSGMembershipStatus::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CSGMembershipStatus::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CSGMembershipStatus::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { BER_encode_chk_enum_valid(p_td, is_valid_enum(enum_value), enum_value); new_tlv=BER_encode_TLV_INTEGER(p_coding, enum_value); } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CSGMembershipStatus::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { enum_value = UNBOUND_VALUE; BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec("While decoding ENUMERATED type @RUA-IEs.CSGMembershipStatus: "); int tmp_mfr; if (BER_decode_TLV_INTEGER(stripped_tlv, L_form, tmp_mfr)) { BER_decode_chk_enum_valid(p_td, is_valid_enum(tmp_mfr), tmp_mfr); enum_value = (enum_type)tmp_mfr; return TRUE; } else return FALSE; } int CSGMembershipStatus::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); return -1; } if (p_td.json->use_null) { return p_tok.put_next_token(JSON_TOKEN_LITERAL_NULL); } char* tmp_str; if (p_td.json->as_number) { tmp_str = mprintf("%d", enum_value); } else { boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (p_td.json->enum_texts[i].index == enum_value) { tmp_str = mprintf("\"%s\"", p_td.json->enum_texts[i].text); text_found = true; break; } } if (!text_found) { tmp_str = mprintf("\"%s\"", enum_to_str(enum_value)); } } int enc_len = p_tok.put_next_token(p_td.json->as_number ? JSON_TOKEN_NUMBER : JSON_TOKEN_STRING, tmp_str); Free(tmp_str); return enc_len; } int CSGMembershipStatus::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { json_token_t token = JSON_TOKEN_NONE; char* value = 0; size_t value_len = 0; boolean error = FALSE; size_t dec_len = 0; boolean use_default = FALSE; if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return dec_len; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { value = const_cast(p_td.json->default_value.str); value_len = strlen(value); use_default = TRUE; } else { dec_len = p_tok.get_next_token(&token, &value, &value_len); } if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_LITERAL_NULL == token && p_td.json->use_null) { enum_value = member; } else if (!p_td.json->use_null && ((JSON_TOKEN_STRING == token && !p_td.json->as_number) || use_default)) { if (use_default || (value_len > 2 && value[0] == '\"' && value[value_len - 1] == '\"')) { if (!use_default) value[value_len - 1] = 0; boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (strcmp(p_td.json->enum_texts[i].text, value + (use_default ? 0 : 1)) == 0) { enum_value = static_cast(p_td.json->enum_texts[i].index); text_found = true; break; } } if (!text_found) { enum_value = str_to_enum(value + (use_default ? 0 : 1)); } if (!use_default) value[value_len - 1] = '\"'; if (UNKNOWN_VALUE == enum_value) { error = TRUE; } } else { error = TRUE; } } else if (!p_td.json->use_null && JSON_TOKEN_NUMBER == token && p_td.json->as_number) { char* value_str = mcopystrn(value, value_len); int number = atoi(value_str); if (strchr(value_str, '.') != NULL || strchr(value_str, 'e') != NULL || strchr(value_str, 'E') != NULL) { error = TRUE; } else if (is_valid_enum(number)) { enum_value = static_cast(number); } else { error = TRUE; } Free(value_str); } else { enum_value = UNBOUND_VALUE; return JSON_ERROR_INVALID_TOKEN; } if (error) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FORMAT_ERROR, p_td.json->as_number ? "number" : "string", "enumerated"); enum_value = UNBOUND_VALUE; return JSON_ERROR_FATAL; } return (int)dec_len; } int CSGMembershipStatus::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); return -1; } if (enum_value >= 0 && enum_value < 128) { char c = enum_value; p_buf.put_c(c); } else { INTEGER intval(enum_value); TTCN_Buffer buf; intval.OER_encode(INTEGER_descr_, buf); unsigned char* uc = const_cast(buf.get_data()); *uc |= 1 << 7; p_buf.put_buf(buf); } return 0; } int CSGMembershipStatus::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); if (!(uc[0] & 0x80)) { if (is_valid_enum(uc[0])) { enum_value = static_cast(uc[0]); } else { enum_value = UNKNOWN_VALUE; } p_buf.increase_pos(1); } else { unsigned char* uc2 = const_cast(p_buf.get_read_data()); uc2[0] &= ~0x80; INTEGER intval; intval.OER_decode(INTEGER_descr_, p_buf, p_oer); if (is_valid_enum(intval.get_val().get_val())) { enum_value = static_cast(intval.get_val().get_val()); } else { enum_value = UNKNOWN_VALUE; } } return 0; } void CSGMembershipStatus::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; boolean ext_bit = FALSE; switch (enum_value) { case member: enc_val = 0; ext_bit = FALSE; break; case non__member: enc_val = 1; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @RUA-IEs.CSGMembershipStatus."); } p_buf.PER_put_bit(ext_bit); if (ext_bit) enc_val.PER_encode_normally_small(p_buf, p_options); else INTEGER::PER_encode_int(p_buf, enc_val, 1); } void CSGMembershipStatus::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { INTEGER dec_val; boolean ext_bit = p_buf.PER_get_bit(); if (ext_bit) dec_val.PER_decode_normally_small(p_buf, p_options); else dec_val.PER_decode_unaligned_constrained(p_buf, 1, FALSE); int dec_int = dec_val; if (ext_bit) switch (dec_int) { default: enum_value = UNBOUND_VALUE; break; } else switch (dec_int) { case 0: enum_value = member; break; case 1: enum_value = non__member; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @RUA-IEs.CSGMembershipStatus.", dec_int); break; } } void CSGMembershipStatus_template::copy_template(const CSGMembershipStatus_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; 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 CSGMembershipStatus_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 CSGMembershipStatus_template(*other_value.implication_.precondition); implication_.implied_template = new CSGMembershipStatus_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 enumerated type @RUA-IEs.CSGMembershipStatus."); } } CSGMembershipStatus_template::CSGMembershipStatus_template() { } CSGMembershipStatus_template::CSGMembershipStatus_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CSGMembershipStatus_template::CSGMembershipStatus_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!CSGMembershipStatus::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RUA-IEs.CSGMembershipStatus with unknown numeric value %d.", other_value); single_value = (CSGMembershipStatus::enum_type)other_value; } CSGMembershipStatus_template::CSGMembershipStatus_template(CSGMembershipStatus::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } CSGMembershipStatus_template::CSGMembershipStatus_template(const CSGMembershipStatus& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == CSGMembershipStatus::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus."); single_value = other_value.enum_value; } CSGMembershipStatus_template::CSGMembershipStatus_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CSGMembershipStatus::enum_type)(const CSGMembershipStatus&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RUA-IEs.CSGMembershipStatus from an unbound optional field."); } } CSGMembershipStatus_template::CSGMembershipStatus_template(CSGMembershipStatus_template* p_precondition, CSGMembershipStatus_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CSGMembershipStatus_template::CSGMembershipStatus_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CSGMembershipStatus_template::CSGMembershipStatus_template(const CSGMembershipStatus_template& other_value) : Base_Template() { copy_template(other_value); } CSGMembershipStatus_template::~CSGMembershipStatus_template() { clean_up(); } boolean CSGMembershipStatus_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean CSGMembershipStatus_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != CSGMembershipStatus::UNBOUND_VALUE; } void CSGMembershipStatus_template::clean_up() { switch (template_selection) { 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; } CSGMembershipStatus_template& CSGMembershipStatus_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CSGMembershipStatus_template& CSGMembershipStatus_template::operator=(int other_value) { if (!CSGMembershipStatus::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RUA-IEs.CSGMembershipStatus.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (CSGMembershipStatus::enum_type)other_value; return *this; } CSGMembershipStatus_template& CSGMembershipStatus_template::operator=(CSGMembershipStatus::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } CSGMembershipStatus_template& CSGMembershipStatus_template::operator=(const CSGMembershipStatus& other_value) { if (other_value.enum_value == CSGMembershipStatus::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CSGMembershipStatus to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } CSGMembershipStatus_template& CSGMembershipStatus_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CSGMembershipStatus::enum_type)(const CSGMembershipStatus&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RUA-IEs.CSGMembershipStatus."); } return *this; } CSGMembershipStatus_template& CSGMembershipStatus_template::operator=(const CSGMembershipStatus_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CSGMembershipStatus_template::match(CSGMembershipStatus::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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)) 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 enumerated type @RUA-IEs.CSGMembershipStatus."); } return FALSE; } boolean CSGMembershipStatus_template::match(const CSGMembershipStatus& other_value, boolean) const { if (other_value.enum_value == CSGMembershipStatus::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RUA-IEs.CSGMembershipStatus with an unbound value."); return match(other_value.enum_value); } CSGMembershipStatus::enum_type CSGMembershipStatus_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RUA-IEs.CSGMembershipStatus."); return single_value; } void CSGMembershipStatus_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CSGMembershipStatus_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RUA-IEs.CSGMembershipStatus."); } } CSGMembershipStatus_template& CSGMembershipStatus_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RUA-IEs.CSGMembershipStatus."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RUA-IEs.CSGMembershipStatus."); return value_list.list_value[list_index]; } void CSGMembershipStatus_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(CSGMembershipStatus::enum_to_str(single_value), single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_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 CSGMembershipStatus_template::log_match(const CSGMembershipStatus& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void CSGMembershipStatus_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RUA-IEs.CSGMembershipStatus."); } } void CSGMembershipStatus_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (CSGMembershipStatus::enum_type)text_buf.pull_int().get_val(); if (!CSGMembershipStatus::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RUA-IEs.CSGMembershipStatus.", single_value); 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 CSGMembershipStatus_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RUA-IEs.CSGMembershipStatus."); } } boolean CSGMembershipStatus_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CSGMembershipStatus_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 i=0; iget_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: { CSGMembershipStatus_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { CSGMembershipStatus::enum_type enum_val = CSGMembershipStatus::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!CSGMembershipStatus::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RUA-IEs.CSGMembershipStatus."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { CSGMembershipStatus_template* precondition = new CSGMembershipStatus_template; precondition->set_param(*m_p->get_elem(0)); CSGMembershipStatus_template* implied_template = new CSGMembershipStatus_template; implied_template->set_param(*m_p->get_elem(1)); *this = CSGMembershipStatus_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RUA-IEs.CSGMembershipStatus"); } is_ifpresent = param.get_ifpresent(); } void CSGMembershipStatus_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_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; 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 : "@RUA-IEs.CSGMembershipStatus"); } Establishment__Cause::Establishment__Cause() { enum_value = UNBOUND_VALUE; } Establishment__Cause::Establishment__Cause(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RUA-IEs.Establishment-Cause with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } Establishment__Cause::Establishment__Cause(enum_type other_value) { enum_value = other_value; } Establishment__Cause::Establishment__Cause(const Establishment__Cause& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); enum_value = other_value.enum_value; } Establishment__Cause& Establishment__Cause::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RUA-IEs.Establishment-Cause.", other_value); enum_value = (enum_type)other_value; return *this; } Establishment__Cause& Establishment__Cause::operator=(enum_type other_value) { enum_value = other_value; return *this; } Establishment__Cause& Establishment__Cause::operator=(const Establishment__Cause& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); enum_value = other_value.enum_value; return *this; } boolean Establishment__Cause::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.Establishment-Cause comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean Establishment__Cause::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); return enum_value == other_value; } boolean Establishment__Cause::operator==(const Establishment__Cause& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); return enum_value == other_value.enum_value; } boolean Establishment__Cause::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.Establishment-Cause comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean Establishment__Cause::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); return enum_value < other_value; } boolean Establishment__Cause::operator<(const Establishment__Cause& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); return enum_value < other_value.enum_value; } boolean Establishment__Cause::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.Establishment-Cause comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean Establishment__Cause::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); return enum_value > other_value; } boolean Establishment__Cause::operator>(const Establishment__Cause& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); return enum_value > other_value.enum_value; } const char *Establishment__Cause::enum_to_str(enum_type enum_par) { switch (enum_par) { case emergency__call: return "emergency_call"; case normal__call: return "normal_call"; default: return ""; } } Establishment__Cause::enum_type Establishment__Cause::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "emergency_call")) return emergency__call; if (!strcmp(str_par, "normal_call")) return normal__call; } return UNKNOWN_VALUE; } boolean Establishment__Cause::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int Establishment__Cause::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.Establishment-Cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int Establishment__Cause::enum2int(const Establishment__Cause& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.Establishment-Cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void Establishment__Cause::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RUA-IEs.Establishment-Cause.", int_val); enum_value = (enum_type)int_val; } Establishment__Cause::operator Establishment__Cause::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RUA-IEs.Establishment-Cause."); return enum_value; } void Establishment__Cause::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void Establishment__Cause::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RUA-IEs.Establishment-Cause"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RUA-IEs.Establishment-Cause."); } } void Establishment__Cause::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); text_buf.push_int(enum_value); } void Establishment__Cause::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RUA-IEs.Establishment-Cause.", enum_value); } void Establishment__Cause::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Establishment__Cause::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Establishment__Cause::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { BER_encode_chk_enum_valid(p_td, is_valid_enum(enum_value), enum_value); new_tlv=BER_encode_TLV_INTEGER(p_coding, enum_value); } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Establishment__Cause::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { enum_value = UNBOUND_VALUE; BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec("While decoding ENUMERATED type @RUA-IEs.Establishment-Cause: "); int tmp_mfr; if (BER_decode_TLV_INTEGER(stripped_tlv, L_form, tmp_mfr)) { BER_decode_chk_enum_valid(p_td, is_valid_enum(tmp_mfr), tmp_mfr); enum_value = (enum_type)tmp_mfr; return TRUE; } else return FALSE; } int Establishment__Cause::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); return -1; } if (p_td.json->use_null) { return p_tok.put_next_token(JSON_TOKEN_LITERAL_NULL); } char* tmp_str; if (p_td.json->as_number) { tmp_str = mprintf("%d", enum_value); } else { boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (p_td.json->enum_texts[i].index == enum_value) { tmp_str = mprintf("\"%s\"", p_td.json->enum_texts[i].text); text_found = true; break; } } if (!text_found) { tmp_str = mprintf("\"%s\"", enum_to_str(enum_value)); } } int enc_len = p_tok.put_next_token(p_td.json->as_number ? JSON_TOKEN_NUMBER : JSON_TOKEN_STRING, tmp_str); Free(tmp_str); return enc_len; } int Establishment__Cause::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { json_token_t token = JSON_TOKEN_NONE; char* value = 0; size_t value_len = 0; boolean error = FALSE; size_t dec_len = 0; boolean use_default = FALSE; if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return dec_len; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { value = const_cast(p_td.json->default_value.str); value_len = strlen(value); use_default = TRUE; } else { dec_len = p_tok.get_next_token(&token, &value, &value_len); } if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_LITERAL_NULL == token && p_td.json->use_null) { enum_value = emergency__call; } else if (!p_td.json->use_null && ((JSON_TOKEN_STRING == token && !p_td.json->as_number) || use_default)) { if (use_default || (value_len > 2 && value[0] == '\"' && value[value_len - 1] == '\"')) { if (!use_default) value[value_len - 1] = 0; boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (strcmp(p_td.json->enum_texts[i].text, value + (use_default ? 0 : 1)) == 0) { enum_value = static_cast(p_td.json->enum_texts[i].index); text_found = true; break; } } if (!text_found) { enum_value = str_to_enum(value + (use_default ? 0 : 1)); } if (!use_default) value[value_len - 1] = '\"'; if (UNKNOWN_VALUE == enum_value) { error = TRUE; } } else { error = TRUE; } } else if (!p_td.json->use_null && JSON_TOKEN_NUMBER == token && p_td.json->as_number) { char* value_str = mcopystrn(value, value_len); int number = atoi(value_str); if (strchr(value_str, '.') != NULL || strchr(value_str, 'e') != NULL || strchr(value_str, 'E') != NULL) { error = TRUE; } else if (is_valid_enum(number)) { enum_value = static_cast(number); } else { error = TRUE; } Free(value_str); } else { enum_value = UNBOUND_VALUE; return JSON_ERROR_INVALID_TOKEN; } if (error) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FORMAT_ERROR, p_td.json->as_number ? "number" : "string", "enumerated"); enum_value = UNBOUND_VALUE; return JSON_ERROR_FATAL; } return (int)dec_len; } int Establishment__Cause::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); return -1; } if (enum_value >= 0 && enum_value < 128) { char c = enum_value; p_buf.put_c(c); } else { INTEGER intval(enum_value); TTCN_Buffer buf; intval.OER_encode(INTEGER_descr_, buf); unsigned char* uc = const_cast(buf.get_data()); *uc |= 1 << 7; p_buf.put_buf(buf); } return 0; } int Establishment__Cause::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); if (!(uc[0] & 0x80)) { if (is_valid_enum(uc[0])) { enum_value = static_cast(uc[0]); } else { enum_value = UNKNOWN_VALUE; } p_buf.increase_pos(1); } else { unsigned char* uc2 = const_cast(p_buf.get_read_data()); uc2[0] &= ~0x80; INTEGER intval; intval.OER_decode(INTEGER_descr_, p_buf, p_oer); if (is_valid_enum(intval.get_val().get_val())) { enum_value = static_cast(intval.get_val().get_val()); } else { enum_value = UNKNOWN_VALUE; } } return 0; } void Establishment__Cause::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; boolean ext_bit = FALSE; switch (enum_value) { case emergency__call: enc_val = 0; ext_bit = FALSE; break; case normal__call: enc_val = 1; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @RUA-IEs.Establishment-Cause."); } p_buf.PER_put_bit(ext_bit); if (ext_bit) enc_val.PER_encode_normally_small(p_buf, p_options); else INTEGER::PER_encode_int(p_buf, enc_val, 1); } void Establishment__Cause::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { INTEGER dec_val; boolean ext_bit = p_buf.PER_get_bit(); if (ext_bit) dec_val.PER_decode_normally_small(p_buf, p_options); else dec_val.PER_decode_unaligned_constrained(p_buf, 1, FALSE); int dec_int = dec_val; if (ext_bit) switch (dec_int) { default: enum_value = UNBOUND_VALUE; break; } else switch (dec_int) { case 0: enum_value = emergency__call; break; case 1: enum_value = normal__call; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @RUA-IEs.Establishment-Cause.", dec_int); break; } } void Establishment__Cause_template::copy_template(const Establishment__Cause_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; 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 Establishment__Cause_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 Establishment__Cause_template(*other_value.implication_.precondition); implication_.implied_template = new Establishment__Cause_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 enumerated type @RUA-IEs.Establishment-Cause."); } } Establishment__Cause_template::Establishment__Cause_template() { } Establishment__Cause_template::Establishment__Cause_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Establishment__Cause_template::Establishment__Cause_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!Establishment__Cause::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RUA-IEs.Establishment-Cause with unknown numeric value %d.", other_value); single_value = (Establishment__Cause::enum_type)other_value; } Establishment__Cause_template::Establishment__Cause_template(Establishment__Cause::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } Establishment__Cause_template::Establishment__Cause_template(const Establishment__Cause& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == Establishment__Cause::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RUA-IEs.Establishment-Cause."); single_value = other_value.enum_value; } Establishment__Cause_template::Establishment__Cause_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (Establishment__Cause::enum_type)(const Establishment__Cause&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RUA-IEs.Establishment-Cause from an unbound optional field."); } } Establishment__Cause_template::Establishment__Cause_template(Establishment__Cause_template* p_precondition, Establishment__Cause_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Establishment__Cause_template::Establishment__Cause_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Establishment__Cause_template::Establishment__Cause_template(const Establishment__Cause_template& other_value) : Base_Template() { copy_template(other_value); } Establishment__Cause_template::~Establishment__Cause_template() { clean_up(); } boolean Establishment__Cause_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean Establishment__Cause_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != Establishment__Cause::UNBOUND_VALUE; } void Establishment__Cause_template::clean_up() { switch (template_selection) { 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; } Establishment__Cause_template& Establishment__Cause_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Establishment__Cause_template& Establishment__Cause_template::operator=(int other_value) { if (!Establishment__Cause::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RUA-IEs.Establishment-Cause.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (Establishment__Cause::enum_type)other_value; return *this; } Establishment__Cause_template& Establishment__Cause_template::operator=(Establishment__Cause::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } Establishment__Cause_template& Establishment__Cause_template::operator=(const Establishment__Cause& other_value) { if (other_value.enum_value == Establishment__Cause::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.Establishment-Cause to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } Establishment__Cause_template& Establishment__Cause_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (Establishment__Cause::enum_type)(const Establishment__Cause&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RUA-IEs.Establishment-Cause."); } return *this; } Establishment__Cause_template& Establishment__Cause_template::operator=(const Establishment__Cause_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Establishment__Cause_template::match(Establishment__Cause::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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)) 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 enumerated type @RUA-IEs.Establishment-Cause."); } return FALSE; } boolean Establishment__Cause_template::match(const Establishment__Cause& other_value, boolean) const { if (other_value.enum_value == Establishment__Cause::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RUA-IEs.Establishment-Cause with an unbound value."); return match(other_value.enum_value); } Establishment__Cause::enum_type Establishment__Cause_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RUA-IEs.Establishment-Cause."); return single_value; } void Establishment__Cause_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Establishment__Cause_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RUA-IEs.Establishment-Cause."); } } Establishment__Cause_template& Establishment__Cause_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RUA-IEs.Establishment-Cause."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RUA-IEs.Establishment-Cause."); return value_list.list_value[list_index]; } void Establishment__Cause_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(Establishment__Cause::enum_to_str(single_value), single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_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 Establishment__Cause_template::log_match(const Establishment__Cause& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void Establishment__Cause_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RUA-IEs.Establishment-Cause."); } } void Establishment__Cause_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (Establishment__Cause::enum_type)text_buf.pull_int().get_val(); if (!Establishment__Cause::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RUA-IEs.Establishment-Cause.", single_value); 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 Establishment__Cause_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RUA-IEs.Establishment-Cause."); } } boolean Establishment__Cause_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Establishment__Cause_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 i=0; iget_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: { Establishment__Cause_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { Establishment__Cause::enum_type enum_val = Establishment__Cause::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!Establishment__Cause::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RUA-IEs.Establishment-Cause."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { Establishment__Cause_template* precondition = new Establishment__Cause_template; precondition->set_param(*m_p->get_elem(0)); Establishment__Cause_template* implied_template = new Establishment__Cause_template; implied_template->set_param(*m_p->get_elem(1)); *this = Establishment__Cause_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RUA-IEs.Establishment-Cause"); } is_ifpresent = param.get_ifpresent(); } void Establishment__Cause_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_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; 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 : "@RUA-IEs.Establishment-Cause"); } void IntraDomainNasNodeSelector_version::copy_value(const IntraDomainNasNodeSelector_version& other_value) { switch (other_value.union_selection) { case ALT_release99: field_release99 = new IntraDomainNasNodeSelector_version_release99(*other_value.field_release99); break; case ALT_later: field_later = new IntraDomainNasNodeSelector_version_later(*other_value.field_later); break; default: TTCN_error("Assignment of an unbound union value of type @RUA-IEs.IntraDomainNasNodeSelector.version."); } union_selection = other_value.union_selection; } IntraDomainNasNodeSelector_version::IntraDomainNasNodeSelector_version() { union_selection = UNBOUND_VALUE; } IntraDomainNasNodeSelector_version::IntraDomainNasNodeSelector_version(const IntraDomainNasNodeSelector_version& other_value) : Base_Type(){ copy_value(other_value); } IntraDomainNasNodeSelector_version::~IntraDomainNasNodeSelector_version() { clean_up(); } IntraDomainNasNodeSelector_version& IntraDomainNasNodeSelector_version::operator=(const IntraDomainNasNodeSelector_version& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean IntraDomainNasNodeSelector_version::operator==(const IntraDomainNasNodeSelector_version& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { case ALT_release99: return *field_release99 == *other_value.field_release99; case ALT_later: return *field_later == *other_value.field_later; default: return FALSE; } } IntraDomainNasNodeSelector_version_release99& IntraDomainNasNodeSelector_version::release99() { if (union_selection != ALT_release99) { clean_up(); field_release99 = new IntraDomainNasNodeSelector_version_release99; union_selection = ALT_release99; } return *field_release99; } const IntraDomainNasNodeSelector_version_release99& IntraDomainNasNodeSelector_version::release99() const { if (union_selection != ALT_release99) TTCN_error("Using non-selected field release99 in a value of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); return *field_release99; } IntraDomainNasNodeSelector_version_later& IntraDomainNasNodeSelector_version::later() { if (union_selection != ALT_later) { clean_up(); field_later = new IntraDomainNasNodeSelector_version_later; union_selection = ALT_later; } return *field_later; } const IntraDomainNasNodeSelector_version_later& IntraDomainNasNodeSelector_version::later() const { if (union_selection != ALT_later) TTCN_error("Using non-selected field later in a value of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); return *field_later; } boolean IntraDomainNasNodeSelector_version::ischosen(union_selection_type checked_selection) const { if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); return union_selection == checked_selection; } boolean IntraDomainNasNodeSelector_version::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean IntraDomainNasNodeSelector_version::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; case ALT_release99: return field_release99->is_value(); case ALT_later: return field_later->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void IntraDomainNasNodeSelector_version::clean_up() { switch (union_selection) { case ALT_release99: delete field_release99; break; case ALT_later: delete field_later; break; default: break; } union_selection = UNBOUND_VALUE; } void IntraDomainNasNodeSelector_version::log() const { switch (union_selection) { case ALT_release99: TTCN_Logger::log_event_str("{ release99 := "); field_release99->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_later: TTCN_Logger::log_event_str("{ later := "); field_later->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void IntraDomainNasNodeSelector_version::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "union value"); Module_Param_Ptr m_p = ¶m; if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return; if (m_p->get_type()!=Module_Param::MP_Assignment_List) { param.error("union value with field name was expected"); } Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "release99")) { release99().set_param(*mp_last); if (!release99().is_bound()) clean_up(); return; } if (!strcmp(last_name, "later")) { later().set_param(*mp_last); if (!later().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @RUA-IEs.IntraDomainNasNodeSelector.version.", last_name); } void IntraDomainNasNodeSelector_version::set_implicit_omit() { switch (union_selection) { case ALT_release99: field_release99->set_implicit_omit(); break; case ALT_later: field_later->set_implicit_omit(); break; default: break; } } void IntraDomainNasNodeSelector_version::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_release99: field_release99->encode_text(text_buf); break; case ALT_later: field_later->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } } void IntraDomainNasNodeSelector_version::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_release99: release99().decode_text(text_buf); break; case ALT_later: later().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @RUA-IEs.IntraDomainNasNodeSelector.version."); } } void IntraDomainNasNodeSelector_version::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void IntraDomainNasNodeSelector_version::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t *IntraDomainNasNodeSelector_version::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv; TTCN_EncDec_ErrorContext ec_0("Alternative '"); TTCN_EncDec_ErrorContext ec_1; switch (union_selection) { case ALT_release99: ec_1.set_msg("release99': "); new_tlv = field_release99->BER_encode_TLV(IntraDomainNasNodeSelector_version_release99_descr_, p_coding); break; case ALT_later: ec_1.set_msg("later': "); new_tlv = field_later->BER_encode_TLV(IntraDomainNasNodeSelector_version_later_descr_, p_coding); break; case UNBOUND_VALUE: new_tlv = BER_encode_chk_bound(FALSE); break; default: TTCN_EncDec_ErrorContext::error_internal("Unknown selection."); new_tlv = NULL; } return ASN_BER_V2TLV(new_tlv, p_td, p_coding); } boolean IntraDomainNasNodeSelector_version::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_release99 = new IntraDomainNasNodeSelector_version_release99; union_selection = ALT_release99; if (field_release99->BER_decode_isMyMsg(IntraDomainNasNodeSelector_version_release99_descr_, p_tlv)) return TRUE; delete field_release99; field_later = new IntraDomainNasNodeSelector_version_later; union_selection = ALT_later; if (field_later->BER_decode_isMyMsg(IntraDomainNasNodeSelector_version_later_descr_, p_tlv)) return TRUE; delete field_later; union_selection = UNBOUND_VALUE; return FALSE; } boolean IntraDomainNasNodeSelector_version::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { IntraDomainNasNodeSelector_version tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean IntraDomainNasNodeSelector_version::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.IntraDomainNasNodeSelector.version' type: "); ASN_BER_TLV_t tmp_tlv; if (!BER_decode_TLV_CHOICE(*p_td.ber, stripped_tlv, L_form, tmp_tlv) || !BER_decode_CHOICE_selection(BER_decode_set_selection(tmp_tlv), tmp_tlv)) return FALSE; TTCN_EncDec_ErrorContext ec_1("Alternative '"); TTCN_EncDec_ErrorContext ec_2; switch (union_selection) { case ALT_release99: ec_2.set_msg("release99': "); field_release99->BER_decode_TLV(IntraDomainNasNodeSelector_version_release99_descr_, tmp_tlv, L_form); break; case ALT_later: ec_2.set_msg("later': "); field_later->BER_decode_TLV(IntraDomainNasNodeSelector_version_later_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int IntraDomainNasNodeSelector_version::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { boolean as_value = p_td.json->as_value; int enc_len = as_value ? 0 : p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); switch(union_selection) { case ALT_release99: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "release99"); } enc_len += field_release99->JSON_encode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, FALSE); break; case ALT_later: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "later"); } enc_len += field_later->JSON_encode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector.version."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int IntraDomainNasNodeSelector_version::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int p_chosen_field) { if (0 <= p_chosen_field && 2 > p_chosen_field) { switch (p_chosen_field) { case 0: return release99().JSON_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, TRUE, FALSE); case 1: return later().JSON_decode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, TRUE, FALSE); } } if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; if (p_td.json->as_value) { size_t buf_pos = p_tok.get_buf_pos(); p_tok.get_next_token(&j_token, NULL, NULL); int ret_val = 0; switch(j_token) { case JSON_TOKEN_NUMBER: { p_tok.set_buf_pos(buf_pos); ret_val = release99().JSON_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = later().JSON_decode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "number '@RUA-IEs.IntraDomainNasNodeSelector.version'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { p_tok.set_buf_pos(buf_pos); ret_val = release99().JSON_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = later().JSON_decode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "string '@RUA-IEs.IntraDomainNasNodeSelector.version'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_LITERAL_TRUE: case JSON_TOKEN_LITERAL_FALSE: { p_tok.set_buf_pos(buf_pos); ret_val = release99().JSON_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = later().JSON_decode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } char* literal_str = mprintf("literal (%s)", (JSON_TOKEN_LITERAL_TRUE == j_token) ? "true" : "false"); try { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, literal_str); } catch (const TC_Error&) { Free(literal_str); throw; } Free(literal_str); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_ARRAY_START: { p_tok.set_buf_pos(buf_pos); ret_val = release99().JSON_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = later().JSON_decode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "array '@RUA-IEs.IntraDomainNasNodeSelector.version'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { p_tok.set_buf_pos(buf_pos); ret_val = release99().JSON_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = later().JSON_decode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "object '@RUA-IEs.IntraDomainNasNodeSelector.version'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_LITERAL_NULL: { p_tok.set_buf_pos(buf_pos); ret_val = release99().JSON_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = later().JSON_decode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } clean_up(); return JSON_ERROR_INVALID_TOKEN; } case JSON_TOKEN_ERROR: JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; default: return JSON_ERROR_INVALID_TOKEN; } return ret_val; } else { size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } char* fld_name = 0; size_t name_len = 0; dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_NAME != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else { if (9 == name_len && 0 == strncmp(fld_name, "release99", name_len)) { int ret_val = release99().JSON_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 9, "release99"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (5 == name_len && 0 == strncmp(fld_name, "later", name_len)) { int ret_val = later().JSON_decode(IntraDomainNasNodeSelector_version_later_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 5, "later"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_STATIC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } return (int)dec_len; } } int IntraDomainNasNodeSelector_version::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_release99: {TTCN_Buffer buf; encode_oer_tag(*IntraDomainNasNodeSelector_version_release99_descr_.ber, p_buf); field_release99->OER_encode(IntraDomainNasNodeSelector_version_release99_descr_, buf); p_buf.put_buf(buf); break; } case ALT_later: {TTCN_Buffer buf; encode_oer_tag(*IntraDomainNasNodeSelector_version_later_descr_.ber, p_buf); field_later->OER_encode(IntraDomainNasNodeSelector_version_later_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector.version."); return -1; } return 0; } int IntraDomainNasNodeSelector_version::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const ASN_Tag_t& descr = decode_oer_tag(p_buf); if (IntraDomainNasNodeSelector_version_release99_descr_.ber->tags[IntraDomainNasNodeSelector_version_release99_descr_.ber->n_tags-1].tagclass == descr.tagclass && IntraDomainNasNodeSelector_version_release99_descr_.ber->tags[IntraDomainNasNodeSelector_version_release99_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { release99().OER_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_buf, p_oer); } else if (IntraDomainNasNodeSelector_version_later_descr_.ber->tags[IntraDomainNasNodeSelector_version_later_descr_.ber->n_tags-1].tagclass == descr.tagclass && IntraDomainNasNodeSelector_version_later_descr_.ber->tags[IntraDomainNasNodeSelector_version_later_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { later().OER_decode(IntraDomainNasNodeSelector_version_later_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type IntraDomainNasNodeSelector_version"); } return 0; } void IntraDomainNasNodeSelector_version::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound CHOICE value."); return; } switch (union_selection) { case ALT_release99: { INTEGER::PER_encode_int(p_buf, 0, 1); field_release99->PER_encode(IntraDomainNasNodeSelector_version_release99_descr_, p_buf, p_options); break; } case ALT_later: { INTEGER::PER_encode_int(p_buf, 1, 1); field_later->PER_encode(IntraDomainNasNodeSelector_version_later_descr_, p_buf, p_options); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Internal error: Invalid CHOICE selection, expected an extension root field."); break; } } void IntraDomainNasNodeSelector_version::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { clean_up(); int sel_int; INTEGER::PER_decode_int(p_buf, 1, FALSE, sel_int); switch (sel_int) { case 0: release99().PER_decode(IntraDomainNasNodeSelector_version_release99_descr_, p_buf, p_options); break; case 1: later().PER_decode(IntraDomainNasNodeSelector_version_later_descr_, p_buf, p_options); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid CHOICE selection (%d).", sel_int); break; } } void IntraDomainNasNodeSelector_version_template::copy_value(const IntraDomainNasNodeSelector_version& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: single_value.field_release99 = new IntraDomainNasNodeSelector_version_release99_template(other_value.release99()); break; case IntraDomainNasNodeSelector_version::ALT_later: single_value.field_later = new IntraDomainNasNodeSelector_version_later_template(other_value.later()); break; default: TTCN_error("Initializing a template with an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector.version."); } set_selection(SPECIFIC_VALUE); } void IntraDomainNasNodeSelector_version_template::copy_template(const IntraDomainNasNodeSelector_version_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.union_selection = other_value.single_value.union_selection; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: single_value.field_release99 = new IntraDomainNasNodeSelector_version_release99_template(*other_value.single_value.field_release99); break; case IntraDomainNasNodeSelector_version::ALT_later: single_value.field_later = new IntraDomainNasNodeSelector_version_later_template(*other_value.single_value.field_later); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @RUA-IEs.IntraDomainNasNodeSelector.version."); } 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 IntraDomainNasNodeSelector_version_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 IntraDomainNasNodeSelector_version_template(*other_value.implication_.precondition); implication_.implied_template = new IntraDomainNasNodeSelector_version_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 template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } set_selection(other_value); } IntraDomainNasNodeSelector_version_template::IntraDomainNasNodeSelector_version_template() { } IntraDomainNasNodeSelector_version_template::IntraDomainNasNodeSelector_version_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } IntraDomainNasNodeSelector_version_template::IntraDomainNasNodeSelector_version_template(const IntraDomainNasNodeSelector_version& other_value) { copy_value(other_value); } IntraDomainNasNodeSelector_version_template::IntraDomainNasNodeSelector_version_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector_version&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version from an unbound optional field."); } } IntraDomainNasNodeSelector_version_template::IntraDomainNasNodeSelector_version_template(IntraDomainNasNodeSelector_version_template* p_precondition, IntraDomainNasNodeSelector_version_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } IntraDomainNasNodeSelector_version_template::IntraDomainNasNodeSelector_version_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } IntraDomainNasNodeSelector_version_template::IntraDomainNasNodeSelector_version_template(const IntraDomainNasNodeSelector_version_template& other_value) : Base_Template(){ copy_template(other_value); } IntraDomainNasNodeSelector_version_template::~IntraDomainNasNodeSelector_version_template() { clean_up(); } void IntraDomainNasNodeSelector_version_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: delete single_value.field_release99; break; case IntraDomainNasNodeSelector_version::ALT_later: delete single_value.field_later; default: break; } 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; } IntraDomainNasNodeSelector_version_template& IntraDomainNasNodeSelector_version_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } IntraDomainNasNodeSelector_version_template& IntraDomainNasNodeSelector_version_template::operator=(const IntraDomainNasNodeSelector_version& other_value) { clean_up(); copy_value(other_value); return *this; } IntraDomainNasNodeSelector_version_template& IntraDomainNasNodeSelector_version_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector_version&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } return *this; } IntraDomainNasNodeSelector_version_template& IntraDomainNasNodeSelector_version_template::operator=(const IntraDomainNasNodeSelector_version_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean IntraDomainNasNodeSelector_version_template::match(const IntraDomainNasNodeSelector_version& 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: { IntraDomainNasNodeSelector_version::union_selection_type value_selection = other_value.get_selection(); if (value_selection == IntraDomainNasNodeSelector_version::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: return single_value.field_release99->match(other_value.release99(), legacy); case IntraDomainNasNodeSelector_version::ALT_later: return single_value.field_later->match(other_value.later(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } } 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 template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } return FALSE; } boolean IntraDomainNasNodeSelector_version_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: return single_value.field_release99->is_value(); case IntraDomainNasNodeSelector_version::ALT_later: return single_value.field_later->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } } IntraDomainNasNodeSelector_version IntraDomainNasNodeSelector_version_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); IntraDomainNasNodeSelector_version ret_val; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: ret_val.release99() = single_value.field_release99->valueof(); break; case IntraDomainNasNodeSelector_version::ALT_later: ret_val.later() = single_value.field_later->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } return ret_val; } IntraDomainNasNodeSelector_version_template& IntraDomainNasNodeSelector_version_template::list_item(unsigned int list_index) const { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); return value_list.list_value[list_index]; } void IntraDomainNasNodeSelector_version_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 ("Internal error: Setting an invalid list for a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new IntraDomainNasNodeSelector_version_template[list_length]; } IntraDomainNasNodeSelector_version_release99_template& IntraDomainNasNodeSelector_version_template::release99() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != IntraDomainNasNodeSelector_version::ALT_release99) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_release99 = new IntraDomainNasNodeSelector_version_release99_template(ANY_VALUE); else single_value.field_release99 = new IntraDomainNasNodeSelector_version_release99_template; single_value.union_selection = IntraDomainNasNodeSelector_version::ALT_release99; set_selection(SPECIFIC_VALUE); } return *single_value.field_release99; } const IntraDomainNasNodeSelector_version_release99_template& IntraDomainNasNodeSelector_version_template::release99() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field release99 in a non-specific template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); if (single_value.union_selection != IntraDomainNasNodeSelector_version::ALT_release99) TTCN_error("Accessing non-selected field release99 in a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); return *single_value.field_release99; } IntraDomainNasNodeSelector_version_later_template& IntraDomainNasNodeSelector_version_template::later() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != IntraDomainNasNodeSelector_version::ALT_later) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_later = new IntraDomainNasNodeSelector_version_later_template(ANY_VALUE); else single_value.field_later = new IntraDomainNasNodeSelector_version_later_template; single_value.union_selection = IntraDomainNasNodeSelector_version::ALT_later; set_selection(SPECIFIC_VALUE); } return *single_value.field_later; } const IntraDomainNasNodeSelector_version_later_template& IntraDomainNasNodeSelector_version_template::later() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field later in a non-specific template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); if (single_value.union_selection != IntraDomainNasNodeSelector_version::ALT_later) TTCN_error("Accessing non-selected field later in a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); return *single_value.field_later; } boolean IntraDomainNasNodeSelector_version_template::ischosen(IntraDomainNasNodeSelector_version::union_selection_type checked_selection) const { if (checked_selection == IntraDomainNasNodeSelector_version::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == IntraDomainNasNodeSelector_version::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); return single_value.union_selection == checked_selection; case VALUE_LIST: { if (value_list.n_values < 1) TTCN_error("Internal error: Performing ischosen() operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version containing an empty list."); boolean ret_val = value_list.list_value[0].ischosen(checked_selection); for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) { ret_val = value_list.list_value[list_count].ischosen(checked_selection); } return ret_val; } default: return FALSE; } return FALSE; } void IntraDomainNasNodeSelector_version_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: TTCN_Logger::log_event_str("{ release99 := "); single_value.field_release99->log(); TTCN_Logger::log_event_str(" }"); break; case IntraDomainNasNodeSelector_version::ALT_later: TTCN_Logger::log_event_str("{ later := "); single_value.field_later->log(); TTCN_Logger::log_event_str(" }"); break; default: 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 IntraDomainNasNodeSelector_version_template::log_match(const IntraDomainNasNodeSelector_version& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); return; } if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".release99"); single_value.field_release99->log_match(match_value.release99(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ release99 := "); single_value.field_release99->log_match(match_value.release99(), legacy); TTCN_Logger::log_event_str(" }"); } break; case IntraDomainNasNodeSelector_version::ALT_later: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".later"); single_value.field_later->log_match(match_value.later(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ later := "); single_value.field_later->log_match(match_value.later(), legacy); TTCN_Logger::log_event_str(" }"); } break; default: TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(""); } } else { TTCN_Logger::print_logmatch_buffer(); 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 IntraDomainNasNodeSelector_version_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: single_value.field_release99->set_implicit_omit(); break; case IntraDomainNasNodeSelector_version::ALT_later: single_value.field_later->set_implicit_omit(); break; default: break; } } void IntraDomainNasNodeSelector_version_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.union_selection); switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: single_value.field_release99->encode_text(text_buf); break; case IntraDomainNasNodeSelector_version::ALT_later: single_value.field_later->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } 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 template of type @RUA-IEs.IntraDomainNasNodeSelector.version."); } } void IntraDomainNasNodeSelector_version_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = IntraDomainNasNodeSelector_version::UNBOUND_VALUE; IntraDomainNasNodeSelector_version::union_selection_type new_selection = (IntraDomainNasNodeSelector_version::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: single_value.field_release99 = new IntraDomainNasNodeSelector_version_release99_template; single_value.field_release99->decode_text(text_buf); break; case IntraDomainNasNodeSelector_version::ALT_later: single_value.field_later = new IntraDomainNasNodeSelector_version_later_template; single_value.field_later->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @RUA-IEs.IntraDomainNasNodeSelector.version."); } single_value.union_selection = new_selection; } 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 IntraDomainNasNodeSelector_version_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: Unrecognized selector was received in a template of type @RUA-IEs.IntraDomainNasNodeSelector.version."); } } boolean IntraDomainNasNodeSelector_version_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean IntraDomainNasNodeSelector_version_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 v_idx=0; v_idx(param.get_id()) != NULL && param.get_id()->next_name()) { char* param_field = param.get_id()->get_current_name(); if (param_field[0] >= '0' && param_field[0] <= '9') { param.error("Unexpected array index in module parameter, expected a valid field" " name for union template type `@RUA-IEs.IntraDomainNasNodeSelector.version'"); } if (strcmp("release99", param_field) == 0) { release99().set_param(param); return; } else if (strcmp("later", param_field) == 0) { later().set_param(param); return; } else param.error("Field `%s' not found in union template type `@RUA-IEs.IntraDomainNasNodeSelector.version'", param_field); } param.basic_check(Module_Param::BC_TEMPLATE, "union template"); Module_Param_Ptr m_p = ¶m; switch (m_p->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: { IntraDomainNasNodeSelector_version_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Value_List: if (m_p->get_size()==0) break; param.type_error("union template", "@RUA-IEs.IntraDomainNasNodeSelector.version"); break; case Module_Param::MP_Assignment_List: { Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "release99")) { release99().set_param(*mp_last); break; } if (!strcmp(last_name, "later")) { later().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @RUA-IEs.IntraDomainNasNodeSelector.version.", last_name); } break; case Module_Param::MP_Implication_Template: { IntraDomainNasNodeSelector_version_template* precondition = new IntraDomainNasNodeSelector_version_template; precondition->set_param(*m_p->get_elem(0)); IntraDomainNasNodeSelector_version_template* implied_template = new IntraDomainNasNodeSelector_version_template; implied_template->set_param(*m_p->get_elem(1)); *this = IntraDomainNasNodeSelector_version_template(precondition, implied_template); } break; default: param.type_error("union template", "@RUA-IEs.IntraDomainNasNodeSelector.version"); } is_ifpresent = param.get_ifpresent(); } void IntraDomainNasNodeSelector_version_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; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version::ALT_release99: single_value.field_release99->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.IntraDomainNasNodeSelector.version"); return; case IntraDomainNasNodeSelector_version::ALT_later: single_value.field_later->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.IntraDomainNasNodeSelector.version"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version."); } 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 : "@RUA-IEs.IntraDomainNasNodeSelector.version"); } void IntraDomainNasNodeSelector_version_release99_cn__Type::copy_value(const IntraDomainNasNodeSelector_version_release99_cn__Type& other_value) { switch (other_value.union_selection) { case ALT_gsm__Map__IDNNS: field_gsm__Map__IDNNS = new Gsm__map__IDNNS(*other_value.field_gsm__Map__IDNNS); break; case ALT_ansi__41__IDNNS: field_ansi__41__IDNNS = new BITSTRING(*other_value.field_ansi__41__IDNNS); break; default: TTCN_error("Assignment of an unbound union value of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } union_selection = other_value.union_selection; } IntraDomainNasNodeSelector_version_release99_cn__Type::IntraDomainNasNodeSelector_version_release99_cn__Type() { union_selection = UNBOUND_VALUE; } IntraDomainNasNodeSelector_version_release99_cn__Type::IntraDomainNasNodeSelector_version_release99_cn__Type(const IntraDomainNasNodeSelector_version_release99_cn__Type& other_value) : Base_Type(){ copy_value(other_value); } IntraDomainNasNodeSelector_version_release99_cn__Type::~IntraDomainNasNodeSelector_version_release99_cn__Type() { clean_up(); } IntraDomainNasNodeSelector_version_release99_cn__Type& IntraDomainNasNodeSelector_version_release99_cn__Type::operator=(const IntraDomainNasNodeSelector_version_release99_cn__Type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean IntraDomainNasNodeSelector_version_release99_cn__Type::operator==(const IntraDomainNasNodeSelector_version_release99_cn__Type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { case ALT_gsm__Map__IDNNS: return *field_gsm__Map__IDNNS == *other_value.field_gsm__Map__IDNNS; case ALT_ansi__41__IDNNS: return *field_ansi__41__IDNNS == *other_value.field_ansi__41__IDNNS; default: return FALSE; } } Gsm__map__IDNNS& IntraDomainNasNodeSelector_version_release99_cn__Type::gsm__Map__IDNNS() { if (union_selection != ALT_gsm__Map__IDNNS) { clean_up(); field_gsm__Map__IDNNS = new Gsm__map__IDNNS; union_selection = ALT_gsm__Map__IDNNS; } return *field_gsm__Map__IDNNS; } const Gsm__map__IDNNS& IntraDomainNasNodeSelector_version_release99_cn__Type::gsm__Map__IDNNS() const { if (union_selection != ALT_gsm__Map__IDNNS) TTCN_error("Using non-selected field gsm_Map_IDNNS in a value of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return *field_gsm__Map__IDNNS; } BITSTRING& IntraDomainNasNodeSelector_version_release99_cn__Type::ansi__41__IDNNS() { if (union_selection != ALT_ansi__41__IDNNS) { clean_up(); field_ansi__41__IDNNS = new BITSTRING; union_selection = ALT_ansi__41__IDNNS; } return *field_ansi__41__IDNNS; } const BITSTRING& IntraDomainNasNodeSelector_version_release99_cn__Type::ansi__41__IDNNS() const { if (union_selection != ALT_ansi__41__IDNNS) TTCN_error("Using non-selected field ansi_41_IDNNS in a value of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return *field_ansi__41__IDNNS; } boolean IntraDomainNasNodeSelector_version_release99_cn__Type::ischosen(union_selection_type checked_selection) const { if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return union_selection == checked_selection; } boolean IntraDomainNasNodeSelector_version_release99_cn__Type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean IntraDomainNasNodeSelector_version_release99_cn__Type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; case ALT_gsm__Map__IDNNS: return field_gsm__Map__IDNNS->is_value(); case ALT_ansi__41__IDNNS: return field_ansi__41__IDNNS->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void IntraDomainNasNodeSelector_version_release99_cn__Type::clean_up() { switch (union_selection) { case ALT_gsm__Map__IDNNS: delete field_gsm__Map__IDNNS; break; case ALT_ansi__41__IDNNS: delete field_ansi__41__IDNNS; break; default: break; } union_selection = UNBOUND_VALUE; } void IntraDomainNasNodeSelector_version_release99_cn__Type::log() const { switch (union_selection) { case ALT_gsm__Map__IDNNS: TTCN_Logger::log_event_str("{ gsm_Map_IDNNS := "); field_gsm__Map__IDNNS->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_ansi__41__IDNNS: TTCN_Logger::log_event_str("{ ansi_41_IDNNS := "); field_ansi__41__IDNNS->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void IntraDomainNasNodeSelector_version_release99_cn__Type::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "union value"); Module_Param_Ptr m_p = ¶m; if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return; if (m_p->get_type()!=Module_Param::MP_Assignment_List) { param.error("union value with field name was expected"); } Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "gsm_Map_IDNNS")) { gsm__Map__IDNNS().set_param(*mp_last); if (!gsm__Map__IDNNS().is_bound()) clean_up(); return; } if (!strcmp(last_name, "ansi_41_IDNNS")) { ansi__41__IDNNS().set_param(*mp_last); if (!ansi__41__IDNNS().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type.", last_name); } void IntraDomainNasNodeSelector_version_release99_cn__Type::set_implicit_omit() { switch (union_selection) { case ALT_gsm__Map__IDNNS: field_gsm__Map__IDNNS->set_implicit_omit(); break; case ALT_ansi__41__IDNNS: field_ansi__41__IDNNS->set_implicit_omit(); break; default: break; } } void IntraDomainNasNodeSelector_version_release99_cn__Type::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_gsm__Map__IDNNS: field_gsm__Map__IDNNS->encode_text(text_buf); break; case ALT_ansi__41__IDNNS: field_ansi__41__IDNNS->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } } void IntraDomainNasNodeSelector_version_release99_cn__Type::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_gsm__Map__IDNNS: gsm__Map__IDNNS().decode_text(text_buf); break; case ALT_ansi__41__IDNNS: ansi__41__IDNNS().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } } void IntraDomainNasNodeSelector_version_release99_cn__Type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void IntraDomainNasNodeSelector_version_release99_cn__Type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t *IntraDomainNasNodeSelector_version_release99_cn__Type::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv; TTCN_EncDec_ErrorContext ec_0("Alternative '"); TTCN_EncDec_ErrorContext ec_1; switch (union_selection) { case ALT_gsm__Map__IDNNS: ec_1.set_msg("gsm_Map_IDNNS': "); new_tlv = field_gsm__Map__IDNNS->BER_encode_TLV(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_coding); break; case ALT_ansi__41__IDNNS: ec_1.set_msg("ansi_41_IDNNS': "); new_tlv = field_ansi__41__IDNNS->BER_encode_TLV(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_coding); break; case UNBOUND_VALUE: new_tlv = BER_encode_chk_bound(FALSE); break; default: TTCN_EncDec_ErrorContext::error_internal("Unknown selection."); new_tlv = NULL; } return ASN_BER_V2TLV(new_tlv, p_td, p_coding); } boolean IntraDomainNasNodeSelector_version_release99_cn__Type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_gsm__Map__IDNNS = new Gsm__map__IDNNS; union_selection = ALT_gsm__Map__IDNNS; if (field_gsm__Map__IDNNS->BER_decode_isMyMsg(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_tlv)) return TRUE; delete field_gsm__Map__IDNNS; field_ansi__41__IDNNS = new BITSTRING; union_selection = ALT_ansi__41__IDNNS; if (field_ansi__41__IDNNS->BER_decode_isMyMsg(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_tlv)) return TRUE; delete field_ansi__41__IDNNS; union_selection = UNBOUND_VALUE; return FALSE; } boolean IntraDomainNasNodeSelector_version_release99_cn__Type::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { IntraDomainNasNodeSelector_version_release99_cn__Type tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean IntraDomainNasNodeSelector_version_release99_cn__Type::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type' type: "); ASN_BER_TLV_t tmp_tlv; if (!BER_decode_TLV_CHOICE(*p_td.ber, stripped_tlv, L_form, tmp_tlv) || !BER_decode_CHOICE_selection(BER_decode_set_selection(tmp_tlv), tmp_tlv)) return FALSE; TTCN_EncDec_ErrorContext ec_1("Alternative '"); TTCN_EncDec_ErrorContext ec_2; switch (union_selection) { case ALT_gsm__Map__IDNNS: ec_2.set_msg("gsm_Map_IDNNS': "); field_gsm__Map__IDNNS->BER_decode_TLV(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, tmp_tlv, L_form); break; case ALT_ansi__41__IDNNS: ec_2.set_msg("ansi_41_IDNNS': "); field_ansi__41__IDNNS->BER_decode_TLV(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int IntraDomainNasNodeSelector_version_release99_cn__Type::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { boolean as_value = p_td.json->as_value; int enc_len = as_value ? 0 : p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); switch(union_selection) { case ALT_gsm__Map__IDNNS: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "gsm_Map_IDNNS"); } enc_len += field_gsm__Map__IDNNS->JSON_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_tok, FALSE); break; case ALT_ansi__41__IDNNS: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "ansi_41_IDNNS"); } enc_len += field_ansi__41__IDNNS->JSON_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int IntraDomainNasNodeSelector_version_release99_cn__Type::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int p_chosen_field) { if (0 <= p_chosen_field && 2 > p_chosen_field) { switch (p_chosen_field) { case 0: return gsm__Map__IDNNS().JSON_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_tok, TRUE, FALSE); case 1: return ansi__41__IDNNS().JSON_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_tok, TRUE, FALSE); } } if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; if (p_td.json->as_value) { size_t buf_pos = p_tok.get_buf_pos(); p_tok.get_next_token(&j_token, NULL, NULL); int ret_val = 0; switch(j_token) { case JSON_TOKEN_NUMBER: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "number '@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { p_tok.set_buf_pos(buf_pos); ret_val = ansi__41__IDNNS().JSON_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "string '@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_LITERAL_TRUE: case JSON_TOKEN_LITERAL_FALSE: { char* literal_str = mprintf("literal (%s)", (JSON_TOKEN_LITERAL_TRUE == j_token) ? "true" : "false"); try { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, literal_str); } catch (const TC_Error&) { Free(literal_str); throw; } Free(literal_str); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_ARRAY_START: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "array '@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { p_tok.set_buf_pos(buf_pos); ret_val = gsm__Map__IDNNS().JSON_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "object '@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_LITERAL_NULL: { clean_up(); return JSON_ERROR_INVALID_TOKEN; } case JSON_TOKEN_ERROR: JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; default: return JSON_ERROR_INVALID_TOKEN; } return ret_val; } else { size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } char* fld_name = 0; size_t name_len = 0; dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_NAME != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else { if (13 == name_len && 0 == strncmp(fld_name, "gsm_Map_IDNNS", name_len)) { int ret_val = gsm__Map__IDNNS().JSON_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 13, "gsm_Map_IDNNS"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (13 == name_len && 0 == strncmp(fld_name, "ansi_41_IDNNS", name_len)) { int ret_val = ansi__41__IDNNS().JSON_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 13, "ansi_41_IDNNS"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_STATIC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } return (int)dec_len; } } int IntraDomainNasNodeSelector_version_release99_cn__Type::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_gsm__Map__IDNNS: {TTCN_Buffer buf; encode_oer_tag(*IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_.ber, p_buf); field_gsm__Map__IDNNS->OER_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, buf); p_buf.put_buf(buf); break; } case ALT_ansi__41__IDNNS: {TTCN_Buffer buf; encode_oer_tag(*IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_.ber, p_buf); field_ansi__41__IDNNS->OER_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return -1; } return 0; } int IntraDomainNasNodeSelector_version_release99_cn__Type::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const ASN_Tag_t& descr = decode_oer_tag(p_buf); if (IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_.ber->tags[IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_.ber->n_tags-1].tagclass == descr.tagclass && IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_.ber->tags[IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { gsm__Map__IDNNS().OER_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_buf, p_oer); } else if (IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_.ber->tags[IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_.ber->n_tags-1].tagclass == descr.tagclass && IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_.ber->tags[IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { ansi__41__IDNNS().OER_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type IntraDomainNasNodeSelector_version_release99_cn__Type"); } return 0; } void IntraDomainNasNodeSelector_version_release99_cn__Type::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound CHOICE value."); return; } switch (union_selection) { case ALT_gsm__Map__IDNNS: { INTEGER::PER_encode_int(p_buf, 0, 1); field_gsm__Map__IDNNS->PER_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_buf, p_options); break; } case ALT_ansi__41__IDNNS: { INTEGER::PER_encode_int(p_buf, 1, 1); field_ansi__41__IDNNS->PER_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_buf, p_options); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Internal error: Invalid CHOICE selection, expected an extension root field."); break; } } void IntraDomainNasNodeSelector_version_release99_cn__Type::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { clean_up(); int sel_int; INTEGER::PER_decode_int(p_buf, 1, FALSE, sel_int); switch (sel_int) { case 0: gsm__Map__IDNNS().PER_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_gsm__Map__IDNNS_descr_, p_buf, p_options); break; case 1: ansi__41__IDNNS().PER_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_ansi__41__IDNNS_descr_, p_buf, p_options); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid CHOICE selection (%d).", sel_int); break; } } void IntraDomainNasNodeSelector_version_release99_cn__Type_template::copy_value(const IntraDomainNasNodeSelector_version_release99_cn__Type& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: single_value.field_gsm__Map__IDNNS = new Gsm__map__IDNNS_template(other_value.gsm__Map__IDNNS()); break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: single_value.field_ansi__41__IDNNS = new BITSTRING_template(other_value.ansi__41__IDNNS()); break; default: TTCN_error("Initializing a template with an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } set_selection(SPECIFIC_VALUE); } void IntraDomainNasNodeSelector_version_release99_cn__Type_template::copy_template(const IntraDomainNasNodeSelector_version_release99_cn__Type_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.union_selection = other_value.single_value.union_selection; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: single_value.field_gsm__Map__IDNNS = new Gsm__map__IDNNS_template(*other_value.single_value.field_gsm__Map__IDNNS); break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: single_value.field_ansi__41__IDNNS = new BITSTRING_template(*other_value.single_value.field_ansi__41__IDNNS); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } 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 IntraDomainNasNodeSelector_version_release99_cn__Type_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 IntraDomainNasNodeSelector_version_release99_cn__Type_template(*other_value.implication_.precondition); implication_.implied_template = new IntraDomainNasNodeSelector_version_release99_cn__Type_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 template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } set_selection(other_value); } IntraDomainNasNodeSelector_version_release99_cn__Type_template::IntraDomainNasNodeSelector_version_release99_cn__Type_template() { } IntraDomainNasNodeSelector_version_release99_cn__Type_template::IntraDomainNasNodeSelector_version_release99_cn__Type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } IntraDomainNasNodeSelector_version_release99_cn__Type_template::IntraDomainNasNodeSelector_version_release99_cn__Type_template(const IntraDomainNasNodeSelector_version_release99_cn__Type& other_value) { copy_value(other_value); } IntraDomainNasNodeSelector_version_release99_cn__Type_template::IntraDomainNasNodeSelector_version_release99_cn__Type_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector_version_release99_cn__Type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type from an unbound optional field."); } } IntraDomainNasNodeSelector_version_release99_cn__Type_template::IntraDomainNasNodeSelector_version_release99_cn__Type_template(IntraDomainNasNodeSelector_version_release99_cn__Type_template* p_precondition, IntraDomainNasNodeSelector_version_release99_cn__Type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } IntraDomainNasNodeSelector_version_release99_cn__Type_template::IntraDomainNasNodeSelector_version_release99_cn__Type_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } IntraDomainNasNodeSelector_version_release99_cn__Type_template::IntraDomainNasNodeSelector_version_release99_cn__Type_template(const IntraDomainNasNodeSelector_version_release99_cn__Type_template& other_value) : Base_Template(){ copy_template(other_value); } IntraDomainNasNodeSelector_version_release99_cn__Type_template::~IntraDomainNasNodeSelector_version_release99_cn__Type_template() { clean_up(); } void IntraDomainNasNodeSelector_version_release99_cn__Type_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: delete single_value.field_gsm__Map__IDNNS; break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: delete single_value.field_ansi__41__IDNNS; default: break; } 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; } IntraDomainNasNodeSelector_version_release99_cn__Type_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } IntraDomainNasNodeSelector_version_release99_cn__Type_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::operator=(const IntraDomainNasNodeSelector_version_release99_cn__Type& other_value) { clean_up(); copy_value(other_value); return *this; } IntraDomainNasNodeSelector_version_release99_cn__Type_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector_version_release99_cn__Type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } return *this; } IntraDomainNasNodeSelector_version_release99_cn__Type_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::operator=(const IntraDomainNasNodeSelector_version_release99_cn__Type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean IntraDomainNasNodeSelector_version_release99_cn__Type_template::match(const IntraDomainNasNodeSelector_version_release99_cn__Type& 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: { IntraDomainNasNodeSelector_version_release99_cn__Type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == IntraDomainNasNodeSelector_version_release99_cn__Type::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: return single_value.field_gsm__Map__IDNNS->match(other_value.gsm__Map__IDNNS(), legacy); case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: return single_value.field_ansi__41__IDNNS->match(other_value.ansi__41__IDNNS(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } } 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 template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } return FALSE; } boolean IntraDomainNasNodeSelector_version_release99_cn__Type_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: return single_value.field_gsm__Map__IDNNS->is_value(); case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: return single_value.field_ansi__41__IDNNS->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } } IntraDomainNasNodeSelector_version_release99_cn__Type IntraDomainNasNodeSelector_version_release99_cn__Type_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); IntraDomainNasNodeSelector_version_release99_cn__Type ret_val; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: ret_val.gsm__Map__IDNNS() = single_value.field_gsm__Map__IDNNS->valueof(); break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: ret_val.ansi__41__IDNNS() = single_value.field_ansi__41__IDNNS->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } return ret_val; } IntraDomainNasNodeSelector_version_release99_cn__Type_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::list_item(unsigned int list_index) const { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return value_list.list_value[list_index]; } void IntraDomainNasNodeSelector_version_release99_cn__Type_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 ("Internal error: Setting an invalid list for a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new IntraDomainNasNodeSelector_version_release99_cn__Type_template[list_length]; } Gsm__map__IDNNS_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::gsm__Map__IDNNS() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gsm__Map__IDNNS = new Gsm__map__IDNNS_template(ANY_VALUE); else single_value.field_gsm__Map__IDNNS = new Gsm__map__IDNNS_template; single_value.union_selection = IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS; set_selection(SPECIFIC_VALUE); } return *single_value.field_gsm__Map__IDNNS; } const Gsm__map__IDNNS_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::gsm__Map__IDNNS() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gsm_Map_IDNNS in a non-specific template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); if (single_value.union_selection != IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS) TTCN_error("Accessing non-selected field gsm_Map_IDNNS in a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return *single_value.field_gsm__Map__IDNNS; } BITSTRING_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::ansi__41__IDNNS() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_ansi__41__IDNNS = new BITSTRING_template(ANY_VALUE); else single_value.field_ansi__41__IDNNS = new BITSTRING_template; single_value.union_selection = IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS; set_selection(SPECIFIC_VALUE); } return *single_value.field_ansi__41__IDNNS; } const BITSTRING_template& IntraDomainNasNodeSelector_version_release99_cn__Type_template::ansi__41__IDNNS() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ansi_41_IDNNS in a non-specific template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); if (single_value.union_selection != IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS) TTCN_error("Accessing non-selected field ansi_41_IDNNS in a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return *single_value.field_ansi__41__IDNNS; } boolean IntraDomainNasNodeSelector_version_release99_cn__Type_template::ischosen(IntraDomainNasNodeSelector_version_release99_cn__Type::union_selection_type checked_selection) const { if (checked_selection == IntraDomainNasNodeSelector_version_release99_cn__Type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == IntraDomainNasNodeSelector_version_release99_cn__Type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); return single_value.union_selection == checked_selection; case VALUE_LIST: { if (value_list.n_values < 1) TTCN_error("Internal error: Performing ischosen() operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type containing an empty list."); boolean ret_val = value_list.list_value[0].ischosen(checked_selection); for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) { ret_val = value_list.list_value[list_count].ischosen(checked_selection); } return ret_val; } default: return FALSE; } return FALSE; } void IntraDomainNasNodeSelector_version_release99_cn__Type_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: TTCN_Logger::log_event_str("{ gsm_Map_IDNNS := "); single_value.field_gsm__Map__IDNNS->log(); TTCN_Logger::log_event_str(" }"); break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: TTCN_Logger::log_event_str("{ ansi_41_IDNNS := "); single_value.field_ansi__41__IDNNS->log(); TTCN_Logger::log_event_str(" }"); break; default: 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 IntraDomainNasNodeSelector_version_release99_cn__Type_template::log_match(const IntraDomainNasNodeSelector_version_release99_cn__Type& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); return; } if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".gsm_Map_IDNNS"); single_value.field_gsm__Map__IDNNS->log_match(match_value.gsm__Map__IDNNS(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ gsm_Map_IDNNS := "); single_value.field_gsm__Map__IDNNS->log_match(match_value.gsm__Map__IDNNS(), legacy); TTCN_Logger::log_event_str(" }"); } break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".ansi_41_IDNNS"); single_value.field_ansi__41__IDNNS->log_match(match_value.ansi__41__IDNNS(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ ansi_41_IDNNS := "); single_value.field_ansi__41__IDNNS->log_match(match_value.ansi__41__IDNNS(), legacy); TTCN_Logger::log_event_str(" }"); } break; default: TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(""); } } else { TTCN_Logger::print_logmatch_buffer(); 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 IntraDomainNasNodeSelector_version_release99_cn__Type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: single_value.field_gsm__Map__IDNNS->set_implicit_omit(); break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: single_value.field_ansi__41__IDNNS->set_implicit_omit(); break; default: break; } } void IntraDomainNasNodeSelector_version_release99_cn__Type_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.union_selection); switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: single_value.field_gsm__Map__IDNNS->encode_text(text_buf); break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: single_value.field_ansi__41__IDNNS->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } 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 template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } } void IntraDomainNasNodeSelector_version_release99_cn__Type_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = IntraDomainNasNodeSelector_version_release99_cn__Type::UNBOUND_VALUE; IntraDomainNasNodeSelector_version_release99_cn__Type::union_selection_type new_selection = (IntraDomainNasNodeSelector_version_release99_cn__Type::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: single_value.field_gsm__Map__IDNNS = new Gsm__map__IDNNS_template; single_value.field_gsm__Map__IDNNS->decode_text(text_buf); break; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: single_value.field_ansi__41__IDNNS = new BITSTRING_template; single_value.field_ansi__41__IDNNS->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } single_value.union_selection = new_selection; } 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 IntraDomainNasNodeSelector_version_release99_cn__Type_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: Unrecognized selector was received in a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } } boolean IntraDomainNasNodeSelector_version_release99_cn__Type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean IntraDomainNasNodeSelector_version_release99_cn__Type_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 v_idx=0; v_idx(param.get_id()) != NULL && param.get_id()->next_name()) { char* param_field = param.get_id()->get_current_name(); if (param_field[0] >= '0' && param_field[0] <= '9') { param.error("Unexpected array index in module parameter, expected a valid field" " name for union template type `@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type'"); } if (strcmp("gsm_Map_IDNNS", param_field) == 0) { gsm__Map__IDNNS().set_param(param); return; } else if (strcmp("ansi_41_IDNNS", param_field) == 0) { ansi__41__IDNNS().set_param(param); return; } else param.error("Field `%s' not found in union template type `@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type'", param_field); } param.basic_check(Module_Param::BC_TEMPLATE, "union template"); Module_Param_Ptr m_p = ¶m; switch (m_p->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: { IntraDomainNasNodeSelector_version_release99_cn__Type_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Value_List: if (m_p->get_size()==0) break; param.type_error("union template", "@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type"); break; case Module_Param::MP_Assignment_List: { Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "gsm_Map_IDNNS")) { gsm__Map__IDNNS().set_param(*mp_last); break; } if (!strcmp(last_name, "ansi_41_IDNNS")) { ansi__41__IDNNS().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type.", last_name); } break; case Module_Param::MP_Implication_Template: { IntraDomainNasNodeSelector_version_release99_cn__Type_template* precondition = new IntraDomainNasNodeSelector_version_release99_cn__Type_template; precondition->set_param(*m_p->get_elem(0)); IntraDomainNasNodeSelector_version_release99_cn__Type_template* implied_template = new IntraDomainNasNodeSelector_version_release99_cn__Type_template; implied_template->set_param(*m_p->get_elem(1)); *this = IntraDomainNasNodeSelector_version_release99_cn__Type_template(precondition, implied_template); } break; default: param.type_error("union template", "@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type"); } is_ifpresent = param.get_ifpresent(); } void IntraDomainNasNodeSelector_version_release99_cn__Type_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; switch (single_value.union_selection) { case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_gsm__Map__IDNNS: single_value.field_gsm__Map__IDNNS->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type"); return; case IntraDomainNasNodeSelector_version_release99_cn__Type::ALT_ansi__41__IDNNS: single_value.field_ansi__41__IDNNS->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type."); } 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 : "@RUA-IEs.IntraDomainNasNodeSelector.version.release99.cn-Type"); } void Gsm__map__IDNNS_routingbasis::copy_value(const Gsm__map__IDNNS_routingbasis& other_value) { switch (other_value.union_selection) { case ALT_localPTMSI: field_localPTMSI = new Gsm__map__IDNNS_routingbasis_localPTMSI(*other_value.field_localPTMSI); break; case ALT_tMSIofsamePLMN: field_tMSIofsamePLMN = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN(*other_value.field_tMSIofsamePLMN); break; case ALT_tMSIofdifferentPLMN: field_tMSIofdifferentPLMN = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN(*other_value.field_tMSIofdifferentPLMN); break; case ALT_iMSIresponsetopaging: field_iMSIresponsetopaging = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging(*other_value.field_iMSIresponsetopaging); break; case ALT_iMSIcauseUEinitiatedEvent: field_iMSIcauseUEinitiatedEvent = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent(*other_value.field_iMSIcauseUEinitiatedEvent); break; case ALT_iMEI: field_iMEI = new Gsm__map__IDNNS_routingbasis_iMEI(*other_value.field_iMEI); break; case ALT_spare2: field_spare2 = new Gsm__map__IDNNS_routingbasis_spare2(*other_value.field_spare2); break; case ALT_spare1: field_spare1 = new Gsm__map__IDNNS_routingbasis_spare1(*other_value.field_spare1); break; default: TTCN_error("Assignment of an unbound union value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } union_selection = other_value.union_selection; } Gsm__map__IDNNS_routingbasis::Gsm__map__IDNNS_routingbasis() { union_selection = UNBOUND_VALUE; } Gsm__map__IDNNS_routingbasis::Gsm__map__IDNNS_routingbasis(const Gsm__map__IDNNS_routingbasis& other_value) : Base_Type(){ copy_value(other_value); } Gsm__map__IDNNS_routingbasis::~Gsm__map__IDNNS_routingbasis() { clean_up(); } Gsm__map__IDNNS_routingbasis& Gsm__map__IDNNS_routingbasis::operator=(const Gsm__map__IDNNS_routingbasis& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis::operator==(const Gsm__map__IDNNS_routingbasis& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { case ALT_localPTMSI: return *field_localPTMSI == *other_value.field_localPTMSI; case ALT_tMSIofsamePLMN: return *field_tMSIofsamePLMN == *other_value.field_tMSIofsamePLMN; case ALT_tMSIofdifferentPLMN: return *field_tMSIofdifferentPLMN == *other_value.field_tMSIofdifferentPLMN; case ALT_iMSIresponsetopaging: return *field_iMSIresponsetopaging == *other_value.field_iMSIresponsetopaging; case ALT_iMSIcauseUEinitiatedEvent: return *field_iMSIcauseUEinitiatedEvent == *other_value.field_iMSIcauseUEinitiatedEvent; case ALT_iMEI: return *field_iMEI == *other_value.field_iMEI; case ALT_spare2: return *field_spare2 == *other_value.field_spare2; case ALT_spare1: return *field_spare1 == *other_value.field_spare1; default: return FALSE; } } Gsm__map__IDNNS_routingbasis_localPTMSI& Gsm__map__IDNNS_routingbasis::localPTMSI() { if (union_selection != ALT_localPTMSI) { clean_up(); field_localPTMSI = new Gsm__map__IDNNS_routingbasis_localPTMSI; union_selection = ALT_localPTMSI; } return *field_localPTMSI; } const Gsm__map__IDNNS_routingbasis_localPTMSI& Gsm__map__IDNNS_routingbasis::localPTMSI() const { if (union_selection != ALT_localPTMSI) TTCN_error("Using non-selected field localPTMSI in a value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *field_localPTMSI; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN& Gsm__map__IDNNS_routingbasis::tMSIofsamePLMN() { if (union_selection != ALT_tMSIofsamePLMN) { clean_up(); field_tMSIofsamePLMN = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN; union_selection = ALT_tMSIofsamePLMN; } return *field_tMSIofsamePLMN; } const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN& Gsm__map__IDNNS_routingbasis::tMSIofsamePLMN() const { if (union_selection != ALT_tMSIofsamePLMN) TTCN_error("Using non-selected field tMSIofsamePLMN in a value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *field_tMSIofsamePLMN; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN& Gsm__map__IDNNS_routingbasis::tMSIofdifferentPLMN() { if (union_selection != ALT_tMSIofdifferentPLMN) { clean_up(); field_tMSIofdifferentPLMN = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN; union_selection = ALT_tMSIofdifferentPLMN; } return *field_tMSIofdifferentPLMN; } const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN& Gsm__map__IDNNS_routingbasis::tMSIofdifferentPLMN() const { if (union_selection != ALT_tMSIofdifferentPLMN) TTCN_error("Using non-selected field tMSIofdifferentPLMN in a value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *field_tMSIofdifferentPLMN; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging& Gsm__map__IDNNS_routingbasis::iMSIresponsetopaging() { if (union_selection != ALT_iMSIresponsetopaging) { clean_up(); field_iMSIresponsetopaging = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging; union_selection = ALT_iMSIresponsetopaging; } return *field_iMSIresponsetopaging; } const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging& Gsm__map__IDNNS_routingbasis::iMSIresponsetopaging() const { if (union_selection != ALT_iMSIresponsetopaging) TTCN_error("Using non-selected field iMSIresponsetopaging in a value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *field_iMSIresponsetopaging; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent& Gsm__map__IDNNS_routingbasis::iMSIcauseUEinitiatedEvent() { if (union_selection != ALT_iMSIcauseUEinitiatedEvent) { clean_up(); field_iMSIcauseUEinitiatedEvent = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent; union_selection = ALT_iMSIcauseUEinitiatedEvent; } return *field_iMSIcauseUEinitiatedEvent; } const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent& Gsm__map__IDNNS_routingbasis::iMSIcauseUEinitiatedEvent() const { if (union_selection != ALT_iMSIcauseUEinitiatedEvent) TTCN_error("Using non-selected field iMSIcauseUEinitiatedEvent in a value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *field_iMSIcauseUEinitiatedEvent; } Gsm__map__IDNNS_routingbasis_iMEI& Gsm__map__IDNNS_routingbasis::iMEI() { if (union_selection != ALT_iMEI) { clean_up(); field_iMEI = new Gsm__map__IDNNS_routingbasis_iMEI; union_selection = ALT_iMEI; } return *field_iMEI; } const Gsm__map__IDNNS_routingbasis_iMEI& Gsm__map__IDNNS_routingbasis::iMEI() const { if (union_selection != ALT_iMEI) TTCN_error("Using non-selected field iMEI in a value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *field_iMEI; } Gsm__map__IDNNS_routingbasis_spare2& Gsm__map__IDNNS_routingbasis::spare2() { if (union_selection != ALT_spare2) { clean_up(); field_spare2 = new Gsm__map__IDNNS_routingbasis_spare2; union_selection = ALT_spare2; } return *field_spare2; } const Gsm__map__IDNNS_routingbasis_spare2& Gsm__map__IDNNS_routingbasis::spare2() const { if (union_selection != ALT_spare2) TTCN_error("Using non-selected field spare2 in a value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *field_spare2; } Gsm__map__IDNNS_routingbasis_spare1& Gsm__map__IDNNS_routingbasis::spare1() { if (union_selection != ALT_spare1) { clean_up(); field_spare1 = new Gsm__map__IDNNS_routingbasis_spare1; union_selection = ALT_spare1; } return *field_spare1; } const Gsm__map__IDNNS_routingbasis_spare1& Gsm__map__IDNNS_routingbasis::spare1() const { if (union_selection != ALT_spare1) TTCN_error("Using non-selected field spare1 in a value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *field_spare1; } boolean Gsm__map__IDNNS_routingbasis::ischosen(union_selection_type checked_selection) const { if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return union_selection == checked_selection; } boolean Gsm__map__IDNNS_routingbasis::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean Gsm__map__IDNNS_routingbasis::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; case ALT_localPTMSI: return field_localPTMSI->is_value(); case ALT_tMSIofsamePLMN: return field_tMSIofsamePLMN->is_value(); case ALT_tMSIofdifferentPLMN: return field_tMSIofdifferentPLMN->is_value(); case ALT_iMSIresponsetopaging: return field_iMSIresponsetopaging->is_value(); case ALT_iMSIcauseUEinitiatedEvent: return field_iMSIcauseUEinitiatedEvent->is_value(); case ALT_iMEI: return field_iMEI->is_value(); case ALT_spare2: return field_spare2->is_value(); case ALT_spare1: return field_spare1->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void Gsm__map__IDNNS_routingbasis::clean_up() { switch (union_selection) { case ALT_localPTMSI: delete field_localPTMSI; break; case ALT_tMSIofsamePLMN: delete field_tMSIofsamePLMN; break; case ALT_tMSIofdifferentPLMN: delete field_tMSIofdifferentPLMN; break; case ALT_iMSIresponsetopaging: delete field_iMSIresponsetopaging; break; case ALT_iMSIcauseUEinitiatedEvent: delete field_iMSIcauseUEinitiatedEvent; break; case ALT_iMEI: delete field_iMEI; break; case ALT_spare2: delete field_spare2; break; case ALT_spare1: delete field_spare1; break; default: break; } union_selection = UNBOUND_VALUE; } void Gsm__map__IDNNS_routingbasis::log() const { switch (union_selection) { case ALT_localPTMSI: TTCN_Logger::log_event_str("{ localPTMSI := "); field_localPTMSI->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_tMSIofsamePLMN: TTCN_Logger::log_event_str("{ tMSIofsamePLMN := "); field_tMSIofsamePLMN->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_tMSIofdifferentPLMN: TTCN_Logger::log_event_str("{ tMSIofdifferentPLMN := "); field_tMSIofdifferentPLMN->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_iMSIresponsetopaging: TTCN_Logger::log_event_str("{ iMSIresponsetopaging := "); field_iMSIresponsetopaging->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_iMSIcauseUEinitiatedEvent: TTCN_Logger::log_event_str("{ iMSIcauseUEinitiatedEvent := "); field_iMSIcauseUEinitiatedEvent->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_iMEI: TTCN_Logger::log_event_str("{ iMEI := "); field_iMEI->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_spare2: TTCN_Logger::log_event_str("{ spare2 := "); field_spare2->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_spare1: TTCN_Logger::log_event_str("{ spare1 := "); field_spare1->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void Gsm__map__IDNNS_routingbasis::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "union value"); Module_Param_Ptr m_p = ¶m; if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return; if (m_p->get_type()!=Module_Param::MP_Assignment_List) { param.error("union value with field name was expected"); } Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "localPTMSI")) { localPTMSI().set_param(*mp_last); if (!localPTMSI().is_bound()) clean_up(); return; } if (!strcmp(last_name, "tMSIofsamePLMN")) { tMSIofsamePLMN().set_param(*mp_last); if (!tMSIofsamePLMN().is_bound()) clean_up(); return; } if (!strcmp(last_name, "tMSIofdifferentPLMN")) { tMSIofdifferentPLMN().set_param(*mp_last); if (!tMSIofdifferentPLMN().is_bound()) clean_up(); return; } if (!strcmp(last_name, "iMSIresponsetopaging")) { iMSIresponsetopaging().set_param(*mp_last); if (!iMSIresponsetopaging().is_bound()) clean_up(); return; } if (!strcmp(last_name, "iMSIcauseUEinitiatedEvent")) { iMSIcauseUEinitiatedEvent().set_param(*mp_last); if (!iMSIcauseUEinitiatedEvent().is_bound()) clean_up(); return; } if (!strcmp(last_name, "iMEI")) { iMEI().set_param(*mp_last); if (!iMEI().is_bound()) clean_up(); return; } if (!strcmp(last_name, "spare2")) { spare2().set_param(*mp_last); if (!spare2().is_bound()) clean_up(); return; } if (!strcmp(last_name, "spare1")) { spare1().set_param(*mp_last); if (!spare1().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.", last_name); } void Gsm__map__IDNNS_routingbasis::set_implicit_omit() { switch (union_selection) { case ALT_localPTMSI: field_localPTMSI->set_implicit_omit(); break; case ALT_tMSIofsamePLMN: field_tMSIofsamePLMN->set_implicit_omit(); break; case ALT_tMSIofdifferentPLMN: field_tMSIofdifferentPLMN->set_implicit_omit(); break; case ALT_iMSIresponsetopaging: field_iMSIresponsetopaging->set_implicit_omit(); break; case ALT_iMSIcauseUEinitiatedEvent: field_iMSIcauseUEinitiatedEvent->set_implicit_omit(); break; case ALT_iMEI: field_iMEI->set_implicit_omit(); break; case ALT_spare2: field_spare2->set_implicit_omit(); break; case ALT_spare1: field_spare1->set_implicit_omit(); break; default: break; } } void Gsm__map__IDNNS_routingbasis::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_localPTMSI: field_localPTMSI->encode_text(text_buf); break; case ALT_tMSIofsamePLMN: field_tMSIofsamePLMN->encode_text(text_buf); break; case ALT_tMSIofdifferentPLMN: field_tMSIofdifferentPLMN->encode_text(text_buf); break; case ALT_iMSIresponsetopaging: field_iMSIresponsetopaging->encode_text(text_buf); break; case ALT_iMSIcauseUEinitiatedEvent: field_iMSIcauseUEinitiatedEvent->encode_text(text_buf); break; case ALT_iMEI: field_iMEI->encode_text(text_buf); break; case ALT_spare2: field_spare2->encode_text(text_buf); break; case ALT_spare1: field_spare1->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } } void Gsm__map__IDNNS_routingbasis::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_localPTMSI: localPTMSI().decode_text(text_buf); break; case ALT_tMSIofsamePLMN: tMSIofsamePLMN().decode_text(text_buf); break; case ALT_tMSIofdifferentPLMN: tMSIofdifferentPLMN().decode_text(text_buf); break; case ALT_iMSIresponsetopaging: iMSIresponsetopaging().decode_text(text_buf); break; case ALT_iMSIcauseUEinitiatedEvent: iMSIcauseUEinitiatedEvent().decode_text(text_buf); break; case ALT_iMEI: iMEI().decode_text(text_buf); break; case ALT_spare2: spare2().decode_text(text_buf); break; case ALT_spare1: spare1().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } } void Gsm__map__IDNNS_routingbasis::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t *Gsm__map__IDNNS_routingbasis::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv; TTCN_EncDec_ErrorContext ec_0("Alternative '"); TTCN_EncDec_ErrorContext ec_1; switch (union_selection) { case ALT_localPTMSI: ec_1.set_msg("localPTMSI': "); new_tlv = field_localPTMSI->BER_encode_TLV(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_coding); break; case ALT_tMSIofsamePLMN: ec_1.set_msg("tMSIofsamePLMN': "); new_tlv = field_tMSIofsamePLMN->BER_encode_TLV(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_coding); break; case ALT_tMSIofdifferentPLMN: ec_1.set_msg("tMSIofdifferentPLMN': "); new_tlv = field_tMSIofdifferentPLMN->BER_encode_TLV(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_coding); break; case ALT_iMSIresponsetopaging: ec_1.set_msg("iMSIresponsetopaging': "); new_tlv = field_iMSIresponsetopaging->BER_encode_TLV(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_coding); break; case ALT_iMSIcauseUEinitiatedEvent: ec_1.set_msg("iMSIcauseUEinitiatedEvent': "); new_tlv = field_iMSIcauseUEinitiatedEvent->BER_encode_TLV(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_coding); break; case ALT_iMEI: ec_1.set_msg("iMEI': "); new_tlv = field_iMEI->BER_encode_TLV(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_coding); break; case ALT_spare2: ec_1.set_msg("spare2': "); new_tlv = field_spare2->BER_encode_TLV(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_coding); break; case ALT_spare1: ec_1.set_msg("spare1': "); new_tlv = field_spare1->BER_encode_TLV(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_coding); break; case UNBOUND_VALUE: new_tlv = BER_encode_chk_bound(FALSE); break; default: TTCN_EncDec_ErrorContext::error_internal("Unknown selection."); new_tlv = NULL; } return ASN_BER_V2TLV(new_tlv, p_td, p_coding); } boolean Gsm__map__IDNNS_routingbasis::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_localPTMSI = new Gsm__map__IDNNS_routingbasis_localPTMSI; union_selection = ALT_localPTMSI; if (field_localPTMSI->BER_decode_isMyMsg(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tlv)) return TRUE; delete field_localPTMSI; field_tMSIofsamePLMN = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN; union_selection = ALT_tMSIofsamePLMN; if (field_tMSIofsamePLMN->BER_decode_isMyMsg(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tlv)) return TRUE; delete field_tMSIofsamePLMN; field_tMSIofdifferentPLMN = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN; union_selection = ALT_tMSIofdifferentPLMN; if (field_tMSIofdifferentPLMN->BER_decode_isMyMsg(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tlv)) return TRUE; delete field_tMSIofdifferentPLMN; field_iMSIresponsetopaging = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging; union_selection = ALT_iMSIresponsetopaging; if (field_iMSIresponsetopaging->BER_decode_isMyMsg(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tlv)) return TRUE; delete field_iMSIresponsetopaging; field_iMSIcauseUEinitiatedEvent = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent; union_selection = ALT_iMSIcauseUEinitiatedEvent; if (field_iMSIcauseUEinitiatedEvent->BER_decode_isMyMsg(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tlv)) return TRUE; delete field_iMSIcauseUEinitiatedEvent; field_iMEI = new Gsm__map__IDNNS_routingbasis_iMEI; union_selection = ALT_iMEI; if (field_iMEI->BER_decode_isMyMsg(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tlv)) return TRUE; delete field_iMEI; field_spare2 = new Gsm__map__IDNNS_routingbasis_spare2; union_selection = ALT_spare2; if (field_spare2->BER_decode_isMyMsg(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tlv)) return TRUE; delete field_spare2; field_spare1 = new Gsm__map__IDNNS_routingbasis_spare1; union_selection = ALT_spare1; if (field_spare1->BER_decode_isMyMsg(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tlv)) return TRUE; delete field_spare1; union_selection = UNBOUND_VALUE; return FALSE; } boolean Gsm__map__IDNNS_routingbasis::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { Gsm__map__IDNNS_routingbasis tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean Gsm__map__IDNNS_routingbasis::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis' type: "); ASN_BER_TLV_t tmp_tlv; if (!BER_decode_TLV_CHOICE(*p_td.ber, stripped_tlv, L_form, tmp_tlv) || !BER_decode_CHOICE_selection(BER_decode_set_selection(tmp_tlv), tmp_tlv)) return FALSE; TTCN_EncDec_ErrorContext ec_1("Alternative '"); TTCN_EncDec_ErrorContext ec_2; switch (union_selection) { case ALT_localPTMSI: ec_2.set_msg("localPTMSI': "); field_localPTMSI->BER_decode_TLV(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, tmp_tlv, L_form); break; case ALT_tMSIofsamePLMN: ec_2.set_msg("tMSIofsamePLMN': "); field_tMSIofsamePLMN->BER_decode_TLV(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, tmp_tlv, L_form); break; case ALT_tMSIofdifferentPLMN: ec_2.set_msg("tMSIofdifferentPLMN': "); field_tMSIofdifferentPLMN->BER_decode_TLV(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, tmp_tlv, L_form); break; case ALT_iMSIresponsetopaging: ec_2.set_msg("iMSIresponsetopaging': "); field_iMSIresponsetopaging->BER_decode_TLV(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, tmp_tlv, L_form); break; case ALT_iMSIcauseUEinitiatedEvent: ec_2.set_msg("iMSIcauseUEinitiatedEvent': "); field_iMSIcauseUEinitiatedEvent->BER_decode_TLV(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, tmp_tlv, L_form); break; case ALT_iMEI: ec_2.set_msg("iMEI': "); field_iMEI->BER_decode_TLV(Gsm__map__IDNNS_routingbasis_iMEI_descr_, tmp_tlv, L_form); break; case ALT_spare2: ec_2.set_msg("spare2': "); field_spare2->BER_decode_TLV(Gsm__map__IDNNS_routingbasis_spare2_descr_, tmp_tlv, L_form); break; case ALT_spare1: ec_2.set_msg("spare1': "); field_spare1->BER_decode_TLV(Gsm__map__IDNNS_routingbasis_spare1_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int Gsm__map__IDNNS_routingbasis::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { boolean as_value = p_td.json->as_value; int enc_len = as_value ? 0 : p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); switch(union_selection) { case ALT_localPTMSI: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "localPTMSI"); } enc_len += field_localPTMSI->JSON_encode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, FALSE); break; case ALT_tMSIofsamePLMN: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "tMSIofsamePLMN"); } enc_len += field_tMSIofsamePLMN->JSON_encode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, FALSE); break; case ALT_tMSIofdifferentPLMN: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "tMSIofdifferentPLMN"); } enc_len += field_tMSIofdifferentPLMN->JSON_encode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, FALSE); break; case ALT_iMSIresponsetopaging: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iMSIresponsetopaging"); } enc_len += field_iMSIresponsetopaging->JSON_encode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, FALSE); break; case ALT_iMSIcauseUEinitiatedEvent: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iMSIcauseUEinitiatedEvent"); } enc_len += field_iMSIcauseUEinitiatedEvent->JSON_encode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, FALSE); break; case ALT_iMEI: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iMEI"); } enc_len += field_iMEI->JSON_encode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, FALSE); break; case ALT_spare2: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "spare2"); } enc_len += field_spare2->JSON_encode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, FALSE); break; case ALT_spare1: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "spare1"); } enc_len += field_spare1->JSON_encode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int Gsm__map__IDNNS_routingbasis::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int p_chosen_field) { if (0 <= p_chosen_field && 8 > p_chosen_field) { switch (p_chosen_field) { case 0: return localPTMSI().JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, TRUE, FALSE); case 1: return tMSIofsamePLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, TRUE, FALSE); case 2: return tMSIofdifferentPLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, TRUE, FALSE); case 3: return iMSIresponsetopaging().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, TRUE, FALSE); case 4: return iMSIcauseUEinitiatedEvent().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, TRUE, FALSE); case 5: return iMEI().JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, TRUE, FALSE); case 6: return spare2().JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, TRUE, FALSE); case 7: return spare1().JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, TRUE, FALSE); } } if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; if (p_td.json->as_value) { size_t buf_pos = p_tok.get_buf_pos(); p_tok.get_next_token(&j_token, NULL, NULL); int ret_val = 0; switch(j_token) { case JSON_TOKEN_NUMBER: { p_tok.set_buf_pos(buf_pos); ret_val = localPTMSI().JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofsamePLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofdifferentPLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIresponsetopaging().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIcauseUEinitiatedEvent().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMEI().JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare2().JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare1().JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "number '@RUA-IEs.Gsm-map-IDNNS.routingbasis'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { p_tok.set_buf_pos(buf_pos); ret_val = localPTMSI().JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofsamePLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofdifferentPLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIresponsetopaging().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIcauseUEinitiatedEvent().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMEI().JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare2().JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare1().JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "string '@RUA-IEs.Gsm-map-IDNNS.routingbasis'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_LITERAL_TRUE: case JSON_TOKEN_LITERAL_FALSE: { p_tok.set_buf_pos(buf_pos); ret_val = localPTMSI().JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofsamePLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofdifferentPLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIresponsetopaging().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIcauseUEinitiatedEvent().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMEI().JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare2().JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare1().JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } char* literal_str = mprintf("literal (%s)", (JSON_TOKEN_LITERAL_TRUE == j_token) ? "true" : "false"); try { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, literal_str); } catch (const TC_Error&) { Free(literal_str); throw; } Free(literal_str); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_ARRAY_START: { p_tok.set_buf_pos(buf_pos); ret_val = localPTMSI().JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofsamePLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofdifferentPLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIresponsetopaging().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIcauseUEinitiatedEvent().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMEI().JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare2().JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare1().JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "array '@RUA-IEs.Gsm-map-IDNNS.routingbasis'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { p_tok.set_buf_pos(buf_pos); ret_val = localPTMSI().JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofsamePLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofdifferentPLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIresponsetopaging().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIcauseUEinitiatedEvent().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMEI().JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare2().JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare1().JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "object '@RUA-IEs.Gsm-map-IDNNS.routingbasis'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_LITERAL_NULL: { p_tok.set_buf_pos(buf_pos); ret_val = localPTMSI().JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofsamePLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIofdifferentPLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIresponsetopaging().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIcauseUEinitiatedEvent().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMEI().JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare2().JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = spare1().JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } clean_up(); return JSON_ERROR_INVALID_TOKEN; } case JSON_TOKEN_ERROR: JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; default: return JSON_ERROR_INVALID_TOKEN; } return ret_val; } else { size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } char* fld_name = 0; size_t name_len = 0; dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_NAME != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else { if (10 == name_len && 0 == strncmp(fld_name, "localPTMSI", name_len)) { int ret_val = localPTMSI().JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 10, "localPTMSI"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (14 == name_len && 0 == strncmp(fld_name, "tMSIofsamePLMN", name_len)) { int ret_val = tMSIofsamePLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 14, "tMSIofsamePLMN"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (19 == name_len && 0 == strncmp(fld_name, "tMSIofdifferentPLMN", name_len)) { int ret_val = tMSIofdifferentPLMN().JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 19, "tMSIofdifferentPLMN"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (20 == name_len && 0 == strncmp(fld_name, "iMSIresponsetopaging", name_len)) { int ret_val = iMSIresponsetopaging().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 20, "iMSIresponsetopaging"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (25 == name_len && 0 == strncmp(fld_name, "iMSIcauseUEinitiatedEvent", name_len)) { int ret_val = iMSIcauseUEinitiatedEvent().JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 25, "iMSIcauseUEinitiatedEvent"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (4 == name_len && 0 == strncmp(fld_name, "iMEI", name_len)) { int ret_val = iMEI().JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 4, "iMEI"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (6 == name_len && 0 == strncmp(fld_name, "spare2", name_len)) { int ret_val = spare2().JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 6, "spare2"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (6 == name_len && 0 == strncmp(fld_name, "spare1", name_len)) { int ret_val = spare1().JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 6, "spare1"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_STATIC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } return (int)dec_len; } } int Gsm__map__IDNNS_routingbasis::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_localPTMSI: {TTCN_Buffer buf; encode_oer_tag(*Gsm__map__IDNNS_routingbasis_localPTMSI_descr_.ber, p_buf); field_localPTMSI->OER_encode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, buf); p_buf.put_buf(buf); break; } case ALT_tMSIofsamePLMN: {TTCN_Buffer buf; encode_oer_tag(*Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_.ber, p_buf); field_tMSIofsamePLMN->OER_encode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, buf); p_buf.put_buf(buf); break; } case ALT_tMSIofdifferentPLMN: {TTCN_Buffer buf; encode_oer_tag(*Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_.ber, p_buf); field_tMSIofdifferentPLMN->OER_encode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, buf); p_buf.put_buf(buf); break; } case ALT_iMSIresponsetopaging: {TTCN_Buffer buf; encode_oer_tag(*Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_.ber, p_buf); field_iMSIresponsetopaging->OER_encode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, buf); p_buf.put_buf(buf); break; } case ALT_iMSIcauseUEinitiatedEvent: {TTCN_Buffer buf; encode_oer_tag(*Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_.ber, p_buf); field_iMSIcauseUEinitiatedEvent->OER_encode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, buf); p_buf.put_buf(buf); break; } case ALT_iMEI: {TTCN_Buffer buf; encode_oer_tag(*Gsm__map__IDNNS_routingbasis_iMEI_descr_.ber, p_buf); field_iMEI->OER_encode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, buf); p_buf.put_buf(buf); break; } case ALT_spare2: {TTCN_Buffer buf; encode_oer_tag(*Gsm__map__IDNNS_routingbasis_spare2_descr_.ber, p_buf); field_spare2->OER_encode(Gsm__map__IDNNS_routingbasis_spare2_descr_, buf); p_buf.put_buf(buf); break; } case ALT_spare1: {TTCN_Buffer buf; encode_oer_tag(*Gsm__map__IDNNS_routingbasis_spare1_descr_.ber, p_buf); field_spare1->OER_encode(Gsm__map__IDNNS_routingbasis_spare1_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return -1; } return 0; } int Gsm__map__IDNNS_routingbasis::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const ASN_Tag_t& descr = decode_oer_tag(p_buf); if (Gsm__map__IDNNS_routingbasis_localPTMSI_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_localPTMSI_descr_.ber->n_tags-1].tagclass == descr.tagclass && Gsm__map__IDNNS_routingbasis_localPTMSI_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_localPTMSI_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { localPTMSI().OER_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_buf, p_oer); } else if (Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_.ber->n_tags-1].tagclass == descr.tagclass && Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { tMSIofsamePLMN().OER_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_buf, p_oer); } else if (Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_.ber->n_tags-1].tagclass == descr.tagclass && Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { tMSIofdifferentPLMN().OER_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_buf, p_oer); } else if (Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_.ber->n_tags-1].tagclass == descr.tagclass && Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { iMSIresponsetopaging().OER_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_buf, p_oer); } else if (Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_.ber->n_tags-1].tagclass == descr.tagclass && Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { iMSIcauseUEinitiatedEvent().OER_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_buf, p_oer); } else if (Gsm__map__IDNNS_routingbasis_iMEI_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_iMEI_descr_.ber->n_tags-1].tagclass == descr.tagclass && Gsm__map__IDNNS_routingbasis_iMEI_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_iMEI_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { iMEI().OER_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_buf, p_oer); } else if (Gsm__map__IDNNS_routingbasis_spare2_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_spare2_descr_.ber->n_tags-1].tagclass == descr.tagclass && Gsm__map__IDNNS_routingbasis_spare2_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_spare2_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { spare2().OER_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_buf, p_oer); } else if (Gsm__map__IDNNS_routingbasis_spare1_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_spare1_descr_.ber->n_tags-1].tagclass == descr.tagclass && Gsm__map__IDNNS_routingbasis_spare1_descr_.ber->tags[Gsm__map__IDNNS_routingbasis_spare1_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { spare1().OER_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type Gsm__map__IDNNS_routingbasis"); } return 0; } void Gsm__map__IDNNS_routingbasis::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound CHOICE value."); return; } switch (union_selection) { case ALT_localPTMSI: { INTEGER::PER_encode_int(p_buf, 0, 3); field_localPTMSI->PER_encode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_buf, p_options); break; } case ALT_tMSIofsamePLMN: { INTEGER::PER_encode_int(p_buf, 1, 3); field_tMSIofsamePLMN->PER_encode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_buf, p_options); break; } case ALT_tMSIofdifferentPLMN: { INTEGER::PER_encode_int(p_buf, 2, 3); field_tMSIofdifferentPLMN->PER_encode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_buf, p_options); break; } case ALT_iMSIresponsetopaging: { INTEGER::PER_encode_int(p_buf, 3, 3); field_iMSIresponsetopaging->PER_encode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_buf, p_options); break; } case ALT_iMSIcauseUEinitiatedEvent: { INTEGER::PER_encode_int(p_buf, 4, 3); field_iMSIcauseUEinitiatedEvent->PER_encode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_buf, p_options); break; } case ALT_iMEI: { INTEGER::PER_encode_int(p_buf, 5, 3); field_iMEI->PER_encode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_buf, p_options); break; } case ALT_spare2: { INTEGER::PER_encode_int(p_buf, 6, 3); field_spare2->PER_encode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_buf, p_options); break; } case ALT_spare1: { INTEGER::PER_encode_int(p_buf, 7, 3); field_spare1->PER_encode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_buf, p_options); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Internal error: Invalid CHOICE selection, expected an extension root field."); break; } } void Gsm__map__IDNNS_routingbasis::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { clean_up(); int sel_int; INTEGER::PER_decode_int(p_buf, 3, FALSE, sel_int); switch (sel_int) { case 0: localPTMSI().PER_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_descr_, p_buf, p_options); break; case 1: tMSIofsamePLMN().PER_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_descr_, p_buf, p_options); break; case 2: tMSIofdifferentPLMN().PER_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_descr_, p_buf, p_options); break; case 3: iMSIresponsetopaging().PER_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_descr_, p_buf, p_options); break; case 4: iMSIcauseUEinitiatedEvent().PER_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_descr_, p_buf, p_options); break; case 5: iMEI().PER_decode(Gsm__map__IDNNS_routingbasis_iMEI_descr_, p_buf, p_options); break; case 6: spare2().PER_decode(Gsm__map__IDNNS_routingbasis_spare2_descr_, p_buf, p_options); break; case 7: spare1().PER_decode(Gsm__map__IDNNS_routingbasis_spare1_descr_, p_buf, p_options); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid CHOICE selection (%d).", sel_int); break; } } void Gsm__map__IDNNS_routingbasis_template::copy_value(const Gsm__map__IDNNS_routingbasis& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: single_value.field_localPTMSI = new Gsm__map__IDNNS_routingbasis_localPTMSI_template(other_value.localPTMSI()); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: single_value.field_tMSIofsamePLMN = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(other_value.tMSIofsamePLMN()); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: single_value.field_tMSIofdifferentPLMN = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(other_value.tMSIofdifferentPLMN()); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: single_value.field_iMSIresponsetopaging = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(other_value.iMSIresponsetopaging()); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: single_value.field_iMSIcauseUEinitiatedEvent = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(other_value.iMSIcauseUEinitiatedEvent()); break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: single_value.field_iMEI = new Gsm__map__IDNNS_routingbasis_iMEI_template(other_value.iMEI()); break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: single_value.field_spare2 = new Gsm__map__IDNNS_routingbasis_spare2_template(other_value.spare2()); break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: single_value.field_spare1 = new Gsm__map__IDNNS_routingbasis_spare1_template(other_value.spare1()); break; default: TTCN_error("Initializing a template with an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_template::copy_template(const Gsm__map__IDNNS_routingbasis_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.union_selection = other_value.single_value.union_selection; switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: single_value.field_localPTMSI = new Gsm__map__IDNNS_routingbasis_localPTMSI_template(*other_value.single_value.field_localPTMSI); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: single_value.field_tMSIofsamePLMN = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(*other_value.single_value.field_tMSIofsamePLMN); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: single_value.field_tMSIofdifferentPLMN = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(*other_value.single_value.field_tMSIofdifferentPLMN); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: single_value.field_iMSIresponsetopaging = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(*other_value.single_value.field_iMSIresponsetopaging); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: single_value.field_iMSIcauseUEinitiatedEvent = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(*other_value.single_value.field_iMSIcauseUEinitiatedEvent); break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: single_value.field_iMEI = new Gsm__map__IDNNS_routingbasis_iMEI_template(*other_value.single_value.field_iMEI); break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: single_value.field_spare2 = new Gsm__map__IDNNS_routingbasis_spare2_template(*other_value.single_value.field_spare2); break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: single_value.field_spare1 = new Gsm__map__IDNNS_routingbasis_spare1_template(*other_value.single_value.field_spare1); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } 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 Gsm__map__IDNNS_routingbasis_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 Gsm__map__IDNNS_routingbasis_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_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 template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_template::Gsm__map__IDNNS_routingbasis_template() { } Gsm__map__IDNNS_routingbasis_template::Gsm__map__IDNNS_routingbasis_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_template::Gsm__map__IDNNS_routingbasis_template(const Gsm__map__IDNNS_routingbasis& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_template::Gsm__map__IDNNS_routingbasis_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_template::Gsm__map__IDNNS_routingbasis_template(Gsm__map__IDNNS_routingbasis_template* p_precondition, Gsm__map__IDNNS_routingbasis_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_template::Gsm__map__IDNNS_routingbasis_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_template::Gsm__map__IDNNS_routingbasis_template(const Gsm__map__IDNNS_routingbasis_template& other_value) : Base_Template(){ copy_template(other_value); } Gsm__map__IDNNS_routingbasis_template::~Gsm__map__IDNNS_routingbasis_template() { clean_up(); } void Gsm__map__IDNNS_routingbasis_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: delete single_value.field_localPTMSI; break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: delete single_value.field_tMSIofsamePLMN; break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: delete single_value.field_tMSIofdifferentPLMN; break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: delete single_value.field_iMSIresponsetopaging; break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: delete single_value.field_iMSIcauseUEinitiatedEvent; break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: delete single_value.field_iMEI; break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: delete single_value.field_spare2; break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: delete single_value.field_spare1; default: break; } 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; } Gsm__map__IDNNS_routingbasis_template& Gsm__map__IDNNS_routingbasis_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_template& Gsm__map__IDNNS_routingbasis_template::operator=(const Gsm__map__IDNNS_routingbasis& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_template& Gsm__map__IDNNS_routingbasis_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } return *this; } Gsm__map__IDNNS_routingbasis_template& Gsm__map__IDNNS_routingbasis_template::operator=(const Gsm__map__IDNNS_routingbasis_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_template::match(const Gsm__map__IDNNS_routingbasis& 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: { Gsm__map__IDNNS_routingbasis::union_selection_type value_selection = other_value.get_selection(); if (value_selection == Gsm__map__IDNNS_routingbasis::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: return single_value.field_localPTMSI->match(other_value.localPTMSI(), legacy); case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: return single_value.field_tMSIofsamePLMN->match(other_value.tMSIofsamePLMN(), legacy); case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: return single_value.field_tMSIofdifferentPLMN->match(other_value.tMSIofdifferentPLMN(), legacy); case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: return single_value.field_iMSIresponsetopaging->match(other_value.iMSIresponsetopaging(), legacy); case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: return single_value.field_iMSIcauseUEinitiatedEvent->match(other_value.iMSIcauseUEinitiatedEvent(), legacy); case Gsm__map__IDNNS_routingbasis::ALT_iMEI: return single_value.field_iMEI->match(other_value.iMEI(), legacy); case Gsm__map__IDNNS_routingbasis::ALT_spare2: return single_value.field_spare2->match(other_value.spare2(), legacy); case Gsm__map__IDNNS_routingbasis::ALT_spare1: return single_value.field_spare1->match(other_value.spare1(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } } 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 template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: return single_value.field_localPTMSI->is_value(); case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: return single_value.field_tMSIofsamePLMN->is_value(); case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: return single_value.field_tMSIofdifferentPLMN->is_value(); case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: return single_value.field_iMSIresponsetopaging->is_value(); case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: return single_value.field_iMSIcauseUEinitiatedEvent->is_value(); case Gsm__map__IDNNS_routingbasis::ALT_iMEI: return single_value.field_iMEI->is_value(); case Gsm__map__IDNNS_routingbasis::ALT_spare2: return single_value.field_spare2->is_value(); case Gsm__map__IDNNS_routingbasis::ALT_spare1: return single_value.field_spare1->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } } Gsm__map__IDNNS_routingbasis Gsm__map__IDNNS_routingbasis_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); Gsm__map__IDNNS_routingbasis ret_val; switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: ret_val.localPTMSI() = single_value.field_localPTMSI->valueof(); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: ret_val.tMSIofsamePLMN() = single_value.field_tMSIofsamePLMN->valueof(); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: ret_val.tMSIofdifferentPLMN() = single_value.field_tMSIofdifferentPLMN->valueof(); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: ret_val.iMSIresponsetopaging() = single_value.field_iMSIresponsetopaging->valueof(); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: ret_val.iMSIcauseUEinitiatedEvent() = single_value.field_iMSIcauseUEinitiatedEvent->valueof(); break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: ret_val.iMEI() = single_value.field_iMEI->valueof(); break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: ret_val.spare2() = single_value.field_spare2->valueof(); break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: ret_val.spare1() = single_value.field_spare1->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } return ret_val; } Gsm__map__IDNNS_routingbasis_template& Gsm__map__IDNNS_routingbasis_template::list_item(unsigned int list_index) const { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return value_list.list_value[list_index]; } void Gsm__map__IDNNS_routingbasis_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 ("Internal error: Setting an invalid list for a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_template[list_length]; } Gsm__map__IDNNS_routingbasis_localPTMSI_template& Gsm__map__IDNNS_routingbasis_template::localPTMSI() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_localPTMSI) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_localPTMSI = new Gsm__map__IDNNS_routingbasis_localPTMSI_template(ANY_VALUE); else single_value.field_localPTMSI = new Gsm__map__IDNNS_routingbasis_localPTMSI_template; single_value.union_selection = Gsm__map__IDNNS_routingbasis::ALT_localPTMSI; set_selection(SPECIFIC_VALUE); } return *single_value.field_localPTMSI; } const Gsm__map__IDNNS_routingbasis_localPTMSI_template& Gsm__map__IDNNS_routingbasis_template::localPTMSI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field localPTMSI in a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_localPTMSI) TTCN_error("Accessing non-selected field localPTMSI in a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *single_value.field_localPTMSI; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& Gsm__map__IDNNS_routingbasis_template::tMSIofsamePLMN() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tMSIofsamePLMN = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(ANY_VALUE); else single_value.field_tMSIofsamePLMN = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template; single_value.union_selection = Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN; set_selection(SPECIFIC_VALUE); } return *single_value.field_tMSIofsamePLMN; } const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& Gsm__map__IDNNS_routingbasis_template::tMSIofsamePLMN() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tMSIofsamePLMN in a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN) TTCN_error("Accessing non-selected field tMSIofsamePLMN in a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *single_value.field_tMSIofsamePLMN; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& Gsm__map__IDNNS_routingbasis_template::tMSIofdifferentPLMN() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tMSIofdifferentPLMN = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(ANY_VALUE); else single_value.field_tMSIofdifferentPLMN = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template; single_value.union_selection = Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN; set_selection(SPECIFIC_VALUE); } return *single_value.field_tMSIofdifferentPLMN; } const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& Gsm__map__IDNNS_routingbasis_template::tMSIofdifferentPLMN() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tMSIofdifferentPLMN in a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN) TTCN_error("Accessing non-selected field tMSIofdifferentPLMN in a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *single_value.field_tMSIofdifferentPLMN; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& Gsm__map__IDNNS_routingbasis_template::iMSIresponsetopaging() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_iMSIresponsetopaging = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(ANY_VALUE); else single_value.field_iMSIresponsetopaging = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template; single_value.union_selection = Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging; set_selection(SPECIFIC_VALUE); } return *single_value.field_iMSIresponsetopaging; } const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& Gsm__map__IDNNS_routingbasis_template::iMSIresponsetopaging() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iMSIresponsetopaging in a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging) TTCN_error("Accessing non-selected field iMSIresponsetopaging in a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *single_value.field_iMSIresponsetopaging; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& Gsm__map__IDNNS_routingbasis_template::iMSIcauseUEinitiatedEvent() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_iMSIcauseUEinitiatedEvent = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(ANY_VALUE); else single_value.field_iMSIcauseUEinitiatedEvent = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template; single_value.union_selection = Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent; set_selection(SPECIFIC_VALUE); } return *single_value.field_iMSIcauseUEinitiatedEvent; } const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& Gsm__map__IDNNS_routingbasis_template::iMSIcauseUEinitiatedEvent() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iMSIcauseUEinitiatedEvent in a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent) TTCN_error("Accessing non-selected field iMSIcauseUEinitiatedEvent in a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *single_value.field_iMSIcauseUEinitiatedEvent; } Gsm__map__IDNNS_routingbasis_iMEI_template& Gsm__map__IDNNS_routingbasis_template::iMEI() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_iMEI) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_iMEI = new Gsm__map__IDNNS_routingbasis_iMEI_template(ANY_VALUE); else single_value.field_iMEI = new Gsm__map__IDNNS_routingbasis_iMEI_template; single_value.union_selection = Gsm__map__IDNNS_routingbasis::ALT_iMEI; set_selection(SPECIFIC_VALUE); } return *single_value.field_iMEI; } const Gsm__map__IDNNS_routingbasis_iMEI_template& Gsm__map__IDNNS_routingbasis_template::iMEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iMEI in a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_iMEI) TTCN_error("Accessing non-selected field iMEI in a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *single_value.field_iMEI; } Gsm__map__IDNNS_routingbasis_spare2_template& Gsm__map__IDNNS_routingbasis_template::spare2() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_spare2) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_spare2 = new Gsm__map__IDNNS_routingbasis_spare2_template(ANY_VALUE); else single_value.field_spare2 = new Gsm__map__IDNNS_routingbasis_spare2_template; single_value.union_selection = Gsm__map__IDNNS_routingbasis::ALT_spare2; set_selection(SPECIFIC_VALUE); } return *single_value.field_spare2; } const Gsm__map__IDNNS_routingbasis_spare2_template& Gsm__map__IDNNS_routingbasis_template::spare2() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field spare2 in a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_spare2) TTCN_error("Accessing non-selected field spare2 in a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *single_value.field_spare2; } Gsm__map__IDNNS_routingbasis_spare1_template& Gsm__map__IDNNS_routingbasis_template::spare1() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_spare1) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_spare1 = new Gsm__map__IDNNS_routingbasis_spare1_template(ANY_VALUE); else single_value.field_spare1 = new Gsm__map__IDNNS_routingbasis_spare1_template; single_value.union_selection = Gsm__map__IDNNS_routingbasis::ALT_spare1; set_selection(SPECIFIC_VALUE); } return *single_value.field_spare1; } const Gsm__map__IDNNS_routingbasis_spare1_template& Gsm__map__IDNNS_routingbasis_template::spare1() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field spare1 in a non-specific template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); if (single_value.union_selection != Gsm__map__IDNNS_routingbasis::ALT_spare1) TTCN_error("Accessing non-selected field spare1 in a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return *single_value.field_spare1; } boolean Gsm__map__IDNNS_routingbasis_template::ischosen(Gsm__map__IDNNS_routingbasis::union_selection_type checked_selection) const { if (checked_selection == Gsm__map__IDNNS_routingbasis::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == Gsm__map__IDNNS_routingbasis::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); return single_value.union_selection == checked_selection; case VALUE_LIST: { if (value_list.n_values < 1) TTCN_error("Internal error: Performing ischosen() operation on a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis containing an empty list."); boolean ret_val = value_list.list_value[0].ischosen(checked_selection); for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) { ret_val = value_list.list_value[list_count].ischosen(checked_selection); } return ret_val; } default: return FALSE; } return FALSE; } void Gsm__map__IDNNS_routingbasis_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: TTCN_Logger::log_event_str("{ localPTMSI := "); single_value.field_localPTMSI->log(); TTCN_Logger::log_event_str(" }"); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: TTCN_Logger::log_event_str("{ tMSIofsamePLMN := "); single_value.field_tMSIofsamePLMN->log(); TTCN_Logger::log_event_str(" }"); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: TTCN_Logger::log_event_str("{ tMSIofdifferentPLMN := "); single_value.field_tMSIofdifferentPLMN->log(); TTCN_Logger::log_event_str(" }"); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: TTCN_Logger::log_event_str("{ iMSIresponsetopaging := "); single_value.field_iMSIresponsetopaging->log(); TTCN_Logger::log_event_str(" }"); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: TTCN_Logger::log_event_str("{ iMSIcauseUEinitiatedEvent := "); single_value.field_iMSIcauseUEinitiatedEvent->log(); TTCN_Logger::log_event_str(" }"); break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: TTCN_Logger::log_event_str("{ iMEI := "); single_value.field_iMEI->log(); TTCN_Logger::log_event_str(" }"); break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: TTCN_Logger::log_event_str("{ spare2 := "); single_value.field_spare2->log(); TTCN_Logger::log_event_str(" }"); break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: TTCN_Logger::log_event_str("{ spare1 := "); single_value.field_spare1->log(); TTCN_Logger::log_event_str(" }"); break; default: 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 Gsm__map__IDNNS_routingbasis_template::log_match(const Gsm__map__IDNNS_routingbasis& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); return; } if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".localPTMSI"); single_value.field_localPTMSI->log_match(match_value.localPTMSI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ localPTMSI := "); single_value.field_localPTMSI->log_match(match_value.localPTMSI(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".tMSIofsamePLMN"); single_value.field_tMSIofsamePLMN->log_match(match_value.tMSIofsamePLMN(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ tMSIofsamePLMN := "); single_value.field_tMSIofsamePLMN->log_match(match_value.tMSIofsamePLMN(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".tMSIofdifferentPLMN"); single_value.field_tMSIofdifferentPLMN->log_match(match_value.tMSIofdifferentPLMN(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ tMSIofdifferentPLMN := "); single_value.field_tMSIofdifferentPLMN->log_match(match_value.tMSIofdifferentPLMN(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".iMSIresponsetopaging"); single_value.field_iMSIresponsetopaging->log_match(match_value.iMSIresponsetopaging(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ iMSIresponsetopaging := "); single_value.field_iMSIresponsetopaging->log_match(match_value.iMSIresponsetopaging(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".iMSIcauseUEinitiatedEvent"); single_value.field_iMSIcauseUEinitiatedEvent->log_match(match_value.iMSIcauseUEinitiatedEvent(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ iMSIcauseUEinitiatedEvent := "); single_value.field_iMSIcauseUEinitiatedEvent->log_match(match_value.iMSIcauseUEinitiatedEvent(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".iMEI"); single_value.field_iMEI->log_match(match_value.iMEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ iMEI := "); single_value.field_iMEI->log_match(match_value.iMEI(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".spare2"); single_value.field_spare2->log_match(match_value.spare2(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ spare2 := "); single_value.field_spare2->log_match(match_value.spare2(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".spare1"); single_value.field_spare1->log_match(match_value.spare1(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ spare1 := "); single_value.field_spare1->log_match(match_value.spare1(), legacy); TTCN_Logger::log_event_str(" }"); } break; default: TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(""); } } else { TTCN_Logger::print_logmatch_buffer(); 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 Gsm__map__IDNNS_routingbasis_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: single_value.field_localPTMSI->set_implicit_omit(); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: single_value.field_tMSIofsamePLMN->set_implicit_omit(); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: single_value.field_tMSIofdifferentPLMN->set_implicit_omit(); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: single_value.field_iMSIresponsetopaging->set_implicit_omit(); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: single_value.field_iMSIcauseUEinitiatedEvent->set_implicit_omit(); break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: single_value.field_iMEI->set_implicit_omit(); break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: single_value.field_spare2->set_implicit_omit(); break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: single_value.field_spare1->set_implicit_omit(); break; default: break; } } void Gsm__map__IDNNS_routingbasis_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.union_selection); switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: single_value.field_localPTMSI->encode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: single_value.field_tMSIofsamePLMN->encode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: single_value.field_tMSIofdifferentPLMN->encode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: single_value.field_iMSIresponsetopaging->encode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: single_value.field_iMSIcauseUEinitiatedEvent->encode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: single_value.field_iMEI->encode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: single_value.field_spare2->encode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: single_value.field_spare1->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } 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 template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } } void Gsm__map__IDNNS_routingbasis_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = Gsm__map__IDNNS_routingbasis::UNBOUND_VALUE; Gsm__map__IDNNS_routingbasis::union_selection_type new_selection = (Gsm__map__IDNNS_routingbasis::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: single_value.field_localPTMSI = new Gsm__map__IDNNS_routingbasis_localPTMSI_template; single_value.field_localPTMSI->decode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: single_value.field_tMSIofsamePLMN = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template; single_value.field_tMSIofsamePLMN->decode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: single_value.field_tMSIofdifferentPLMN = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template; single_value.field_tMSIofdifferentPLMN->decode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: single_value.field_iMSIresponsetopaging = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template; single_value.field_iMSIresponsetopaging->decode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: single_value.field_iMSIcauseUEinitiatedEvent = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template; single_value.field_iMSIcauseUEinitiatedEvent->decode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: single_value.field_iMEI = new Gsm__map__IDNNS_routingbasis_iMEI_template; single_value.field_iMEI->decode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_spare2: single_value.field_spare2 = new Gsm__map__IDNNS_routingbasis_spare2_template; single_value.field_spare2->decode_text(text_buf); break; case Gsm__map__IDNNS_routingbasis::ALT_spare1: single_value.field_spare1 = new Gsm__map__IDNNS_routingbasis_spare1_template; single_value.field_spare1->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } single_value.union_selection = new_selection; } 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 Gsm__map__IDNNS_routingbasis_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: Unrecognized selector was received in a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } } boolean Gsm__map__IDNNS_routingbasis_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_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 v_idx=0; v_idx(param.get_id()) != NULL && param.get_id()->next_name()) { char* param_field = param.get_id()->get_current_name(); if (param_field[0] >= '0' && param_field[0] <= '9') { param.error("Unexpected array index in module parameter, expected a valid field" " name for union template type `@RUA-IEs.Gsm-map-IDNNS.routingbasis'"); } if (strcmp("localPTMSI", param_field) == 0) { localPTMSI().set_param(param); return; } else if (strcmp("tMSIofsamePLMN", param_field) == 0) { tMSIofsamePLMN().set_param(param); return; } else if (strcmp("tMSIofdifferentPLMN", param_field) == 0) { tMSIofdifferentPLMN().set_param(param); return; } else if (strcmp("iMSIresponsetopaging", param_field) == 0) { iMSIresponsetopaging().set_param(param); return; } else if (strcmp("iMSIcauseUEinitiatedEvent", param_field) == 0) { iMSIcauseUEinitiatedEvent().set_param(param); return; } else if (strcmp("iMEI", param_field) == 0) { iMEI().set_param(param); return; } else if (strcmp("spare2", param_field) == 0) { spare2().set_param(param); return; } else if (strcmp("spare1", param_field) == 0) { spare1().set_param(param); return; } else param.error("Field `%s' not found in union template type `@RUA-IEs.Gsm-map-IDNNS.routingbasis'", param_field); } param.basic_check(Module_Param::BC_TEMPLATE, "union template"); Module_Param_Ptr m_p = ¶m; switch (m_p->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: { Gsm__map__IDNNS_routingbasis_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Value_List: if (m_p->get_size()==0) break; param.type_error("union template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); break; case Module_Param::MP_Assignment_List: { Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "localPTMSI")) { localPTMSI().set_param(*mp_last); break; } if (!strcmp(last_name, "tMSIofsamePLMN")) { tMSIofsamePLMN().set_param(*mp_last); break; } if (!strcmp(last_name, "tMSIofdifferentPLMN")) { tMSIofdifferentPLMN().set_param(*mp_last); break; } if (!strcmp(last_name, "iMSIresponsetopaging")) { iMSIresponsetopaging().set_param(*mp_last); break; } if (!strcmp(last_name, "iMSIcauseUEinitiatedEvent")) { iMSIcauseUEinitiatedEvent().set_param(*mp_last); break; } if (!strcmp(last_name, "iMEI")) { iMEI().set_param(*mp_last); break; } if (!strcmp(last_name, "spare2")) { spare2().set_param(*mp_last); break; } if (!strcmp(last_name, "spare1")) { spare1().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.", last_name); } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_template* precondition = new Gsm__map__IDNNS_routingbasis_template; precondition->set_param(*m_p->get_elem(0)); Gsm__map__IDNNS_routingbasis_template* implied_template = new Gsm__map__IDNNS_routingbasis_template; implied_template->set_param(*m_p->get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_template(precondition, implied_template); } break; default: param.type_error("union template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_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; switch (single_value.union_selection) { case Gsm__map__IDNNS_routingbasis::ALT_localPTMSI: single_value.field_localPTMSI->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); return; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofsamePLMN: single_value.field_tMSIofsamePLMN->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); return; case Gsm__map__IDNNS_routingbasis::ALT_tMSIofdifferentPLMN: single_value.field_tMSIofdifferentPLMN->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); return; case Gsm__map__IDNNS_routingbasis::ALT_iMSIresponsetopaging: single_value.field_iMSIresponsetopaging->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); return; case Gsm__map__IDNNS_routingbasis::ALT_iMSIcauseUEinitiatedEvent: single_value.field_iMSIcauseUEinitiatedEvent->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); return; case Gsm__map__IDNNS_routingbasis::ALT_iMEI: single_value.field_iMEI->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); return; case Gsm__map__IDNNS_routingbasis::ALT_spare2: single_value.field_spare2->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); return; case Gsm__map__IDNNS_routingbasis::ALT_spare1: single_value.field_spare1->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @RUA-IEs.Gsm-map-IDNNS.routingbasis."); } 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis"); } Gsm__map__IDNNS_routingbasis_localPTMSI::Gsm__map__IDNNS_routingbasis_localPTMSI() { } Gsm__map__IDNNS_routingbasis_localPTMSI::Gsm__map__IDNNS_routingbasis_localPTMSI(const BITSTRING& par_routingparameter) : field_routingparameter(par_routingparameter) { } Gsm__map__IDNNS_routingbasis_localPTMSI::Gsm__map__IDNNS_routingbasis_localPTMSI(const Gsm__map__IDNNS_routingbasis_localPTMSI& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); if (other_value.routingparameter().is_bound()) field_routingparameter = other_value.routingparameter(); else field_routingparameter.clean_up(); } void Gsm__map__IDNNS_routingbasis_localPTMSI::clean_up() { field_routingparameter.clean_up(); } const TTCN_Typedescriptor_t* Gsm__map__IDNNS_routingbasis_localPTMSI::get_descriptor() const { return &Gsm__map__IDNNS_routingbasis_localPTMSI_descr_; } Gsm__map__IDNNS_routingbasis_localPTMSI& Gsm__map__IDNNS_routingbasis_localPTMSI::operator=(const Gsm__map__IDNNS_routingbasis_localPTMSI& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); if (other_value.routingparameter().is_bound()) field_routingparameter = other_value.routingparameter(); else field_routingparameter.clean_up(); } return *this; } boolean Gsm__map__IDNNS_routingbasis_localPTMSI::operator==(const Gsm__map__IDNNS_routingbasis_localPTMSI& other_value) const { return field_routingparameter==other_value.field_routingparameter; } boolean Gsm__map__IDNNS_routingbasis_localPTMSI::is_bound() const { return (field_routingparameter.is_bound()); } boolean Gsm__map__IDNNS_routingbasis_localPTMSI::is_value() const { return field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_localPTMSI::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ routingparameter := "); field_routingparameter.log(); TTCN_Logger::log_event_str(" }"); } void Gsm__map__IDNNS_routingbasis_localPTMSI::set_implicit_omit() { if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_localPTMSI::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 (10 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI"); } } void Gsm__map__IDNNS_routingbasis_localPTMSI::encode_text(Text_Buf& text_buf) const { field_routingparameter.encode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_localPTMSI::decode_text(Text_Buf& text_buf) { field_routingparameter.decode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_localPTMSI::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis_localPTMSI::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS_routingbasis_localPTMSI::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingparameter': "); new_tlv->add_TLV(field_routingparameter.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS_routingbasis_localPTMSI::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingparameter': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingparameter.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS_routingbasis_localPTMSI::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); return -1; } if (p_td.json->as_value) { return field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingparameter"); enc_len += field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS_routingbasis_localPTMSI::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingparameter_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (16 == name_len && 0 == strncmp(fld_name, "routingparameter", name_len)) { routingparameter_found = TRUE; int ret_val = field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 16, "routingparameter"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingparameter_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingparameter"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS_routingbasis_localPTMSI::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingparameter.OER_encode(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_buf); return 0; } int Gsm__map__IDNNS_routingbasis_localPTMSI::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingparameter.OER_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS_routingbasis_localPTMSI::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingparameter.PER_encode(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_buf, p_options); } void Gsm__map__IDNNS_routingbasis_localPTMSI::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingparameter.PER_decode(Gsm__map__IDNNS_routingbasis_localPTMSI_routingparameter_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_routingbasis_localPTMSI_template::single_value_struct { BITSTRING_template field_routingparameter; }; void Gsm__map__IDNNS_routingbasis_localPTMSI_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_routingparameter = ANY_VALUE; } } } void Gsm__map__IDNNS_routingbasis_localPTMSI_template::copy_value(const Gsm__map__IDNNS_routingbasis_localPTMSI& other_value) { single_value = new single_value_struct; if (other_value.routingparameter().is_bound()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_localPTMSI_template::copy_template(const Gsm__map__IDNNS_routingbasis_localPTMSI_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingparameter().get_selection()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_localPTMSI_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 Gsm__map__IDNNS_routingbasis_localPTMSI_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_localPTMSI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); break; } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_localPTMSI_template::Gsm__map__IDNNS_routingbasis_localPTMSI_template() { } Gsm__map__IDNNS_routingbasis_localPTMSI_template::Gsm__map__IDNNS_routingbasis_localPTMSI_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_localPTMSI_template::Gsm__map__IDNNS_routingbasis_localPTMSI_template(const Gsm__map__IDNNS_routingbasis_localPTMSI& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_localPTMSI_template::Gsm__map__IDNNS_routingbasis_localPTMSI_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_localPTMSI&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_localPTMSI_template::Gsm__map__IDNNS_routingbasis_localPTMSI_template(Gsm__map__IDNNS_routingbasis_localPTMSI_template* p_precondition, Gsm__map__IDNNS_routingbasis_localPTMSI_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_localPTMSI_template::Gsm__map__IDNNS_routingbasis_localPTMSI_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_localPTMSI_template::Gsm__map__IDNNS_routingbasis_localPTMSI_template(const Gsm__map__IDNNS_routingbasis_localPTMSI_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_routingbasis_localPTMSI_template::~Gsm__map__IDNNS_routingbasis_localPTMSI_template() { clean_up(); } Gsm__map__IDNNS_routingbasis_localPTMSI_template& Gsm__map__IDNNS_routingbasis_localPTMSI_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_localPTMSI_template& Gsm__map__IDNNS_routingbasis_localPTMSI_template::operator=(const Gsm__map__IDNNS_routingbasis_localPTMSI& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_localPTMSI_template& Gsm__map__IDNNS_routingbasis_localPTMSI_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_localPTMSI&)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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); } return *this; } Gsm__map__IDNNS_routingbasis_localPTMSI_template& Gsm__map__IDNNS_routingbasis_localPTMSI_template::operator=(const Gsm__map__IDNNS_routingbasis_localPTMSI_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_localPTMSI_template::match(const Gsm__map__IDNNS_routingbasis_localPTMSI& 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.routingparameter().is_bound()) return FALSE; if(!single_value->field_routingparameter.match(other_value.routingparameter(), 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_localPTMSI_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingparameter.is_bound(); } boolean Gsm__map__IDNNS_routingbasis_localPTMSI_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_localPTMSI_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; } Gsm__map__IDNNS_routingbasis_localPTMSI Gsm__map__IDNNS_routingbasis_localPTMSI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); Gsm__map__IDNNS_routingbasis_localPTMSI ret_val; if (single_value->field_routingparameter.is_bound()) { ret_val.routingparameter() = single_value->field_routingparameter.valueof(); } return ret_val; } void Gsm__map__IDNNS_routingbasis_localPTMSI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_localPTMSI_template[list_length]; } Gsm__map__IDNNS_routingbasis_localPTMSI_template& Gsm__map__IDNNS_routingbasis_localPTMSI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); return value_list.list_value[list_index]; } BITSTRING_template& Gsm__map__IDNNS_routingbasis_localPTMSI_template::routingparameter() { set_specific(); return single_value->field_routingparameter; } const BITSTRING_template& Gsm__map__IDNNS_routingbasis_localPTMSI_template::routingparameter() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingparameter of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); return single_value->field_routingparameter; } int Gsm__map__IDNNS_routingbasis_localPTMSI_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); } return 0; } void Gsm__map__IDNNS_routingbasis_localPTMSI_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingparameter := "); single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_localPTMSI_template::log_match(const Gsm__map__IDNNS_routingbasis_localPTMSI& 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_routingparameter.match(match_value.routingparameter(), legacy)){ TTCN_Logger::log_logmatch_info(".routingparameter"); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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("{ routingparameter := "); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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 Gsm__map__IDNNS_routingbasis_localPTMSI_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_localPTMSI_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingparameter.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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); } } void Gsm__map__IDNNS_routingbasis_localPTMSI_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_routingparameter.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 Gsm__map__IDNNS_routingbasis_localPTMSI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI."); } } void Gsm__map__IDNNS_routingbasis_localPTMSI_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: { Gsm__map__IDNNS_routingbasis_localPTMSI_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_localPTMSI_template* precondition = new Gsm__map__IDNNS_routingbasis_localPTMSI_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_routingbasis_localPTMSI_template* implied_template = new Gsm__map__IDNNS_routingbasis_localPTMSI_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_localPTMSI_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_localPTMSI_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_routingparameter.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI"); 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.localPTMSI"); } boolean Gsm__map__IDNNS_routingbasis_localPTMSI_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_localPTMSI_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN"); } } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::encode_text(Text_Buf& text_buf) const { field_routingparameter.encode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::decode_text(Text_Buf& text_buf) { field_routingparameter.decode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingparameter': "); new_tlv->add_TLV(field_routingparameter.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingparameter': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingparameter.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); return -1; } if (p_td.json->as_value) { return field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingparameter"); enc_len += field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingparameter_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (16 == name_len && 0 == strncmp(fld_name, "routingparameter", name_len)) { routingparameter_found = TRUE; int ret_val = field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 16, "routingparameter"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingparameter_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingparameter"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingparameter.OER_encode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_buf); return 0; } int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingparameter.OER_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingparameter.PER_encode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_buf, p_options); } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingparameter.PER_decode(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_routingparameter_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::single_value_struct { BITSTRING_template field_routingparameter; }; void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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_routingparameter = ANY_VALUE; } } } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::copy_value(const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN& other_value) { single_value = new single_value_struct; if (other_value.routingparameter().is_bound()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::copy_template(const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingparameter().get_selection()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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 Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); break; } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template() { } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template* p_precondition, Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::~Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template() { clean_up(); } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::operator=(const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN&)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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); } return *this; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::operator=(const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::match(const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN& 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.routingparameter().is_bound()) return FALSE; if(!single_value->field_routingparameter.match(other_value.routingparameter(), 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingparameter.is_bound(); } boolean Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN ret_val; if (single_value->field_routingparameter.is_bound()) { ret_val.routingparameter() = single_value->field_routingparameter.valueof(); } return ret_val; } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template[list_length]; } Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); return value_list.list_value[list_index]; } BITSTRING_template& Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::routingparameter() { set_specific(); return single_value->field_routingparameter; } const BITSTRING_template& Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::routingparameter() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingparameter of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); return single_value->field_routingparameter; } int Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); } return 0; } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingparameter := "); single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::log_match(const Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN& 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_routingparameter.match(match_value.routingparameter(), legacy)){ TTCN_Logger::log_logmatch_info(".routingparameter"); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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("{ routingparameter := "); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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 Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingparameter.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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); } } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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_routingparameter.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 Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN."); } } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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: { Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template* precondition = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template* implied_template = new Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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_routingparameter.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN"); 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofsamePLMN"); } boolean Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_tMSIofsamePLMN_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN"); } } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::encode_text(Text_Buf& text_buf) const { field_routingparameter.encode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::decode_text(Text_Buf& text_buf) { field_routingparameter.decode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingparameter': "); new_tlv->add_TLV(field_routingparameter.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingparameter': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingparameter.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); return -1; } if (p_td.json->as_value) { return field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingparameter"); enc_len += field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingparameter_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (16 == name_len && 0 == strncmp(fld_name, "routingparameter", name_len)) { routingparameter_found = TRUE; int ret_val = field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 16, "routingparameter"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingparameter_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingparameter"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingparameter.OER_encode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_buf); return 0; } int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingparameter.OER_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingparameter.PER_encode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_buf, p_options); } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingparameter.PER_decode(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_routingparameter_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::single_value_struct { BITSTRING_template field_routingparameter; }; void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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_routingparameter = ANY_VALUE; } } } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::copy_value(const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN& other_value) { single_value = new single_value_struct; if (other_value.routingparameter().is_bound()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::copy_template(const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingparameter().get_selection()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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 Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); break; } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template() { } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template* p_precondition, Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::~Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template() { clean_up(); } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::operator=(const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN&)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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); } return *this; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::operator=(const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::match(const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN& 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.routingparameter().is_bound()) return FALSE; if(!single_value->field_routingparameter.match(other_value.routingparameter(), 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingparameter.is_bound(); } boolean Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN ret_val; if (single_value->field_routingparameter.is_bound()) { ret_val.routingparameter() = single_value->field_routingparameter.valueof(); } return ret_val; } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template[list_length]; } Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template& Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); return value_list.list_value[list_index]; } BITSTRING_template& Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::routingparameter() { set_specific(); return single_value->field_routingparameter; } const BITSTRING_template& Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::routingparameter() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingparameter of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); return single_value->field_routingparameter; } int Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); } return 0; } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingparameter := "); single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::log_match(const Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN& 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_routingparameter.match(match_value.routingparameter(), legacy)){ TTCN_Logger::log_logmatch_info(".routingparameter"); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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("{ routingparameter := "); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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 Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingparameter.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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); } } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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_routingparameter.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 Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN."); } } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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: { Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template* precondition = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template* implied_template = new Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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_routingparameter.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN"); 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.tMSIofdifferentPLMN"); } boolean Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_tMSIofdifferentPLMN_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging"); } } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::encode_text(Text_Buf& text_buf) const { field_routingparameter.encode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::decode_text(Text_Buf& text_buf) { field_routingparameter.decode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingparameter': "); new_tlv->add_TLV(field_routingparameter.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingparameter': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingparameter.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); return -1; } if (p_td.json->as_value) { return field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingparameter"); enc_len += field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingparameter_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (16 == name_len && 0 == strncmp(fld_name, "routingparameter", name_len)) { routingparameter_found = TRUE; int ret_val = field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 16, "routingparameter"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingparameter_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingparameter"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingparameter.OER_encode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_buf); return 0; } int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingparameter.OER_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingparameter.PER_encode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_buf, p_options); } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingparameter.PER_decode(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_routingparameter_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::single_value_struct { BITSTRING_template field_routingparameter; }; void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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_routingparameter = ANY_VALUE; } } } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::copy_value(const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging& other_value) { single_value = new single_value_struct; if (other_value.routingparameter().is_bound()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::copy_template(const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingparameter().get_selection()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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 Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); break; } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template() { } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template* p_precondition, Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::~Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template() { clean_up(); } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::operator=(const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging&)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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); } return *this; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::operator=(const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::match(const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging& 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.routingparameter().is_bound()) return FALSE; if(!single_value->field_routingparameter.match(other_value.routingparameter(), 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingparameter.is_bound(); } boolean Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging ret_val; if (single_value->field_routingparameter.is_bound()) { ret_val.routingparameter() = single_value->field_routingparameter.valueof(); } return ret_val; } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template[list_length]; } Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template& Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); return value_list.list_value[list_index]; } BITSTRING_template& Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::routingparameter() { set_specific(); return single_value->field_routingparameter; } const BITSTRING_template& Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::routingparameter() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingparameter of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); return single_value->field_routingparameter; } int Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); } return 0; } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingparameter := "); single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::log_match(const Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging& 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_routingparameter.match(match_value.routingparameter(), legacy)){ TTCN_Logger::log_logmatch_info(".routingparameter"); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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("{ routingparameter := "); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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 Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingparameter.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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); } } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging."); } } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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: { Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template* precondition = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template* implied_template = new Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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_routingparameter.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging"); 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIresponsetopaging"); } boolean Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_iMSIresponsetopaging_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent"); } } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::encode_text(Text_Buf& text_buf) const { field_routingparameter.encode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::decode_text(Text_Buf& text_buf) { field_routingparameter.decode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingparameter': "); new_tlv->add_TLV(field_routingparameter.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingparameter': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingparameter.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); return -1; } if (p_td.json->as_value) { return field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingparameter"); enc_len += field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingparameter_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (16 == name_len && 0 == strncmp(fld_name, "routingparameter", name_len)) { routingparameter_found = TRUE; int ret_val = field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 16, "routingparameter"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingparameter_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingparameter"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingparameter.OER_encode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_buf); return 0; } int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingparameter.OER_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingparameter.PER_encode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_buf, p_options); } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingparameter.PER_decode(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_routingparameter_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::single_value_struct { BITSTRING_template field_routingparameter; }; void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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_routingparameter = ANY_VALUE; } } } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::copy_value(const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent& other_value) { single_value = new single_value_struct; if (other_value.routingparameter().is_bound()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::copy_template(const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingparameter().get_selection()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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 Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); break; } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template() { } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template* p_precondition, Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::~Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template() { clean_up(); } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::operator=(const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent&)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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); } return *this; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::operator=(const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::match(const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent& 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.routingparameter().is_bound()) return FALSE; if(!single_value->field_routingparameter.match(other_value.routingparameter(), 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingparameter.is_bound(); } boolean Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent ret_val; if (single_value->field_routingparameter.is_bound()) { ret_val.routingparameter() = single_value->field_routingparameter.valueof(); } return ret_val; } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template[list_length]; } Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template& Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); return value_list.list_value[list_index]; } BITSTRING_template& Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::routingparameter() { set_specific(); return single_value->field_routingparameter; } const BITSTRING_template& Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::routingparameter() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingparameter of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); return single_value->field_routingparameter; } int Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); } return 0; } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingparameter := "); single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::log_match(const Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent& 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_routingparameter.match(match_value.routingparameter(), legacy)){ TTCN_Logger::log_logmatch_info(".routingparameter"); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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("{ routingparameter := "); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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 Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingparameter.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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); } } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent."); } } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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: { Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template* precondition = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template* implied_template = new Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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_routingparameter.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent"); 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMSIcauseUEinitiatedEvent"); } boolean Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_iMSIcauseUEinitiatedEvent_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI"); } } void Gsm__map__IDNNS_routingbasis_iMEI::encode_text(Text_Buf& text_buf) const { field_routingparameter.encode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_iMEI::decode_text(Text_Buf& text_buf) { field_routingparameter.decode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_iMEI::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis_iMEI::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS_routingbasis_iMEI::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingparameter': "); new_tlv->add_TLV(field_routingparameter.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS_routingbasis_iMEI::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingparameter': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingparameter.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS_routingbasis_iMEI::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); return -1; } if (p_td.json->as_value) { return field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingparameter"); enc_len += field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS_routingbasis_iMEI::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingparameter_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (16 == name_len && 0 == strncmp(fld_name, "routingparameter", name_len)) { routingparameter_found = TRUE; int ret_val = field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 16, "routingparameter"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingparameter_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingparameter"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS_routingbasis_iMEI::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingparameter.OER_encode(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_buf); return 0; } int Gsm__map__IDNNS_routingbasis_iMEI::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingparameter.OER_decode(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS_routingbasis_iMEI::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingparameter.PER_encode(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_buf, p_options); } void Gsm__map__IDNNS_routingbasis_iMEI::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingparameter.PER_decode(Gsm__map__IDNNS_routingbasis_iMEI_routingparameter_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_routingbasis_iMEI_template::single_value_struct { BITSTRING_template field_routingparameter; }; void Gsm__map__IDNNS_routingbasis_iMEI_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_routingparameter = ANY_VALUE; } } } void Gsm__map__IDNNS_routingbasis_iMEI_template::copy_value(const Gsm__map__IDNNS_routingbasis_iMEI& other_value) { single_value = new single_value_struct; if (other_value.routingparameter().is_bound()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_iMEI_template::copy_template(const Gsm__map__IDNNS_routingbasis_iMEI_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingparameter().get_selection()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMEI_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 Gsm__map__IDNNS_routingbasis_iMEI_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_iMEI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); break; } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_iMEI_template::Gsm__map__IDNNS_routingbasis_iMEI_template() { } Gsm__map__IDNNS_routingbasis_iMEI_template::Gsm__map__IDNNS_routingbasis_iMEI_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_iMEI_template::Gsm__map__IDNNS_routingbasis_iMEI_template(const Gsm__map__IDNNS_routingbasis_iMEI& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_iMEI_template::Gsm__map__IDNNS_routingbasis_iMEI_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_iMEI&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_iMEI_template::Gsm__map__IDNNS_routingbasis_iMEI_template(Gsm__map__IDNNS_routingbasis_iMEI_template* p_precondition, Gsm__map__IDNNS_routingbasis_iMEI_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_iMEI_template::Gsm__map__IDNNS_routingbasis_iMEI_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_iMEI_template::Gsm__map__IDNNS_routingbasis_iMEI_template(const Gsm__map__IDNNS_routingbasis_iMEI_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_routingbasis_iMEI_template::~Gsm__map__IDNNS_routingbasis_iMEI_template() { clean_up(); } Gsm__map__IDNNS_routingbasis_iMEI_template& Gsm__map__IDNNS_routingbasis_iMEI_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_iMEI_template& Gsm__map__IDNNS_routingbasis_iMEI_template::operator=(const Gsm__map__IDNNS_routingbasis_iMEI& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_iMEI_template& Gsm__map__IDNNS_routingbasis_iMEI_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_iMEI&)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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); } return *this; } Gsm__map__IDNNS_routingbasis_iMEI_template& Gsm__map__IDNNS_routingbasis_iMEI_template::operator=(const Gsm__map__IDNNS_routingbasis_iMEI_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_iMEI_template::match(const Gsm__map__IDNNS_routingbasis_iMEI& 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.routingparameter().is_bound()) return FALSE; if(!single_value->field_routingparameter.match(other_value.routingparameter(), 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_iMEI_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingparameter.is_bound(); } boolean Gsm__map__IDNNS_routingbasis_iMEI_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_iMEI_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; } Gsm__map__IDNNS_routingbasis_iMEI Gsm__map__IDNNS_routingbasis_iMEI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); Gsm__map__IDNNS_routingbasis_iMEI ret_val; if (single_value->field_routingparameter.is_bound()) { ret_val.routingparameter() = single_value->field_routingparameter.valueof(); } return ret_val; } void Gsm__map__IDNNS_routingbasis_iMEI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_iMEI_template[list_length]; } Gsm__map__IDNNS_routingbasis_iMEI_template& Gsm__map__IDNNS_routingbasis_iMEI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); return value_list.list_value[list_index]; } BITSTRING_template& Gsm__map__IDNNS_routingbasis_iMEI_template::routingparameter() { set_specific(); return single_value->field_routingparameter; } const BITSTRING_template& Gsm__map__IDNNS_routingbasis_iMEI_template::routingparameter() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingparameter of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); return single_value->field_routingparameter; } int Gsm__map__IDNNS_routingbasis_iMEI_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); } return 0; } void Gsm__map__IDNNS_routingbasis_iMEI_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingparameter := "); single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMEI_template::log_match(const Gsm__map__IDNNS_routingbasis_iMEI& 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_routingparameter.match(match_value.routingparameter(), legacy)){ TTCN_Logger::log_logmatch_info(".routingparameter"); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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("{ routingparameter := "); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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 Gsm__map__IDNNS_routingbasis_iMEI_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_iMEI_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingparameter.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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); } } void Gsm__map__IDNNS_routingbasis_iMEI_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_routingparameter.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 Gsm__map__IDNNS_routingbasis_iMEI_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI."); } } void Gsm__map__IDNNS_routingbasis_iMEI_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: { Gsm__map__IDNNS_routingbasis_iMEI_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_iMEI_template* precondition = new Gsm__map__IDNNS_routingbasis_iMEI_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_routingbasis_iMEI_template* implied_template = new Gsm__map__IDNNS_routingbasis_iMEI_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_iMEI_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_iMEI_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_routingparameter.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI"); 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.iMEI"); } boolean Gsm__map__IDNNS_routingbasis_iMEI_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_iMEI_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2"); } } void Gsm__map__IDNNS_routingbasis_spare2::encode_text(Text_Buf& text_buf) const { field_routingparameter.encode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_spare2::decode_text(Text_Buf& text_buf) { field_routingparameter.decode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_spare2::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis_spare2::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS_routingbasis_spare2::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingparameter': "); new_tlv->add_TLV(field_routingparameter.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS_routingbasis_spare2::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingparameter': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingparameter.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS_routingbasis_spare2::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); return -1; } if (p_td.json->as_value) { return field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingparameter"); enc_len += field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS_routingbasis_spare2::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingparameter_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (16 == name_len && 0 == strncmp(fld_name, "routingparameter", name_len)) { routingparameter_found = TRUE; int ret_val = field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 16, "routingparameter"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingparameter_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingparameter"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS_routingbasis_spare2::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingparameter.OER_encode(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_buf); return 0; } int Gsm__map__IDNNS_routingbasis_spare2::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingparameter.OER_decode(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS_routingbasis_spare2::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingparameter.PER_encode(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_buf, p_options); } void Gsm__map__IDNNS_routingbasis_spare2::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingparameter.PER_decode(Gsm__map__IDNNS_routingbasis_spare2_routingparameter_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_routingbasis_spare2_template::single_value_struct { BITSTRING_template field_routingparameter; }; void Gsm__map__IDNNS_routingbasis_spare2_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_routingparameter = ANY_VALUE; } } } void Gsm__map__IDNNS_routingbasis_spare2_template::copy_value(const Gsm__map__IDNNS_routingbasis_spare2& other_value) { single_value = new single_value_struct; if (other_value.routingparameter().is_bound()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_spare2_template::copy_template(const Gsm__map__IDNNS_routingbasis_spare2_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingparameter().get_selection()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_spare2_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 Gsm__map__IDNNS_routingbasis_spare2_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_spare2_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); break; } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_spare2_template::Gsm__map__IDNNS_routingbasis_spare2_template() { } Gsm__map__IDNNS_routingbasis_spare2_template::Gsm__map__IDNNS_routingbasis_spare2_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_spare2_template::Gsm__map__IDNNS_routingbasis_spare2_template(const Gsm__map__IDNNS_routingbasis_spare2& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_spare2_template::Gsm__map__IDNNS_routingbasis_spare2_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_spare2&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_spare2_template::Gsm__map__IDNNS_routingbasis_spare2_template(Gsm__map__IDNNS_routingbasis_spare2_template* p_precondition, Gsm__map__IDNNS_routingbasis_spare2_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_spare2_template::Gsm__map__IDNNS_routingbasis_spare2_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_spare2_template::Gsm__map__IDNNS_routingbasis_spare2_template(const Gsm__map__IDNNS_routingbasis_spare2_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_routingbasis_spare2_template::~Gsm__map__IDNNS_routingbasis_spare2_template() { clean_up(); } Gsm__map__IDNNS_routingbasis_spare2_template& Gsm__map__IDNNS_routingbasis_spare2_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_spare2_template& Gsm__map__IDNNS_routingbasis_spare2_template::operator=(const Gsm__map__IDNNS_routingbasis_spare2& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_spare2_template& Gsm__map__IDNNS_routingbasis_spare2_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_spare2&)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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); } return *this; } Gsm__map__IDNNS_routingbasis_spare2_template& Gsm__map__IDNNS_routingbasis_spare2_template::operator=(const Gsm__map__IDNNS_routingbasis_spare2_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_spare2_template::match(const Gsm__map__IDNNS_routingbasis_spare2& 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.routingparameter().is_bound()) return FALSE; if(!single_value->field_routingparameter.match(other_value.routingparameter(), 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_spare2_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingparameter.is_bound(); } boolean Gsm__map__IDNNS_routingbasis_spare2_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_spare2_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; } Gsm__map__IDNNS_routingbasis_spare2 Gsm__map__IDNNS_routingbasis_spare2_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); Gsm__map__IDNNS_routingbasis_spare2 ret_val; if (single_value->field_routingparameter.is_bound()) { ret_val.routingparameter() = single_value->field_routingparameter.valueof(); } return ret_val; } void Gsm__map__IDNNS_routingbasis_spare2_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_spare2_template[list_length]; } Gsm__map__IDNNS_routingbasis_spare2_template& Gsm__map__IDNNS_routingbasis_spare2_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); return value_list.list_value[list_index]; } BITSTRING_template& Gsm__map__IDNNS_routingbasis_spare2_template::routingparameter() { set_specific(); return single_value->field_routingparameter; } const BITSTRING_template& Gsm__map__IDNNS_routingbasis_spare2_template::routingparameter() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingparameter of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); return single_value->field_routingparameter; } int Gsm__map__IDNNS_routingbasis_spare2_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); } return 0; } void Gsm__map__IDNNS_routingbasis_spare2_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingparameter := "); single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_spare2_template::log_match(const Gsm__map__IDNNS_routingbasis_spare2& 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_routingparameter.match(match_value.routingparameter(), legacy)){ TTCN_Logger::log_logmatch_info(".routingparameter"); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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("{ routingparameter := "); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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 Gsm__map__IDNNS_routingbasis_spare2_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_spare2_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingparameter.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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); } } void Gsm__map__IDNNS_routingbasis_spare2_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_routingparameter.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 Gsm__map__IDNNS_routingbasis_spare2_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2."); } } void Gsm__map__IDNNS_routingbasis_spare2_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: { Gsm__map__IDNNS_routingbasis_spare2_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_spare2_template* precondition = new Gsm__map__IDNNS_routingbasis_spare2_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_routingbasis_spare2_template* implied_template = new Gsm__map__IDNNS_routingbasis_spare2_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_spare2_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_spare2_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_routingparameter.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2"); 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare2"); } boolean Gsm__map__IDNNS_routingbasis_spare2_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_spare2_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1"); } } void Gsm__map__IDNNS_routingbasis_spare1::encode_text(Text_Buf& text_buf) const { field_routingparameter.encode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_spare1::decode_text(Text_Buf& text_buf) { field_routingparameter.decode_text(text_buf); } void Gsm__map__IDNNS_routingbasis_spare1::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS_routingbasis_spare1::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS_routingbasis_spare1::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingparameter': "); new_tlv->add_TLV(field_routingparameter.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS_routingbasis_spare1::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingparameter': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingparameter.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS_routingbasis_spare1::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); return -1; } if (p_td.json->as_value) { return field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingparameter"); enc_len += field_routingparameter.JSON_encode(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS_routingbasis_spare1::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingparameter_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (16 == name_len && 0 == strncmp(fld_name, "routingparameter", name_len)) { routingparameter_found = TRUE; int ret_val = field_routingparameter.JSON_decode(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 16, "routingparameter"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingparameter_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingparameter"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS_routingbasis_spare1::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingparameter.OER_encode(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_buf); return 0; } int Gsm__map__IDNNS_routingbasis_spare1::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingparameter.OER_decode(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS_routingbasis_spare1::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingparameter.PER_encode(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_buf, p_options); } void Gsm__map__IDNNS_routingbasis_spare1::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingparameter.PER_decode(Gsm__map__IDNNS_routingbasis_spare1_routingparameter_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_routingbasis_spare1_template::single_value_struct { BITSTRING_template field_routingparameter; }; void Gsm__map__IDNNS_routingbasis_spare1_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_routingparameter = ANY_VALUE; } } } void Gsm__map__IDNNS_routingbasis_spare1_template::copy_value(const Gsm__map__IDNNS_routingbasis_spare1& other_value) { single_value = new single_value_struct; if (other_value.routingparameter().is_bound()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_routingbasis_spare1_template::copy_template(const Gsm__map__IDNNS_routingbasis_spare1_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingparameter().get_selection()) { single_value->field_routingparameter = other_value.routingparameter(); } else { single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_spare1_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 Gsm__map__IDNNS_routingbasis_spare1_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_routingbasis_spare1_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); break; } set_selection(other_value); } Gsm__map__IDNNS_routingbasis_spare1_template::Gsm__map__IDNNS_routingbasis_spare1_template() { } Gsm__map__IDNNS_routingbasis_spare1_template::Gsm__map__IDNNS_routingbasis_spare1_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_routingbasis_spare1_template::Gsm__map__IDNNS_routingbasis_spare1_template(const Gsm__map__IDNNS_routingbasis_spare1& other_value) { copy_value(other_value); } Gsm__map__IDNNS_routingbasis_spare1_template::Gsm__map__IDNNS_routingbasis_spare1_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_spare1&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 from an unbound optional field."); } } Gsm__map__IDNNS_routingbasis_spare1_template::Gsm__map__IDNNS_routingbasis_spare1_template(Gsm__map__IDNNS_routingbasis_spare1_template* p_precondition, Gsm__map__IDNNS_routingbasis_spare1_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_routingbasis_spare1_template::Gsm__map__IDNNS_routingbasis_spare1_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_routingbasis_spare1_template::Gsm__map__IDNNS_routingbasis_spare1_template(const Gsm__map__IDNNS_routingbasis_spare1_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_routingbasis_spare1_template::~Gsm__map__IDNNS_routingbasis_spare1_template() { clean_up(); } Gsm__map__IDNNS_routingbasis_spare1_template& Gsm__map__IDNNS_routingbasis_spare1_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_routingbasis_spare1_template& Gsm__map__IDNNS_routingbasis_spare1_template::operator=(const Gsm__map__IDNNS_routingbasis_spare1& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_routingbasis_spare1_template& Gsm__map__IDNNS_routingbasis_spare1_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS_routingbasis_spare1&)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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); } return *this; } Gsm__map__IDNNS_routingbasis_spare1_template& Gsm__map__IDNNS_routingbasis_spare1_template::operator=(const Gsm__map__IDNNS_routingbasis_spare1_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_routingbasis_spare1_template::match(const Gsm__map__IDNNS_routingbasis_spare1& 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.routingparameter().is_bound()) return FALSE; if(!single_value->field_routingparameter.match(other_value.routingparameter(), 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); } return FALSE; } boolean Gsm__map__IDNNS_routingbasis_spare1_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingparameter.is_bound(); } boolean Gsm__map__IDNNS_routingbasis_spare1_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingparameter.is_value(); } void Gsm__map__IDNNS_routingbasis_spare1_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; } Gsm__map__IDNNS_routingbasis_spare1 Gsm__map__IDNNS_routingbasis_spare1_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); Gsm__map__IDNNS_routingbasis_spare1 ret_val; if (single_value->field_routingparameter.is_bound()) { ret_val.routingparameter() = single_value->field_routingparameter.valueof(); } return ret_val; } void Gsm__map__IDNNS_routingbasis_spare1_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_routingbasis_spare1_template[list_length]; } Gsm__map__IDNNS_routingbasis_spare1_template& Gsm__map__IDNNS_routingbasis_spare1_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); return value_list.list_value[list_index]; } BITSTRING_template& Gsm__map__IDNNS_routingbasis_spare1_template::routingparameter() { set_specific(); return single_value->field_routingparameter; } const BITSTRING_template& Gsm__map__IDNNS_routingbasis_spare1_template::routingparameter() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingparameter of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); return single_value->field_routingparameter; } int Gsm__map__IDNNS_routingbasis_spare1_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); } return 0; } void Gsm__map__IDNNS_routingbasis_spare1_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingparameter := "); single_value->field_routingparameter.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 Gsm__map__IDNNS_routingbasis_spare1_template::log_match(const Gsm__map__IDNNS_routingbasis_spare1& 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_routingparameter.match(match_value.routingparameter(), legacy)){ TTCN_Logger::log_logmatch_info(".routingparameter"); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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("{ routingparameter := "); single_value->field_routingparameter.log_match(match_value.routingparameter(), 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 Gsm__map__IDNNS_routingbasis_spare1_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingparameter().is_bound()) routingparameter().set_implicit_omit(); } void Gsm__map__IDNNS_routingbasis_spare1_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingparameter.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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); } } void Gsm__map__IDNNS_routingbasis_spare1_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_routingparameter.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 Gsm__map__IDNNS_routingbasis_spare1_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 @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1."); } } void Gsm__map__IDNNS_routingbasis_spare1_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: { Gsm__map__IDNNS_routingbasis_spare1_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingparameter().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingparameter")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingparameter().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_routingbasis_spare1_template* precondition = new Gsm__map__IDNNS_routingbasis_spare1_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_routingbasis_spare1_template* implied_template = new Gsm__map__IDNNS_routingbasis_spare1_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_routingbasis_spare1_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_routingbasis_spare1_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_routingparameter.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1"); 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 : "@RUA-IEs.Gsm-map-IDNNS.routingbasis.spare1"); } boolean Gsm__map__IDNNS_routingbasis_spare1_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_routingbasis_spare1_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingbasis().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dummy().set_param(*param.get_elem(1)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingbasis")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingbasis().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dummy")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dummy().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.Gsm-map-IDNNS"); } } void Gsm__map__IDNNS::encode_text(Text_Buf& text_buf) const { field_routingbasis.encode_text(text_buf); field_dummy.encode_text(text_buf); } void Gsm__map__IDNNS::decode_text(Text_Buf& text_buf) { field_routingbasis.decode_text(text_buf); field_dummy.decode_text(text_buf); } void Gsm__map__IDNNS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Gsm__map__IDNNS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* Gsm__map__IDNNS::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("routingbasis': "); new_tlv->add_TLV(field_routingbasis.BER_encode_TLV(Gsm__map__IDNNS_routingbasis_descr_, p_coding)); ec_1.set_msg("dummy': "); new_tlv->add_TLV(field_dummy.BER_encode_TLV(Gsm__map__IDNNS_dummy_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean Gsm__map__IDNNS::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Gsm-map-IDNNS' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("routingbasis': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_routingbasis.BER_decode_TLV(Gsm__map__IDNNS_routingbasis_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("dummy': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_dummy.BER_decode_TLV(Gsm__map__IDNNS_dummy_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int Gsm__map__IDNNS::JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Gsm-map-IDNNS."); return -1; } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "routingbasis"); enc_len += field_routingbasis.JSON_encode(Gsm__map__IDNNS_routingbasis_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "dummy"); enc_len += field_dummy.JSON_encode(Gsm__map__IDNNS_dummy_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int Gsm__map__IDNNS::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean routingbasis_found = FALSE; boolean dummy_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (12 == name_len && 0 == strncmp(fld_name, "routingbasis", name_len)) { routingbasis_found = TRUE; int ret_val = field_routingbasis.JSON_decode(Gsm__map__IDNNS_routingbasis_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 12, "routingbasis"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (5 == name_len && 0 == strncmp(fld_name, "dummy", name_len)) { dummy_found = TRUE; int ret_val = field_dummy.JSON_decode(Gsm__map__IDNNS_dummy_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 5, "dummy"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!routingbasis_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "routingbasis"); return JSON_ERROR_FATAL; } if (!dummy_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "dummy"); return JSON_ERROR_FATAL; } return (int)dec_len; } int Gsm__map__IDNNS::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_routingbasis.OER_encode(Gsm__map__IDNNS_routingbasis_descr_, p_buf); field_dummy.OER_encode(Gsm__map__IDNNS_dummy_descr_, p_buf); return 0; } int Gsm__map__IDNNS::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_routingbasis.OER_decode(Gsm__map__IDNNS_routingbasis_descr_, p_buf, p_oer); field_dummy.OER_decode(Gsm__map__IDNNS_dummy_descr_, p_buf, p_oer); return 0; } void Gsm__map__IDNNS::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_routingbasis.PER_encode(Gsm__map__IDNNS_routingbasis_descr_, p_buf, p_options); field_dummy.PER_encode(Gsm__map__IDNNS_dummy_descr_, p_buf, p_options); } void Gsm__map__IDNNS::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_routingbasis.PER_decode(Gsm__map__IDNNS_routingbasis_descr_, p_buf, p_options); field_dummy.PER_decode(Gsm__map__IDNNS_dummy_descr_, p_buf, p_options); } struct Gsm__map__IDNNS_template::single_value_struct { Gsm__map__IDNNS_routingbasis_template field_routingbasis; BOOLEAN_template field_dummy; }; void Gsm__map__IDNNS_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_routingbasis = ANY_VALUE; single_value->field_dummy = ANY_VALUE; } } } void Gsm__map__IDNNS_template::copy_value(const Gsm__map__IDNNS& other_value) { single_value = new single_value_struct; if (other_value.routingbasis().is_bound()) { single_value->field_routingbasis = other_value.routingbasis(); } else { single_value->field_routingbasis.clean_up(); } if (other_value.dummy().is_bound()) { single_value->field_dummy = other_value.dummy(); } else { single_value->field_dummy.clean_up(); } set_selection(SPECIFIC_VALUE); } void Gsm__map__IDNNS_template::copy_template(const Gsm__map__IDNNS_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.routingbasis().get_selection()) { single_value->field_routingbasis = other_value.routingbasis(); } else { single_value->field_routingbasis.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dummy().get_selection()) { single_value->field_dummy = other_value.dummy(); } else { single_value->field_dummy.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 Gsm__map__IDNNS_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 Gsm__map__IDNNS_template(*other_value.implication_.precondition); implication_.implied_template = new Gsm__map__IDNNS_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 @RUA-IEs.Gsm-map-IDNNS."); break; } set_selection(other_value); } Gsm__map__IDNNS_template::Gsm__map__IDNNS_template() { } Gsm__map__IDNNS_template::Gsm__map__IDNNS_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Gsm__map__IDNNS_template::Gsm__map__IDNNS_template(const Gsm__map__IDNNS& other_value) { copy_value(other_value); } Gsm__map__IDNNS_template::Gsm__map__IDNNS_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.Gsm-map-IDNNS from an unbound optional field."); } } Gsm__map__IDNNS_template::Gsm__map__IDNNS_template(Gsm__map__IDNNS_template* p_precondition, Gsm__map__IDNNS_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Gsm__map__IDNNS_template::Gsm__map__IDNNS_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Gsm__map__IDNNS_template::Gsm__map__IDNNS_template(const Gsm__map__IDNNS_template& other_value) : Base_Template() { copy_template(other_value); } Gsm__map__IDNNS_template::~Gsm__map__IDNNS_template() { clean_up(); } Gsm__map__IDNNS_template& Gsm__map__IDNNS_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Gsm__map__IDNNS_template& Gsm__map__IDNNS_template::operator=(const Gsm__map__IDNNS& other_value) { clean_up(); copy_value(other_value); return *this; } Gsm__map__IDNNS_template& Gsm__map__IDNNS_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Gsm__map__IDNNS&)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 @RUA-IEs.Gsm-map-IDNNS."); } return *this; } Gsm__map__IDNNS_template& Gsm__map__IDNNS_template::operator=(const Gsm__map__IDNNS_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Gsm__map__IDNNS_template::match(const Gsm__map__IDNNS& 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.routingbasis().is_bound()) return FALSE; if(!single_value->field_routingbasis.match(other_value.routingbasis(), legacy))return FALSE; if(!other_value.dummy().is_bound()) return FALSE; if(!single_value->field_dummy.match(other_value.dummy(), 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 @RUA-IEs.Gsm-map-IDNNS."); } return FALSE; } boolean Gsm__map__IDNNS_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_routingbasis.is_bound() || single_value->field_dummy.is_bound(); } boolean Gsm__map__IDNNS_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_routingbasis.is_value() && single_value->field_dummy.is_value(); } void Gsm__map__IDNNS_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; } Gsm__map__IDNNS Gsm__map__IDNNS_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 @RUA-IEs.Gsm-map-IDNNS."); Gsm__map__IDNNS ret_val; if (single_value->field_routingbasis.is_bound()) { ret_val.routingbasis() = single_value->field_routingbasis.valueof(); } if (single_value->field_dummy.is_bound()) { ret_val.dummy() = single_value->field_dummy.valueof(); } return ret_val; } void Gsm__map__IDNNS_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 @RUA-IEs.Gsm-map-IDNNS."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Gsm__map__IDNNS_template[list_length]; } Gsm__map__IDNNS_template& Gsm__map__IDNNS_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 @RUA-IEs.Gsm-map-IDNNS."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.Gsm-map-IDNNS."); return value_list.list_value[list_index]; } Gsm__map__IDNNS_routingbasis_template& Gsm__map__IDNNS_template::routingbasis() { set_specific(); return single_value->field_routingbasis; } const Gsm__map__IDNNS_routingbasis_template& Gsm__map__IDNNS_template::routingbasis() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field routingbasis of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS."); return single_value->field_routingbasis; } BOOLEAN_template& Gsm__map__IDNNS_template::dummy() { set_specific(); return single_value->field_dummy; } const BOOLEAN_template& Gsm__map__IDNNS_template::dummy() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dummy of a non-specific template of type @RUA-IEs.Gsm-map-IDNNS."); return single_value->field_dummy; } int Gsm__map__IDNNS_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 2; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS 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 @RUA-IEs.Gsm-map-IDNNS containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.Gsm-map-IDNNS containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.Gsm-map-IDNNS."); } return 0; } void Gsm__map__IDNNS_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ routingbasis := "); single_value->field_routingbasis.log(); TTCN_Logger::log_event_str(", dummy := "); single_value->field_dummy.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 Gsm__map__IDNNS_template::log_match(const Gsm__map__IDNNS& 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_routingbasis.match(match_value.routingbasis(), legacy)){ TTCN_Logger::log_logmatch_info(".routingbasis"); single_value->field_routingbasis.log_match(match_value.routingbasis(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_dummy.match(match_value.dummy(), legacy)){ TTCN_Logger::log_logmatch_info(".dummy"); single_value->field_dummy.log_match(match_value.dummy(), 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("{ routingbasis := "); single_value->field_routingbasis.log_match(match_value.routingbasis(), legacy); TTCN_Logger::log_event_str(", dummy := "); single_value->field_dummy.log_match(match_value.dummy(), 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 Gsm__map__IDNNS_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (routingbasis().is_bound()) routingbasis().set_implicit_omit(); if (dummy().is_bound()) dummy().set_implicit_omit(); } void Gsm__map__IDNNS_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_routingbasis.encode_text(text_buf); single_value->field_dummy.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 @RUA-IEs.Gsm-map-IDNNS."); } } void Gsm__map__IDNNS_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_routingbasis.decode_text(text_buf); single_value->field_dummy.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 Gsm__map__IDNNS_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 @RUA-IEs.Gsm-map-IDNNS."); } } void Gsm__map__IDNNS_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: { Gsm__map__IDNNS_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) routingbasis().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dummy().set_param(*param.get_elem(1)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "routingbasis")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { routingbasis().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dummy")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dummy().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.Gsm-map-IDNNS: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Gsm__map__IDNNS_template* precondition = new Gsm__map__IDNNS_template; precondition->set_param(*param.get_elem(0)); Gsm__map__IDNNS_template* implied_template = new Gsm__map__IDNNS_template; implied_template->set_param(*param.get_elem(1)); *this = Gsm__map__IDNNS_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.Gsm-map-IDNNS"); } is_ifpresent = param.get_ifpresent(); } void Gsm__map__IDNNS_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_routingbasis.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS"); single_value->field_dummy.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Gsm-map-IDNNS"); 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 : "@RUA-IEs.Gsm-map-IDNNS"); } boolean Gsm__map__IDNNS_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Gsm__map__IDNNS_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cn__Type().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_Type")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__Type().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.IntraDomainNasNodeSelector.version.release99: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.IntraDomainNasNodeSelector.version.release99"); } } void IntraDomainNasNodeSelector_version_release99::encode_text(Text_Buf& text_buf) const { field_cn__Type.encode_text(text_buf); } void IntraDomainNasNodeSelector_version_release99::decode_text(Text_Buf& text_buf) { field_cn__Type.decode_text(text_buf); } void IntraDomainNasNodeSelector_version_release99::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void IntraDomainNasNodeSelector_version_release99::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* IntraDomainNasNodeSelector_version_release99::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("cn_Type': "); new_tlv->add_TLV(field_cn__Type.BER_encode_TLV(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean IntraDomainNasNodeSelector_version_release99::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.IntraDomainNasNodeSelector.version.release99' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("cn_Type': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_cn__Type.BER_decode_TLV(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int IntraDomainNasNodeSelector_version_release99::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); return -1; } if (p_td.json->as_value) { return field_cn__Type.JSON_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "cn_Type"); enc_len += field_cn__Type.JSON_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int IntraDomainNasNodeSelector_version_release99::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_cn__Type.JSON_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean cn__Type_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (7 == name_len && 0 == strncmp(fld_name, "cn_Type", name_len)) { cn__Type_found = TRUE; int ret_val = field_cn__Type.JSON_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 7, "cn_Type"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!cn__Type_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "cn_Type"); return JSON_ERROR_FATAL; } return (int)dec_len; } int IntraDomainNasNodeSelector_version_release99::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_cn__Type.OER_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_buf); return 0; } int IntraDomainNasNodeSelector_version_release99::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_cn__Type.OER_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_buf, p_oer); return 0; } void IntraDomainNasNodeSelector_version_release99::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_cn__Type.PER_encode(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_buf, p_options); } void IntraDomainNasNodeSelector_version_release99::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_cn__Type.PER_decode(IntraDomainNasNodeSelector_version_release99_cn__Type_descr_, p_buf, p_options); } struct IntraDomainNasNodeSelector_version_release99_template::single_value_struct { IntraDomainNasNodeSelector_version_release99_cn__Type_template field_cn__Type; }; void IntraDomainNasNodeSelector_version_release99_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_cn__Type = ANY_VALUE; } } } void IntraDomainNasNodeSelector_version_release99_template::copy_value(const IntraDomainNasNodeSelector_version_release99& other_value) { single_value = new single_value_struct; if (other_value.cn__Type().is_bound()) { single_value->field_cn__Type = other_value.cn__Type(); } else { single_value->field_cn__Type.clean_up(); } set_selection(SPECIFIC_VALUE); } void IntraDomainNasNodeSelector_version_release99_template::copy_template(const IntraDomainNasNodeSelector_version_release99_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.cn__Type().get_selection()) { single_value->field_cn__Type = other_value.cn__Type(); } else { single_value->field_cn__Type.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 IntraDomainNasNodeSelector_version_release99_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 IntraDomainNasNodeSelector_version_release99_template(*other_value.implication_.precondition); implication_.implied_template = new IntraDomainNasNodeSelector_version_release99_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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); break; } set_selection(other_value); } IntraDomainNasNodeSelector_version_release99_template::IntraDomainNasNodeSelector_version_release99_template() { } IntraDomainNasNodeSelector_version_release99_template::IntraDomainNasNodeSelector_version_release99_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } IntraDomainNasNodeSelector_version_release99_template::IntraDomainNasNodeSelector_version_release99_template(const IntraDomainNasNodeSelector_version_release99& other_value) { copy_value(other_value); } IntraDomainNasNodeSelector_version_release99_template::IntraDomainNasNodeSelector_version_release99_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector_version_release99&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 from an unbound optional field."); } } IntraDomainNasNodeSelector_version_release99_template::IntraDomainNasNodeSelector_version_release99_template(IntraDomainNasNodeSelector_version_release99_template* p_precondition, IntraDomainNasNodeSelector_version_release99_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } IntraDomainNasNodeSelector_version_release99_template::IntraDomainNasNodeSelector_version_release99_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } IntraDomainNasNodeSelector_version_release99_template::IntraDomainNasNodeSelector_version_release99_template(const IntraDomainNasNodeSelector_version_release99_template& other_value) : Base_Template() { copy_template(other_value); } IntraDomainNasNodeSelector_version_release99_template::~IntraDomainNasNodeSelector_version_release99_template() { clean_up(); } IntraDomainNasNodeSelector_version_release99_template& IntraDomainNasNodeSelector_version_release99_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } IntraDomainNasNodeSelector_version_release99_template& IntraDomainNasNodeSelector_version_release99_template::operator=(const IntraDomainNasNodeSelector_version_release99& other_value) { clean_up(); copy_value(other_value); return *this; } IntraDomainNasNodeSelector_version_release99_template& IntraDomainNasNodeSelector_version_release99_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector_version_release99&)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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); } return *this; } IntraDomainNasNodeSelector_version_release99_template& IntraDomainNasNodeSelector_version_release99_template::operator=(const IntraDomainNasNodeSelector_version_release99_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean IntraDomainNasNodeSelector_version_release99_template::match(const IntraDomainNasNodeSelector_version_release99& 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.cn__Type().is_bound()) return FALSE; if(!single_value->field_cn__Type.match(other_value.cn__Type(), 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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); } return FALSE; } boolean IntraDomainNasNodeSelector_version_release99_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_cn__Type.is_bound(); } boolean IntraDomainNasNodeSelector_version_release99_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_cn__Type.is_value(); } void IntraDomainNasNodeSelector_version_release99_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; } IntraDomainNasNodeSelector_version_release99 IntraDomainNasNodeSelector_version_release99_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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); IntraDomainNasNodeSelector_version_release99 ret_val; if (single_value->field_cn__Type.is_bound()) { ret_val.cn__Type() = single_value->field_cn__Type.valueof(); } return ret_val; } void IntraDomainNasNodeSelector_version_release99_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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new IntraDomainNasNodeSelector_version_release99_template[list_length]; } IntraDomainNasNodeSelector_version_release99_template& IntraDomainNasNodeSelector_version_release99_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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); return value_list.list_value[list_index]; } IntraDomainNasNodeSelector_version_release99_cn__Type_template& IntraDomainNasNodeSelector_version_release99_template::cn__Type() { set_specific(); return single_value->field_cn__Type; } const IntraDomainNasNodeSelector_version_release99_cn__Type_template& IntraDomainNasNodeSelector_version_release99_template::cn__Type() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cn_Type of a non-specific template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); return single_value->field_cn__Type; } int IntraDomainNasNodeSelector_version_release99_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); } return 0; } void IntraDomainNasNodeSelector_version_release99_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ cn_Type := "); single_value->field_cn__Type.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 IntraDomainNasNodeSelector_version_release99_template::log_match(const IntraDomainNasNodeSelector_version_release99& 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_cn__Type.match(match_value.cn__Type(), legacy)){ TTCN_Logger::log_logmatch_info(".cn_Type"); single_value->field_cn__Type.log_match(match_value.cn__Type(), 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("{ cn_Type := "); single_value->field_cn__Type.log_match(match_value.cn__Type(), 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 IntraDomainNasNodeSelector_version_release99_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (cn__Type().is_bound()) cn__Type().set_implicit_omit(); } void IntraDomainNasNodeSelector_version_release99_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_cn__Type.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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); } } void IntraDomainNasNodeSelector_version_release99_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_cn__Type.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 IntraDomainNasNodeSelector_version_release99_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 @RUA-IEs.IntraDomainNasNodeSelector.version.release99."); } } void IntraDomainNasNodeSelector_version_release99_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: { IntraDomainNasNodeSelector_version_release99_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cn__Type().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_Type")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__Type().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.IntraDomainNasNodeSelector.version.release99: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { IntraDomainNasNodeSelector_version_release99_template* precondition = new IntraDomainNasNodeSelector_version_release99_template; precondition->set_param(*param.get_elem(0)); IntraDomainNasNodeSelector_version_release99_template* implied_template = new IntraDomainNasNodeSelector_version_release99_template; implied_template->set_param(*param.get_elem(1)); *this = IntraDomainNasNodeSelector_version_release99_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.IntraDomainNasNodeSelector.version.release99"); } is_ifpresent = param.get_ifpresent(); } void IntraDomainNasNodeSelector_version_release99_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_cn__Type.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.IntraDomainNasNodeSelector.version.release99"); 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 : "@RUA-IEs.IntraDomainNasNodeSelector.version.release99"); } boolean IntraDomainNasNodeSelector_version_release99_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean IntraDomainNasNodeSelector_version_release99_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) futurecoding().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "futurecoding")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { futurecoding().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.IntraDomainNasNodeSelector.version.later: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.IntraDomainNasNodeSelector.version.later"); } } void IntraDomainNasNodeSelector_version_later::encode_text(Text_Buf& text_buf) const { field_futurecoding.encode_text(text_buf); } void IntraDomainNasNodeSelector_version_later::decode_text(Text_Buf& text_buf) { field_futurecoding.decode_text(text_buf); } void IntraDomainNasNodeSelector_version_later::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void IntraDomainNasNodeSelector_version_later::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* IntraDomainNasNodeSelector_version_later::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("futurecoding': "); new_tlv->add_TLV(field_futurecoding.BER_encode_TLV(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean IntraDomainNasNodeSelector_version_later::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.IntraDomainNasNodeSelector.version.later' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("futurecoding': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_futurecoding.BER_decode_TLV(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int IntraDomainNasNodeSelector_version_later::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector.version.later."); return -1; } if (p_td.json->as_value) { return field_futurecoding.JSON_encode(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "futurecoding"); enc_len += field_futurecoding.JSON_encode(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int IntraDomainNasNodeSelector_version_later::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_futurecoding.JSON_decode(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean futurecoding_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (12 == name_len && 0 == strncmp(fld_name, "futurecoding", name_len)) { futurecoding_found = TRUE; int ret_val = field_futurecoding.JSON_decode(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 12, "futurecoding"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!futurecoding_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "futurecoding"); return JSON_ERROR_FATAL; } return (int)dec_len; } int IntraDomainNasNodeSelector_version_later::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_futurecoding.OER_encode(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_buf); return 0; } int IntraDomainNasNodeSelector_version_later::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_futurecoding.OER_decode(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_buf, p_oer); return 0; } void IntraDomainNasNodeSelector_version_later::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_futurecoding.PER_encode(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_buf, p_options); } void IntraDomainNasNodeSelector_version_later::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_futurecoding.PER_decode(IntraDomainNasNodeSelector_version_later_futurecoding_descr_, p_buf, p_options); } struct IntraDomainNasNodeSelector_version_later_template::single_value_struct { BITSTRING_template field_futurecoding; }; void IntraDomainNasNodeSelector_version_later_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_futurecoding = ANY_VALUE; } } } void IntraDomainNasNodeSelector_version_later_template::copy_value(const IntraDomainNasNodeSelector_version_later& other_value) { single_value = new single_value_struct; if (other_value.futurecoding().is_bound()) { single_value->field_futurecoding = other_value.futurecoding(); } else { single_value->field_futurecoding.clean_up(); } set_selection(SPECIFIC_VALUE); } void IntraDomainNasNodeSelector_version_later_template::copy_template(const IntraDomainNasNodeSelector_version_later_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.futurecoding().get_selection()) { single_value->field_futurecoding = other_value.futurecoding(); } else { single_value->field_futurecoding.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 IntraDomainNasNodeSelector_version_later_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 IntraDomainNasNodeSelector_version_later_template(*other_value.implication_.precondition); implication_.implied_template = new IntraDomainNasNodeSelector_version_later_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 @RUA-IEs.IntraDomainNasNodeSelector.version.later."); break; } set_selection(other_value); } IntraDomainNasNodeSelector_version_later_template::IntraDomainNasNodeSelector_version_later_template() { } IntraDomainNasNodeSelector_version_later_template::IntraDomainNasNodeSelector_version_later_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } IntraDomainNasNodeSelector_version_later_template::IntraDomainNasNodeSelector_version_later_template(const IntraDomainNasNodeSelector_version_later& other_value) { copy_value(other_value); } IntraDomainNasNodeSelector_version_later_template::IntraDomainNasNodeSelector_version_later_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector_version_later&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later from an unbound optional field."); } } IntraDomainNasNodeSelector_version_later_template::IntraDomainNasNodeSelector_version_later_template(IntraDomainNasNodeSelector_version_later_template* p_precondition, IntraDomainNasNodeSelector_version_later_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } IntraDomainNasNodeSelector_version_later_template::IntraDomainNasNodeSelector_version_later_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } IntraDomainNasNodeSelector_version_later_template::IntraDomainNasNodeSelector_version_later_template(const IntraDomainNasNodeSelector_version_later_template& other_value) : Base_Template() { copy_template(other_value); } IntraDomainNasNodeSelector_version_later_template::~IntraDomainNasNodeSelector_version_later_template() { clean_up(); } IntraDomainNasNodeSelector_version_later_template& IntraDomainNasNodeSelector_version_later_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } IntraDomainNasNodeSelector_version_later_template& IntraDomainNasNodeSelector_version_later_template::operator=(const IntraDomainNasNodeSelector_version_later& other_value) { clean_up(); copy_value(other_value); return *this; } IntraDomainNasNodeSelector_version_later_template& IntraDomainNasNodeSelector_version_later_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector_version_later&)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 @RUA-IEs.IntraDomainNasNodeSelector.version.later."); } return *this; } IntraDomainNasNodeSelector_version_later_template& IntraDomainNasNodeSelector_version_later_template::operator=(const IntraDomainNasNodeSelector_version_later_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean IntraDomainNasNodeSelector_version_later_template::match(const IntraDomainNasNodeSelector_version_later& 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.futurecoding().is_bound()) return FALSE; if(!single_value->field_futurecoding.match(other_value.futurecoding(), 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 @RUA-IEs.IntraDomainNasNodeSelector.version.later."); } return FALSE; } boolean IntraDomainNasNodeSelector_version_later_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_futurecoding.is_bound(); } boolean IntraDomainNasNodeSelector_version_later_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_futurecoding.is_value(); } void IntraDomainNasNodeSelector_version_later_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; } IntraDomainNasNodeSelector_version_later IntraDomainNasNodeSelector_version_later_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 @RUA-IEs.IntraDomainNasNodeSelector.version.later."); IntraDomainNasNodeSelector_version_later ret_val; if (single_value->field_futurecoding.is_bound()) { ret_val.futurecoding() = single_value->field_futurecoding.valueof(); } return ret_val; } void IntraDomainNasNodeSelector_version_later_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 @RUA-IEs.IntraDomainNasNodeSelector.version.later."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new IntraDomainNasNodeSelector_version_later_template[list_length]; } IntraDomainNasNodeSelector_version_later_template& IntraDomainNasNodeSelector_version_later_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 @RUA-IEs.IntraDomainNasNodeSelector.version.later."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later."); return value_list.list_value[list_index]; } BITSTRING_template& IntraDomainNasNodeSelector_version_later_template::futurecoding() { set_specific(); return single_value->field_futurecoding; } const BITSTRING_template& IntraDomainNasNodeSelector_version_later_template::futurecoding() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field futurecoding of a non-specific template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later."); return single_value->field_futurecoding; } int IntraDomainNasNodeSelector_version_later_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later 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 @RUA-IEs.IntraDomainNasNodeSelector.version.later containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.IntraDomainNasNodeSelector.version.later."); } return 0; } void IntraDomainNasNodeSelector_version_later_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ futurecoding := "); single_value->field_futurecoding.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 IntraDomainNasNodeSelector_version_later_template::log_match(const IntraDomainNasNodeSelector_version_later& 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_futurecoding.match(match_value.futurecoding(), legacy)){ TTCN_Logger::log_logmatch_info(".futurecoding"); single_value->field_futurecoding.log_match(match_value.futurecoding(), 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("{ futurecoding := "); single_value->field_futurecoding.log_match(match_value.futurecoding(), 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 IntraDomainNasNodeSelector_version_later_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (futurecoding().is_bound()) futurecoding().set_implicit_omit(); } void IntraDomainNasNodeSelector_version_later_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_futurecoding.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 @RUA-IEs.IntraDomainNasNodeSelector.version.later."); } } void IntraDomainNasNodeSelector_version_later_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_futurecoding.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 IntraDomainNasNodeSelector_version_later_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 @RUA-IEs.IntraDomainNasNodeSelector.version.later."); } } void IntraDomainNasNodeSelector_version_later_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: { IntraDomainNasNodeSelector_version_later_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) futurecoding().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "futurecoding")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { futurecoding().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.IntraDomainNasNodeSelector.version.later: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { IntraDomainNasNodeSelector_version_later_template* precondition = new IntraDomainNasNodeSelector_version_later_template; precondition->set_param(*param.get_elem(0)); IntraDomainNasNodeSelector_version_later_template* implied_template = new IntraDomainNasNodeSelector_version_later_template; implied_template->set_param(*param.get_elem(1)); *this = IntraDomainNasNodeSelector_version_later_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.IntraDomainNasNodeSelector.version.later"); } is_ifpresent = param.get_ifpresent(); } void IntraDomainNasNodeSelector_version_later_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_futurecoding.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.IntraDomainNasNodeSelector.version.later"); 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 : "@RUA-IEs.IntraDomainNasNodeSelector.version.later"); } boolean IntraDomainNasNodeSelector_version_later_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean IntraDomainNasNodeSelector_version_later_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_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) version().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "version")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { version().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.IntraDomainNasNodeSelector: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.IntraDomainNasNodeSelector"); } } void IntraDomainNasNodeSelector::encode_text(Text_Buf& text_buf) const { field_version.encode_text(text_buf); } void IntraDomainNasNodeSelector::decode_text(Text_Buf& text_buf) { field_version.decode_text(text_buf); } void IntraDomainNasNodeSelector::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void IntraDomainNasNodeSelector::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* IntraDomainNasNodeSelector::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("version': "); new_tlv->add_TLV(field_version.BER_encode_TLV(IntraDomainNasNodeSelector_version_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean IntraDomainNasNodeSelector::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.IntraDomainNasNodeSelector' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("version': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_version.BER_decode_TLV(IntraDomainNasNodeSelector_version_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int IntraDomainNasNodeSelector::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.IntraDomainNasNodeSelector."); return -1; } if (p_td.json->as_value) { return field_version.JSON_encode(IntraDomainNasNodeSelector_version_descr_, p_tok, FALSE); } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "version"); enc_len += field_version.JSON_encode(IntraDomainNasNodeSelector_version_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int IntraDomainNasNodeSelector::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->as_value) { return field_version.JSON_decode(IntraDomainNasNodeSelector_version_descr_, p_tok, p_silent, FALSE); } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean version_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (7 == name_len && 0 == strncmp(fld_name, "version", name_len)) { version_found = TRUE; int ret_val = field_version.JSON_decode(IntraDomainNasNodeSelector_version_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 7, "version"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!version_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "version"); return JSON_ERROR_FATAL; } return (int)dec_len; } int IntraDomainNasNodeSelector::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_version.OER_encode(IntraDomainNasNodeSelector_version_descr_, p_buf); return 0; } int IntraDomainNasNodeSelector::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_version.OER_decode(IntraDomainNasNodeSelector_version_descr_, p_buf, p_oer); return 0; } void IntraDomainNasNodeSelector::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_version.PER_encode(IntraDomainNasNodeSelector_version_descr_, p_buf, p_options); } void IntraDomainNasNodeSelector::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_version.PER_decode(IntraDomainNasNodeSelector_version_descr_, p_buf, p_options); } struct IntraDomainNasNodeSelector_template::single_value_struct { IntraDomainNasNodeSelector_version_template field_version; }; void IntraDomainNasNodeSelector_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_version = ANY_VALUE; } } } void IntraDomainNasNodeSelector_template::copy_value(const IntraDomainNasNodeSelector& other_value) { single_value = new single_value_struct; if (other_value.version().is_bound()) { single_value->field_version = other_value.version(); } else { single_value->field_version.clean_up(); } set_selection(SPECIFIC_VALUE); } void IntraDomainNasNodeSelector_template::copy_template(const IntraDomainNasNodeSelector_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.version().get_selection()) { single_value->field_version = other_value.version(); } else { single_value->field_version.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 IntraDomainNasNodeSelector_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 IntraDomainNasNodeSelector_template(*other_value.implication_.precondition); implication_.implied_template = new IntraDomainNasNodeSelector_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 @RUA-IEs.IntraDomainNasNodeSelector."); break; } set_selection(other_value); } IntraDomainNasNodeSelector_template::IntraDomainNasNodeSelector_template() { } IntraDomainNasNodeSelector_template::IntraDomainNasNodeSelector_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } IntraDomainNasNodeSelector_template::IntraDomainNasNodeSelector_template(const IntraDomainNasNodeSelector& other_value) { copy_value(other_value); } IntraDomainNasNodeSelector_template::IntraDomainNasNodeSelector_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.IntraDomainNasNodeSelector from an unbound optional field."); } } IntraDomainNasNodeSelector_template::IntraDomainNasNodeSelector_template(IntraDomainNasNodeSelector_template* p_precondition, IntraDomainNasNodeSelector_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } IntraDomainNasNodeSelector_template::IntraDomainNasNodeSelector_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } IntraDomainNasNodeSelector_template::IntraDomainNasNodeSelector_template(const IntraDomainNasNodeSelector_template& other_value) : Base_Template() { copy_template(other_value); } IntraDomainNasNodeSelector_template::~IntraDomainNasNodeSelector_template() { clean_up(); } IntraDomainNasNodeSelector_template& IntraDomainNasNodeSelector_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } IntraDomainNasNodeSelector_template& IntraDomainNasNodeSelector_template::operator=(const IntraDomainNasNodeSelector& other_value) { clean_up(); copy_value(other_value); return *this; } IntraDomainNasNodeSelector_template& IntraDomainNasNodeSelector_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IntraDomainNasNodeSelector&)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 @RUA-IEs.IntraDomainNasNodeSelector."); } return *this; } IntraDomainNasNodeSelector_template& IntraDomainNasNodeSelector_template::operator=(const IntraDomainNasNodeSelector_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean IntraDomainNasNodeSelector_template::match(const IntraDomainNasNodeSelector& 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.version().is_bound()) return FALSE; if(!single_value->field_version.match(other_value.version(), 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 @RUA-IEs.IntraDomainNasNodeSelector."); } return FALSE; } boolean IntraDomainNasNodeSelector_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_version.is_bound(); } boolean IntraDomainNasNodeSelector_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_version.is_value(); } void IntraDomainNasNodeSelector_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; } IntraDomainNasNodeSelector IntraDomainNasNodeSelector_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 @RUA-IEs.IntraDomainNasNodeSelector."); IntraDomainNasNodeSelector ret_val; if (single_value->field_version.is_bound()) { ret_val.version() = single_value->field_version.valueof(); } return ret_val; } void IntraDomainNasNodeSelector_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 @RUA-IEs.IntraDomainNasNodeSelector."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new IntraDomainNasNodeSelector_template[list_length]; } IntraDomainNasNodeSelector_template& IntraDomainNasNodeSelector_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 @RUA-IEs.IntraDomainNasNodeSelector."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.IntraDomainNasNodeSelector."); return value_list.list_value[list_index]; } IntraDomainNasNodeSelector_version_template& IntraDomainNasNodeSelector_template::version() { set_specific(); return single_value->field_version; } const IntraDomainNasNodeSelector_version_template& IntraDomainNasNodeSelector_template::version() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field version of a non-specific template of type @RUA-IEs.IntraDomainNasNodeSelector."); return single_value->field_version; } int IntraDomainNasNodeSelector_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector 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 @RUA-IEs.IntraDomainNasNodeSelector containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.IntraDomainNasNodeSelector containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.IntraDomainNasNodeSelector."); } return 0; } void IntraDomainNasNodeSelector_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ version := "); single_value->field_version.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 IntraDomainNasNodeSelector_template::log_match(const IntraDomainNasNodeSelector& 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_version.match(match_value.version(), legacy)){ TTCN_Logger::log_logmatch_info(".version"); single_value->field_version.log_match(match_value.version(), 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("{ version := "); single_value->field_version.log_match(match_value.version(), 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 IntraDomainNasNodeSelector_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (version().is_bound()) version().set_implicit_omit(); } void IntraDomainNasNodeSelector_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_version.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 @RUA-IEs.IntraDomainNasNodeSelector."); } } void IntraDomainNasNodeSelector_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_version.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 IntraDomainNasNodeSelector_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 @RUA-IEs.IntraDomainNasNodeSelector."); } } void IntraDomainNasNodeSelector_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: { IntraDomainNasNodeSelector_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) version().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "version")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { version().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.IntraDomainNasNodeSelector: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { IntraDomainNasNodeSelector_template* precondition = new IntraDomainNasNodeSelector_template; precondition->set_param(*param.get_elem(0)); IntraDomainNasNodeSelector_template* implied_template = new IntraDomainNasNodeSelector_template; implied_template->set_param(*param.get_elem(1)); *this = IntraDomainNasNodeSelector_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.IntraDomainNasNodeSelector"); } is_ifpresent = param.get_ifpresent(); } void IntraDomainNasNodeSelector_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_version.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.IntraDomainNasNodeSelector"); 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 : "@RUA-IEs.IntraDomainNasNodeSelector"); } boolean IntraDomainNasNodeSelector_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean IntraDomainNasNodeSelector_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_idxis_value(); case ALT_transport: return field_transport->is_value(); case ALT_protocol: return field_protocol->is_value(); case ALT_misc: return field_misc->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void Cause::clean_up() { switch (union_selection) { case ALT_radioNetwork: delete field_radioNetwork; break; case ALT_transport: delete field_transport; break; case ALT_protocol: delete field_protocol; break; case ALT_misc: delete field_misc; break; default: break; } union_selection = UNBOUND_VALUE; } void Cause::log() const { switch (union_selection) { case ALT_radioNetwork: TTCN_Logger::log_event_str("{ radioNetwork := "); field_radioNetwork->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_transport: TTCN_Logger::log_event_str("{ transport := "); field_transport->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_protocol: TTCN_Logger::log_event_str("{ protocol := "); field_protocol->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_misc: TTCN_Logger::log_event_str("{ misc := "); field_misc->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void Cause::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "union value"); Module_Param_Ptr m_p = ¶m; if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return; if (m_p->get_type()!=Module_Param::MP_Assignment_List) { param.error("union value with field name was expected"); } Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "radioNetwork")) { radioNetwork().set_param(*mp_last); if (!radioNetwork().is_bound()) clean_up(); return; } if (!strcmp(last_name, "transport")) { transport().set_param(*mp_last); if (!transport().is_bound()) clean_up(); return; } if (!strcmp(last_name, "protocol")) { protocol().set_param(*mp_last); if (!protocol().is_bound()) clean_up(); return; } if (!strcmp(last_name, "misc")) { misc().set_param(*mp_last); if (!misc().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @RUA-IEs.Cause.", last_name); } void Cause::set_implicit_omit() { switch (union_selection) { case ALT_radioNetwork: field_radioNetwork->set_implicit_omit(); break; case ALT_transport: field_transport->set_implicit_omit(); break; case ALT_protocol: field_protocol->set_implicit_omit(); break; case ALT_misc: field_misc->set_implicit_omit(); break; default: break; } } void Cause::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_radioNetwork: field_radioNetwork->encode_text(text_buf); break; case ALT_transport: field_transport->encode_text(text_buf); break; case ALT_protocol: field_protocol->encode_text(text_buf); break; case ALT_misc: field_misc->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @RUA-IEs.Cause."); } } void Cause::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_radioNetwork: radioNetwork().decode_text(text_buf); break; case ALT_transport: transport().decode_text(text_buf); break; case ALT_protocol: protocol().decode_text(text_buf); break; case ALT_misc: misc().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @RUA-IEs.Cause."); } } void Cause::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Cause::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t *Cause::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv; TTCN_EncDec_ErrorContext ec_0("Alternative '"); TTCN_EncDec_ErrorContext ec_1; switch (union_selection) { case ALT_radioNetwork: ec_1.set_msg("radioNetwork': "); new_tlv = field_radioNetwork->BER_encode_TLV(Cause_radioNetwork_descr_, p_coding); break; case ALT_transport: ec_1.set_msg("transport': "); new_tlv = field_transport->BER_encode_TLV(Cause_transport_descr_, p_coding); break; case ALT_protocol: ec_1.set_msg("protocol': "); new_tlv = field_protocol->BER_encode_TLV(Cause_protocol_descr_, p_coding); break; case ALT_misc: ec_1.set_msg("misc': "); new_tlv = field_misc->BER_encode_TLV(Cause_misc_descr_, p_coding); break; case UNBOUND_VALUE: new_tlv = BER_encode_chk_bound(FALSE); break; default: TTCN_EncDec_ErrorContext::error_internal("Unknown selection."); new_tlv = NULL; } return ASN_BER_V2TLV(new_tlv, p_td, p_coding); } boolean Cause::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_radioNetwork = new CauseRadioNetwork; union_selection = ALT_radioNetwork; if (field_radioNetwork->BER_decode_isMyMsg(Cause_radioNetwork_descr_, p_tlv)) return TRUE; delete field_radioNetwork; field_transport = new CauseTransport; union_selection = ALT_transport; if (field_transport->BER_decode_isMyMsg(Cause_transport_descr_, p_tlv)) return TRUE; delete field_transport; field_protocol = new CauseProtocol; union_selection = ALT_protocol; if (field_protocol->BER_decode_isMyMsg(Cause_protocol_descr_, p_tlv)) return TRUE; delete field_protocol; field_misc = new CauseMisc; union_selection = ALT_misc; if (field_misc->BER_decode_isMyMsg(Cause_misc_descr_, p_tlv)) return TRUE; delete field_misc; union_selection = UNBOUND_VALUE; return FALSE; } boolean Cause::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { Cause tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean Cause::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.Cause' type: "); ASN_BER_TLV_t tmp_tlv; if (!BER_decode_TLV_CHOICE(*p_td.ber, stripped_tlv, L_form, tmp_tlv) || !BER_decode_CHOICE_selection(BER_decode_set_selection(tmp_tlv), tmp_tlv)) return FALSE; TTCN_EncDec_ErrorContext ec_1("Alternative '"); TTCN_EncDec_ErrorContext ec_2; switch (union_selection) { case ALT_radioNetwork: ec_2.set_msg("radioNetwork': "); field_radioNetwork->BER_decode_TLV(Cause_radioNetwork_descr_, tmp_tlv, L_form); break; case ALT_transport: ec_2.set_msg("transport': "); field_transport->BER_decode_TLV(Cause_transport_descr_, tmp_tlv, L_form); break; case ALT_protocol: ec_2.set_msg("protocol': "); field_protocol->BER_decode_TLV(Cause_protocol_descr_, tmp_tlv, L_form); break; case ALT_misc: ec_2.set_msg("misc': "); field_misc->BER_decode_TLV(Cause_misc_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int Cause::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { boolean as_value = p_td.json->as_value; int enc_len = as_value ? 0 : p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); switch(union_selection) { case ALT_radioNetwork: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "radioNetwork"); } enc_len += field_radioNetwork->JSON_encode(Cause_radioNetwork_descr_, p_tok, FALSE); break; case ALT_transport: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "transport"); } enc_len += field_transport->JSON_encode(Cause_transport_descr_, p_tok, FALSE); break; case ALT_protocol: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "protocol"); } enc_len += field_protocol->JSON_encode(Cause_protocol_descr_, p_tok, FALSE); break; case ALT_misc: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "misc"); } enc_len += field_misc->JSON_encode(Cause_misc_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Cause."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int Cause::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int p_chosen_field) { if (0 <= p_chosen_field && 4 > p_chosen_field) { switch (p_chosen_field) { case 0: return radioNetwork().JSON_decode(Cause_radioNetwork_descr_, p_tok, TRUE, FALSE); case 1: return transport().JSON_decode(Cause_transport_descr_, p_tok, TRUE, FALSE); case 2: return protocol().JSON_decode(Cause_protocol_descr_, p_tok, TRUE, FALSE); case 3: return misc().JSON_decode(Cause_misc_descr_, p_tok, TRUE, FALSE); } } if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; if (p_td.json->as_value) { size_t buf_pos = p_tok.get_buf_pos(); p_tok.get_next_token(&j_token, NULL, NULL); int ret_val = 0; switch(j_token) { case JSON_TOKEN_NUMBER: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "number '@RUA-IEs.Cause'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { p_tok.set_buf_pos(buf_pos); ret_val = radioNetwork().JSON_decode(Cause_radioNetwork_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = transport().JSON_decode(Cause_transport_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = protocol().JSON_decode(Cause_protocol_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = misc().JSON_decode(Cause_misc_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "string '@RUA-IEs.Cause'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_LITERAL_TRUE: case JSON_TOKEN_LITERAL_FALSE: { char* literal_str = mprintf("literal (%s)", (JSON_TOKEN_LITERAL_TRUE == j_token) ? "true" : "false"); try { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, literal_str); } catch (const TC_Error&) { Free(literal_str); throw; } Free(literal_str); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_ARRAY_START: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "array '@RUA-IEs.Cause'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "object '@RUA-IEs.Cause'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_LITERAL_NULL: { clean_up(); return JSON_ERROR_INVALID_TOKEN; } case JSON_TOKEN_ERROR: JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; default: return JSON_ERROR_INVALID_TOKEN; } return ret_val; } else { size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } char* fld_name = 0; size_t name_len = 0; dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_NAME != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else { if (12 == name_len && 0 == strncmp(fld_name, "radioNetwork", name_len)) { int ret_val = radioNetwork().JSON_decode(Cause_radioNetwork_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 12, "radioNetwork"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (9 == name_len && 0 == strncmp(fld_name, "transport", name_len)) { int ret_val = transport().JSON_decode(Cause_transport_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 9, "transport"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (8 == name_len && 0 == strncmp(fld_name, "protocol", name_len)) { int ret_val = protocol().JSON_decode(Cause_protocol_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 8, "protocol"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (4 == name_len && 0 == strncmp(fld_name, "misc", name_len)) { int ret_val = misc().JSON_decode(Cause_misc_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 4, "misc"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_STATIC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } return (int)dec_len; } } int Cause::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_radioNetwork: {TTCN_Buffer buf; encode_oer_tag(*Cause_radioNetwork_descr_.ber, p_buf); field_radioNetwork->OER_encode(Cause_radioNetwork_descr_, buf); p_buf.put_buf(buf); break; } case ALT_transport: {TTCN_Buffer buf; encode_oer_tag(*Cause_transport_descr_.ber, p_buf); field_transport->OER_encode(Cause_transport_descr_, buf); p_buf.put_buf(buf); break; } case ALT_protocol: {TTCN_Buffer buf; encode_oer_tag(*Cause_protocol_descr_.ber, p_buf); field_protocol->OER_encode(Cause_protocol_descr_, buf); p_buf.put_buf(buf); break; } case ALT_misc: {TTCN_Buffer buf; encode_oer_tag(*Cause_misc_descr_.ber, p_buf); field_misc->OER_encode(Cause_misc_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.Cause."); return -1; } return 0; } int Cause::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const ASN_Tag_t& descr = decode_oer_tag(p_buf); if (Cause_radioNetwork_descr_.ber->tags[Cause_radioNetwork_descr_.ber->n_tags-1].tagclass == descr.tagclass && Cause_radioNetwork_descr_.ber->tags[Cause_radioNetwork_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { radioNetwork().OER_decode(Cause_radioNetwork_descr_, p_buf, p_oer); } else if (Cause_transport_descr_.ber->tags[Cause_transport_descr_.ber->n_tags-1].tagclass == descr.tagclass && Cause_transport_descr_.ber->tags[Cause_transport_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { transport().OER_decode(Cause_transport_descr_, p_buf, p_oer); } else if (Cause_protocol_descr_.ber->tags[Cause_protocol_descr_.ber->n_tags-1].tagclass == descr.tagclass && Cause_protocol_descr_.ber->tags[Cause_protocol_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { protocol().OER_decode(Cause_protocol_descr_, p_buf, p_oer); } else if (Cause_misc_descr_.ber->tags[Cause_misc_descr_.ber->n_tags-1].tagclass == descr.tagclass && Cause_misc_descr_.ber->tags[Cause_misc_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { misc().OER_decode(Cause_misc_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type Cause"); } return 0; } void Cause::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound CHOICE value."); return; } p_buf.PER_put_bit(FALSE); switch (union_selection) { case ALT_radioNetwork: { INTEGER::PER_encode_int(p_buf, 0, 2); field_radioNetwork->PER_encode(Cause_radioNetwork_descr_, p_buf, p_options); break; } case ALT_transport: { INTEGER::PER_encode_int(p_buf, 1, 2); field_transport->PER_encode(Cause_transport_descr_, p_buf, p_options); break; } case ALT_protocol: { INTEGER::PER_encode_int(p_buf, 2, 2); field_protocol->PER_encode(Cause_protocol_descr_, p_buf, p_options); break; } case ALT_misc: { INTEGER::PER_encode_int(p_buf, 3, 2); field_misc->PER_encode(Cause_misc_descr_, p_buf, p_options); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Internal error: Invalid CHOICE selection, expected an extension root field."); break; } } void Cause::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { clean_up(); boolean ext_bit = p_buf.PER_get_bit(); if (ext_bit) { INTEGER sel_code; sel_code.PER_decode_normally_small(p_buf, p_options); PER_skip_opentype(p_buf, p_options); } else { int sel_int; INTEGER::PER_decode_int(p_buf, 2, FALSE, sel_int); switch (sel_int) { case 0: radioNetwork().PER_decode(Cause_radioNetwork_descr_, p_buf, p_options); break; case 1: transport().PER_decode(Cause_transport_descr_, p_buf, p_options); break; case 2: protocol().PER_decode(Cause_protocol_descr_, p_buf, p_options); break; case 3: misc().PER_decode(Cause_misc_descr_, p_buf, p_options); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid CHOICE selection (%d).", sel_int); break; } } } void Cause_template::copy_value(const Cause& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case Cause::ALT_radioNetwork: single_value.field_radioNetwork = new CauseRadioNetwork_template(other_value.radioNetwork()); break; case Cause::ALT_transport: single_value.field_transport = new CauseTransport_template(other_value.transport()); break; case Cause::ALT_protocol: single_value.field_protocol = new CauseProtocol_template(other_value.protocol()); break; case Cause::ALT_misc: single_value.field_misc = new CauseMisc_template(other_value.misc()); break; default: TTCN_error("Initializing a template with an unbound value of type @RUA-IEs.Cause."); } set_selection(SPECIFIC_VALUE); } void Cause_template::copy_template(const Cause_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.union_selection = other_value.single_value.union_selection; switch (single_value.union_selection) { case Cause::ALT_radioNetwork: single_value.field_radioNetwork = new CauseRadioNetwork_template(*other_value.single_value.field_radioNetwork); break; case Cause::ALT_transport: single_value.field_transport = new CauseTransport_template(*other_value.single_value.field_transport); break; case Cause::ALT_protocol: single_value.field_protocol = new CauseProtocol_template(*other_value.single_value.field_protocol); break; case Cause::ALT_misc: single_value.field_misc = new CauseMisc_template(*other_value.single_value.field_misc); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @RUA-IEs.Cause."); } 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 Cause_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 Cause_template(*other_value.implication_.precondition); implication_.implied_template = new Cause_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 template of union type @RUA-IEs.Cause."); } set_selection(other_value); } Cause_template::Cause_template() { } Cause_template::Cause_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Cause_template::Cause_template(const Cause& other_value) { copy_value(other_value); } Cause_template::Cause_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Cause&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @RUA-IEs.Cause from an unbound optional field."); } } Cause_template::Cause_template(Cause_template* p_precondition, Cause_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Cause_template::Cause_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } Cause_template::Cause_template(const Cause_template& other_value) : Base_Template(){ copy_template(other_value); } Cause_template::~Cause_template() { clean_up(); } void Cause_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case Cause::ALT_radioNetwork: delete single_value.field_radioNetwork; break; case Cause::ALT_transport: delete single_value.field_transport; break; case Cause::ALT_protocol: delete single_value.field_protocol; break; case Cause::ALT_misc: delete single_value.field_misc; default: break; } 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; } Cause_template& Cause_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Cause_template& Cause_template::operator=(const Cause& other_value) { clean_up(); copy_value(other_value); return *this; } Cause_template& Cause_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Cause&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of union type @RUA-IEs.Cause."); } return *this; } Cause_template& Cause_template::operator=(const Cause_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Cause_template::match(const Cause& 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: { Cause::union_selection_type value_selection = other_value.get_selection(); if (value_selection == Cause::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case Cause::ALT_radioNetwork: return single_value.field_radioNetwork->match(other_value.radioNetwork(), legacy); case Cause::ALT_transport: return single_value.field_transport->match(other_value.transport(), legacy); case Cause::ALT_protocol: return single_value.field_protocol->match(other_value.protocol(), legacy); case Cause::ALT_misc: return single_value.field_misc->match(other_value.misc(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @RUA-IEs.Cause."); } } 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 template of union type @RUA-IEs.Cause."); } return FALSE; } boolean Cause_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case Cause::ALT_radioNetwork: return single_value.field_radioNetwork->is_value(); case Cause::ALT_transport: return single_value.field_transport->is_value(); case Cause::ALT_protocol: return single_value.field_protocol->is_value(); case Cause::ALT_misc: return single_value.field_misc->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @RUA-IEs.Cause."); } } Cause Cause_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of union type @RUA-IEs.Cause."); Cause ret_val; switch (single_value.union_selection) { case Cause::ALT_radioNetwork: ret_val.radioNetwork() = single_value.field_radioNetwork->valueof(); break; case Cause::ALT_transport: ret_val.transport() = single_value.field_transport->valueof(); break; case Cause::ALT_protocol: ret_val.protocol() = single_value.field_protocol->valueof(); break; case Cause::ALT_misc: ret_val.misc() = single_value.field_misc->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @RUA-IEs.Cause."); } return ret_val; } Cause_template& Cause_template::list_item(unsigned int list_index) const { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @RUA-IEs.Cause."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @RUA-IEs.Cause."); return value_list.list_value[list_index]; } void Cause_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 ("Internal error: Setting an invalid list for a template of union type @RUA-IEs.Cause."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Cause_template[list_length]; } CauseRadioNetwork_template& Cause_template::radioNetwork() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Cause::ALT_radioNetwork) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_radioNetwork = new CauseRadioNetwork_template(ANY_VALUE); else single_value.field_radioNetwork = new CauseRadioNetwork_template; single_value.union_selection = Cause::ALT_radioNetwork; set_selection(SPECIFIC_VALUE); } return *single_value.field_radioNetwork; } const CauseRadioNetwork_template& Cause_template::radioNetwork() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field radioNetwork in a non-specific template of union type @RUA-IEs.Cause."); if (single_value.union_selection != Cause::ALT_radioNetwork) TTCN_error("Accessing non-selected field radioNetwork in a template of union type @RUA-IEs.Cause."); return *single_value.field_radioNetwork; } CauseTransport_template& Cause_template::transport() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Cause::ALT_transport) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_transport = new CauseTransport_template(ANY_VALUE); else single_value.field_transport = new CauseTransport_template; single_value.union_selection = Cause::ALT_transport; set_selection(SPECIFIC_VALUE); } return *single_value.field_transport; } const CauseTransport_template& Cause_template::transport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field transport in a non-specific template of union type @RUA-IEs.Cause."); if (single_value.union_selection != Cause::ALT_transport) TTCN_error("Accessing non-selected field transport in a template of union type @RUA-IEs.Cause."); return *single_value.field_transport; } CauseProtocol_template& Cause_template::protocol() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Cause::ALT_protocol) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_protocol = new CauseProtocol_template(ANY_VALUE); else single_value.field_protocol = new CauseProtocol_template; single_value.union_selection = Cause::ALT_protocol; set_selection(SPECIFIC_VALUE); } return *single_value.field_protocol; } const CauseProtocol_template& Cause_template::protocol() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field protocol in a non-specific template of union type @RUA-IEs.Cause."); if (single_value.union_selection != Cause::ALT_protocol) TTCN_error("Accessing non-selected field protocol in a template of union type @RUA-IEs.Cause."); return *single_value.field_protocol; } CauseMisc_template& Cause_template::misc() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != Cause::ALT_misc) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_misc = new CauseMisc_template(ANY_VALUE); else single_value.field_misc = new CauseMisc_template; single_value.union_selection = Cause::ALT_misc; set_selection(SPECIFIC_VALUE); } return *single_value.field_misc; } const CauseMisc_template& Cause_template::misc() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field misc in a non-specific template of union type @RUA-IEs.Cause."); if (single_value.union_selection != Cause::ALT_misc) TTCN_error("Accessing non-selected field misc in a template of union type @RUA-IEs.Cause."); return *single_value.field_misc; } boolean Cause_template::ischosen(Cause::union_selection_type checked_selection) const { if (checked_selection == Cause::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-IEs.Cause."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == Cause::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @RUA-IEs.Cause."); return single_value.union_selection == checked_selection; case VALUE_LIST: { if (value_list.n_values < 1) TTCN_error("Internal error: Performing ischosen() operation on a template of union type @RUA-IEs.Cause containing an empty list."); boolean ret_val = value_list.list_value[0].ischosen(checked_selection); for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) { ret_val = value_list.list_value[list_count].ischosen(checked_selection); } return ret_val; } default: return FALSE; } return FALSE; } void Cause_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case Cause::ALT_radioNetwork: TTCN_Logger::log_event_str("{ radioNetwork := "); single_value.field_radioNetwork->log(); TTCN_Logger::log_event_str(" }"); break; case Cause::ALT_transport: TTCN_Logger::log_event_str("{ transport := "); single_value.field_transport->log(); TTCN_Logger::log_event_str(" }"); break; case Cause::ALT_protocol: TTCN_Logger::log_event_str("{ protocol := "); single_value.field_protocol->log(); TTCN_Logger::log_event_str(" }"); break; case Cause::ALT_misc: TTCN_Logger::log_event_str("{ misc := "); single_value.field_misc->log(); TTCN_Logger::log_event_str(" }"); break; default: 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 Cause_template::log_match(const Cause& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); return; } if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); switch (single_value.union_selection) { case Cause::ALT_radioNetwork: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".radioNetwork"); single_value.field_radioNetwork->log_match(match_value.radioNetwork(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ radioNetwork := "); single_value.field_radioNetwork->log_match(match_value.radioNetwork(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Cause::ALT_transport: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".transport"); single_value.field_transport->log_match(match_value.transport(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ transport := "); single_value.field_transport->log_match(match_value.transport(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Cause::ALT_protocol: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".protocol"); single_value.field_protocol->log_match(match_value.protocol(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ protocol := "); single_value.field_protocol->log_match(match_value.protocol(), legacy); TTCN_Logger::log_event_str(" }"); } break; case Cause::ALT_misc: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".misc"); single_value.field_misc->log_match(match_value.misc(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ misc := "); single_value.field_misc->log_match(match_value.misc(), legacy); TTCN_Logger::log_event_str(" }"); } break; default: TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(""); } } else { TTCN_Logger::print_logmatch_buffer(); 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 Cause_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case Cause::ALT_radioNetwork: single_value.field_radioNetwork->set_implicit_omit(); break; case Cause::ALT_transport: single_value.field_transport->set_implicit_omit(); break; case Cause::ALT_protocol: single_value.field_protocol->set_implicit_omit(); break; case Cause::ALT_misc: single_value.field_misc->set_implicit_omit(); break; default: break; } } void Cause_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.union_selection); switch (single_value.union_selection) { case Cause::ALT_radioNetwork: single_value.field_radioNetwork->encode_text(text_buf); break; case Cause::ALT_transport: single_value.field_transport->encode_text(text_buf); break; case Cause::ALT_protocol: single_value.field_protocol->encode_text(text_buf); break; case Cause::ALT_misc: single_value.field_misc->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @RUA-IEs.Cause."); } 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 template of type @RUA-IEs.Cause."); } } void Cause_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = Cause::UNBOUND_VALUE; Cause::union_selection_type new_selection = (Cause::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case Cause::ALT_radioNetwork: single_value.field_radioNetwork = new CauseRadioNetwork_template; single_value.field_radioNetwork->decode_text(text_buf); break; case Cause::ALT_transport: single_value.field_transport = new CauseTransport_template; single_value.field_transport->decode_text(text_buf); break; case Cause::ALT_protocol: single_value.field_protocol = new CauseProtocol_template; single_value.field_protocol->decode_text(text_buf); break; case Cause::ALT_misc: single_value.field_misc = new CauseMisc_template; single_value.field_misc->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @RUA-IEs.Cause."); } single_value.union_selection = new_selection; } 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 Cause_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: Unrecognized selector was received in a template of type @RUA-IEs.Cause."); } } boolean Cause_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Cause_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 v_idx=0; v_idx(param.get_id()) != NULL && param.get_id()->next_name()) { char* param_field = param.get_id()->get_current_name(); if (param_field[0] >= '0' && param_field[0] <= '9') { param.error("Unexpected array index in module parameter, expected a valid field" " name for union template type `@RUA-IEs.Cause'"); } if (strcmp("radioNetwork", param_field) == 0) { radioNetwork().set_param(param); return; } else if (strcmp("transport", param_field) == 0) { transport().set_param(param); return; } else if (strcmp("protocol", param_field) == 0) { protocol().set_param(param); return; } else if (strcmp("misc", param_field) == 0) { misc().set_param(param); return; } else param.error("Field `%s' not found in union template type `@RUA-IEs.Cause'", param_field); } param.basic_check(Module_Param::BC_TEMPLATE, "union template"); Module_Param_Ptr m_p = ¶m; switch (m_p->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: { Cause_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Value_List: if (m_p->get_size()==0) break; param.type_error("union template", "@RUA-IEs.Cause"); break; case Module_Param::MP_Assignment_List: { Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); if (!strcmp(last_name, "radioNetwork")) { radioNetwork().set_param(*mp_last); break; } if (!strcmp(last_name, "transport")) { transport().set_param(*mp_last); break; } if (!strcmp(last_name, "protocol")) { protocol().set_param(*mp_last); break; } if (!strcmp(last_name, "misc")) { misc().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @RUA-IEs.Cause.", last_name); } break; case Module_Param::MP_Implication_Template: { Cause_template* precondition = new Cause_template; precondition->set_param(*m_p->get_elem(0)); Cause_template* implied_template = new Cause_template; implied_template->set_param(*m_p->get_elem(1)); *this = Cause_template(precondition, implied_template); } break; default: param.type_error("union template", "@RUA-IEs.Cause"); } is_ifpresent = param.get_ifpresent(); } void Cause_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; switch (single_value.union_selection) { case Cause::ALT_radioNetwork: single_value.field_radioNetwork->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Cause"); return; case Cause::ALT_transport: single_value.field_transport->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Cause"); return; case Cause::ALT_protocol: single_value.field_protocol->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Cause"); return; case Cause::ALT_misc: single_value.field_misc->check_restriction(t_res, t_name ? t_name : "@RUA-IEs.Cause"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @RUA-IEs.Cause."); } 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 : "@RUA-IEs.Cause"); } CauseRadioNetwork::CauseRadioNetwork() { enum_value = UNBOUND_VALUE; } CauseRadioNetwork::CauseRadioNetwork(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RUA-IEs.CauseRadioNetwork with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } CauseRadioNetwork::CauseRadioNetwork(enum_type other_value) { enum_value = other_value; } CauseRadioNetwork::CauseRadioNetwork(const CauseRadioNetwork& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); enum_value = other_value.enum_value; } CauseRadioNetwork& CauseRadioNetwork::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RUA-IEs.CauseRadioNetwork.", other_value); enum_value = (enum_type)other_value; return *this; } CauseRadioNetwork& CauseRadioNetwork::operator=(enum_type other_value) { enum_value = other_value; return *this; } CauseRadioNetwork& CauseRadioNetwork::operator=(const CauseRadioNetwork& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); enum_value = other_value.enum_value; return *this; } boolean CauseRadioNetwork::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseRadioNetwork comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean CauseRadioNetwork::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); return enum_value == other_value; } boolean CauseRadioNetwork::operator==(const CauseRadioNetwork& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); return enum_value == other_value.enum_value; } boolean CauseRadioNetwork::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseRadioNetwork comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean CauseRadioNetwork::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); return enum_value < other_value; } boolean CauseRadioNetwork::operator<(const CauseRadioNetwork& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); return enum_value < other_value.enum_value; } boolean CauseRadioNetwork::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseRadioNetwork comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean CauseRadioNetwork::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); return enum_value > other_value; } boolean CauseRadioNetwork::operator>(const CauseRadioNetwork& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); return enum_value > other_value.enum_value; } const char *CauseRadioNetwork::enum_to_str(enum_type enum_par) { switch (enum_par) { case normal: return "normal"; case connect__failed: return "connect_failed"; case network__release: return "network_release"; case unspecified: return "unspecified"; default: return ""; } } CauseRadioNetwork::enum_type CauseRadioNetwork::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "normal")) return normal; if (!strcmp(str_par, "connect_failed")) return connect__failed; if (!strcmp(str_par, "network_release")) return network__release; if (!strcmp(str_par, "unspecified")) return unspecified; } return UNKNOWN_VALUE; } boolean CauseRadioNetwork::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: case 3: return TRUE; default: return FALSE; } } int CauseRadioNetwork::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CauseRadioNetwork.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int CauseRadioNetwork::enum2int(const CauseRadioNetwork& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CauseRadioNetwork.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void CauseRadioNetwork::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RUA-IEs.CauseRadioNetwork.", int_val); enum_value = (enum_type)int_val; } CauseRadioNetwork::operator CauseRadioNetwork::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RUA-IEs.CauseRadioNetwork."); return enum_value; } void CauseRadioNetwork::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void CauseRadioNetwork::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RUA-IEs.CauseRadioNetwork"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RUA-IEs.CauseRadioNetwork."); } } void CauseRadioNetwork::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); text_buf.push_int(enum_value); } void CauseRadioNetwork::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RUA-IEs.CauseRadioNetwork.", enum_value); } void CauseRadioNetwork::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CauseRadioNetwork::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CauseRadioNetwork::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { BER_encode_chk_enum_valid(p_td, is_valid_enum(enum_value), enum_value); new_tlv=BER_encode_TLV_INTEGER(p_coding, enum_value); } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CauseRadioNetwork::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { enum_value = UNBOUND_VALUE; BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec("While decoding ENUMERATED type @RUA-IEs.CauseRadioNetwork: "); int tmp_mfr; if (BER_decode_TLV_INTEGER(stripped_tlv, L_form, tmp_mfr)) { BER_decode_chk_enum_valid(p_td, is_valid_enum(tmp_mfr), tmp_mfr); enum_value = (enum_type)tmp_mfr; return TRUE; } else return FALSE; } int CauseRadioNetwork::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); return -1; } if (p_td.json->use_null) { return p_tok.put_next_token(JSON_TOKEN_LITERAL_NULL); } char* tmp_str; if (p_td.json->as_number) { tmp_str = mprintf("%d", enum_value); } else { boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (p_td.json->enum_texts[i].index == enum_value) { tmp_str = mprintf("\"%s\"", p_td.json->enum_texts[i].text); text_found = true; break; } } if (!text_found) { tmp_str = mprintf("\"%s\"", enum_to_str(enum_value)); } } int enc_len = p_tok.put_next_token(p_td.json->as_number ? JSON_TOKEN_NUMBER : JSON_TOKEN_STRING, tmp_str); Free(tmp_str); return enc_len; } int CauseRadioNetwork::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { json_token_t token = JSON_TOKEN_NONE; char* value = 0; size_t value_len = 0; boolean error = FALSE; size_t dec_len = 0; boolean use_default = FALSE; if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return dec_len; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { value = const_cast(p_td.json->default_value.str); value_len = strlen(value); use_default = TRUE; } else { dec_len = p_tok.get_next_token(&token, &value, &value_len); } if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_LITERAL_NULL == token && p_td.json->use_null) { enum_value = normal; } else if (!p_td.json->use_null && ((JSON_TOKEN_STRING == token && !p_td.json->as_number) || use_default)) { if (use_default || (value_len > 2 && value[0] == '\"' && value[value_len - 1] == '\"')) { if (!use_default) value[value_len - 1] = 0; boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (strcmp(p_td.json->enum_texts[i].text, value + (use_default ? 0 : 1)) == 0) { enum_value = static_cast(p_td.json->enum_texts[i].index); text_found = true; break; } } if (!text_found) { enum_value = str_to_enum(value + (use_default ? 0 : 1)); } if (!use_default) value[value_len - 1] = '\"'; if (UNKNOWN_VALUE == enum_value) { error = TRUE; } } else { error = TRUE; } } else if (!p_td.json->use_null && JSON_TOKEN_NUMBER == token && p_td.json->as_number) { char* value_str = mcopystrn(value, value_len); int number = atoi(value_str); if (strchr(value_str, '.') != NULL || strchr(value_str, 'e') != NULL || strchr(value_str, 'E') != NULL) { error = TRUE; } else if (is_valid_enum(number)) { enum_value = static_cast(number); } else { error = TRUE; } Free(value_str); } else { enum_value = UNBOUND_VALUE; return JSON_ERROR_INVALID_TOKEN; } if (error) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FORMAT_ERROR, p_td.json->as_number ? "number" : "string", "enumerated"); enum_value = UNBOUND_VALUE; return JSON_ERROR_FATAL; } return (int)dec_len; } int CauseRadioNetwork::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); return -1; } if (enum_value >= 0 && enum_value < 128) { char c = enum_value; p_buf.put_c(c); } else { INTEGER intval(enum_value); TTCN_Buffer buf; intval.OER_encode(INTEGER_descr_, buf); unsigned char* uc = const_cast(buf.get_data()); *uc |= 1 << 7; p_buf.put_buf(buf); } return 0; } int CauseRadioNetwork::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); if (!(uc[0] & 0x80)) { if (is_valid_enum(uc[0])) { enum_value = static_cast(uc[0]); } else { enum_value = UNKNOWN_VALUE; } p_buf.increase_pos(1); } else { unsigned char* uc2 = const_cast(p_buf.get_read_data()); uc2[0] &= ~0x80; INTEGER intval; intval.OER_decode(INTEGER_descr_, p_buf, p_oer); if (is_valid_enum(intval.get_val().get_val())) { enum_value = static_cast(intval.get_val().get_val()); } else { enum_value = UNKNOWN_VALUE; } } return 0; } void CauseRadioNetwork::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; boolean ext_bit = FALSE; switch (enum_value) { case normal: enc_val = 0; ext_bit = FALSE; break; case connect__failed: enc_val = 1; ext_bit = FALSE; break; case network__release: enc_val = 2; ext_bit = FALSE; break; case unspecified: enc_val = 3; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @RUA-IEs.CauseRadioNetwork."); } p_buf.PER_put_bit(ext_bit); if (ext_bit) enc_val.PER_encode_normally_small(p_buf, p_options); else INTEGER::PER_encode_int(p_buf, enc_val, 2); } void CauseRadioNetwork::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { INTEGER dec_val; boolean ext_bit = p_buf.PER_get_bit(); if (ext_bit) dec_val.PER_decode_normally_small(p_buf, p_options); else dec_val.PER_decode_unaligned_constrained(p_buf, 2, FALSE); int dec_int = dec_val; if (ext_bit) switch (dec_int) { default: enum_value = UNBOUND_VALUE; break; } else switch (dec_int) { case 0: enum_value = normal; break; case 1: enum_value = connect__failed; break; case 2: enum_value = network__release; break; case 3: enum_value = unspecified; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @RUA-IEs.CauseRadioNetwork.", dec_int); break; } } void CauseRadioNetwork_template::copy_template(const CauseRadioNetwork_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; 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 CauseRadioNetwork_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 CauseRadioNetwork_template(*other_value.implication_.precondition); implication_.implied_template = new CauseRadioNetwork_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 enumerated type @RUA-IEs.CauseRadioNetwork."); } } CauseRadioNetwork_template::CauseRadioNetwork_template() { } CauseRadioNetwork_template::CauseRadioNetwork_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CauseRadioNetwork_template::CauseRadioNetwork_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!CauseRadioNetwork::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RUA-IEs.CauseRadioNetwork with unknown numeric value %d.", other_value); single_value = (CauseRadioNetwork::enum_type)other_value; } CauseRadioNetwork_template::CauseRadioNetwork_template(CauseRadioNetwork::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } CauseRadioNetwork_template::CauseRadioNetwork_template(const CauseRadioNetwork& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == CauseRadioNetwork::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork."); single_value = other_value.enum_value; } CauseRadioNetwork_template::CauseRadioNetwork_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CauseRadioNetwork::enum_type)(const CauseRadioNetwork&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RUA-IEs.CauseRadioNetwork from an unbound optional field."); } } CauseRadioNetwork_template::CauseRadioNetwork_template(CauseRadioNetwork_template* p_precondition, CauseRadioNetwork_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CauseRadioNetwork_template::CauseRadioNetwork_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CauseRadioNetwork_template::CauseRadioNetwork_template(const CauseRadioNetwork_template& other_value) : Base_Template() { copy_template(other_value); } CauseRadioNetwork_template::~CauseRadioNetwork_template() { clean_up(); } boolean CauseRadioNetwork_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean CauseRadioNetwork_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != CauseRadioNetwork::UNBOUND_VALUE; } void CauseRadioNetwork_template::clean_up() { switch (template_selection) { 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; } CauseRadioNetwork_template& CauseRadioNetwork_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CauseRadioNetwork_template& CauseRadioNetwork_template::operator=(int other_value) { if (!CauseRadioNetwork::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RUA-IEs.CauseRadioNetwork.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (CauseRadioNetwork::enum_type)other_value; return *this; } CauseRadioNetwork_template& CauseRadioNetwork_template::operator=(CauseRadioNetwork::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } CauseRadioNetwork_template& CauseRadioNetwork_template::operator=(const CauseRadioNetwork& other_value) { if (other_value.enum_value == CauseRadioNetwork::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CauseRadioNetwork to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } CauseRadioNetwork_template& CauseRadioNetwork_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CauseRadioNetwork::enum_type)(const CauseRadioNetwork&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RUA-IEs.CauseRadioNetwork."); } return *this; } CauseRadioNetwork_template& CauseRadioNetwork_template::operator=(const CauseRadioNetwork_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CauseRadioNetwork_template::match(CauseRadioNetwork::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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)) 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 enumerated type @RUA-IEs.CauseRadioNetwork."); } return FALSE; } boolean CauseRadioNetwork_template::match(const CauseRadioNetwork& other_value, boolean) const { if (other_value.enum_value == CauseRadioNetwork::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RUA-IEs.CauseRadioNetwork with an unbound value."); return match(other_value.enum_value); } CauseRadioNetwork::enum_type CauseRadioNetwork_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RUA-IEs.CauseRadioNetwork."); return single_value; } void CauseRadioNetwork_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CauseRadioNetwork_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RUA-IEs.CauseRadioNetwork."); } } CauseRadioNetwork_template& CauseRadioNetwork_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RUA-IEs.CauseRadioNetwork."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RUA-IEs.CauseRadioNetwork."); return value_list.list_value[list_index]; } void CauseRadioNetwork_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(CauseRadioNetwork::enum_to_str(single_value), single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_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 CauseRadioNetwork_template::log_match(const CauseRadioNetwork& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void CauseRadioNetwork_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RUA-IEs.CauseRadioNetwork."); } } void CauseRadioNetwork_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (CauseRadioNetwork::enum_type)text_buf.pull_int().get_val(); if (!CauseRadioNetwork::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RUA-IEs.CauseRadioNetwork.", single_value); 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 CauseRadioNetwork_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RUA-IEs.CauseRadioNetwork."); } } boolean CauseRadioNetwork_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CauseRadioNetwork_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 i=0; iget_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: { CauseRadioNetwork_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { CauseRadioNetwork::enum_type enum_val = CauseRadioNetwork::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!CauseRadioNetwork::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RUA-IEs.CauseRadioNetwork."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { CauseRadioNetwork_template* precondition = new CauseRadioNetwork_template; precondition->set_param(*m_p->get_elem(0)); CauseRadioNetwork_template* implied_template = new CauseRadioNetwork_template; implied_template->set_param(*m_p->get_elem(1)); *this = CauseRadioNetwork_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RUA-IEs.CauseRadioNetwork"); } is_ifpresent = param.get_ifpresent(); } void CauseRadioNetwork_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_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; 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 : "@RUA-IEs.CauseRadioNetwork"); } CauseTransport::CauseTransport() { enum_value = UNBOUND_VALUE; } CauseTransport::CauseTransport(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RUA-IEs.CauseTransport with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } CauseTransport::CauseTransport(enum_type other_value) { enum_value = other_value; } CauseTransport::CauseTransport(const CauseTransport& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RUA-IEs.CauseTransport."); enum_value = other_value.enum_value; } CauseTransport& CauseTransport::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RUA-IEs.CauseTransport.", other_value); enum_value = (enum_type)other_value; return *this; } CauseTransport& CauseTransport::operator=(enum_type other_value) { enum_value = other_value; return *this; } CauseTransport& CauseTransport::operator=(const CauseTransport& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CauseTransport."); enum_value = other_value.enum_value; return *this; } boolean CauseTransport::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseTransport comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean CauseTransport::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); return enum_value == other_value; } boolean CauseTransport::operator==(const CauseTransport& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); return enum_value == other_value.enum_value; } boolean CauseTransport::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseTransport comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean CauseTransport::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); return enum_value < other_value; } boolean CauseTransport::operator<(const CauseTransport& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); return enum_value < other_value.enum_value; } boolean CauseTransport::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseTransport comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean CauseTransport::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); return enum_value > other_value; } boolean CauseTransport::operator>(const CauseTransport& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseTransport."); return enum_value > other_value.enum_value; } const char *CauseTransport::enum_to_str(enum_type enum_par) { switch (enum_par) { case transport__resource__unavailable: return "transport_resource_unavailable"; case unspecified: return "unspecified"; default: return ""; } } CauseTransport::enum_type CauseTransport::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "transport_resource_unavailable")) return transport__resource__unavailable; if (!strcmp(str_par, "unspecified")) return unspecified; } return UNKNOWN_VALUE; } boolean CauseTransport::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int CauseTransport::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CauseTransport.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int CauseTransport::enum2int(const CauseTransport& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CauseTransport.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void CauseTransport::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RUA-IEs.CauseTransport.", int_val); enum_value = (enum_type)int_val; } CauseTransport::operator CauseTransport::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RUA-IEs.CauseTransport."); return enum_value; } void CauseTransport::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void CauseTransport::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RUA-IEs.CauseTransport"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RUA-IEs.CauseTransport."); } } void CauseTransport::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RUA-IEs.CauseTransport."); text_buf.push_int(enum_value); } void CauseTransport::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RUA-IEs.CauseTransport.", enum_value); } void CauseTransport::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CauseTransport::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CauseTransport::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { BER_encode_chk_enum_valid(p_td, is_valid_enum(enum_value), enum_value); new_tlv=BER_encode_TLV_INTEGER(p_coding, enum_value); } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CauseTransport::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { enum_value = UNBOUND_VALUE; BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec("While decoding ENUMERATED type @RUA-IEs.CauseTransport: "); int tmp_mfr; if (BER_decode_TLV_INTEGER(stripped_tlv, L_form, tmp_mfr)) { BER_decode_chk_enum_valid(p_td, is_valid_enum(tmp_mfr), tmp_mfr); enum_value = (enum_type)tmp_mfr; return TRUE; } else return FALSE; } int CauseTransport::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CauseTransport."); return -1; } if (p_td.json->use_null) { return p_tok.put_next_token(JSON_TOKEN_LITERAL_NULL); } char* tmp_str; if (p_td.json->as_number) { tmp_str = mprintf("%d", enum_value); } else { boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (p_td.json->enum_texts[i].index == enum_value) { tmp_str = mprintf("\"%s\"", p_td.json->enum_texts[i].text); text_found = true; break; } } if (!text_found) { tmp_str = mprintf("\"%s\"", enum_to_str(enum_value)); } } int enc_len = p_tok.put_next_token(p_td.json->as_number ? JSON_TOKEN_NUMBER : JSON_TOKEN_STRING, tmp_str); Free(tmp_str); return enc_len; } int CauseTransport::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { json_token_t token = JSON_TOKEN_NONE; char* value = 0; size_t value_len = 0; boolean error = FALSE; size_t dec_len = 0; boolean use_default = FALSE; if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return dec_len; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { value = const_cast(p_td.json->default_value.str); value_len = strlen(value); use_default = TRUE; } else { dec_len = p_tok.get_next_token(&token, &value, &value_len); } if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_LITERAL_NULL == token && p_td.json->use_null) { enum_value = transport__resource__unavailable; } else if (!p_td.json->use_null && ((JSON_TOKEN_STRING == token && !p_td.json->as_number) || use_default)) { if (use_default || (value_len > 2 && value[0] == '\"' && value[value_len - 1] == '\"')) { if (!use_default) value[value_len - 1] = 0; boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (strcmp(p_td.json->enum_texts[i].text, value + (use_default ? 0 : 1)) == 0) { enum_value = static_cast(p_td.json->enum_texts[i].index); text_found = true; break; } } if (!text_found) { enum_value = str_to_enum(value + (use_default ? 0 : 1)); } if (!use_default) value[value_len - 1] = '\"'; if (UNKNOWN_VALUE == enum_value) { error = TRUE; } } else { error = TRUE; } } else if (!p_td.json->use_null && JSON_TOKEN_NUMBER == token && p_td.json->as_number) { char* value_str = mcopystrn(value, value_len); int number = atoi(value_str); if (strchr(value_str, '.') != NULL || strchr(value_str, 'e') != NULL || strchr(value_str, 'E') != NULL) { error = TRUE; } else if (is_valid_enum(number)) { enum_value = static_cast(number); } else { error = TRUE; } Free(value_str); } else { enum_value = UNBOUND_VALUE; return JSON_ERROR_INVALID_TOKEN; } if (error) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FORMAT_ERROR, p_td.json->as_number ? "number" : "string", "enumerated"); enum_value = UNBOUND_VALUE; return JSON_ERROR_FATAL; } return (int)dec_len; } int CauseTransport::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CauseTransport."); return -1; } if (enum_value >= 0 && enum_value < 128) { char c = enum_value; p_buf.put_c(c); } else { INTEGER intval(enum_value); TTCN_Buffer buf; intval.OER_encode(INTEGER_descr_, buf); unsigned char* uc = const_cast(buf.get_data()); *uc |= 1 << 7; p_buf.put_buf(buf); } return 0; } int CauseTransport::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); if (!(uc[0] & 0x80)) { if (is_valid_enum(uc[0])) { enum_value = static_cast(uc[0]); } else { enum_value = UNKNOWN_VALUE; } p_buf.increase_pos(1); } else { unsigned char* uc2 = const_cast(p_buf.get_read_data()); uc2[0] &= ~0x80; INTEGER intval; intval.OER_decode(INTEGER_descr_, p_buf, p_oer); if (is_valid_enum(intval.get_val().get_val())) { enum_value = static_cast(intval.get_val().get_val()); } else { enum_value = UNKNOWN_VALUE; } } return 0; } void CauseTransport::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; boolean ext_bit = FALSE; switch (enum_value) { case transport__resource__unavailable: enc_val = 0; ext_bit = FALSE; break; case unspecified: enc_val = 1; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @RUA-IEs.CauseTransport."); } p_buf.PER_put_bit(ext_bit); if (ext_bit) enc_val.PER_encode_normally_small(p_buf, p_options); else INTEGER::PER_encode_int(p_buf, enc_val, 1); } void CauseTransport::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { INTEGER dec_val; boolean ext_bit = p_buf.PER_get_bit(); if (ext_bit) dec_val.PER_decode_normally_small(p_buf, p_options); else dec_val.PER_decode_unaligned_constrained(p_buf, 1, FALSE); int dec_int = dec_val; if (ext_bit) switch (dec_int) { default: enum_value = UNBOUND_VALUE; break; } else switch (dec_int) { case 0: enum_value = transport__resource__unavailable; break; case 1: enum_value = unspecified; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @RUA-IEs.CauseTransport.", dec_int); break; } } void CauseTransport_template::copy_template(const CauseTransport_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; 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 CauseTransport_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 CauseTransport_template(*other_value.implication_.precondition); implication_.implied_template = new CauseTransport_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 enumerated type @RUA-IEs.CauseTransport."); } } CauseTransport_template::CauseTransport_template() { } CauseTransport_template::CauseTransport_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CauseTransport_template::CauseTransport_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!CauseTransport::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RUA-IEs.CauseTransport with unknown numeric value %d.", other_value); single_value = (CauseTransport::enum_type)other_value; } CauseTransport_template::CauseTransport_template(CauseTransport::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } CauseTransport_template::CauseTransport_template(const CauseTransport& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == CauseTransport::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RUA-IEs.CauseTransport."); single_value = other_value.enum_value; } CauseTransport_template::CauseTransport_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CauseTransport::enum_type)(const CauseTransport&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RUA-IEs.CauseTransport from an unbound optional field."); } } CauseTransport_template::CauseTransport_template(CauseTransport_template* p_precondition, CauseTransport_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CauseTransport_template::CauseTransport_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CauseTransport_template::CauseTransport_template(const CauseTransport_template& other_value) : Base_Template() { copy_template(other_value); } CauseTransport_template::~CauseTransport_template() { clean_up(); } boolean CauseTransport_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean CauseTransport_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != CauseTransport::UNBOUND_VALUE; } void CauseTransport_template::clean_up() { switch (template_selection) { 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; } CauseTransport_template& CauseTransport_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CauseTransport_template& CauseTransport_template::operator=(int other_value) { if (!CauseTransport::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RUA-IEs.CauseTransport.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (CauseTransport::enum_type)other_value; return *this; } CauseTransport_template& CauseTransport_template::operator=(CauseTransport::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } CauseTransport_template& CauseTransport_template::operator=(const CauseTransport& other_value) { if (other_value.enum_value == CauseTransport::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CauseTransport to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } CauseTransport_template& CauseTransport_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CauseTransport::enum_type)(const CauseTransport&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RUA-IEs.CauseTransport."); } return *this; } CauseTransport_template& CauseTransport_template::operator=(const CauseTransport_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CauseTransport_template::match(CauseTransport::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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)) 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 enumerated type @RUA-IEs.CauseTransport."); } return FALSE; } boolean CauseTransport_template::match(const CauseTransport& other_value, boolean) const { if (other_value.enum_value == CauseTransport::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RUA-IEs.CauseTransport with an unbound value."); return match(other_value.enum_value); } CauseTransport::enum_type CauseTransport_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RUA-IEs.CauseTransport."); return single_value; } void CauseTransport_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CauseTransport_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RUA-IEs.CauseTransport."); } } CauseTransport_template& CauseTransport_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RUA-IEs.CauseTransport."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RUA-IEs.CauseTransport."); return value_list.list_value[list_index]; } void CauseTransport_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(CauseTransport::enum_to_str(single_value), single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_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 CauseTransport_template::log_match(const CauseTransport& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void CauseTransport_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RUA-IEs.CauseTransport."); } } void CauseTransport_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (CauseTransport::enum_type)text_buf.pull_int().get_val(); if (!CauseTransport::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RUA-IEs.CauseTransport.", single_value); 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 CauseTransport_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RUA-IEs.CauseTransport."); } } boolean CauseTransport_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CauseTransport_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 i=0; iget_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: { CauseTransport_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { CauseTransport::enum_type enum_val = CauseTransport::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!CauseTransport::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RUA-IEs.CauseTransport."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { CauseTransport_template* precondition = new CauseTransport_template; precondition->set_param(*m_p->get_elem(0)); CauseTransport_template* implied_template = new CauseTransport_template; implied_template->set_param(*m_p->get_elem(1)); *this = CauseTransport_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RUA-IEs.CauseTransport"); } is_ifpresent = param.get_ifpresent(); } void CauseTransport_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_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; 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 : "@RUA-IEs.CauseTransport"); } CauseProtocol::CauseProtocol() { enum_value = UNBOUND_VALUE; } CauseProtocol::CauseProtocol(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RUA-IEs.CauseProtocol with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } CauseProtocol::CauseProtocol(enum_type other_value) { enum_value = other_value; } CauseProtocol::CauseProtocol(const CauseProtocol& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RUA-IEs.CauseProtocol."); enum_value = other_value.enum_value; } CauseProtocol& CauseProtocol::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RUA-IEs.CauseProtocol.", other_value); enum_value = (enum_type)other_value; return *this; } CauseProtocol& CauseProtocol::operator=(enum_type other_value) { enum_value = other_value; return *this; } CauseProtocol& CauseProtocol::operator=(const CauseProtocol& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CauseProtocol."); enum_value = other_value.enum_value; return *this; } boolean CauseProtocol::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseProtocol comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean CauseProtocol::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); return enum_value == other_value; } boolean CauseProtocol::operator==(const CauseProtocol& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); return enum_value == other_value.enum_value; } boolean CauseProtocol::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseProtocol comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean CauseProtocol::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); return enum_value < other_value; } boolean CauseProtocol::operator<(const CauseProtocol& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); return enum_value < other_value.enum_value; } boolean CauseProtocol::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseProtocol comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean CauseProtocol::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); return enum_value > other_value; } boolean CauseProtocol::operator>(const CauseProtocol& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseProtocol."); return enum_value > other_value.enum_value; } const char *CauseProtocol::enum_to_str(enum_type enum_par) { switch (enum_par) { case transfer__syntax__error: return "transfer_syntax_error"; case abstract__syntax__error__reject: return "abstract_syntax_error_reject"; case abstract__syntax__error__ignore__and__notify: return "abstract_syntax_error_ignore_and_notify"; case message__not__compatible__with__receiver__state: return "message_not_compatible_with_receiver_state"; case semantic__error: return "semantic_error"; case unspecified: return "unspecified"; case abstract__syntax__error__falsely__constructed__message: return "abstract_syntax_error_falsely_constructed_message"; default: return ""; } } CauseProtocol::enum_type CauseProtocol::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "transfer_syntax_error")) return transfer__syntax__error; if (!strcmp(str_par, "abstract_syntax_error_reject")) return abstract__syntax__error__reject; if (!strcmp(str_par, "abstract_syntax_error_ignore_and_notify")) return abstract__syntax__error__ignore__and__notify; if (!strcmp(str_par, "message_not_compatible_with_receiver_state")) return message__not__compatible__with__receiver__state; if (!strcmp(str_par, "semantic_error")) return semantic__error; if (!strcmp(str_par, "unspecified")) return unspecified; if (!strcmp(str_par, "abstract_syntax_error_falsely_constructed_message")) return abstract__syntax__error__falsely__constructed__message; } return UNKNOWN_VALUE; } boolean CauseProtocol::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: return TRUE; default: return FALSE; } } int CauseProtocol::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CauseProtocol.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int CauseProtocol::enum2int(const CauseProtocol& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CauseProtocol.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void CauseProtocol::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RUA-IEs.CauseProtocol.", int_val); enum_value = (enum_type)int_val; } CauseProtocol::operator CauseProtocol::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RUA-IEs.CauseProtocol."); return enum_value; } void CauseProtocol::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void CauseProtocol::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RUA-IEs.CauseProtocol"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RUA-IEs.CauseProtocol."); } } void CauseProtocol::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RUA-IEs.CauseProtocol."); text_buf.push_int(enum_value); } void CauseProtocol::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RUA-IEs.CauseProtocol.", enum_value); } void CauseProtocol::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CauseProtocol::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CauseProtocol::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { BER_encode_chk_enum_valid(p_td, is_valid_enum(enum_value), enum_value); new_tlv=BER_encode_TLV_INTEGER(p_coding, enum_value); } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CauseProtocol::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { enum_value = UNBOUND_VALUE; BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec("While decoding ENUMERATED type @RUA-IEs.CauseProtocol: "); int tmp_mfr; if (BER_decode_TLV_INTEGER(stripped_tlv, L_form, tmp_mfr)) { BER_decode_chk_enum_valid(p_td, is_valid_enum(tmp_mfr), tmp_mfr); enum_value = (enum_type)tmp_mfr; return TRUE; } else return FALSE; } int CauseProtocol::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CauseProtocol."); return -1; } if (p_td.json->use_null) { return p_tok.put_next_token(JSON_TOKEN_LITERAL_NULL); } char* tmp_str; if (p_td.json->as_number) { tmp_str = mprintf("%d", enum_value); } else { boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (p_td.json->enum_texts[i].index == enum_value) { tmp_str = mprintf("\"%s\"", p_td.json->enum_texts[i].text); text_found = true; break; } } if (!text_found) { tmp_str = mprintf("\"%s\"", enum_to_str(enum_value)); } } int enc_len = p_tok.put_next_token(p_td.json->as_number ? JSON_TOKEN_NUMBER : JSON_TOKEN_STRING, tmp_str); Free(tmp_str); return enc_len; } int CauseProtocol::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { json_token_t token = JSON_TOKEN_NONE; char* value = 0; size_t value_len = 0; boolean error = FALSE; size_t dec_len = 0; boolean use_default = FALSE; if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return dec_len; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { value = const_cast(p_td.json->default_value.str); value_len = strlen(value); use_default = TRUE; } else { dec_len = p_tok.get_next_token(&token, &value, &value_len); } if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_LITERAL_NULL == token && p_td.json->use_null) { enum_value = transfer__syntax__error; } else if (!p_td.json->use_null && ((JSON_TOKEN_STRING == token && !p_td.json->as_number) || use_default)) { if (use_default || (value_len > 2 && value[0] == '\"' && value[value_len - 1] == '\"')) { if (!use_default) value[value_len - 1] = 0; boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (strcmp(p_td.json->enum_texts[i].text, value + (use_default ? 0 : 1)) == 0) { enum_value = static_cast(p_td.json->enum_texts[i].index); text_found = true; break; } } if (!text_found) { enum_value = str_to_enum(value + (use_default ? 0 : 1)); } if (!use_default) value[value_len - 1] = '\"'; if (UNKNOWN_VALUE == enum_value) { error = TRUE; } } else { error = TRUE; } } else if (!p_td.json->use_null && JSON_TOKEN_NUMBER == token && p_td.json->as_number) { char* value_str = mcopystrn(value, value_len); int number = atoi(value_str); if (strchr(value_str, '.') != NULL || strchr(value_str, 'e') != NULL || strchr(value_str, 'E') != NULL) { error = TRUE; } else if (is_valid_enum(number)) { enum_value = static_cast(number); } else { error = TRUE; } Free(value_str); } else { enum_value = UNBOUND_VALUE; return JSON_ERROR_INVALID_TOKEN; } if (error) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FORMAT_ERROR, p_td.json->as_number ? "number" : "string", "enumerated"); enum_value = UNBOUND_VALUE; return JSON_ERROR_FATAL; } return (int)dec_len; } int CauseProtocol::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CauseProtocol."); return -1; } if (enum_value >= 0 && enum_value < 128) { char c = enum_value; p_buf.put_c(c); } else { INTEGER intval(enum_value); TTCN_Buffer buf; intval.OER_encode(INTEGER_descr_, buf); unsigned char* uc = const_cast(buf.get_data()); *uc |= 1 << 7; p_buf.put_buf(buf); } return 0; } int CauseProtocol::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); if (!(uc[0] & 0x80)) { if (is_valid_enum(uc[0])) { enum_value = static_cast(uc[0]); } else { enum_value = UNKNOWN_VALUE; } p_buf.increase_pos(1); } else { unsigned char* uc2 = const_cast(p_buf.get_read_data()); uc2[0] &= ~0x80; INTEGER intval; intval.OER_decode(INTEGER_descr_, p_buf, p_oer); if (is_valid_enum(intval.get_val().get_val())) { enum_value = static_cast(intval.get_val().get_val()); } else { enum_value = UNKNOWN_VALUE; } } return 0; } void CauseProtocol::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; boolean ext_bit = FALSE; switch (enum_value) { case transfer__syntax__error: enc_val = 0; ext_bit = FALSE; break; case abstract__syntax__error__reject: enc_val = 1; ext_bit = FALSE; break; case abstract__syntax__error__ignore__and__notify: enc_val = 2; ext_bit = FALSE; break; case message__not__compatible__with__receiver__state: enc_val = 3; ext_bit = FALSE; break; case semantic__error: enc_val = 4; ext_bit = FALSE; break; case unspecified: enc_val = 5; ext_bit = FALSE; break; case abstract__syntax__error__falsely__constructed__message: enc_val = 6; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @RUA-IEs.CauseProtocol."); } p_buf.PER_put_bit(ext_bit); if (ext_bit) enc_val.PER_encode_normally_small(p_buf, p_options); else INTEGER::PER_encode_int(p_buf, enc_val, 3); } void CauseProtocol::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { INTEGER dec_val; boolean ext_bit = p_buf.PER_get_bit(); if (ext_bit) dec_val.PER_decode_normally_small(p_buf, p_options); else dec_val.PER_decode_unaligned_constrained(p_buf, 3, FALSE); int dec_int = dec_val; if (ext_bit) switch (dec_int) { default: enum_value = UNBOUND_VALUE; break; } else switch (dec_int) { case 0: enum_value = transfer__syntax__error; break; case 1: enum_value = abstract__syntax__error__reject; break; case 2: enum_value = abstract__syntax__error__ignore__and__notify; break; case 3: enum_value = message__not__compatible__with__receiver__state; break; case 4: enum_value = semantic__error; break; case 5: enum_value = unspecified; break; case 6: enum_value = abstract__syntax__error__falsely__constructed__message; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @RUA-IEs.CauseProtocol.", dec_int); break; } } void CauseProtocol_template::copy_template(const CauseProtocol_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; 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 CauseProtocol_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 CauseProtocol_template(*other_value.implication_.precondition); implication_.implied_template = new CauseProtocol_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 enumerated type @RUA-IEs.CauseProtocol."); } } CauseProtocol_template::CauseProtocol_template() { } CauseProtocol_template::CauseProtocol_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CauseProtocol_template::CauseProtocol_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!CauseProtocol::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RUA-IEs.CauseProtocol with unknown numeric value %d.", other_value); single_value = (CauseProtocol::enum_type)other_value; } CauseProtocol_template::CauseProtocol_template(CauseProtocol::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } CauseProtocol_template::CauseProtocol_template(const CauseProtocol& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == CauseProtocol::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RUA-IEs.CauseProtocol."); single_value = other_value.enum_value; } CauseProtocol_template::CauseProtocol_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CauseProtocol::enum_type)(const CauseProtocol&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RUA-IEs.CauseProtocol from an unbound optional field."); } } CauseProtocol_template::CauseProtocol_template(CauseProtocol_template* p_precondition, CauseProtocol_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CauseProtocol_template::CauseProtocol_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CauseProtocol_template::CauseProtocol_template(const CauseProtocol_template& other_value) : Base_Template() { copy_template(other_value); } CauseProtocol_template::~CauseProtocol_template() { clean_up(); } boolean CauseProtocol_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean CauseProtocol_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != CauseProtocol::UNBOUND_VALUE; } void CauseProtocol_template::clean_up() { switch (template_selection) { 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; } CauseProtocol_template& CauseProtocol_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CauseProtocol_template& CauseProtocol_template::operator=(int other_value) { if (!CauseProtocol::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RUA-IEs.CauseProtocol.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (CauseProtocol::enum_type)other_value; return *this; } CauseProtocol_template& CauseProtocol_template::operator=(CauseProtocol::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } CauseProtocol_template& CauseProtocol_template::operator=(const CauseProtocol& other_value) { if (other_value.enum_value == CauseProtocol::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CauseProtocol to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } CauseProtocol_template& CauseProtocol_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CauseProtocol::enum_type)(const CauseProtocol&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RUA-IEs.CauseProtocol."); } return *this; } CauseProtocol_template& CauseProtocol_template::operator=(const CauseProtocol_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CauseProtocol_template::match(CauseProtocol::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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)) 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 enumerated type @RUA-IEs.CauseProtocol."); } return FALSE; } boolean CauseProtocol_template::match(const CauseProtocol& other_value, boolean) const { if (other_value.enum_value == CauseProtocol::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RUA-IEs.CauseProtocol with an unbound value."); return match(other_value.enum_value); } CauseProtocol::enum_type CauseProtocol_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RUA-IEs.CauseProtocol."); return single_value; } void CauseProtocol_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CauseProtocol_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RUA-IEs.CauseProtocol."); } } CauseProtocol_template& CauseProtocol_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RUA-IEs.CauseProtocol."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RUA-IEs.CauseProtocol."); return value_list.list_value[list_index]; } void CauseProtocol_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(CauseProtocol::enum_to_str(single_value), single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_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 CauseProtocol_template::log_match(const CauseProtocol& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void CauseProtocol_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RUA-IEs.CauseProtocol."); } } void CauseProtocol_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (CauseProtocol::enum_type)text_buf.pull_int().get_val(); if (!CauseProtocol::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RUA-IEs.CauseProtocol.", single_value); 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 CauseProtocol_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RUA-IEs.CauseProtocol."); } } boolean CauseProtocol_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CauseProtocol_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 i=0; iget_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: { CauseProtocol_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { CauseProtocol::enum_type enum_val = CauseProtocol::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!CauseProtocol::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RUA-IEs.CauseProtocol."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { CauseProtocol_template* precondition = new CauseProtocol_template; precondition->set_param(*m_p->get_elem(0)); CauseProtocol_template* implied_template = new CauseProtocol_template; implied_template->set_param(*m_p->get_elem(1)); *this = CauseProtocol_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RUA-IEs.CauseProtocol"); } is_ifpresent = param.get_ifpresent(); } void CauseProtocol_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_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; 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 : "@RUA-IEs.CauseProtocol"); } CauseMisc::CauseMisc() { enum_value = UNBOUND_VALUE; } CauseMisc::CauseMisc(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RUA-IEs.CauseMisc with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } CauseMisc::CauseMisc(enum_type other_value) { enum_value = other_value; } CauseMisc::CauseMisc(const CauseMisc& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RUA-IEs.CauseMisc."); enum_value = other_value.enum_value; } CauseMisc& CauseMisc::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RUA-IEs.CauseMisc.", other_value); enum_value = (enum_type)other_value; return *this; } CauseMisc& CauseMisc::operator=(enum_type other_value) { enum_value = other_value; return *this; } CauseMisc& CauseMisc::operator=(const CauseMisc& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CauseMisc."); enum_value = other_value.enum_value; return *this; } boolean CauseMisc::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseMisc comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean CauseMisc::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); return enum_value == other_value; } boolean CauseMisc::operator==(const CauseMisc& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); return enum_value == other_value.enum_value; } boolean CauseMisc::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseMisc comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean CauseMisc::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); return enum_value < other_value; } boolean CauseMisc::operator<(const CauseMisc& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); return enum_value < other_value.enum_value; } boolean CauseMisc::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.CauseMisc comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean CauseMisc::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); return enum_value > other_value; } boolean CauseMisc::operator>(const CauseMisc& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.CauseMisc."); return enum_value > other_value.enum_value; } const char *CauseMisc::enum_to_str(enum_type enum_par) { switch (enum_par) { case processing__overload: return "processing_overload"; case hardware__failure: return "hardware_failure"; case o__and__m__intervention: return "o_and_m_intervention"; case unspecified: return "unspecified"; default: return ""; } } CauseMisc::enum_type CauseMisc::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "processing_overload")) return processing__overload; if (!strcmp(str_par, "hardware_failure")) return hardware__failure; if (!strcmp(str_par, "o_and_m_intervention")) return o__and__m__intervention; if (!strcmp(str_par, "unspecified")) return unspecified; } return UNKNOWN_VALUE; } boolean CauseMisc::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: case 3: return TRUE; default: return FALSE; } } int CauseMisc::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CauseMisc.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int CauseMisc::enum2int(const CauseMisc& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.CauseMisc.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void CauseMisc::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RUA-IEs.CauseMisc.", int_val); enum_value = (enum_type)int_val; } CauseMisc::operator CauseMisc::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RUA-IEs.CauseMisc."); return enum_value; } void CauseMisc::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void CauseMisc::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RUA-IEs.CauseMisc"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RUA-IEs.CauseMisc."); } } void CauseMisc::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RUA-IEs.CauseMisc."); text_buf.push_int(enum_value); } void CauseMisc::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RUA-IEs.CauseMisc.", enum_value); } void CauseMisc::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CauseMisc::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CauseMisc::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { BER_encode_chk_enum_valid(p_td, is_valid_enum(enum_value), enum_value); new_tlv=BER_encode_TLV_INTEGER(p_coding, enum_value); } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CauseMisc::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { enum_value = UNBOUND_VALUE; BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec("While decoding ENUMERATED type @RUA-IEs.CauseMisc: "); int tmp_mfr; if (BER_decode_TLV_INTEGER(stripped_tlv, L_form, tmp_mfr)) { BER_decode_chk_enum_valid(p_td, is_valid_enum(tmp_mfr), tmp_mfr); enum_value = (enum_type)tmp_mfr; return TRUE; } else return FALSE; } int CauseMisc::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CauseMisc."); return -1; } if (p_td.json->use_null) { return p_tok.put_next_token(JSON_TOKEN_LITERAL_NULL); } char* tmp_str; if (p_td.json->as_number) { tmp_str = mprintf("%d", enum_value); } else { boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (p_td.json->enum_texts[i].index == enum_value) { tmp_str = mprintf("\"%s\"", p_td.json->enum_texts[i].text); text_found = true; break; } } if (!text_found) { tmp_str = mprintf("\"%s\"", enum_to_str(enum_value)); } } int enc_len = p_tok.put_next_token(p_td.json->as_number ? JSON_TOKEN_NUMBER : JSON_TOKEN_STRING, tmp_str); Free(tmp_str); return enc_len; } int CauseMisc::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { json_token_t token = JSON_TOKEN_NONE; char* value = 0; size_t value_len = 0; boolean error = FALSE; size_t dec_len = 0; boolean use_default = FALSE; if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return dec_len; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { value = const_cast(p_td.json->default_value.str); value_len = strlen(value); use_default = TRUE; } else { dec_len = p_tok.get_next_token(&token, &value, &value_len); } if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_LITERAL_NULL == token && p_td.json->use_null) { enum_value = processing__overload; } else if (!p_td.json->use_null && ((JSON_TOKEN_STRING == token && !p_td.json->as_number) || use_default)) { if (use_default || (value_len > 2 && value[0] == '\"' && value[value_len - 1] == '\"')) { if (!use_default) value[value_len - 1] = 0; boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (strcmp(p_td.json->enum_texts[i].text, value + (use_default ? 0 : 1)) == 0) { enum_value = static_cast(p_td.json->enum_texts[i].index); text_found = true; break; } } if (!text_found) { enum_value = str_to_enum(value + (use_default ? 0 : 1)); } if (!use_default) value[value_len - 1] = '\"'; if (UNKNOWN_VALUE == enum_value) { error = TRUE; } } else { error = TRUE; } } else if (!p_td.json->use_null && JSON_TOKEN_NUMBER == token && p_td.json->as_number) { char* value_str = mcopystrn(value, value_len); int number = atoi(value_str); if (strchr(value_str, '.') != NULL || strchr(value_str, 'e') != NULL || strchr(value_str, 'E') != NULL) { error = TRUE; } else if (is_valid_enum(number)) { enum_value = static_cast(number); } else { error = TRUE; } Free(value_str); } else { enum_value = UNBOUND_VALUE; return JSON_ERROR_INVALID_TOKEN; } if (error) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FORMAT_ERROR, p_td.json->as_number ? "number" : "string", "enumerated"); enum_value = UNBOUND_VALUE; return JSON_ERROR_FATAL; } return (int)dec_len; } int CauseMisc::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.CauseMisc."); return -1; } if (enum_value >= 0 && enum_value < 128) { char c = enum_value; p_buf.put_c(c); } else { INTEGER intval(enum_value); TTCN_Buffer buf; intval.OER_encode(INTEGER_descr_, buf); unsigned char* uc = const_cast(buf.get_data()); *uc |= 1 << 7; p_buf.put_buf(buf); } return 0; } int CauseMisc::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); if (!(uc[0] & 0x80)) { if (is_valid_enum(uc[0])) { enum_value = static_cast(uc[0]); } else { enum_value = UNKNOWN_VALUE; } p_buf.increase_pos(1); } else { unsigned char* uc2 = const_cast(p_buf.get_read_data()); uc2[0] &= ~0x80; INTEGER intval; intval.OER_decode(INTEGER_descr_, p_buf, p_oer); if (is_valid_enum(intval.get_val().get_val())) { enum_value = static_cast(intval.get_val().get_val()); } else { enum_value = UNKNOWN_VALUE; } } return 0; } void CauseMisc::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; boolean ext_bit = FALSE; switch (enum_value) { case processing__overload: enc_val = 0; ext_bit = FALSE; break; case hardware__failure: enc_val = 1; ext_bit = FALSE; break; case o__and__m__intervention: enc_val = 2; ext_bit = FALSE; break; case unspecified: enc_val = 3; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @RUA-IEs.CauseMisc."); } p_buf.PER_put_bit(ext_bit); if (ext_bit) enc_val.PER_encode_normally_small(p_buf, p_options); else INTEGER::PER_encode_int(p_buf, enc_val, 2); } void CauseMisc::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { INTEGER dec_val; boolean ext_bit = p_buf.PER_get_bit(); if (ext_bit) dec_val.PER_decode_normally_small(p_buf, p_options); else dec_val.PER_decode_unaligned_constrained(p_buf, 2, FALSE); int dec_int = dec_val; if (ext_bit) switch (dec_int) { default: enum_value = UNBOUND_VALUE; break; } else switch (dec_int) { case 0: enum_value = processing__overload; break; case 1: enum_value = hardware__failure; break; case 2: enum_value = o__and__m__intervention; break; case 3: enum_value = unspecified; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @RUA-IEs.CauseMisc.", dec_int); break; } } void CauseMisc_template::copy_template(const CauseMisc_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; 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 CauseMisc_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 CauseMisc_template(*other_value.implication_.precondition); implication_.implied_template = new CauseMisc_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 enumerated type @RUA-IEs.CauseMisc."); } } CauseMisc_template::CauseMisc_template() { } CauseMisc_template::CauseMisc_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CauseMisc_template::CauseMisc_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!CauseMisc::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RUA-IEs.CauseMisc with unknown numeric value %d.", other_value); single_value = (CauseMisc::enum_type)other_value; } CauseMisc_template::CauseMisc_template(CauseMisc::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } CauseMisc_template::CauseMisc_template(const CauseMisc& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == CauseMisc::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RUA-IEs.CauseMisc."); single_value = other_value.enum_value; } CauseMisc_template::CauseMisc_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CauseMisc::enum_type)(const CauseMisc&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RUA-IEs.CauseMisc from an unbound optional field."); } } CauseMisc_template::CauseMisc_template(CauseMisc_template* p_precondition, CauseMisc_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CauseMisc_template::CauseMisc_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CauseMisc_template::CauseMisc_template(const CauseMisc_template& other_value) : Base_Template() { copy_template(other_value); } CauseMisc_template::~CauseMisc_template() { clean_up(); } boolean CauseMisc_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean CauseMisc_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != CauseMisc::UNBOUND_VALUE; } void CauseMisc_template::clean_up() { switch (template_selection) { 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; } CauseMisc_template& CauseMisc_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CauseMisc_template& CauseMisc_template::operator=(int other_value) { if (!CauseMisc::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RUA-IEs.CauseMisc.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (CauseMisc::enum_type)other_value; return *this; } CauseMisc_template& CauseMisc_template::operator=(CauseMisc::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } CauseMisc_template& CauseMisc_template::operator=(const CauseMisc& other_value) { if (other_value.enum_value == CauseMisc::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.CauseMisc to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } CauseMisc_template& CauseMisc_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CauseMisc::enum_type)(const CauseMisc&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RUA-IEs.CauseMisc."); } return *this; } CauseMisc_template& CauseMisc_template::operator=(const CauseMisc_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CauseMisc_template::match(CauseMisc::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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)) 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 enumerated type @RUA-IEs.CauseMisc."); } return FALSE; } boolean CauseMisc_template::match(const CauseMisc& other_value, boolean) const { if (other_value.enum_value == CauseMisc::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RUA-IEs.CauseMisc with an unbound value."); return match(other_value.enum_value); } CauseMisc::enum_type CauseMisc_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RUA-IEs.CauseMisc."); return single_value; } void CauseMisc_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CauseMisc_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RUA-IEs.CauseMisc."); } } CauseMisc_template& CauseMisc_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RUA-IEs.CauseMisc."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RUA-IEs.CauseMisc."); return value_list.list_value[list_index]; } void CauseMisc_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(CauseMisc::enum_to_str(single_value), single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_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 CauseMisc_template::log_match(const CauseMisc& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void CauseMisc_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RUA-IEs.CauseMisc."); } } void CauseMisc_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (CauseMisc::enum_type)text_buf.pull_int().get_val(); if (!CauseMisc::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RUA-IEs.CauseMisc.", single_value); 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 CauseMisc_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RUA-IEs.CauseMisc."); } } boolean CauseMisc_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CauseMisc_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 i=0; iget_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: { CauseMisc_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { CauseMisc::enum_type enum_val = CauseMisc::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!CauseMisc::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RUA-IEs.CauseMisc."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { CauseMisc_template* precondition = new CauseMisc_template; precondition->set_param(*m_p->get_elem(0)); CauseMisc_template* implied_template = new CauseMisc_template; implied_template->set_param(*m_p->get_elem(1)); *this = CauseMisc_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RUA-IEs.CauseMisc"); } is_ifpresent = param.get_ifpresent(); } void CauseMisc_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_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; 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 : "@RUA-IEs.CauseMisc"); } CriticalityDiagnostics::CriticalityDiagnostics() { } CriticalityDiagnostics::CriticalityDiagnostics(const OPTIONAL< INTEGER >& par_procedureCode, const OPTIONAL< RUA__CommonDataTypes::TriggeringMessage >& par_triggeringMessage, const OPTIONAL< RUA__CommonDataTypes::Criticality >& par_procedureCriticality, const OPTIONAL< CriticalityDiagnostics__IE__List >& par_iEsCriticalityDiagnostics, const OPTIONAL< _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 >& par_iE__Extensions) : field_procedureCode(par_procedureCode), field_triggeringMessage(par_triggeringMessage), field_procedureCriticality(par_procedureCriticality), field_iEsCriticalityDiagnostics(par_iEsCriticalityDiagnostics), field_iE__Extensions(par_iE__Extensions) { } CriticalityDiagnostics::CriticalityDiagnostics(const CriticalityDiagnostics& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RUA-IEs.CriticalityDiagnostics."); if (other_value.procedureCode().is_bound()) field_procedureCode = other_value.procedureCode(); else field_procedureCode.clean_up(); if (other_value.triggeringMessage().is_bound()) field_triggeringMessage = other_value.triggeringMessage(); else field_triggeringMessage.clean_up(); if (other_value.procedureCriticality().is_bound()) field_procedureCriticality = other_value.procedureCriticality(); else field_procedureCriticality.clean_up(); if (other_value.iEsCriticalityDiagnostics().is_bound()) field_iEsCriticalityDiagnostics = other_value.iEsCriticalityDiagnostics(); else field_iEsCriticalityDiagnostics.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void CriticalityDiagnostics::clean_up() { field_procedureCode.clean_up(); field_triggeringMessage.clean_up(); field_procedureCriticality.clean_up(); field_iEsCriticalityDiagnostics.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* CriticalityDiagnostics::get_descriptor() const { return &CriticalityDiagnostics_descr_; } CriticalityDiagnostics& CriticalityDiagnostics::operator=(const CriticalityDiagnostics& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RUA-IEs.CriticalityDiagnostics."); if (other_value.procedureCode().is_bound()) field_procedureCode = other_value.procedureCode(); else field_procedureCode.clean_up(); if (other_value.triggeringMessage().is_bound()) field_triggeringMessage = other_value.triggeringMessage(); else field_triggeringMessage.clean_up(); if (other_value.procedureCriticality().is_bound()) field_procedureCriticality = other_value.procedureCriticality(); else field_procedureCriticality.clean_up(); if (other_value.iEsCriticalityDiagnostics().is_bound()) field_iEsCriticalityDiagnostics = other_value.iEsCriticalityDiagnostics(); else field_iEsCriticalityDiagnostics.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } return *this; } boolean CriticalityDiagnostics::operator==(const CriticalityDiagnostics& other_value) const { return field_procedureCode==other_value.field_procedureCode && field_triggeringMessage==other_value.field_triggeringMessage && field_procedureCriticality==other_value.field_procedureCriticality && field_iEsCriticalityDiagnostics==other_value.field_iEsCriticalityDiagnostics && field_iE__Extensions==other_value.field_iE__Extensions; } boolean CriticalityDiagnostics::is_bound() const { return (OPTIONAL_OMIT == field_procedureCode.get_selection() || field_procedureCode.is_bound()) || (OPTIONAL_OMIT == field_triggeringMessage.get_selection() || field_triggeringMessage.is_bound()) || (OPTIONAL_OMIT == field_procedureCriticality.get_selection() || field_procedureCriticality.is_bound()) || (OPTIONAL_OMIT == field_iEsCriticalityDiagnostics.get_selection() || field_iEsCriticalityDiagnostics.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean CriticalityDiagnostics::is_value() const { return (OPTIONAL_OMIT == field_procedureCode.get_selection() || field_procedureCode.is_value()) && (OPTIONAL_OMIT == field_triggeringMessage.get_selection() || field_triggeringMessage.is_value()) && (OPTIONAL_OMIT == field_procedureCriticality.get_selection() || field_procedureCriticality.is_value()) && (OPTIONAL_OMIT == field_iEsCriticalityDiagnostics.get_selection() || field_iEsCriticalityDiagnostics.is_value()) && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int CriticalityDiagnostics::size_of() const { int ret_val = 0; if (field_procedureCode.ispresent()) ret_val++; if (field_triggeringMessage.ispresent()) ret_val++; if (field_procedureCriticality.ispresent()) ret_val++; if (field_iEsCriticalityDiagnostics.ispresent()) ret_val++; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void CriticalityDiagnostics::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ procedureCode := "); field_procedureCode.log(); TTCN_Logger::log_event_str(", triggeringMessage := "); field_triggeringMessage.log(); TTCN_Logger::log_event_str(", procedureCriticality := "); field_procedureCriticality.log(); TTCN_Logger::log_event_str(", iEsCriticalityDiagnostics := "); field_iEsCriticalityDiagnostics.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void CriticalityDiagnostics::set_implicit_omit() { if (!procedureCode().is_bound()) procedureCode() = OMIT_VALUE; else procedureCode().set_implicit_omit(); if (!triggeringMessage().is_bound()) triggeringMessage() = OMIT_VALUE; else triggeringMessage().set_implicit_omit(); if (!procedureCriticality().is_bound()) procedureCriticality() = OMIT_VALUE; else procedureCriticality().set_implicit_omit(); if (!iEsCriticalityDiagnostics().is_bound()) iEsCriticalityDiagnostics() = OMIT_VALUE; else iEsCriticalityDiagnostics().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void CriticalityDiagnostics::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 (50 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) procedureCode().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) triggeringMessage().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) procedureCriticality().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iEsCriticalityDiagnostics().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().set_param(*param.get_elem(4)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "procedureCode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { procedureCode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "triggeringMessage")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { triggeringMessage().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "procedureCriticality")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { procedureCriticality().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iEsCriticalityDiagnostics")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEsCriticalityDiagnostics().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iE_Extensions")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iE__Extensions().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.CriticalityDiagnostics: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.CriticalityDiagnostics"); } } void CriticalityDiagnostics::encode_text(Text_Buf& text_buf) const { field_procedureCode.encode_text(text_buf); field_triggeringMessage.encode_text(text_buf); field_procedureCriticality.encode_text(text_buf); field_iEsCriticalityDiagnostics.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void CriticalityDiagnostics::decode_text(Text_Buf& text_buf) { field_procedureCode.decode_text(text_buf); field_triggeringMessage.decode_text(text_buf); field_procedureCriticality.decode_text(text_buf); field_iEsCriticalityDiagnostics.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void CriticalityDiagnostics::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CriticalityDiagnostics::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CriticalityDiagnostics::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("procedureCode': "); new_tlv->add_TLV(field_procedureCode.BER_encode_TLV(CriticalityDiagnostics_procedureCode_descr_, p_coding)); ec_1.set_msg("triggeringMessage': "); new_tlv->add_TLV(field_triggeringMessage.BER_encode_TLV(CriticalityDiagnostics_triggeringMessage_descr_, p_coding)); ec_1.set_msg("procedureCriticality': "); new_tlv->add_TLV(field_procedureCriticality.BER_encode_TLV(CriticalityDiagnostics_procedureCriticality_descr_, p_coding)); ec_1.set_msg("iEsCriticalityDiagnostics': "); new_tlv->add_TLV(field_iEsCriticalityDiagnostics.BER_encode_TLV(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(CriticalityDiagnostics_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CriticalityDiagnostics::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.CriticalityDiagnostics' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("procedureCode': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_procedureCode=OMIT_VALUE; else { field_procedureCode.BER_decode_TLV(CriticalityDiagnostics_procedureCode_descr_, tmp_tlv, L_form); if(field_procedureCode.ispresent()) tlv_present=FALSE; } ec_2.set_msg("triggeringMessage': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_triggeringMessage=OMIT_VALUE; else { field_triggeringMessage.BER_decode_TLV(CriticalityDiagnostics_triggeringMessage_descr_, tmp_tlv, L_form); if(field_triggeringMessage.ispresent()) tlv_present=FALSE; } ec_2.set_msg("procedureCriticality': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_procedureCriticality=OMIT_VALUE; else { field_procedureCriticality.BER_decode_TLV(CriticalityDiagnostics_procedureCriticality_descr_, tmp_tlv, L_form); if(field_procedureCriticality.ispresent()) tlv_present=FALSE; } ec_2.set_msg("iEsCriticalityDiagnostics': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_iEsCriticalityDiagnostics=OMIT_VALUE; else { field_iEsCriticalityDiagnostics.BER_decode_TLV(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, tmp_tlv, L_form); if(field_iEsCriticalityDiagnostics.ispresent()) tlv_present=FALSE; } ec_2.set_msg("iE_Extensions': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_iE__Extensions=OMIT_VALUE; else { field_iE__Extensions.BER_decode_TLV(CriticalityDiagnostics_iE__Extensions_descr_, tmp_tlv, L_form); if(field_iE__Extensions.ispresent()) tlv_present=FALSE; } } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int CriticalityDiagnostics::JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.CriticalityDiagnostics."); return -1; } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); if (field_procedureCode.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "procedureCode"); enc_len += field_procedureCode.JSON_encode(CriticalityDiagnostics_procedureCode_descr_, p_tok, FALSE); } if (field_triggeringMessage.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "triggeringMessage"); enc_len += field_triggeringMessage.JSON_encode(CriticalityDiagnostics_triggeringMessage_descr_, p_tok, FALSE); } if (field_procedureCriticality.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "procedureCriticality"); enc_len += field_procedureCriticality.JSON_encode(CriticalityDiagnostics_procedureCriticality_descr_, p_tok, FALSE); } if (field_iEsCriticalityDiagnostics.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iEsCriticalityDiagnostics"); enc_len += field_iEsCriticalityDiagnostics.JSON_encode(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, p_tok, FALSE); } if (field_iE__Extensions.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iE_Extensions"); enc_len += field_iE__Extensions.JSON_encode(CriticalityDiagnostics_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int CriticalityDiagnostics::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean procedureCode_found = FALSE; boolean triggeringMessage_found = FALSE; boolean procedureCriticality_found = FALSE; boolean iEsCriticalityDiagnostics_found = FALSE; boolean iE__Extensions_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (13 == name_len && 0 == strncmp(fld_name, "procedureCode", name_len)) { procedureCode_found = TRUE; int ret_val = field_procedureCode.JSON_decode(CriticalityDiagnostics_procedureCode_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 13, "procedureCode"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (17 == name_len && 0 == strncmp(fld_name, "triggeringMessage", name_len)) { triggeringMessage_found = TRUE; int ret_val = field_triggeringMessage.JSON_decode(CriticalityDiagnostics_triggeringMessage_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 17, "triggeringMessage"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (20 == name_len && 0 == strncmp(fld_name, "procedureCriticality", name_len)) { procedureCriticality_found = TRUE; int ret_val = field_procedureCriticality.JSON_decode(CriticalityDiagnostics_procedureCriticality_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 20, "procedureCriticality"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (25 == name_len && 0 == strncmp(fld_name, "iEsCriticalityDiagnostics", name_len)) { iEsCriticalityDiagnostics_found = TRUE; int ret_val = field_iEsCriticalityDiagnostics.JSON_decode(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 25, "iEsCriticalityDiagnostics"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (13 == name_len && 0 == strncmp(fld_name, "iE_Extensions", name_len)) { iE__Extensions_found = TRUE; int ret_val = field_iE__Extensions.JSON_decode(CriticalityDiagnostics_iE__Extensions_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 13, "iE_Extensions"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!procedureCode_found) { field_procedureCode = OMIT_VALUE; } if (!triggeringMessage_found) { field_triggeringMessage = OMIT_VALUE; } if (!procedureCriticality_found) { field_procedureCriticality = OMIT_VALUE; } if (!iEsCriticalityDiagnostics_found) { field_iEsCriticalityDiagnostics = OMIT_VALUE; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int CriticalityDiagnostics::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } char c = 0; if (field_procedureCode.is_present()) { c |= 64; } if (field_triggeringMessage.is_present()) { c |= 32; } if (field_procedureCriticality.is_present()) { c |= 16; } if (field_iEsCriticalityDiagnostics.is_present()) { c |= 8; } if (field_iE__Extensions.is_present()) { c |= 4; } p_buf.put_c(c); if (field_procedureCode.is_present()) field_procedureCode.OER_encode(CriticalityDiagnostics_procedureCode_descr_, p_buf); if (field_triggeringMessage.is_present()) field_triggeringMessage.OER_encode(CriticalityDiagnostics_triggeringMessage_descr_, p_buf); if (field_procedureCriticality.is_present()) field_procedureCriticality.OER_encode(CriticalityDiagnostics_procedureCriticality_descr_, p_buf); if (field_iEsCriticalityDiagnostics.is_present()) field_iEsCriticalityDiagnostics.OER_encode(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(CriticalityDiagnostics_iE__Extensions_descr_, p_buf); return 0; } int CriticalityDiagnostics::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); p_buf.increase_pos(1); boolean has_extension = FALSE; if (uc[0] & 0x80) { has_extension = TRUE; } if (uc[0] & 64) field_procedureCode.OER_decode(CriticalityDiagnostics_procedureCode_descr_, p_buf, p_oer); else field_procedureCode = OMIT_VALUE; if (uc[0] & 32) field_triggeringMessage.OER_decode(CriticalityDiagnostics_triggeringMessage_descr_, p_buf, p_oer); else field_triggeringMessage = OMIT_VALUE; if (uc[0] & 16) field_procedureCriticality.OER_decode(CriticalityDiagnostics_procedureCriticality_descr_, p_buf, p_oer); else field_procedureCriticality = OMIT_VALUE; if (uc[0] & 8) field_iEsCriticalityDiagnostics.OER_decode(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, p_buf, p_oer); else field_iEsCriticalityDiagnostics = OMIT_VALUE; if (uc[0] & 4) field_iE__Extensions.OER_decode(CriticalityDiagnostics_iE__Extensions_descr_, p_buf, p_oer); else field_iE__Extensions = OMIT_VALUE; if (has_extension) { size_t bytes = decode_oer_length(p_buf, FALSE); uc = p_buf.get_read_data(); p_buf.increase_pos(bytes); uc++; } return 0; } void CriticalityDiagnostics::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } boolean ext_bit = FALSE; p_buf.PER_put_bit(ext_bit); boolean field_procedureCode_present = field_procedureCode.is_present(); p_buf.PER_put_bit(field_procedureCode_present); boolean field_triggeringMessage_present = field_triggeringMessage.is_present(); p_buf.PER_put_bit(field_triggeringMessage_present); boolean field_procedureCriticality_present = field_procedureCriticality.is_present(); p_buf.PER_put_bit(field_procedureCriticality_present); boolean field_iEsCriticalityDiagnostics_present = field_iEsCriticalityDiagnostics.is_present(); p_buf.PER_put_bit(field_iEsCriticalityDiagnostics_present); boolean field_iE__Extensions_present = field_iE__Extensions.is_present(); p_buf.PER_put_bit(field_iE__Extensions_present); if (field_procedureCode_present) field_procedureCode.PER_encode(CriticalityDiagnostics_procedureCode_descr_, p_buf, p_options); if (field_triggeringMessage_present) field_triggeringMessage.PER_encode(CriticalityDiagnostics_triggeringMessage_descr_, p_buf, p_options); if (field_procedureCriticality_present) field_procedureCriticality.PER_encode(CriticalityDiagnostics_procedureCriticality_descr_, p_buf, p_options); if (field_iEsCriticalityDiagnostics_present) field_iEsCriticalityDiagnostics.PER_encode(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(CriticalityDiagnostics_iE__Extensions_descr_, p_buf, p_options); } void CriticalityDiagnostics::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); boolean ext_bit = p_buf.PER_get_bit(); boolean field_procedureCode_present = p_buf.PER_get_bit(); boolean field_triggeringMessage_present = p_buf.PER_get_bit(); boolean field_procedureCriticality_present = p_buf.PER_get_bit(); boolean field_iEsCriticalityDiagnostics_present = p_buf.PER_get_bit(); boolean field_iE__Extensions_present = p_buf.PER_get_bit(); if (field_procedureCode_present) field_procedureCode.PER_decode(CriticalityDiagnostics_procedureCode_descr_, p_buf, p_options); else field_procedureCode = OMIT_VALUE; if (field_triggeringMessage_present) field_triggeringMessage.PER_decode(CriticalityDiagnostics_triggeringMessage_descr_, p_buf, p_options); else field_triggeringMessage = OMIT_VALUE; if (field_procedureCriticality_present) field_procedureCriticality.PER_decode(CriticalityDiagnostics_procedureCriticality_descr_, p_buf, p_options); else field_procedureCriticality = OMIT_VALUE; if (field_iEsCriticalityDiagnostics_present) field_iEsCriticalityDiagnostics.PER_decode(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, p_buf, p_options); else field_iEsCriticalityDiagnostics = OMIT_VALUE; if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(CriticalityDiagnostics_iE__Extensions_descr_, p_buf, p_options); else field_iE__Extensions = OMIT_VALUE; Vector ext_presences; if (ext_bit) { INTEGER length_; int normally_small_length = TRUE; int mul_16k; do { mul_16k = length_.PER_decode_length(p_buf, p_options, normally_small_length); if (mul_16k > 0) normally_small_length = FALSE; for (int i = 0; i < length_; ++i) { ext_presences.push_back(p_buf.PER_get_bit()); } } while (mul_16k > 0); } int nof_decoded_ext_adds = ext_presences.size(); for (int i = 0; i < nof_decoded_ext_adds; ++i) { if (ext_presences[i]) PER_skip_opentype(p_buf, p_options); } } struct CriticalityDiagnostics_template::single_value_struct { INTEGER_template field_procedureCode; RUA__CommonDataTypes::TriggeringMessage_template field_triggeringMessage; RUA__CommonDataTypes::Criticality_template field_procedureCriticality; CriticalityDiagnostics__IE__List_template field_iEsCriticalityDiagnostics; _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template field_iE__Extensions; }; void CriticalityDiagnostics_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_procedureCode = ANY_OR_OMIT; single_value->field_triggeringMessage = ANY_OR_OMIT; single_value->field_procedureCriticality = ANY_OR_OMIT; single_value->field_iEsCriticalityDiagnostics = ANY_OR_OMIT; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void CriticalityDiagnostics_template::copy_value(const CriticalityDiagnostics& other_value) { single_value = new single_value_struct; if (other_value.procedureCode().is_bound()) { if (other_value.procedureCode().ispresent()) single_value->field_procedureCode = other_value.procedureCode()(); else single_value->field_procedureCode = OMIT_VALUE; } else { single_value->field_procedureCode.clean_up(); } if (other_value.triggeringMessage().is_bound()) { if (other_value.triggeringMessage().ispresent()) single_value->field_triggeringMessage = other_value.triggeringMessage()(); else single_value->field_triggeringMessage = OMIT_VALUE; } else { single_value->field_triggeringMessage.clean_up(); } if (other_value.procedureCriticality().is_bound()) { if (other_value.procedureCriticality().ispresent()) single_value->field_procedureCriticality = other_value.procedureCriticality()(); else single_value->field_procedureCriticality = OMIT_VALUE; } else { single_value->field_procedureCriticality.clean_up(); } if (other_value.iEsCriticalityDiagnostics().is_bound()) { if (other_value.iEsCriticalityDiagnostics().ispresent()) single_value->field_iEsCriticalityDiagnostics = other_value.iEsCriticalityDiagnostics()(); else single_value->field_iEsCriticalityDiagnostics = OMIT_VALUE; } else { single_value->field_iEsCriticalityDiagnostics.clean_up(); } if (other_value.iE__Extensions().is_bound()) { if (other_value.iE__Extensions().ispresent()) single_value->field_iE__Extensions = other_value.iE__Extensions()(); else single_value->field_iE__Extensions = OMIT_VALUE; } else { single_value->field_iE__Extensions.clean_up(); } set_selection(SPECIFIC_VALUE); } void CriticalityDiagnostics_template::copy_template(const CriticalityDiagnostics_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.procedureCode().get_selection()) { single_value->field_procedureCode = other_value.procedureCode(); } else { single_value->field_procedureCode.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.triggeringMessage().get_selection()) { single_value->field_triggeringMessage = other_value.triggeringMessage(); } else { single_value->field_triggeringMessage.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.procedureCriticality().get_selection()) { single_value->field_procedureCriticality = other_value.procedureCriticality(); } else { single_value->field_procedureCriticality.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.iEsCriticalityDiagnostics().get_selection()) { single_value->field_iEsCriticalityDiagnostics = other_value.iEsCriticalityDiagnostics(); } else { single_value->field_iEsCriticalityDiagnostics.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.iE__Extensions().get_selection()) { single_value->field_iE__Extensions = other_value.iE__Extensions(); } else { single_value->field_iE__Extensions.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 CriticalityDiagnostics_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 CriticalityDiagnostics_template(*other_value.implication_.precondition); implication_.implied_template = new CriticalityDiagnostics_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 @RUA-IEs.CriticalityDiagnostics."); break; } set_selection(other_value); } CriticalityDiagnostics_template::CriticalityDiagnostics_template() { } CriticalityDiagnostics_template::CriticalityDiagnostics_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CriticalityDiagnostics_template::CriticalityDiagnostics_template(const CriticalityDiagnostics& other_value) { copy_value(other_value); } CriticalityDiagnostics_template::CriticalityDiagnostics_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const CriticalityDiagnostics&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.CriticalityDiagnostics from an unbound optional field."); } } CriticalityDiagnostics_template::CriticalityDiagnostics_template(CriticalityDiagnostics_template* p_precondition, CriticalityDiagnostics_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CriticalityDiagnostics_template::CriticalityDiagnostics_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CriticalityDiagnostics_template::CriticalityDiagnostics_template(const CriticalityDiagnostics_template& other_value) : Base_Template() { copy_template(other_value); } CriticalityDiagnostics_template::~CriticalityDiagnostics_template() { clean_up(); } CriticalityDiagnostics_template& CriticalityDiagnostics_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CriticalityDiagnostics_template& CriticalityDiagnostics_template::operator=(const CriticalityDiagnostics& other_value) { clean_up(); copy_value(other_value); return *this; } CriticalityDiagnostics_template& CriticalityDiagnostics_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const CriticalityDiagnostics&)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 @RUA-IEs.CriticalityDiagnostics."); } return *this; } CriticalityDiagnostics_template& CriticalityDiagnostics_template::operator=(const CriticalityDiagnostics_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CriticalityDiagnostics_template::match(const CriticalityDiagnostics& 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.procedureCode().is_bound()) return FALSE; if((other_value.procedureCode().ispresent() ? !single_value->field_procedureCode.match((const INTEGER&)other_value.procedureCode(), legacy) : !single_value->field_procedureCode.match_omit(legacy)))return FALSE; if(!other_value.triggeringMessage().is_bound()) return FALSE; if((other_value.triggeringMessage().ispresent() ? !single_value->field_triggeringMessage.match((const RUA__CommonDataTypes::TriggeringMessage&)other_value.triggeringMessage(), legacy) : !single_value->field_triggeringMessage.match_omit(legacy)))return FALSE; if(!other_value.procedureCriticality().is_bound()) return FALSE; if((other_value.procedureCriticality().ispresent() ? !single_value->field_procedureCriticality.match((const RUA__CommonDataTypes::Criticality&)other_value.procedureCriticality(), legacy) : !single_value->field_procedureCriticality.match_omit(legacy)))return FALSE; if(!other_value.iEsCriticalityDiagnostics().is_bound()) return FALSE; if((other_value.iEsCriticalityDiagnostics().ispresent() ? !single_value->field_iEsCriticalityDiagnostics.match((const CriticalityDiagnostics__IE__List&)other_value.iEsCriticalityDiagnostics(), legacy) : !single_value->field_iEsCriticalityDiagnostics.match_omit(legacy)))return FALSE; if(!other_value.iE__Extensions().is_bound()) return FALSE; if((other_value.iE__Extensions().ispresent() ? !single_value->field_iE__Extensions.match((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2&)other_value.iE__Extensions(), legacy) : !single_value->field_iE__Extensions.match_omit(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 @RUA-IEs.CriticalityDiagnostics."); } return FALSE; } boolean CriticalityDiagnostics_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return (single_value->field_procedureCode.is_omit() || single_value->field_procedureCode.is_bound()) || (single_value->field_triggeringMessage.is_omit() || single_value->field_triggeringMessage.is_bound()) || (single_value->field_procedureCriticality.is_omit() || single_value->field_procedureCriticality.is_bound()) || (single_value->field_iEsCriticalityDiagnostics.is_omit() || single_value->field_iEsCriticalityDiagnostics.is_bound()) || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean CriticalityDiagnostics_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return (single_value->field_procedureCode.is_omit() || single_value->field_procedureCode.is_value()) && (single_value->field_triggeringMessage.is_omit() || single_value->field_triggeringMessage.is_value()) && (single_value->field_procedureCriticality.is_omit() || single_value->field_procedureCriticality.is_value()) && (single_value->field_iEsCriticalityDiagnostics.is_omit() || single_value->field_iEsCriticalityDiagnostics.is_value()) && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void CriticalityDiagnostics_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; } CriticalityDiagnostics CriticalityDiagnostics_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 @RUA-IEs.CriticalityDiagnostics."); CriticalityDiagnostics ret_val; if (single_value->field_procedureCode.is_omit()) ret_val.procedureCode() = OMIT_VALUE; else if (single_value->field_procedureCode.is_bound()) { ret_val.procedureCode() = single_value->field_procedureCode.valueof(); } if (single_value->field_triggeringMessage.is_omit()) ret_val.triggeringMessage() = OMIT_VALUE; else if (single_value->field_triggeringMessage.is_bound()) { ret_val.triggeringMessage() = single_value->field_triggeringMessage.valueof(); } if (single_value->field_procedureCriticality.is_omit()) ret_val.procedureCriticality() = OMIT_VALUE; else if (single_value->field_procedureCriticality.is_bound()) { ret_val.procedureCriticality() = single_value->field_procedureCriticality.valueof(); } if (single_value->field_iEsCriticalityDiagnostics.is_omit()) ret_val.iEsCriticalityDiagnostics() = OMIT_VALUE; else if (single_value->field_iEsCriticalityDiagnostics.is_bound()) { ret_val.iEsCriticalityDiagnostics() = single_value->field_iEsCriticalityDiagnostics.valueof(); } if (single_value->field_iE__Extensions.is_omit()) ret_val.iE__Extensions() = OMIT_VALUE; else if (single_value->field_iE__Extensions.is_bound()) { ret_val.iE__Extensions() = single_value->field_iE__Extensions.valueof(); } return ret_val; } void CriticalityDiagnostics_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 @RUA-IEs.CriticalityDiagnostics."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CriticalityDiagnostics_template[list_length]; } CriticalityDiagnostics_template& CriticalityDiagnostics_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 @RUA-IEs.CriticalityDiagnostics."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.CriticalityDiagnostics."); return value_list.list_value[list_index]; } INTEGER_template& CriticalityDiagnostics_template::procedureCode() { set_specific(); return single_value->field_procedureCode; } const INTEGER_template& CriticalityDiagnostics_template::procedureCode() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field procedureCode of a non-specific template of type @RUA-IEs.CriticalityDiagnostics."); return single_value->field_procedureCode; } RUA__CommonDataTypes::TriggeringMessage_template& CriticalityDiagnostics_template::triggeringMessage() { set_specific(); return single_value->field_triggeringMessage; } const RUA__CommonDataTypes::TriggeringMessage_template& CriticalityDiagnostics_template::triggeringMessage() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field triggeringMessage of a non-specific template of type @RUA-IEs.CriticalityDiagnostics."); return single_value->field_triggeringMessage; } RUA__CommonDataTypes::Criticality_template& CriticalityDiagnostics_template::procedureCriticality() { set_specific(); return single_value->field_procedureCriticality; } const RUA__CommonDataTypes::Criticality_template& CriticalityDiagnostics_template::procedureCriticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field procedureCriticality of a non-specific template of type @RUA-IEs.CriticalityDiagnostics."); return single_value->field_procedureCriticality; } CriticalityDiagnostics__IE__List_template& CriticalityDiagnostics_template::iEsCriticalityDiagnostics() { set_specific(); return single_value->field_iEsCriticalityDiagnostics; } const CriticalityDiagnostics__IE__List_template& CriticalityDiagnostics_template::iEsCriticalityDiagnostics() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEsCriticalityDiagnostics of a non-specific template of type @RUA-IEs.CriticalityDiagnostics."); return single_value->field_iEsCriticalityDiagnostics; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& CriticalityDiagnostics_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& CriticalityDiagnostics_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @RUA-IEs.CriticalityDiagnostics."); return single_value->field_iE__Extensions; } int CriticalityDiagnostics_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 0; if (single_value->field_procedureCode.is_present()) ret_val++; if (single_value->field_triggeringMessage.is_present()) ret_val++; if (single_value->field_procedureCriticality.is_present()) ret_val++; if (single_value->field_iEsCriticalityDiagnostics.is_present()) ret_val++; if (single_value->field_iE__Extensions.is_present()) ret_val++; return ret_val; } case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics 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 @RUA-IEs.CriticalityDiagnostics containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.CriticalityDiagnostics."); } return 0; } void CriticalityDiagnostics_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ procedureCode := "); single_value->field_procedureCode.log(); TTCN_Logger::log_event_str(", triggeringMessage := "); single_value->field_triggeringMessage.log(); TTCN_Logger::log_event_str(", procedureCriticality := "); single_value->field_procedureCriticality.log(); TTCN_Logger::log_event_str(", iEsCriticalityDiagnostics := "); single_value->field_iEsCriticalityDiagnostics.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); single_value->field_iE__Extensions.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 CriticalityDiagnostics_template::log_match(const CriticalityDiagnostics& 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 (match_value.procedureCode().ispresent()){ if(!single_value->field_procedureCode.match(match_value.procedureCode(), legacy)){ TTCN_Logger::log_logmatch_info(".procedureCode"); single_value->field_procedureCode.log_match(match_value.procedureCode(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_procedureCode.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".procedureCode := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_procedureCode.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.triggeringMessage().ispresent()){ if(!single_value->field_triggeringMessage.match(match_value.triggeringMessage(), legacy)){ TTCN_Logger::log_logmatch_info(".triggeringMessage"); single_value->field_triggeringMessage.log_match(match_value.triggeringMessage(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_triggeringMessage.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".triggeringMessage := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_triggeringMessage.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.procedureCriticality().ispresent()){ if(!single_value->field_procedureCriticality.match(match_value.procedureCriticality(), legacy)){ TTCN_Logger::log_logmatch_info(".procedureCriticality"); single_value->field_procedureCriticality.log_match(match_value.procedureCriticality(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_procedureCriticality.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".procedureCriticality := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_procedureCriticality.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.iEsCriticalityDiagnostics().ispresent()){ if(!single_value->field_iEsCriticalityDiagnostics.match(match_value.iEsCriticalityDiagnostics(), legacy)){ TTCN_Logger::log_logmatch_info(".iEsCriticalityDiagnostics"); single_value->field_iEsCriticalityDiagnostics.log_match(match_value.iEsCriticalityDiagnostics(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_iEsCriticalityDiagnostics.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".iEsCriticalityDiagnostics := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_iEsCriticalityDiagnostics.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.iE__Extensions().ispresent()){ if(!single_value->field_iE__Extensions.match(match_value.iE__Extensions(), legacy)){ TTCN_Logger::log_logmatch_info(".iE_Extensions"); single_value->field_iE__Extensions.log_match(match_value.iE__Extensions(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_iE__Extensions.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".iE_Extensions := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_iE__Extensions.log(); TTCN_Logger::log_event_str(" unmatched"); 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("{ procedureCode := "); if (match_value.procedureCode().ispresent()) { single_value->field_procedureCode.log_match(match_value.procedureCode(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_procedureCode.log(); if (single_value->field_procedureCode.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", triggeringMessage := "); if (match_value.triggeringMessage().ispresent()) { single_value->field_triggeringMessage.log_match(match_value.triggeringMessage(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_triggeringMessage.log(); if (single_value->field_triggeringMessage.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", procedureCriticality := "); if (match_value.procedureCriticality().ispresent()) { single_value->field_procedureCriticality.log_match(match_value.procedureCriticality(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_procedureCriticality.log(); if (single_value->field_procedureCriticality.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", iEsCriticalityDiagnostics := "); if (match_value.iEsCriticalityDiagnostics().ispresent()) { single_value->field_iEsCriticalityDiagnostics.log_match(match_value.iEsCriticalityDiagnostics(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_iEsCriticalityDiagnostics.log(); if (single_value->field_iEsCriticalityDiagnostics.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", iE_Extensions := "); if (match_value.iE__Extensions().ispresent()) { single_value->field_iE__Extensions.log_match(match_value.iE__Extensions(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_iE__Extensions.log(); if (single_value->field_iE__Extensions.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } 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 CriticalityDiagnostics_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (!procedureCode().is_bound()) procedureCode() = OMIT_VALUE; else procedureCode().set_implicit_omit(); if (!triggeringMessage().is_bound()) triggeringMessage() = OMIT_VALUE; else triggeringMessage().set_implicit_omit(); if (!procedureCriticality().is_bound()) procedureCriticality() = OMIT_VALUE; else procedureCriticality().set_implicit_omit(); if (!iEsCriticalityDiagnostics().is_bound()) iEsCriticalityDiagnostics() = OMIT_VALUE; else iEsCriticalityDiagnostics().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void CriticalityDiagnostics_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_procedureCode.encode_text(text_buf); single_value->field_triggeringMessage.encode_text(text_buf); single_value->field_procedureCriticality.encode_text(text_buf); single_value->field_iEsCriticalityDiagnostics.encode_text(text_buf); single_value->field_iE__Extensions.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 @RUA-IEs.CriticalityDiagnostics."); } } void CriticalityDiagnostics_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_procedureCode.decode_text(text_buf); single_value->field_triggeringMessage.decode_text(text_buf); single_value->field_procedureCriticality.decode_text(text_buf); single_value->field_iEsCriticalityDiagnostics.decode_text(text_buf); single_value->field_iE__Extensions.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 CriticalityDiagnostics_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 @RUA-IEs.CriticalityDiagnostics."); } } void CriticalityDiagnostics_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: { CriticalityDiagnostics_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) procedureCode().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) triggeringMessage().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) procedureCriticality().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iEsCriticalityDiagnostics().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().set_param(*param.get_elem(4)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "procedureCode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { procedureCode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "triggeringMessage")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { triggeringMessage().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "procedureCriticality")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { procedureCriticality().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iEsCriticalityDiagnostics")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEsCriticalityDiagnostics().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iE_Extensions")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iE__Extensions().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.CriticalityDiagnostics: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { CriticalityDiagnostics_template* precondition = new CriticalityDiagnostics_template; precondition->set_param(*param.get_elem(0)); CriticalityDiagnostics_template* implied_template = new CriticalityDiagnostics_template; implied_template->set_param(*param.get_elem(1)); *this = CriticalityDiagnostics_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.CriticalityDiagnostics"); } is_ifpresent = param.get_ifpresent(); } void CriticalityDiagnostics_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_procedureCode.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics"); single_value->field_triggeringMessage.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics"); single_value->field_procedureCriticality.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics"); single_value->field_iEsCriticalityDiagnostics.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics"); 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 : "@RUA-IEs.CriticalityDiagnostics"); } boolean CriticalityDiagnostics_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CriticalityDiagnostics_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_idxref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } CriticalityDiagnostics__IE__List::CriticalityDiagnostics__IE__List(const CriticalityDiagnostics__IE__List& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } CriticalityDiagnostics__IE__List::~CriticalityDiagnostics__IE__List() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void CriticalityDiagnostics__IE__List::clean_up() { if (val_ptr != NULL) { if (val_ptr->ref_count > 1) { val_ptr->ref_count--; val_ptr = NULL; } else if (val_ptr->ref_count == 1) { for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL) delete val_ptr->value_elements[elem_count]; free_pointers((void**)val_ptr->value_elements); delete val_ptr; val_ptr = NULL; } else TTCN_error("Internal error: Invalid reference counter in a record of/set of value."); } } CriticalityDiagnostics__IE__List& CriticalityDiagnostics__IE__List::operator=(null_type) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; return *this; } CriticalityDiagnostics__IE__List& CriticalityDiagnostics__IE__List::operator=(const CriticalityDiagnostics__IE__List& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean CriticalityDiagnostics__IE__List::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return val_ptr->n_elements == 0 ; } boolean CriticalityDiagnostics__IE__List::operator==(const CriticalityDiagnostics__IE__List& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (val_ptr == other_value.val_ptr) return TRUE; if (val_ptr->n_elements != (other_value.val_ptr)->n_elements) return FALSE; for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ if ((other_value.val_ptr)->value_elements[elem_count] != NULL){ if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE; } else return FALSE; } else { if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE; } } return TRUE; } CriticalityDiagnostics__IE__List_0& CriticalityDiagnostics__IE__List::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @RUA-IEs.CriticalityDiagnostics-IE-List using a negative index: %d.", index_value); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements; new_val_ptr->value_elements = (CriticalityDiagnostics__IE__List_0**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (index_value >= val_ptr->n_elements) set_size(index_value + 1); if (val_ptr->value_elements[index_value] == NULL) { val_ptr->value_elements[index_value] = new CriticalityDiagnostics__IE__List_0; } return *val_ptr->value_elements[index_value]; } CriticalityDiagnostics__IE__List_0& CriticalityDiagnostics__IE__List::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return (*this)[(int)index_value]; } const CriticalityDiagnostics__IE__List_0& CriticalityDiagnostics__IE__List::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (index_value < 0) TTCN_error("Accessing an element of type @RUA-IEs.CriticalityDiagnostics-IE-List using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @RUA-IEs.CriticalityDiagnostics-IE-List: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements); return (val_ptr->value_elements[index_value] == NULL) ? UNBOUND_ELEM : *val_ptr->value_elements[index_value]; } const CriticalityDiagnostics__IE__List_0& CriticalityDiagnostics__IE__List::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return (*this)[(int)index_value]; } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (val_ptr->n_elements == 0) return *this; int rc; if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements; else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements); if (rc == 0) return *this; CriticalityDiagnostics__IE__List ret_val; ret_val.set_size(val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new CriticalityDiagnostics__IE__List_0(*val_ptr->value_elements[i]); } } return ret_val; } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List::operator+(const CriticalityDiagnostics__IE__List& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @RUA-IEs.CriticalityDiagnostics-IE-List concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; CriticalityDiagnostics__IE__List ret_val; ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new CriticalityDiagnostics__IE__List_0(*val_ptr->value_elements[i]); } } for (int i=0; in_elements; i++) { if (other_value.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new CriticalityDiagnostics__IE__List_0(*other_value.val_ptr->value_elements[i]); } } return ret_val; } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@RUA-IEs.CriticalityDiagnostics-IE-List","element"); CriticalityDiagnostics__IE__List ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new CriticalityDiagnostics__IE__List_0(*val_ptr->value_elements[i+index]); } } return ret_val; } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List::replace(int index, int len, const CriticalityDiagnostics__IE__List& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); check_replace_arguments(val_ptr->n_elements, index, len, "@RUA-IEs.CriticalityDiagnostics-IE-List","element"); CriticalityDiagnostics__IE__List ret_val; ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len); for (int i = 0; i < index; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new CriticalityDiagnostics__IE__List_0(*val_ptr->value_elements[i]); } } for (int i = 0; i < repl.val_ptr->n_elements; i++) { if (repl.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+index] = new CriticalityDiagnostics__IE__List_0(*repl.val_ptr->value_elements[i]); } } for (int i = 0; i < val_ptr->n_elements - index - len; i++) { if (val_ptr->value_elements[index+i+len] != NULL) { ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new CriticalityDiagnostics__IE__List_0(*val_ptr->value_elements[index+i+len]); } } return ret_val; } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List::replace(int index, int len, const CriticalityDiagnostics__IE__List_template& repl) const { if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return replace(index, len, repl.valueof()); } void CriticalityDiagnostics__IE__List::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements; new_val_ptr->value_elements = (CriticalityDiagnostics__IE__List_0**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) { if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (CriticalityDiagnostics__IE__List_0**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); #ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @RUA-IEs.CriticalityDiagnostics-IE-List: %d",new_size); #endif val_ptr->n_elements = new_size; } else if (new_size < val_ptr->n_elements) { for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count]; val_ptr->value_elements = (CriticalityDiagnostics__IE__List_0**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean CriticalityDiagnostics__IE__List::is_value() const { if (val_ptr == NULL) return FALSE; for(int i = 0; i < val_ptr->n_elements; ++i) { if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE; } return TRUE; } int CriticalityDiagnostics__IE__List::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return val_ptr->n_elements; } int CriticalityDiagnostics__IE__List::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length; return 0; } void CriticalityDiagnostics__IE__List::log() const { if (val_ptr == NULL) {; TTCN_Logger::log_event_unbound(); return; } switch (val_ptr->n_elements) { case 0: TTCN_Logger::log_event_str("{ }"); break; default: TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); (*this)[elem_count].log(); } TTCN_Logger::log_event_str(" }"); } } void CriticalityDiagnostics__IE__List::set_implicit_omit() { if (val_ptr == NULL) return; for (int i = 0; i < val_ptr->n_elements; i++) { if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit(); } } void CriticalityDiagnostics__IE__List::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value"); switch (param.get_operation_type()) { case Module_Param::OT_ASSIGN: if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) { *this = NULL_VALUE; return; } switch (param.get_type()) { case Module_Param::MP_Value_List: set_size(param.get_size()); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed) { (*this)[i].set_param(*curr); if (!(*this)[i].is_bound()) { delete val_ptr->value_elements[i]; val_ptr->value_elements[i] = NULL; } } } break; case Module_Param::MP_Indexed_List: for (size_t i=0; iget_id()->get_index()].set_param(*curr); if (!(*this)[curr->get_id()->get_index()].is_bound()) { delete val_ptr->value_elements[curr->get_id()->get_index()]; val_ptr->value_elements[curr->get_id()->get_index()] = NULL; } } break; default: param.type_error("record of value", "@RUA-IEs.CriticalityDiagnostics-IE-List"); } break; case Module_Param::OT_CONCAT: switch (param.get_type()) { case Module_Param::MP_Value_List: { if (!is_bound()) *this = NULL_VALUE; int start_idx = lengthof(); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed)) { (*this)[start_idx+(int)i].set_param(*curr); } } } break; case Module_Param::MP_Indexed_List: param.error("Cannot concatenate an indexed value list"); break; default: param.type_error("record of value", "@RUA-IEs.CriticalityDiagnostics-IE-List"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void CriticalityDiagnostics__IE__List::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); text_buf.push_int(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) (*this)[elem_count].encode_text(text_buf); } void CriticalityDiagnostics__IE__List::decode_text(Text_Buf& text_buf) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = text_buf.pull_int().get_val(); if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); val_ptr->value_elements = (CriticalityDiagnostics__IE__List_0**)allocate_pointers(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { val_ptr->value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void CriticalityDiagnostics__IE__List::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CriticalityDiagnostics__IE__List::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CriticalityDiagnostics__IE__List::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec; for(int elem_i=0; elem_in_elements; elem_i++) { ec.set_msg("Component #%d: ", elem_i); new_tlv->add_TLV((*this)[elem_i].BER_encode_TLV(*p_td.oftype_descr, p_coding)); } } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CriticalityDiagnostics__IE__List::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '%s' type: ", p_td.name); stripped_tlv.chk_constructed_flag(TRUE); clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; TTCN_EncDec_ErrorContext ec_1("Component #"); TTCN_EncDec_ErrorContext ec_2("0: "); while(BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv)) { val_ptr->value_elements = (CriticalityDiagnostics__IE__List_0**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, val_ptr->n_elements + 1); val_ptr->n_elements++; val_ptr->value_elements[val_ptr->n_elements - 1] = new CriticalityDiagnostics__IE__List_0; val_ptr->value_elements[val_ptr->n_elements - 1]->BER_decode_TLV(*p_td.oftype_descr, tmp_tlv, L_form); ec_2.set_msg("%d: ", val_ptr->n_elements); } return TRUE; } int CriticalityDiagnostics__IE__List::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return -1; } int enc_len = p_tok.put_next_token(p_td.json->as_map ? JSON_TOKEN_OBJECT_START : JSON_TOKEN_ARRAY_START, NULL); for (int i = 0; i < val_ptr->n_elements; ++i) { if (p_td.json->metainfo_unbound && !(*this)[i].is_bound()) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "metainfo []"); enc_len += p_tok.put_next_token(JSON_TOKEN_STRING, "\"unbound\""); enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } else { int ret_val = (*this)[i].JSON_encode(*p_td.oftype_descr, p_tok, p_td.json->as_map); if (0 > ret_val) break; enc_len += ret_val; } } enc_len += p_tok.put_next_token(p_td.json->as_map ? JSON_TOKEN_OBJECT_END : JSON_TOKEN_ARRAY_END, NULL); return enc_len; } int CriticalityDiagnostics__IE__List::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { set_size(0); return strlen(p_td.json->default_value.str); } json_token_t token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if ((!p_td.json->as_map && JSON_TOKEN_ARRAY_START != token) || (p_td.json->as_map && JSON_TOKEN_OBJECT_START != token)) { return JSON_ERROR_INVALID_TOKEN; } set_size(0); for (int nof_elements = 0; TRUE; ++nof_elements) { size_t buf_pos = p_tok.get_buf_pos(); size_t ret_val; if (p_td.json->metainfo_unbound) { ret_val = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_OBJECT_START == token) { char* value = NULL; size_t value_len = 0; ret_val += p_tok.get_next_token(&token, &value, &value_len); if (JSON_TOKEN_NAME == token && 11 == value_len && 0 == strncmp(value, "metainfo []", 11)) { ret_val += p_tok.get_next_token(&token, &value, &value_len); if (JSON_TOKEN_STRING == token && 9 == value_len && 0 == strncmp(value, "\"unbound\"", 9)) { ret_val = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_OBJECT_END == token) { dec_len += ret_val; continue; } } } } p_tok.set_buf_pos(buf_pos); } CriticalityDiagnostics__IE__List_0* val = new CriticalityDiagnostics__IE__List_0; int ret_val2 = val->JSON_decode(*p_td.oftype_descr, p_tok, p_silent, p_td.json->as_map); if (JSON_ERROR_INVALID_TOKEN == ret_val2) { p_tok.set_buf_pos(buf_pos); delete val; break; } else if (JSON_ERROR_FATAL == ret_val2) { delete val; if (p_silent) { clean_up(); } return JSON_ERROR_FATAL; } val_ptr->value_elements = (CriticalityDiagnostics__IE__List_0**)reallocate_pointers( (void**)val_ptr->value_elements, val_ptr->n_elements, nof_elements + 1); val_ptr->value_elements[nof_elements] = val; val_ptr->n_elements = nof_elements + 1; dec_len += (size_t)ret_val2; } dec_len += p_tok.get_next_token(&token, NULL, NULL); if ((!p_td.json->as_map && JSON_TOKEN_ARRAY_END != token) || (p_td.json->as_map && JSON_TOKEN_OBJECT_END != token)) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_REC_OF_END_TOKEN_ERROR, ""); if (p_silent) { clean_up(); } return JSON_ERROR_FATAL; } return (int)dec_len; } int CriticalityDiagnostics__IE__List::OER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return -1; } encode_oer_length(val_ptr->n_elements, p_buf, TRUE); for (int i = 0; i < val_ptr->n_elements; ++i) { (*this)[i].OER_encode(*p_td.oftype_descr, p_buf); } return 0; } int CriticalityDiagnostics__IE__List::OER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, OER_struct& p_oer) { size_t nof_elem = decode_oer_length(p_buf, TRUE); set_size(nof_elem); for (size_t i = 0; i < nof_elem; i++) { (*this)[i].OER_decode(*p_td.oftype_descr, p_buf, p_oer); } return 0; } void CriticalityDiagnostics__IE__List::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE OF value."); return; } const Per_Integer_Constraint* cons = dynamic_cast(p_td.per->c); if (cons == NULL) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INTERNAL, "Internal error: Invalid constraint in PER descriptor."); return; } INTEGER length(val_ptr->n_elements); boolean extendable = cons->has_extension_marker(); boolean within_ext_root = cons->is_within_extension_root(length); if (!within_ext_root && !extendable) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_CONSTRAINT, "Encoding an invalid SEQUENCE OF value (does not match PER-visible constraints)."); return; } boolean ext_bit = extendable && !within_ext_root; if (extendable) p_buf.PER_put_bit(ext_bit); INTEGER length_ub = cons->has_upper_bound() ? cons->get_upper_bound() : INTEGER(-1); if (length_ub >= PER_64K) length_ub = -1; INTEGER range = (ext_bit || length_ub < 0) ? INTEGER(0) : cons->get_nof_values(); if (range == 1 && length == 0) return; int mul_16k; int pos = 0; do { mul_16k = (range == 1) ? 0 : length.PER_encode_length(p_buf, p_options, range, cons->get_lower_bound(), length_ub); int elements_encoded = (mul_16k == 0) ? (int)length : mul_16k * PER_16K; for (int i = 0; i < elements_encoded; ++i) { (*this)[i + pos].PER_encode(*p_td.oftype_descr, p_buf, p_options); } if (mul_16k > 0) { pos += elements_encoded; length = length - elements_encoded; range = 0; } } while (mul_16k > 0); } void CriticalityDiagnostics__IE__List::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { const Per_Integer_Constraint* cons = dynamic_cast(p_td.per->c); if (cons == NULL) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INTERNAL, "Internal error: Invalid constraint in PER descriptor."); return; } clean_up(); boolean extendable = cons->has_extension_marker(); boolean ext_bit = extendable ? p_buf.PER_get_bit() : FALSE; INTEGER length_ub = cons->has_upper_bound() ? cons->get_upper_bound() : INTEGER(-1); if (length_ub >= PER_64K) length_ub = -1; INTEGER range = (ext_bit || length_ub < 0) ? INTEGER(0) : cons->get_nof_values(); int mul_16k; INTEGER length; int current_size = 0; do { mul_16k = length.PER_decode_length(p_buf, p_options, range, cons->get_lower_bound(), length_ub); if (mul_16k != 0) range = 0; int new_size = current_size + (int)length; set_size(new_size); for (int i = current_size; i < new_size; ++i) { (*this)[i].PER_decode(*p_td.oftype_descr, p_buf, p_options); } current_size = new_size; } while (mul_16k > 0); if (!ext_bit && !cons->is_within_extension_root(val_ptr->n_elements)) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_CONSTRAINT, "Decoded SEQUENCE OF value does not match PER-visible constraints."); } void CriticalityDiagnostics__IE__List_template::copy_value(const CriticalityDiagnostics__IE__List& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @RUA-IEs.CriticalityDiagnostics-IE-List with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (CriticalityDiagnostics__IE__List_0_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (other_value[elem_count].is_bound()) { single_value.value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0_template; } } set_selection(SPECIFIC_VALUE); } void CriticalityDiagnostics__IE__List_template::copy_template(const CriticalityDiagnostics__IE__List_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.n_elements = other_value.single_value.n_elements; single_value.value_elements = (CriticalityDiagnostics__IE__List_0_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) { single_value.value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0_template; } } 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 CriticalityDiagnostics__IE__List_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 CriticalityDiagnostics__IE__List_template(*other_value.implication_.precondition); implication_.implied_template = new CriticalityDiagnostics__IE__List_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 @RUA-IEs.CriticalityDiagnostics-IE-List."); break; } set_selection(other_value); } boolean CriticalityDiagnostics__IE__List_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy) { if (value_index >= 0) return ((const CriticalityDiagnostics__IE__List_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const CriticalityDiagnostics__IE__List*)value_ptr)[value_index], legacy); else return ((const CriticalityDiagnostics__IE__List_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } CriticalityDiagnostics__IE__List_template::CriticalityDiagnostics__IE__List_template() { } CriticalityDiagnostics__IE__List_template::CriticalityDiagnostics__IE__List_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } CriticalityDiagnostics__IE__List_template::CriticalityDiagnostics__IE__List_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } CriticalityDiagnostics__IE__List_template::CriticalityDiagnostics__IE__List_template(const CriticalityDiagnostics__IE__List& other_value) { copy_value(other_value); } CriticalityDiagnostics__IE__List_template::CriticalityDiagnostics__IE__List_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const CriticalityDiagnostics__IE__List&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.CriticalityDiagnostics-IE-List from an unbound optional field."); } } CriticalityDiagnostics__IE__List_template::CriticalityDiagnostics__IE__List_template(CriticalityDiagnostics__IE__List_template* p_precondition, CriticalityDiagnostics__IE__List_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CriticalityDiagnostics__IE__List_template::CriticalityDiagnostics__IE__List_template(Dynamic_Match_Interface* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CriticalityDiagnostics__IE__List_template::CriticalityDiagnostics__IE__List_template(const CriticalityDiagnostics__IE__List_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } CriticalityDiagnostics__IE__List_template::~CriticalityDiagnostics__IE__List_template() { clean_up(); } void CriticalityDiagnostics__IE__List_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; free_pointers((void**)single_value.value_elements); 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; } CriticalityDiagnostics__IE__List_template& CriticalityDiagnostics__IE__List_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CriticalityDiagnostics__IE__List_template& CriticalityDiagnostics__IE__List_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } CriticalityDiagnostics__IE__List_template& CriticalityDiagnostics__IE__List_template::operator=(const CriticalityDiagnostics__IE__List& other_value) { clean_up(); copy_value(other_value); return *this; } CriticalityDiagnostics__IE__List_template& CriticalityDiagnostics__IE__List_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const CriticalityDiagnostics__IE__List&)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 @RUA-IEs.CriticalityDiagnostics-IE-List."); } return *this; } CriticalityDiagnostics__IE__List_template& CriticalityDiagnostics__IE__List_template::operator=(const CriticalityDiagnostics__IE__List_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RUA-IEs.CriticalityDiagnostics-IE-List using a negative index: %d.", index_value); switch (template_selection) { case SPECIFIC_VALUE: if(index_value < single_value.n_elements) break; // no break case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: case UNINITIALIZED_TEMPLATE: set_size(index_value + 1); break; default: TTCN_error("Accessing an element of a non-specific template for type @RUA-IEs.CriticalityDiagnostics-IE-List."); break; } return *single_value.value_elements[index_value]; } CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return (*this)[(int)index_value]; } const CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RUA-IEs.CriticalityDiagnostics-IE-List using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @RUA-IEs.CriticalityDiagnostics-IE-List: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements); return *single_value.value_elements[index_value]; } const CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return (*this)[(int)index_value]; } void CriticalityDiagnostics__IE__List_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); template_sel old_selection = template_selection; if (old_selection != SPECIFIC_VALUE) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; } if (new_size > single_value.n_elements) { single_value.value_elements = (CriticalityDiagnostics__IE__List_0_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0_template(ANY_VALUE); } else { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0_template; } single_value.n_elements = new_size; } else if (new_size < single_value.n_elements) { for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; single_value.value_elements = (CriticalityDiagnostics__IE__List_0_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int CriticalityDiagnostics__IE__List_template::n_elem() const { switch (template_selection) { case SPECIFIC_VALUE: return single_value.n_elements; break; case VALUE_LIST: return value_list.n_values; break; default: TTCN_error("Performing n_elem"); } } int CriticalityDiagnostics__IE__List_template::size_of(boolean is_size) const { const char* op_name = is_size ? "size" : "length"; int min_size; boolean has_any_or_none; if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List which has an ifpresent attribute.", op_name); switch (template_selection) { case SPECIFIC_VALUE: { min_size = 0; has_any_or_none = FALSE; int elem_count = single_value.n_elements; if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; } for (int i=0; iget_selection()) { case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List containing omit element.", op_name); case ANY_OR_OMIT: has_any_or_none = TRUE; break; default: min_size++; break; } } } break; case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List containing omit value.", op_name); case ANY_VALUE: case ANY_OR_OMIT: min_size = 0; has_any_or_none = TRUE; break; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List containing an empty list.", op_name); int item_size = value_list.list_value[0].size_of(is_size); for (unsigned int i = 1; i < value_list.n_values; i++) { if (value_list.list_value[i].size_of(is_size)!=item_size) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List containing a value list with different sizes.", op_name); } min_size = item_size; has_any_or_none = FALSE; break; } case COMPLEMENTED_LIST: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @RUA-IEs.CriticalityDiagnostics-IE-List.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @RUA-IEs.CriticalityDiagnostics-IE-List"); } boolean CriticalityDiagnostics__IE__List_template::match(const CriticalityDiagnostics__IE__List& other_value, boolean legacy) const { if (!other_value.is_bound()) return FALSE; int value_length = other_value.size_of(); if (!match_length(value_length)) return FALSE; switch (template_selection) { case SPECIFIC_VALUE: return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy); case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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 with an uninitialized/unsupported template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); } return FALSE; } boolean CriticalityDiagnostics__IE__List_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (!single_value.value_elements[elem_count]->is_value()) return FALSE; return TRUE; } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List_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 @RUA-IEs.CriticalityDiagnostics-IE-List."); CriticalityDiagnostics__IE__List ret_val; ret_val.set_size(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (single_value.value_elements[elem_count]->is_bound()) { ret_val[elem_count] = single_value.value_elements[elem_count]->valueof(); } return ret_val; } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List_template::substr(int index, int returncount) const { if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value."); return valueof().substr(index, returncount); } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List_template::replace(int index, int len, const CriticalityDiagnostics__IE__List_template& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl.valueof()); } CriticalityDiagnostics__IE__List CriticalityDiagnostics__IE__List_template::replace(int index, int len, const CriticalityDiagnostics__IE__List& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl); } void CriticalityDiagnostics__IE__List_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = list_length; value_list.list_value = new CriticalityDiagnostics__IE__List_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); } set_selection(template_type); } CriticalityDiagnostics__IE__List_template& CriticalityDiagnostics__IE__List_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); return value_list.list_value[list_index]; } void CriticalityDiagnostics__IE__List_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: if (single_value.n_elements > 0) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation("); single_value.value_elements[elem_count]->log(); if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')'); } TTCN_Logger::log_event_str(" }"); } else 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_restricted(); log_ifpresent(); } void CriticalityDiagnostics__IE__List_template::log_match(const CriticalityDiagnostics__IE__List& 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){ TTCN_Logger::log_logmatch_info("[%d]", elem_count); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } log_match_length(single_value.n_elements); } 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); } TTCN_Logger::log_event_str(" }"); log_match_length(single_value.n_elements); } 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 CriticalityDiagnostics__IE__List_template::encode_text(Text_Buf& text_buf) const { encode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) single_value.value_elements[elem_count]->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 @RUA-IEs.CriticalityDiagnostics-IE-List."); } } void CriticalityDiagnostics__IE__List_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value.n_elements = text_buf.pull_int().get_val(); if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); single_value.value_elements = (CriticalityDiagnostics__IE__List_0_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { single_value.value_elements[elem_count] = new CriticalityDiagnostics__IE__List_0_template; single_value.value_elements[elem_count]->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 CriticalityDiagnostics__IE__List_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 for a template of type @RUA-IEs.CriticalityDiagnostics-IE-List."); } } boolean CriticalityDiagnostics__IE__List_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CriticalityDiagnostics__IE__List_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 i=0; iset_implicit_omit(); } } void CriticalityDiagnostics__IE__List_template::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of 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: { CriticalityDiagnostics__IE__List_template temp; 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_iget_id()->get_index())].set_param(*param.get_elem(p_i)); } break; case Module_Param::MP_Value_List: { set_size(param.get_size()); int curr_idx = 0; for (size_t p_i=0; p_iget_type()) { case Module_Param::MP_NotUsed: curr_idx++; break; case Module_Param::MP_Permutation_Template: { int perm_start_idx = curr_idx; Module_Param* param_i = param.get_elem(p_i); for (size_t perm_i=0; perm_iget_size(); perm_i++) { (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i))); curr_idx++; } int perm_end_idx = curr_idx - 1; add_permutation(perm_start_idx, perm_end_idx); } break; default: (*this)[curr_idx].set_param(*param.get_elem(p_i)); curr_idx++; } } } break; case Module_Param::MP_Implication_Template: { CriticalityDiagnostics__IE__List_template* precondition = new CriticalityDiagnostics__IE__List_template; precondition->set_param(*param.get_elem(0)); CriticalityDiagnostics__IE__List_template* implied_template = new CriticalityDiagnostics__IE__List_template; implied_template->set_param(*param.get_elem(1)); *this = CriticalityDiagnostics__IE__List_template(precondition, implied_template); } break; default: param.type_error("record of template", "@RUA-IEs.CriticalityDiagnostics-IE-List"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void CriticalityDiagnostics__IE__List_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; for (int i=0; icheck_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics-IE-List"); 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 : "@RUA-IEs.CriticalityDiagnostics-IE-List"); } boolean CriticalityDiagnostics__IE__List_template::get_istemplate_kind(const char* type) const { if (!strcmp(type, "AnyElement")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_VALUE) { return TRUE; } } return FALSE; } else if (!strcmp(type, "AnyElementsOrNone")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) { return TRUE; } } return FALSE; } else if (!strcmp(type, "permutation")) { return number_of_permutations; } else if (!strcmp(type, "length")) { return length_restriction_type != NO_LENGTH_RESTRICTION; } else { return Base_Template::get_istemplate_kind(type); } } TypeOfError::TypeOfError() { enum_value = UNBOUND_VALUE; } TypeOfError::TypeOfError(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @RUA-IEs.TypeOfError with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } TypeOfError::TypeOfError(enum_type other_value) { enum_value = other_value; } TypeOfError::TypeOfError(const TypeOfError& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @RUA-IEs.TypeOfError."); enum_value = other_value.enum_value; } TypeOfError& TypeOfError::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @RUA-IEs.TypeOfError.", other_value); enum_value = (enum_type)other_value; return *this; } TypeOfError& TypeOfError::operator=(enum_type other_value) { enum_value = other_value; return *this; } TypeOfError& TypeOfError::operator=(const TypeOfError& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.TypeOfError."); enum_value = other_value.enum_value; return *this; } boolean TypeOfError::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.TypeOfError comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean TypeOfError::operator==(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); return enum_value == other_value; } boolean TypeOfError::operator==(const TypeOfError& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); return enum_value == other_value.enum_value; } boolean TypeOfError::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.TypeOfError comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean TypeOfError::operator<(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); return enum_value < other_value; } boolean TypeOfError::operator<(const TypeOfError& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); return enum_value < other_value.enum_value; } boolean TypeOfError::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @RUA-IEs.TypeOfError comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean TypeOfError::operator>(enum_type other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); return enum_value > other_value; } boolean TypeOfError::operator>(const TypeOfError& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @RUA-IEs.TypeOfError."); return enum_value > other_value.enum_value; } const char *TypeOfError::enum_to_str(enum_type enum_par) { switch (enum_par) { case not__understood: return "not_understood"; case missing: return "missing"; default: return ""; } } TypeOfError::enum_type TypeOfError::str_to_enum(const char *str_par, const int* int_par, const int* int_par2) { if (int_par == NULL && int_par2 == NULL) { if (!strcmp(str_par, "not_understood")) return not__understood; if (!strcmp(str_par, "missing")) return missing; } return UNKNOWN_VALUE; } boolean TypeOfError::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int TypeOfError::enum2int(enum_type enum_par) { if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.TypeOfError.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int TypeOfError::enum2int(const TypeOfError& enum_par) { if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @RUA-IEs.TypeOfError.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void TypeOfError::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @RUA-IEs.TypeOfError.", int_val); enum_value = (enum_type)int_val; } TypeOfError::operator TypeOfError::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @RUA-IEs.TypeOfError."); return enum_value; } void TypeOfError::log() const { if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value); else TTCN_Logger::log_event_unbound(); } void TypeOfError::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "enumerated value"); if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@RUA-IEs.TypeOfError"); enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value()); if (!is_valid_enum(enum_value)) { param.error("Invalid enumerated value for type @RUA-IEs.TypeOfError."); } } void TypeOfError::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @RUA-IEs.TypeOfError."); text_buf.push_int(enum_value); } void TypeOfError::decode_text(Text_Buf& text_buf) { enum_value = (enum_type)text_buf.pull_int().get_val(); if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @RUA-IEs.TypeOfError.", enum_value); } void TypeOfError::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void TypeOfError::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* TypeOfError::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { BER_encode_chk_enum_valid(p_td, is_valid_enum(enum_value), enum_value); new_tlv=BER_encode_TLV_INTEGER(p_coding, enum_value); } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean TypeOfError::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { enum_value = UNBOUND_VALUE; BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec("While decoding ENUMERATED type @RUA-IEs.TypeOfError: "); int tmp_mfr; if (BER_decode_TLV_INTEGER(stripped_tlv, L_form, tmp_mfr)) { BER_decode_chk_enum_valid(p_td, is_valid_enum(tmp_mfr), tmp_mfr); enum_value = (enum_type)tmp_mfr; return TRUE; } else return FALSE; } int TypeOfError::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.TypeOfError."); return -1; } if (p_td.json->use_null) { return p_tok.put_next_token(JSON_TOKEN_LITERAL_NULL); } char* tmp_str; if (p_td.json->as_number) { tmp_str = mprintf("%d", enum_value); } else { boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (p_td.json->enum_texts[i].index == enum_value) { tmp_str = mprintf("\"%s\"", p_td.json->enum_texts[i].text); text_found = true; break; } } if (!text_found) { tmp_str = mprintf("\"%s\"", enum_to_str(enum_value)); } } int enc_len = p_tok.put_next_token(p_td.json->as_number ? JSON_TOKEN_NUMBER : JSON_TOKEN_STRING, tmp_str); Free(tmp_str); return enc_len; } int TypeOfError::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { json_token_t token = JSON_TOKEN_NONE; char* value = 0; size_t value_len = 0; boolean error = FALSE; size_t dec_len = 0; boolean use_default = FALSE; if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return dec_len; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { value = const_cast(p_td.json->default_value.str); value_len = strlen(value); use_default = TRUE; } else { dec_len = p_tok.get_next_token(&token, &value, &value_len); } if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_LITERAL_NULL == token && p_td.json->use_null) { enum_value = not__understood; } else if (!p_td.json->use_null && ((JSON_TOKEN_STRING == token && !p_td.json->as_number) || use_default)) { if (use_default || (value_len > 2 && value[0] == '\"' && value[value_len - 1] == '\"')) { if (!use_default) value[value_len - 1] = 0; boolean text_found = false; for (size_t i = 0; i < p_td.json->nof_enum_texts; ++i) { if (strcmp(p_td.json->enum_texts[i].text, value + (use_default ? 0 : 1)) == 0) { enum_value = static_cast(p_td.json->enum_texts[i].index); text_found = true; break; } } if (!text_found) { enum_value = str_to_enum(value + (use_default ? 0 : 1)); } if (!use_default) value[value_len - 1] = '\"'; if (UNKNOWN_VALUE == enum_value) { error = TRUE; } } else { error = TRUE; } } else if (!p_td.json->use_null && JSON_TOKEN_NUMBER == token && p_td.json->as_number) { char* value_str = mcopystrn(value, value_len); int number = atoi(value_str); if (strchr(value_str, '.') != NULL || strchr(value_str, 'e') != NULL || strchr(value_str, 'E') != NULL) { error = TRUE; } else if (is_valid_enum(number)) { enum_value = static_cast(number); } else { error = TRUE; } Free(value_str); } else { enum_value = UNBOUND_VALUE; return JSON_ERROR_INVALID_TOKEN; } if (error) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FORMAT_ERROR, p_td.json->as_number ? "number" : "string", "enumerated"); enum_value = UNBOUND_VALUE; return JSON_ERROR_FATAL; } return (int)dec_len; } int TypeOfError::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (enum_value == UNBOUND_VALUE) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of enumerated type @RUA-IEs.TypeOfError."); return -1; } if (enum_value >= 0 && enum_value < 128) { char c = enum_value; p_buf.put_c(c); } else { INTEGER intval(enum_value); TTCN_Buffer buf; intval.OER_encode(INTEGER_descr_, buf); unsigned char* uc = const_cast(buf.get_data()); *uc |= 1 << 7; p_buf.put_buf(buf); } return 0; } int TypeOfError::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); if (!(uc[0] & 0x80)) { if (is_valid_enum(uc[0])) { enum_value = static_cast(uc[0]); } else { enum_value = UNKNOWN_VALUE; } p_buf.increase_pos(1); } else { unsigned char* uc2 = const_cast(p_buf.get_read_data()); uc2[0] &= ~0x80; INTEGER intval; intval.OER_decode(INTEGER_descr_, p_buf, p_oer); if (is_valid_enum(intval.get_val().get_val())) { enum_value = static_cast(intval.get_val().get_val()); } else { enum_value = UNKNOWN_VALUE; } } return 0; } void TypeOfError::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; boolean ext_bit = FALSE; switch (enum_value) { case not__understood: enc_val = 0; ext_bit = FALSE; break; case missing: enc_val = 1; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @RUA-IEs.TypeOfError."); } p_buf.PER_put_bit(ext_bit); if (ext_bit) enc_val.PER_encode_normally_small(p_buf, p_options); else INTEGER::PER_encode_int(p_buf, enc_val, 1); } void TypeOfError::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { INTEGER dec_val; boolean ext_bit = p_buf.PER_get_bit(); if (ext_bit) dec_val.PER_decode_normally_small(p_buf, p_options); else dec_val.PER_decode_unaligned_constrained(p_buf, 1, FALSE); int dec_int = dec_val; if (ext_bit) switch (dec_int) { default: enum_value = UNBOUND_VALUE; break; } else switch (dec_int) { case 0: enum_value = not__understood; break; case 1: enum_value = missing; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @RUA-IEs.TypeOfError.", dec_int); break; } } void TypeOfError_template::copy_template(const TypeOfError_template& other_value) { set_selection(other_value); switch (template_selection) { case SPECIFIC_VALUE: single_value = other_value.single_value; break; 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 TypeOfError_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 TypeOfError_template(*other_value.implication_.precondition); implication_.implied_template = new TypeOfError_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 enumerated type @RUA-IEs.TypeOfError."); } } TypeOfError_template::TypeOfError_template() { } TypeOfError_template::TypeOfError_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TypeOfError_template::TypeOfError_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!TypeOfError::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @RUA-IEs.TypeOfError with unknown numeric value %d.", other_value); single_value = (TypeOfError::enum_type)other_value; } TypeOfError_template::TypeOfError_template(TypeOfError::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } TypeOfError_template::TypeOfError_template(const TypeOfError& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == TypeOfError::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @RUA-IEs.TypeOfError."); single_value = other_value.enum_value; } TypeOfError_template::TypeOfError_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (TypeOfError::enum_type)(const TypeOfError&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @RUA-IEs.TypeOfError from an unbound optional field."); } } TypeOfError_template::TypeOfError_template(TypeOfError_template* p_precondition, TypeOfError_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TypeOfError_template::TypeOfError_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } TypeOfError_template::TypeOfError_template(const TypeOfError_template& other_value) : Base_Template() { copy_template(other_value); } TypeOfError_template::~TypeOfError_template() { clean_up(); } boolean TypeOfError_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean TypeOfError_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != TypeOfError::UNBOUND_VALUE; } void TypeOfError_template::clean_up() { switch (template_selection) { 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; } TypeOfError_template& TypeOfError_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TypeOfError_template& TypeOfError_template::operator=(int other_value) { if (!TypeOfError::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @RUA-IEs.TypeOfError.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (TypeOfError::enum_type)other_value; return *this; } TypeOfError_template& TypeOfError_template::operator=(TypeOfError::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } TypeOfError_template& TypeOfError_template::operator=(const TypeOfError& other_value) { if (other_value.enum_value == TypeOfError::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @RUA-IEs.TypeOfError to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } TypeOfError_template& TypeOfError_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (TypeOfError::enum_type)(const TypeOfError&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of enumerated type @RUA-IEs.TypeOfError."); } return *this; } TypeOfError_template& TypeOfError_template::operator=(const TypeOfError_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TypeOfError_template::match(TypeOfError::enum_type other_value, boolean) const { switch (template_selection) { case SPECIFIC_VALUE: return single_value == other_value; case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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)) 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 enumerated type @RUA-IEs.TypeOfError."); } return FALSE; } boolean TypeOfError_template::match(const TypeOfError& other_value, boolean) const { if (other_value.enum_value == TypeOfError::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @RUA-IEs.TypeOfError with an unbound value."); return match(other_value.enum_value); } TypeOfError::enum_type TypeOfError_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @RUA-IEs.TypeOfError."); return single_value; } void TypeOfError_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TypeOfError_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @RUA-IEs.TypeOfError."); } } TypeOfError_template& TypeOfError_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Accessing a list element in a non-list template of enumerated type @RUA-IEs.TypeOfError."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @RUA-IEs.TypeOfError."); return value_list.list_value[list_index]; } void TypeOfError_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(TypeOfError::enum_to_str(single_value), single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); value_list.list_value[elem_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 TypeOfError_template::log_match(const TypeOfError& match_value, boolean) const { match_value.log(); TTCN_Logger::log_event_str(" with "); log(); if (match(match_value)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } void TypeOfError_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value); 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 elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @RUA-IEs.TypeOfError."); } } void TypeOfError_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (TypeOfError::enum_type)text_buf.pull_int().get_val(); if (!TypeOfError::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @RUA-IEs.TypeOfError.", single_value); 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 TypeOfError_template[value_list.n_values]; for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++) value_list.list_value[elem_count].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @RUA-IEs.TypeOfError."); } } boolean TypeOfError_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TypeOfError_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 i=0; iget_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: { TypeOfError_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Enumerated: { TypeOfError::enum_type enum_val = TypeOfError::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!TypeOfError::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @RUA-IEs.TypeOfError."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { TypeOfError_template* precondition = new TypeOfError_template; precondition->set_param(*m_p->get_elem(0)); TypeOfError_template* implied_template = new TypeOfError_template; implied_template->set_param(*m_p->get_elem(1)); *this = TypeOfError_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@RUA-IEs.TypeOfError"); } is_ifpresent = param.get_ifpresent(); } void TypeOfError_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_VALUE: if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return; break; case TR_OMIT: if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return; break; 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 : "@RUA-IEs.TypeOfError"); } CriticalityDiagnostics__IE__List_0::CriticalityDiagnostics__IE__List_0() { } CriticalityDiagnostics__IE__List_0::CriticalityDiagnostics__IE__List_0(const RUA__CommonDataTypes::Criticality& par_iECriticality, const INTEGER& par_iE__ID, const TypeOfError& par_typeOfError, const OPTIONAL< _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 >& par_iE__Extensions) : field_iECriticality(par_iECriticality), field_iE__ID(par_iE__ID), field_typeOfError(par_typeOfError), field_iE__Extensions(par_iE__Extensions) { } CriticalityDiagnostics__IE__List_0::CriticalityDiagnostics__IE__List_0(const CriticalityDiagnostics__IE__List_0& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); if (other_value.iECriticality().is_bound()) field_iECriticality = other_value.iECriticality(); else field_iECriticality.clean_up(); if (other_value.iE__ID().is_bound()) field_iE__ID = other_value.iE__ID(); else field_iE__ID.clean_up(); if (other_value.typeOfError().is_bound()) field_typeOfError = other_value.typeOfError(); else field_typeOfError.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void CriticalityDiagnostics__IE__List_0::clean_up() { field_iECriticality.clean_up(); field_iE__ID.clean_up(); field_typeOfError.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* CriticalityDiagnostics__IE__List_0::get_descriptor() const { return &CriticalityDiagnostics__IE__List_0_descr_; } CriticalityDiagnostics__IE__List_0& CriticalityDiagnostics__IE__List_0::operator=(const CriticalityDiagnostics__IE__List_0& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); if (other_value.iECriticality().is_bound()) field_iECriticality = other_value.iECriticality(); else field_iECriticality.clean_up(); if (other_value.iE__ID().is_bound()) field_iE__ID = other_value.iE__ID(); else field_iE__ID.clean_up(); if (other_value.typeOfError().is_bound()) field_typeOfError = other_value.typeOfError(); else field_typeOfError.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } return *this; } boolean CriticalityDiagnostics__IE__List_0::operator==(const CriticalityDiagnostics__IE__List_0& other_value) const { return field_iECriticality==other_value.field_iECriticality && field_iE__ID==other_value.field_iE__ID && field_typeOfError==other_value.field_typeOfError && field_iE__Extensions==other_value.field_iE__Extensions; } boolean CriticalityDiagnostics__IE__List_0::is_bound() const { return (field_iECriticality.is_bound()) || (field_iE__ID.is_bound()) || (field_typeOfError.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean CriticalityDiagnostics__IE__List_0::is_value() const { return field_iECriticality.is_value() && field_iE__ID.is_value() && field_typeOfError.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int CriticalityDiagnostics__IE__List_0::size_of() const { int ret_val = 3; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void CriticalityDiagnostics__IE__List_0::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ iECriticality := "); field_iECriticality.log(); TTCN_Logger::log_event_str(", iE_ID := "); field_iE__ID.log(); TTCN_Logger::log_event_str(", typeOfError := "); field_typeOfError.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void CriticalityDiagnostics__IE__List_0::set_implicit_omit() { if (iECriticality().is_bound()) iECriticality().set_implicit_omit(); if (iE__ID().is_bound()) iE__ID().set_implicit_omit(); if (typeOfError().is_bound()) typeOfError().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void CriticalityDiagnostics__IE__List_0::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 (40 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iECriticality().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__ID().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) typeOfError().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().set_param(*param.get_elem(3)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "iECriticality")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iECriticality().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iE_ID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iE__ID().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "typeOfError")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { typeOfError().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iE_Extensions")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iE__Extensions().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); } } void CriticalityDiagnostics__IE__List_0::encode_text(Text_Buf& text_buf) const { field_iECriticality.encode_text(text_buf); field_iE__ID.encode_text(text_buf); field_typeOfError.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void CriticalityDiagnostics__IE__List_0::decode_text(Text_Buf& text_buf) { field_iECriticality.decode_text(text_buf); field_iE__ID.decode_text(text_buf); field_typeOfError.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void CriticalityDiagnostics__IE__List_0::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void CriticalityDiagnostics__IE__List_0::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* CriticalityDiagnostics__IE__List_0::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("iECriticality': "); new_tlv->add_TLV(field_iECriticality.BER_encode_TLV(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, p_coding)); ec_1.set_msg("iE_ID': "); new_tlv->add_TLV(field_iE__ID.BER_encode_TLV(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, p_coding)); ec_1.set_msg("typeOfError': "); new_tlv->add_TLV(field_typeOfError.BER_encode_TLV(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CriticalityDiagnostics__IE__List_0::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("iECriticality': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_iECriticality.BER_decode_TLV(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("iE_ID': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_iE__ID.BER_decode_TLV(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("typeOfError': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_typeOfError.BER_decode_TLV(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("iE_Extensions': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_iE__Extensions=OMIT_VALUE; else { field_iE__Extensions.BER_decode_TLV(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, tmp_tlv, L_form); if(field_iE__Extensions.ispresent()) tlv_present=FALSE; } } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); return TRUE; } int CriticalityDiagnostics__IE__List_0::JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); return -1; } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iECriticality"); enc_len += field_iECriticality.JSON_encode(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iE_ID"); enc_len += field_iE__ID.JSON_encode(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "typeOfError"); enc_len += field_typeOfError.JSON_encode(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, p_tok, FALSE); } if (field_iE__Extensions.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iE_Extensions"); enc_len += field_iE__Extensions.JSON_encode(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int CriticalityDiagnostics__IE__List_0::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean iECriticality_found = FALSE; boolean iE__ID_found = FALSE; boolean typeOfError_found = FALSE; boolean iE__Extensions_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (13 == name_len && 0 == strncmp(fld_name, "iECriticality", name_len)) { iECriticality_found = TRUE; int ret_val = field_iECriticality.JSON_decode(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 13, "iECriticality"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (5 == name_len && 0 == strncmp(fld_name, "iE_ID", name_len)) { iE__ID_found = TRUE; int ret_val = field_iE__ID.JSON_decode(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 5, "iE_ID"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (11 == name_len && 0 == strncmp(fld_name, "typeOfError", name_len)) { typeOfError_found = TRUE; int ret_val = field_typeOfError.JSON_decode(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 11, "typeOfError"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (13 == name_len && 0 == strncmp(fld_name, "iE_Extensions", name_len)) { iE__Extensions_found = TRUE; int ret_val = field_iE__Extensions.JSON_decode(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 13, "iE_Extensions"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!iECriticality_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "iECriticality"); return JSON_ERROR_FATAL; } if (!iE__ID_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "iE_ID"); return JSON_ERROR_FATAL; } if (!typeOfError_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "typeOfError"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int CriticalityDiagnostics__IE__List_0::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } char c = 0; if (field_iE__Extensions.is_present()) { c |= 64; } p_buf.put_c(c); field_iECriticality.OER_encode(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, p_buf); field_iE__ID.OER_encode(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, p_buf); field_typeOfError.OER_encode(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, p_buf); return 0; } int CriticalityDiagnostics__IE__List_0::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { const unsigned char* uc = p_buf.get_read_data(); p_buf.increase_pos(1); boolean has_extension = FALSE; if (uc[0] & 0x80) { has_extension = TRUE; } field_iECriticality.OER_decode(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, p_buf, p_oer); field_iE__ID.OER_decode(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, p_buf, p_oer); field_typeOfError.OER_decode(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, p_buf, p_oer); else field_iE__Extensions = OMIT_VALUE; if (has_extension) { size_t bytes = decode_oer_length(p_buf, FALSE); uc = p_buf.get_read_data(); p_buf.increase_pos(bytes); uc++; } return 0; } void CriticalityDiagnostics__IE__List_0::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } boolean ext_bit = FALSE; p_buf.PER_put_bit(ext_bit); boolean field_iE__Extensions_present = field_iE__Extensions.is_present(); p_buf.PER_put_bit(field_iE__Extensions_present); field_iECriticality.PER_encode(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, p_buf, p_options); field_iE__ID.PER_encode(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, p_buf, p_options); field_typeOfError.PER_encode(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, p_buf, p_options); } void CriticalityDiagnostics__IE__List_0::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); boolean ext_bit = p_buf.PER_get_bit(); boolean field_iE__Extensions_present = p_buf.PER_get_bit(); field_iECriticality.PER_decode(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, p_buf, p_options); field_iE__ID.PER_decode(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, p_buf, p_options); field_typeOfError.PER_decode(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, p_buf, p_options); else field_iE__Extensions = OMIT_VALUE; Vector ext_presences; if (ext_bit) { INTEGER length_; int normally_small_length = TRUE; int mul_16k; do { mul_16k = length_.PER_decode_length(p_buf, p_options, normally_small_length); if (mul_16k > 0) normally_small_length = FALSE; for (int i = 0; i < length_; ++i) { ext_presences.push_back(p_buf.PER_get_bit()); } } while (mul_16k > 0); } int nof_decoded_ext_adds = ext_presences.size(); for (int i = 0; i < nof_decoded_ext_adds; ++i) { if (ext_presences[i]) PER_skip_opentype(p_buf, p_options); } } struct CriticalityDiagnostics__IE__List_0_template::single_value_struct { RUA__CommonDataTypes::Criticality_template field_iECriticality; INTEGER_template field_iE__ID; TypeOfError_template field_typeOfError; _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template field_iE__Extensions; }; void CriticalityDiagnostics__IE__List_0_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_iECriticality = ANY_VALUE; single_value->field_iE__ID = ANY_VALUE; single_value->field_typeOfError = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void CriticalityDiagnostics__IE__List_0_template::copy_value(const CriticalityDiagnostics__IE__List_0& other_value) { single_value = new single_value_struct; if (other_value.iECriticality().is_bound()) { single_value->field_iECriticality = other_value.iECriticality(); } else { single_value->field_iECriticality.clean_up(); } if (other_value.iE__ID().is_bound()) { single_value->field_iE__ID = other_value.iE__ID(); } else { single_value->field_iE__ID.clean_up(); } if (other_value.typeOfError().is_bound()) { single_value->field_typeOfError = other_value.typeOfError(); } else { single_value->field_typeOfError.clean_up(); } if (other_value.iE__Extensions().is_bound()) { if (other_value.iE__Extensions().ispresent()) single_value->field_iE__Extensions = other_value.iE__Extensions()(); else single_value->field_iE__Extensions = OMIT_VALUE; } else { single_value->field_iE__Extensions.clean_up(); } set_selection(SPECIFIC_VALUE); } void CriticalityDiagnostics__IE__List_0_template::copy_template(const CriticalityDiagnostics__IE__List_0_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iECriticality().get_selection()) { single_value->field_iECriticality = other_value.iECriticality(); } else { single_value->field_iECriticality.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.iE__ID().get_selection()) { single_value->field_iE__ID = other_value.iE__ID(); } else { single_value->field_iE__ID.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.typeOfError().get_selection()) { single_value->field_typeOfError = other_value.typeOfError(); } else { single_value->field_typeOfError.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.iE__Extensions().get_selection()) { single_value->field_iE__Extensions = other_value.iE__Extensions(); } else { single_value->field_iE__Extensions.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 CriticalityDiagnostics__IE__List_0_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 CriticalityDiagnostics__IE__List_0_template(*other_value.implication_.precondition); implication_.implied_template = new CriticalityDiagnostics__IE__List_0_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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); break; } set_selection(other_value); } CriticalityDiagnostics__IE__List_0_template::CriticalityDiagnostics__IE__List_0_template() { } CriticalityDiagnostics__IE__List_0_template::CriticalityDiagnostics__IE__List_0_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CriticalityDiagnostics__IE__List_0_template::CriticalityDiagnostics__IE__List_0_template(const CriticalityDiagnostics__IE__List_0& other_value) { copy_value(other_value); } CriticalityDiagnostics__IE__List_0_template::CriticalityDiagnostics__IE__List_0_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const CriticalityDiagnostics__IE__List_0&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE from an unbound optional field."); } } CriticalityDiagnostics__IE__List_0_template::CriticalityDiagnostics__IE__List_0_template(CriticalityDiagnostics__IE__List_0_template* p_precondition, CriticalityDiagnostics__IE__List_0_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CriticalityDiagnostics__IE__List_0_template::CriticalityDiagnostics__IE__List_0_template(Dynamic_Match_Interface* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } CriticalityDiagnostics__IE__List_0_template::CriticalityDiagnostics__IE__List_0_template(const CriticalityDiagnostics__IE__List_0_template& other_value) : Base_Template() { copy_template(other_value); } CriticalityDiagnostics__IE__List_0_template::~CriticalityDiagnostics__IE__List_0_template() { clean_up(); } CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_0_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_0_template::operator=(const CriticalityDiagnostics__IE__List_0& other_value) { clean_up(); copy_value(other_value); return *this; } CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_0_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const CriticalityDiagnostics__IE__List_0&)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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); } return *this; } CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_0_template::operator=(const CriticalityDiagnostics__IE__List_0_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CriticalityDiagnostics__IE__List_0_template::match(const CriticalityDiagnostics__IE__List_0& 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.iECriticality().is_bound()) return FALSE; if(!single_value->field_iECriticality.match(other_value.iECriticality(), legacy))return FALSE; if(!other_value.iE__ID().is_bound()) return FALSE; if(!single_value->field_iE__ID.match(other_value.iE__ID(), legacy))return FALSE; if(!other_value.typeOfError().is_bound()) return FALSE; if(!single_value->field_typeOfError.match(other_value.typeOfError(), legacy))return FALSE; if(!other_value.iE__Extensions().is_bound()) return FALSE; if((other_value.iE__Extensions().ispresent() ? !single_value->field_iE__Extensions.match((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1&)other_value.iE__Extensions(), legacy) : !single_value->field_iE__Extensions.match_omit(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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); } return FALSE; } boolean CriticalityDiagnostics__IE__List_0_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iECriticality.is_bound() || single_value->field_iE__ID.is_bound() || single_value->field_typeOfError.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean CriticalityDiagnostics__IE__List_0_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iECriticality.is_value() && single_value->field_iE__ID.is_value() && single_value->field_typeOfError.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void CriticalityDiagnostics__IE__List_0_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; } CriticalityDiagnostics__IE__List_0 CriticalityDiagnostics__IE__List_0_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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); CriticalityDiagnostics__IE__List_0 ret_val; if (single_value->field_iECriticality.is_bound()) { ret_val.iECriticality() = single_value->field_iECriticality.valueof(); } if (single_value->field_iE__ID.is_bound()) { ret_val.iE__ID() = single_value->field_iE__ID.valueof(); } if (single_value->field_typeOfError.is_bound()) { ret_val.typeOfError() = single_value->field_typeOfError.valueof(); } if (single_value->field_iE__Extensions.is_omit()) ret_val.iE__Extensions() = OMIT_VALUE; else if (single_value->field_iE__Extensions.is_bound()) { ret_val.iE__Extensions() = single_value->field_iE__Extensions.valueof(); } return ret_val; } void CriticalityDiagnostics__IE__List_0_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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CriticalityDiagnostics__IE__List_0_template[list_length]; } CriticalityDiagnostics__IE__List_0_template& CriticalityDiagnostics__IE__List_0_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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); return value_list.list_value[list_index]; } RUA__CommonDataTypes::Criticality_template& CriticalityDiagnostics__IE__List_0_template::iECriticality() { set_specific(); return single_value->field_iECriticality; } const RUA__CommonDataTypes::Criticality_template& CriticalityDiagnostics__IE__List_0_template::iECriticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iECriticality of a non-specific template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); return single_value->field_iECriticality; } INTEGER_template& CriticalityDiagnostics__IE__List_0_template::iE__ID() { set_specific(); return single_value->field_iE__ID; } const INTEGER_template& CriticalityDiagnostics__IE__List_0_template::iE__ID() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_ID of a non-specific template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); return single_value->field_iE__ID; } TypeOfError_template& CriticalityDiagnostics__IE__List_0_template::typeOfError() { set_specific(); return single_value->field_typeOfError; } const TypeOfError_template& CriticalityDiagnostics__IE__List_0_template::typeOfError() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field typeOfError of a non-specific template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); return single_value->field_typeOfError; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& CriticalityDiagnostics__IE__List_0_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& CriticalityDiagnostics__IE__List_0_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); return single_value->field_iE__Extensions; } int CriticalityDiagnostics__IE__List_0_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 3; if (single_value->field_iE__Extensions.is_present()) ret_val++; return ret_val; } case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE 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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); } return 0; } void CriticalityDiagnostics__IE__List_0_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iECriticality := "); single_value->field_iECriticality.log(); TTCN_Logger::log_event_str(", iE_ID := "); single_value->field_iE__ID.log(); TTCN_Logger::log_event_str(", typeOfError := "); single_value->field_typeOfError.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); single_value->field_iE__Extensions.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 CriticalityDiagnostics__IE__List_0_template::log_match(const CriticalityDiagnostics__IE__List_0& 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_iECriticality.match(match_value.iECriticality(), legacy)){ TTCN_Logger::log_logmatch_info(".iECriticality"); single_value->field_iECriticality.log_match(match_value.iECriticality(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_iE__ID.match(match_value.iE__ID(), legacy)){ TTCN_Logger::log_logmatch_info(".iE_ID"); single_value->field_iE__ID.log_match(match_value.iE__ID(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_typeOfError.match(match_value.typeOfError(), legacy)){ TTCN_Logger::log_logmatch_info(".typeOfError"); single_value->field_typeOfError.log_match(match_value.typeOfError(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.iE__Extensions().ispresent()){ if(!single_value->field_iE__Extensions.match(match_value.iE__Extensions(), legacy)){ TTCN_Logger::log_logmatch_info(".iE_Extensions"); single_value->field_iE__Extensions.log_match(match_value.iE__Extensions(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_iE__Extensions.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".iE_Extensions := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_iE__Extensions.log(); TTCN_Logger::log_event_str(" unmatched"); 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("{ iECriticality := "); single_value->field_iECriticality.log_match(match_value.iECriticality(), legacy); TTCN_Logger::log_event_str(", iE_ID := "); single_value->field_iE__ID.log_match(match_value.iE__ID(), legacy); TTCN_Logger::log_event_str(", typeOfError := "); single_value->field_typeOfError.log_match(match_value.typeOfError(), legacy); TTCN_Logger::log_event_str(", iE_Extensions := "); if (match_value.iE__Extensions().ispresent()) { single_value->field_iE__Extensions.log_match(match_value.iE__Extensions(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_iE__Extensions.log(); if (single_value->field_iE__Extensions.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } 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 CriticalityDiagnostics__IE__List_0_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (iECriticality().is_bound()) iECriticality().set_implicit_omit(); if (iE__ID().is_bound()) iE__ID().set_implicit_omit(); if (typeOfError().is_bound()) typeOfError().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void CriticalityDiagnostics__IE__List_0_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iECriticality.encode_text(text_buf); single_value->field_iE__ID.encode_text(text_buf); single_value->field_typeOfError.encode_text(text_buf); single_value->field_iE__Extensions.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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); } } void CriticalityDiagnostics__IE__List_0_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_iECriticality.decode_text(text_buf); single_value->field_iE__ID.decode_text(text_buf); single_value->field_typeOfError.decode_text(text_buf); single_value->field_iE__Extensions.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 CriticalityDiagnostics__IE__List_0_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 @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); } } void CriticalityDiagnostics__IE__List_0_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: { CriticalityDiagnostics__IE__List_0_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iECriticality().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__ID().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) typeOfError().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().set_param(*param.get_elem(3)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "iECriticality")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iECriticality().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iE_ID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iE__ID().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "typeOfError")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { typeOfError().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iE_Extensions")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iE__Extensions().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { CriticalityDiagnostics__IE__List_0_template* precondition = new CriticalityDiagnostics__IE__List_0_template; precondition->set_param(*param.get_elem(0)); CriticalityDiagnostics__IE__List_0_template* implied_template = new CriticalityDiagnostics__IE__List_0_template; implied_template->set_param(*param.get_elem(1)); *this = CriticalityDiagnostics__IE__List_0_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); } is_ifpresent = param.get_ifpresent(); } void CriticalityDiagnostics__IE__List_0_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_iECriticality.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); single_value->field_iE__ID.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); single_value->field_typeOfError.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); 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 : "@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); } boolean CriticalityDiagnostics__IE__List_0_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CriticalityDiagnostics__IE__List_0_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_idxref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::~_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::clean_up() { if (val_ptr != NULL) { if (val_ptr->ref_count > 1) { val_ptr->ref_count--; val_ptr = NULL; } else if (val_ptr->ref_count == 1) { for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL) delete val_ptr->value_elements[elem_count]; free_pointers((void**)val_ptr->value_elements); delete val_ptr; val_ptr = NULL; } else TTCN_error("Internal error: Invalid reference counter in a record of/set of value."); } } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator=(null_type) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator=(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return val_ptr->n_elements == 0 ; } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator==(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (val_ptr == other_value.val_ptr) return TRUE; if (val_ptr->n_elements != (other_value.val_ptr)->n_elements) return FALSE; for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ if ((other_value.val_ptr)->value_elements[elem_count] != NULL){ if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE; } else return FALSE; } else { if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE; } } return TRUE; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 using a negative index: %d.", index_value); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements; new_val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (index_value >= val_ptr->n_elements) set_size(index_value + 1); if (val_ptr->value_elements[index_value] == NULL) { val_ptr->value_elements[index_value] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1; } return *val_ptr->value_elements[index_value]; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return (*this)[(int)index_value]; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (index_value < 0) TTCN_error("Accessing an element of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements); return (val_ptr->value_elements[index_value] == NULL) ? UNBOUND_ELEM : *val_ptr->value_elements[index_value]; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return (*this)[(int)index_value]; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (val_ptr->n_elements == 0) return *this; int rc; if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements; else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements); if (rc == 0) return *this; _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 ret_val; ret_val.set_size(val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*val_ptr->value_elements[i]); } } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::operator+(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 ret_val; ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*val_ptr->value_elements[i]); } } for (int i=0; in_elements; i++) { if (other_value.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1","element"); _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::replace(int index, int len, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); check_replace_arguments(val_ptr->n_elements, index, len, "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1","element"); _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 ret_val; ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len); for (int i = 0; i < index; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*val_ptr->value_elements[i]); } } for (int i = 0; i < repl.val_ptr->n_elements; i++) { if (repl.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+index] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*repl.val_ptr->value_elements[i]); } } for (int i = 0; i < val_ptr->n_elements - index - len; i++) { if (val_ptr->value_elements[index+i+len] != NULL) { ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::replace(int index, int len, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& repl) const { if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return replace(index, len, repl.valueof()); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements; new_val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) { if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); #ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1: %d",new_size); #endif val_ptr->n_elements = new_size; } else if (new_size < val_ptr->n_elements) { for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count]; val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::is_value() const { if (val_ptr == NULL) return FALSE; for(int i = 0; i < val_ptr->n_elements; ++i) { if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE; } return TRUE; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return val_ptr->n_elements; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length; return 0; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::log() const { if (val_ptr == NULL) {; TTCN_Logger::log_event_unbound(); return; } switch (val_ptr->n_elements) { case 0: TTCN_Logger::log_event_str("{ }"); break; default: TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); (*this)[elem_count].log(); } TTCN_Logger::log_event_str(" }"); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::set_implicit_omit() { if (val_ptr == NULL) return; for (int i = 0; i < val_ptr->n_elements; i++) { if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit(); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value"); switch (param.get_operation_type()) { case Module_Param::OT_ASSIGN: if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) { *this = NULL_VALUE; return; } switch (param.get_type()) { case Module_Param::MP_Value_List: set_size(param.get_size()); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed) { (*this)[i].set_param(*curr); if (!(*this)[i].is_bound()) { delete val_ptr->value_elements[i]; val_ptr->value_elements[i] = NULL; } } } break; case Module_Param::MP_Indexed_List: for (size_t i=0; iget_id()->get_index()].set_param(*curr); if (!(*this)[curr->get_id()->get_index()].is_bound()) { delete val_ptr->value_elements[curr->get_id()->get_index()]; val_ptr->value_elements[curr->get_id()->get_index()] = NULL; } } break; default: param.type_error("record of value", "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1"); } break; case Module_Param::OT_CONCAT: switch (param.get_type()) { case Module_Param::MP_Value_List: { if (!is_bound()) *this = NULL_VALUE; int start_idx = lengthof(); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed)) { (*this)[start_idx+(int)i].set_param(*curr); } } } break; case Module_Param::MP_Indexed_List: param.error("Cannot concatenate an indexed value list"); break; default: param.type_error("record of value", "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); text_buf.push_int(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) (*this)[elem_count].encode_text(text_buf); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::decode_text(Text_Buf& text_buf) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = text_buf.pull_int().get_val(); if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1**)allocate_pointers(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { val_ptr->value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec; for(int elem_i=0; elem_in_elements; elem_i++) { ec.set_msg("Component #%d: ", elem_i); new_tlv->add_TLV((*this)[elem_i].BER_encode_TLV(*p_td.oftype_descr, p_coding)); } } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '%s' type: ", p_td.name); stripped_tlv.chk_constructed_flag(TRUE); clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; TTCN_EncDec_ErrorContext ec_1("Component #"); TTCN_EncDec_ErrorContext ec_2("0: "); while(BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv)) { val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, val_ptr->n_elements + 1); val_ptr->n_elements++; val_ptr->value_elements[val_ptr->n_elements - 1] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1; val_ptr->value_elements[val_ptr->n_elements - 1]->BER_decode_TLV(*p_td.oftype_descr, tmp_tlv, L_form); ec_2.set_msg("%d: ", val_ptr->n_elements); } return TRUE; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return -1; } int enc_len = p_tok.put_next_token(p_td.json->as_map ? JSON_TOKEN_OBJECT_START : JSON_TOKEN_ARRAY_START, NULL); for (int i = 0; i < val_ptr->n_elements; ++i) { if (p_td.json->metainfo_unbound && !(*this)[i].is_bound()) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "metainfo []"); enc_len += p_tok.put_next_token(JSON_TOKEN_STRING, "\"unbound\""); enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } else { int ret_val = (*this)[i].JSON_encode(*p_td.oftype_descr, p_tok, p_td.json->as_map); if (0 > ret_val) break; enc_len += ret_val; } } enc_len += p_tok.put_next_token(p_td.json->as_map ? JSON_TOKEN_OBJECT_END : JSON_TOKEN_ARRAY_END, NULL); return enc_len; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { set_size(0); return strlen(p_td.json->default_value.str); } json_token_t token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if ((!p_td.json->as_map && JSON_TOKEN_ARRAY_START != token) || (p_td.json->as_map && JSON_TOKEN_OBJECT_START != token)) { return JSON_ERROR_INVALID_TOKEN; } set_size(0); for (int nof_elements = 0; TRUE; ++nof_elements) { size_t buf_pos = p_tok.get_buf_pos(); size_t ret_val; if (p_td.json->metainfo_unbound) { ret_val = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_OBJECT_START == token) { char* value = NULL; size_t value_len = 0; ret_val += p_tok.get_next_token(&token, &value, &value_len); if (JSON_TOKEN_NAME == token && 11 == value_len && 0 == strncmp(value, "metainfo []", 11)) { ret_val += p_tok.get_next_token(&token, &value, &value_len); if (JSON_TOKEN_STRING == token && 9 == value_len && 0 == strncmp(value, "\"unbound\"", 9)) { ret_val = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_OBJECT_END == token) { dec_len += ret_val; continue; } } } } p_tok.set_buf_pos(buf_pos); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1* val = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1; int ret_val2 = val->JSON_decode(*p_td.oftype_descr, p_tok, p_silent, p_td.json->as_map); if (JSON_ERROR_INVALID_TOKEN == ret_val2) { p_tok.set_buf_pos(buf_pos); delete val; break; } else if (JSON_ERROR_FATAL == ret_val2) { delete val; if (p_silent) { clean_up(); } return JSON_ERROR_FATAL; } val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1**)reallocate_pointers( (void**)val_ptr->value_elements, val_ptr->n_elements, nof_elements + 1); val_ptr->value_elements[nof_elements] = val; val_ptr->n_elements = nof_elements + 1; dec_len += (size_t)ret_val2; } dec_len += p_tok.get_next_token(&token, NULL, NULL); if ((!p_td.json->as_map && JSON_TOKEN_ARRAY_END != token) || (p_td.json->as_map && JSON_TOKEN_OBJECT_END != token)) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_REC_OF_END_TOKEN_ERROR, ""); if (p_silent) { clean_up(); } return JSON_ERROR_FATAL; } return (int)dec_len; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::OER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return -1; } encode_oer_length(val_ptr->n_elements, p_buf, TRUE); for (int i = 0; i < val_ptr->n_elements; ++i) { (*this)[i].OER_encode(*p_td.oftype_descr, p_buf); } return 0; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::OER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, OER_struct& p_oer) { size_t nof_elem = decode_oer_length(p_buf, TRUE); set_size(nof_elem); for (size_t i = 0; i < nof_elem; i++) { (*this)[i].OER_decode(*p_td.oftype_descr, p_buf, p_oer); } return 0; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE OF value."); return; } const Per_Integer_Constraint* cons = dynamic_cast(p_td.per->c); if (cons == NULL) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INTERNAL, "Internal error: Invalid constraint in PER descriptor."); return; } INTEGER length(val_ptr->n_elements); boolean extendable = cons->has_extension_marker(); boolean within_ext_root = cons->is_within_extension_root(length); if (!within_ext_root && !extendable) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_CONSTRAINT, "Encoding an invalid SEQUENCE OF value (does not match PER-visible constraints)."); return; } boolean ext_bit = extendable && !within_ext_root; if (extendable) p_buf.PER_put_bit(ext_bit); INTEGER length_ub = cons->has_upper_bound() ? cons->get_upper_bound() : INTEGER(-1); if (length_ub >= PER_64K) length_ub = -1; INTEGER range = (ext_bit || length_ub < 0) ? INTEGER(0) : cons->get_nof_values(); if (range == 1 && length == 0) return; int mul_16k; int pos = 0; do { mul_16k = (range == 1) ? 0 : length.PER_encode_length(p_buf, p_options, range, cons->get_lower_bound(), length_ub); int elements_encoded = (mul_16k == 0) ? (int)length : mul_16k * PER_16K; for (int i = 0; i < elements_encoded; ++i) { (*this)[i + pos].PER_encode(*p_td.oftype_descr, p_buf, p_options); } if (mul_16k > 0) { pos += elements_encoded; length = length - elements_encoded; range = 0; } } while (mul_16k > 0); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { const Per_Integer_Constraint* cons = dynamic_cast(p_td.per->c); if (cons == NULL) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INTERNAL, "Internal error: Invalid constraint in PER descriptor."); return; } clean_up(); boolean extendable = cons->has_extension_marker(); boolean ext_bit = extendable ? p_buf.PER_get_bit() : FALSE; INTEGER length_ub = cons->has_upper_bound() ? cons->get_upper_bound() : INTEGER(-1); if (length_ub >= PER_64K) length_ub = -1; INTEGER range = (ext_bit || length_ub < 0) ? INTEGER(0) : cons->get_nof_values(); int mul_16k; INTEGER length; int current_size = 0; do { mul_16k = length.PER_decode_length(p_buf, p_options, range, cons->get_lower_bound(), length_ub); if (mul_16k != 0) range = 0; int new_size = current_size + (int)length; set_size(new_size); for (int i = current_size; i < new_size; ++i) { (*this)[i].PER_decode(*p_td.oftype_descr, p_buf, p_options); } current_size = new_size; } while (mul_16k > 0); if (!ext_bit && !cons->is_within_extension_root(val_ptr->n_elements)) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_CONSTRAINT, "Decoded SEQUENCE OF value does not match PER-visible constraints."); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::copy_value(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (other_value[elem_count].is_bound()) { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template; } } set_selection(SPECIFIC_VALUE); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::copy_template(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.n_elements = other_value.single_value.n_elements; single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template; } } 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 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_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 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(*other_value.implication_.precondition); implication_.implied_template = new _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_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 @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); break; } set_selection(other_value); } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy) { if (value_index >= 0) return ((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1*)value_ptr)[value_index], legacy); else return ((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template() { } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value) { copy_value(other_value); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 from an unbound optional field."); } } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template* p_precondition, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(Dynamic_Match_Interface<_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::~_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template() { clean_up(); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; free_pointers((void**)single_value.value_elements); 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; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator=(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value) { clean_up(); copy_value(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator=(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1&)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 @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); } return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator=(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 using a negative index: %d.", index_value); switch (template_selection) { case SPECIFIC_VALUE: if(index_value < single_value.n_elements) break; // no break case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: case UNINITIALIZED_TEMPLATE: set_size(index_value + 1); break; default: TTCN_error("Accessing an element of a non-specific template for type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); break; } return *single_value.value_elements[index_value]; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return (*this)[(int)index_value]; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements); return *single_value.value_elements[index_value]; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return (*this)[(int)index_value]; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); template_sel old_selection = template_selection; if (old_selection != SPECIFIC_VALUE) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; } if (new_size > single_value.n_elements) { single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(ANY_VALUE); } else { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template; } single_value.n_elements = new_size; } else if (new_size < single_value.n_elements) { for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::n_elem() const { switch (template_selection) { case SPECIFIC_VALUE: return single_value.n_elements; break; case VALUE_LIST: return value_list.n_values; break; default: TTCN_error("Performing n_elem"); } } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::size_of(boolean is_size) const { const char* op_name = is_size ? "size" : "length"; int min_size; boolean has_any_or_none; if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 which has an ifpresent attribute.", op_name); switch (template_selection) { case SPECIFIC_VALUE: { min_size = 0; has_any_or_none = FALSE; int elem_count = single_value.n_elements; if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; } for (int i=0; iget_selection()) { case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 containing omit element.", op_name); case ANY_OR_OMIT: has_any_or_none = TRUE; break; default: min_size++; break; } } } break; case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 containing omit value.", op_name); case ANY_VALUE: case ANY_OR_OMIT: min_size = 0; has_any_or_none = TRUE; break; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 containing an empty list.", op_name); int item_size = value_list.list_value[0].size_of(is_size); for (unsigned int i = 1; i < value_list.n_values; i++) { if (value_list.list_value[i].size_of(is_size)!=item_size) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 containing a value list with different sizes.", op_name); } min_size = item_size; has_any_or_none = FALSE; break; } case COMPLEMENTED_LIST: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1"); } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::match(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value, boolean legacy) const { if (!other_value.is_bound()) return FALSE; int value_length = other_value.size_of(); if (!match_length(value_length)) return FALSE; switch (template_selection) { case SPECIFIC_VALUE: return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy); case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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 with an uninitialized/unsupported template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); } return FALSE; } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (!single_value.value_elements[elem_count]->is_value()) return FALSE; return TRUE; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_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 @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 ret_val; ret_val.set_size(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (single_value.value_elements[elem_count]->is_bound()) { ret_val[elem_count] = single_value.value_elements[elem_count]->valueof(); } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::substr(int index, int returncount) const { if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value."); return valueof().substr(index, returncount); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::replace(int index, int len, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl.valueof()); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::replace(int index, int len, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = list_length; value_list.list_value = new _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); } set_selection(template_type); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return value_list.list_value[list_index]; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: if (single_value.n_elements > 0) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation("); single_value.value_elements[elem_count]->log(); if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')'); } TTCN_Logger::log_event_str(" }"); } else 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_restricted(); log_ifpresent(); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::log_match(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){ TTCN_Logger::log_logmatch_info("[%d]", elem_count); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } log_match_length(single_value.n_elements); } 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); } TTCN_Logger::log_event_str(" }"); log_match_length(single_value.n_elements); } 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 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::encode_text(Text_Buf& text_buf) const { encode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) single_value.value_elements[elem_count]->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 @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value.n_elements = text_buf.pull_int().get_val(); if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template; single_value.value_elements[elem_count]->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 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_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 for a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); } } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_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 i=0; iset_implicit_omit(); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of 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: { _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template temp; 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_iget_id()->get_index())].set_param(*param.get_elem(p_i)); } break; case Module_Param::MP_Value_List: { set_size(param.get_size()); int curr_idx = 0; for (size_t p_i=0; p_iget_type()) { case Module_Param::MP_NotUsed: curr_idx++; break; case Module_Param::MP_Permutation_Template: { int perm_start_idx = curr_idx; Module_Param* param_i = param.get_elem(p_i); for (size_t perm_i=0; perm_iget_size(); perm_i++) { (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i))); curr_idx++; } int perm_end_idx = curr_idx - 1; add_permutation(perm_start_idx, perm_end_idx); } break; default: (*this)[curr_idx].set_param(*param.get_elem(p_i)); curr_idx++; } } } break; case Module_Param::MP_Implication_Template: { _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template* precondition = new _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template; precondition->set_param(*param.get_elem(0)); _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template* implied_template = new _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template; implied_template->set_param(*param.get_elem(1)); *this = _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template(precondition, implied_template); } break; default: param.type_error("record of template", "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_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; for (int i=0; icheck_restriction(t_res, t_name ? t_name : "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1"); 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 : "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1"); } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_template::get_istemplate_kind(const char* type) const { if (!strcmp(type, "AnyElement")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_VALUE) { return TRUE; } } return FALSE; } else if (!strcmp(type, "AnyElementsOrNone")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) { return TRUE; } } return FALSE; } else if (!strcmp(type, "permutation")) { return number_of_permutations; } else if (!strcmp(type, "length")) { return length_restriction_type != NO_LENGTH_RESTRICTION; } else { return Base_Template::get_istemplate_kind(type); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::copy_value(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } union_selection = other_value.union_selection; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::~_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type() { clean_up(); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::operator==(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::ischosen(union_selection_type checked_selection) const { if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); return union_selection == checked_selection; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "union value"); Module_Param_Ptr m_p = ¶m; if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return; if (m_p->get_type()!=Module_Param::MP_Assignment_List) { param.error("union value with field name was expected"); } Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); mp_last->error("Field %s does not exist in type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type.", last_name); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { default: TTCN_error("Text encoder: Encoding an unbound value of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { default: TTCN_error("Text decoder: Unrecognized union selector was received for type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t *_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv; TTCN_EncDec_ErrorContext ec_0("Alternative '"); TTCN_EncDec_ErrorContext ec_1; switch (union_selection) { case UNBOUND_VALUE: new_tlv = BER_encode_chk_bound(FALSE); break; default: TTCN_EncDec_ErrorContext::error_internal("Unknown selection."); new_tlv = NULL; } return ASN_BER_V2TLV(new_tlv, p_td, p_coding); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type' type: "); if (!BER_decode_TLV_CHOICE(*p_td.ber, stripped_tlv, L_form, tlv_opentype)) { tlv_opentype.Tlen = 0; return FALSE; } clean_up(); union_selection = UNBOUND_VALUE; return TRUE; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::BER_decode_opentypes(TTCN_Type_list& p_typelist, unsigned L_form) { if (union_selection != UNBOUND_VALUE) return; TTCN_EncDec_ErrorContext ec_0("While decoding open type '@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean) const { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Cannot encode union of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type, because it has zero alternatives."); return -1; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int p_chosen_field) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, "Cannot decode union of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); return -1; } return 0; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { size_t pos = decode_oer_length(p_buf, FALSE); size_t prev_pos = p_buf.get_pos(); p_buf.increase_pos(pos); p_oer.opentype_poses.push_back(prev_pos); return 0; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::OER_decode_opentypes(TTCN_Type_list& p_typelist, TTCN_Buffer& p_buf, OER_struct& p_oer) { if (union_selection != UNBOUND_VALUE) return; TTCN_EncDec_ErrorContext ec_0("While decoding open type '@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::copy_value(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { default: TTCN_error("Initializing a template with an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::copy_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.union_selection = other_value.single_value.union_selection; switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_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 template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } set_selection(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template() { } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& other_value) { copy_value(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type from an unbound optional field."); } } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template* p_precondition, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template(Dynamic_Match_Interface<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::~_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template() { clean_up(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { default: break; } 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; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::operator=(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::match(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& 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: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } } 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 template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } return FALSE; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type ret_val; switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } return ret_val; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::list_item(unsigned int list_index) const { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); return value_list.list_value[list_index]; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_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 ("Internal error: Setting an invalid list for a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template[list_length]; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::ischosen(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); return single_value.union_selection == checked_selection; case VALUE_LIST: { if (value_list.n_values < 1) TTCN_error("Internal error: Performing ischosen() operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type containing an empty list."); boolean ret_val = value_list.list_value[0].ischosen(checked_selection); for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) { ret_val = value_list.list_value[list_count].ischosen(checked_selection); } return ret_val; } default: return FALSE; } return FALSE; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { default: 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::log_match(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); return; } if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) { switch (single_value.union_selection) { default: TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(""); } } else { TTCN_Logger::print_logmatch_buffer(); 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.union_selection); switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } 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 template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::UNBOUND_VALUE; _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::union_selection_type new_selection = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } single_value.union_selection = new_selection; } 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_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: Unrecognized selector was received in a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_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 v_idx=0; v_idx(param.get_id()) != NULL && param.get_id()->next_name()) { char* param_field = param.get_id()->get_current_name(); if (param_field[0] >= '0' && param_field[0] <= '9') { param.error("Unexpected array index in module parameter, expected a valid field" " name for union template type `@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type'", param_field); } param.basic_check(Module_Param::BC_TEMPLATE, "union template"); Module_Param_Ptr m_p = ¶m; switch (m_p->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: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Value_List: if (m_p->get_size()==0) break; param.type_error("union template", "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type"); break; case Module_Param::MP_Assignment_List: { Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); mp_last->error("Field %s does not exist in type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template* precondition = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template* implied_template = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_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; switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type."); } 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 : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1.extensionValue.type"); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1() { } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(const INTEGER& par_id, const RUA__CommonDataTypes::Criticality& par_criticality, const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); if (other_value.id().is_bound()) field_id = other_value.id(); else field_id.clean_up(); if (other_value.criticality().is_bound()) field_criticality = other_value.criticality(); else field_criticality.clean_up(); if (other_value.extensionValue().is_bound()) field_extensionValue = other_value.extensionValue(); else field_extensionValue.clean_up(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::get_descriptor() const { return &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_descr_; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); if (other_value.id().is_bound()) field_id = other_value.id(); else field_id.clean_up(); if (other_value.criticality().is_bound()) field_criticality = other_value.criticality(); else field_criticality.clean_up(); if (other_value.extensionValue().is_bound()) field_extensionValue = other_value.extensionValue(); else field_extensionValue.clean_up(); } return *this; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::operator==(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ id := "); field_id.log(); TTCN_Logger::log_event_str(", criticality := "); field_criticality.log(); TTCN_Logger::log_event_str(", extensionValue := "); field_extensionValue.log(); TTCN_Logger::log_event_str(" }"); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::set_implicit_omit() { if (id().is_bound()) id().set_implicit_omit(); if (criticality().is_bound()) criticality().set_implicit_omit(); if (extensionValue().is_bound()) extensionValue().set_implicit_omit(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::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 (30 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) criticality().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) extensionValue().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "criticality")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { criticality().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extensionValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extensionValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1"); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::encode_text(Text_Buf& text_buf) const { field_id.encode_text(text_buf); field_criticality.encode_text(text_buf); field_extensionValue.encode_text(text_buf); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::decode_text(Text_Buf& text_buf) { field_id.decode_text(text_buf); field_criticality.decode_text(text_buf); field_extensionValue.decode_text(text_buf); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("id': "); new_tlv->add_TLV(field_id.BER_encode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("id': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_id.BER_decode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("criticality': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_criticality.BER_decode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("extensionValue': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_extensionValue.BER_decode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); TTCN_EncDec_ErrorContext ec_1("While decoding opentypes: "); TTCN_Type_list p_typelist; BER_decode_opentypes(p_typelist, L_form); return TRUE; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::BER_decode_opentypes(TTCN_Type_list& p_typelist, unsigned L_form) { p_typelist.push(this); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("id': "); field_id.BER_decode_opentypes(p_typelist, L_form); ec_1.set_msg("criticality': "); field_criticality.BER_decode_opentypes(p_typelist, L_form); ec_1.set_msg("extensionValue': "); field_extensionValue.BER_decode_opentypes(p_typelist, L_form); p_typelist.pop(); } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); return -1; } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "id"); enc_len += field_id.JSON_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean id_found = FALSE; boolean criticality_found = FALSE; boolean extensionValue_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (2 == name_len && 0 == strncmp(fld_name, "id", name_len)) { id_found = TRUE; int ret_val = field_id.JSON_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 2, "id"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (11 == name_len && 0 == strncmp(fld_name, "criticality", name_len)) { criticality_found = TRUE; int ret_val = field_criticality.JSON_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 11, "criticality"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (14 == name_len && 0 == strncmp(fld_name, "extensionValue", name_len)) { extensionValue_found = TRUE; int ret_val = field_extensionValue.JSON_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 14, "extensionValue"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!id_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "id"); return JSON_ERROR_FATAL; } if (!criticality_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "criticality"); return JSON_ERROR_FATAL; } if (!extensionValue_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "extensionValue"); return JSON_ERROR_FATAL; } return (int)dec_len; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_id.OER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, p_buf); field_criticality.OER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, p_buf); return 0; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, p_buf, p_oer); TTCN_EncDec_ErrorContext ec_1("While decoding opentypes: "); TTCN_Type_list p_typelist; OER_decode_opentypes(p_typelist, p_buf, p_oer); return 0; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::OER_decode_opentypes(TTCN_Type_list& p_typelist, TTCN_Buffer& p_buf, OER_struct& p_oer) { p_typelist.push(this); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("id': "); field_id.OER_decode_opentypes(p_typelist, p_buf, p_oer); ec_1.set_msg("criticality': "); field_criticality.OER_decode_opentypes(p_typelist, p_buf, p_oer); ec_1.set_msg("extensionValue': "); field_extensionValue.OER_decode_opentypes(p_typelist, p_buf, p_oer); p_typelist.pop(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_id.PER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, p_buf, p_options); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, p_buf, p_options); TTCN_EncDec_ErrorContext ec_1("While decoding opentypes: ");TTCN_Type_list p_typelist; PER_decode_opentypes(p_typelist, p_options); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1::PER_decode_opentypes(TTCN_Type_list& p_typelist, int p_options) { p_typelist.push(this); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("id': "); field_id.PER_decode_opentypes(p_typelist, p_options); ec_1.set_msg("criticality': "); field_criticality.PER_decode_opentypes(p_typelist, p_options); ec_1.set_msg("extensionValue': "); field_extensionValue.PER_decode_opentypes(p_typelist, p_options); p_typelist.pop(); } struct _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::single_value_struct { INTEGER_template field_id; RUA__CommonDataTypes::Criticality_template field_criticality; _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template field_extensionValue; }; void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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_id = ANY_VALUE; single_value->field_criticality = ANY_VALUE; single_value->field_extensionValue = ANY_VALUE; } } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::copy_value(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& other_value) { single_value = new single_value_struct; if (other_value.id().is_bound()) { single_value->field_id = other_value.id(); } else { single_value->field_id.clean_up(); } if (other_value.criticality().is_bound()) { single_value->field_criticality = other_value.criticality(); } else { single_value->field_criticality.clean_up(); } if (other_value.extensionValue().is_bound()) { single_value->field_extensionValue = other_value.extensionValue(); } else { single_value->field_extensionValue.clean_up(); } set_selection(SPECIFIC_VALUE); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::copy_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.id().get_selection()) { single_value->field_id = other_value.id(); } else { single_value->field_id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.criticality().get_selection()) { single_value->field_criticality = other_value.criticality(); } else { single_value->field_criticality.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.extensionValue().get_selection()) { single_value->field_extensionValue = other_value.extensionValue(); } else { single_value->field_extensionValue.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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(*other_value.implication_.precondition); implication_.implied_template = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); break; } set_selection(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template() { } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& other_value) { copy_value(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 from an unbound optional field."); } } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template* p_precondition, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(Dynamic_Match_Interface<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& other_value) : Base_Template() { copy_template(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::~_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template() { clean_up(); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& other_value) { clean_up(); copy_value(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::operator=(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1&)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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); } return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::match(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& 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.id().is_bound()) return FALSE; if(!single_value->field_id.match(other_value.id(), legacy))return FALSE; if(!other_value.criticality().is_bound()) return FALSE; if(!single_value->field_criticality.match(other_value.criticality(), legacy))return FALSE; if(!other_value.extensionValue().is_bound()) return FALSE; if(!single_value->field_extensionValue.match(other_value.extensionValue(), 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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); } return FALSE; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_id.is_bound() || single_value->field_criticality.is_bound() || single_value->field_extensionValue.is_bound(); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_id.is_value() && single_value->field_criticality.is_value() && single_value->field_extensionValue.is_value(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1 ret_val; if (single_value->field_id.is_bound()) { ret_val.id() = single_value->field_id.valueof(); } if (single_value->field_criticality.is_bound()) { ret_val.criticality() = single_value->field_criticality.valueof(); } if (single_value->field_extensionValue.is_bound()) { ret_val.extensionValue() = single_value->field_extensionValue.valueof(); } return ret_val; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template[list_length]; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); return value_list.list_value[list_index]; } INTEGER_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); return single_value->field_id; } RUA__CommonDataTypes::Criticality_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::criticality() { set_specific(); return single_value->field_criticality; } const RUA__CommonDataTypes::Criticality_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); return single_value->field_criticality; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); return single_value->field_extensionValue; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); } return 0; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ id := "); single_value->field_id.log(); TTCN_Logger::log_event_str(", criticality := "); single_value->field_criticality.log(); TTCN_Logger::log_event_str(", extensionValue := "); single_value->field_extensionValue.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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::log_match(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& 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_id.match(match_value.id(), legacy)){ TTCN_Logger::log_logmatch_info(".id"); single_value->field_id.log_match(match_value.id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_criticality.match(match_value.criticality(), legacy)){ TTCN_Logger::log_logmatch_info(".criticality"); single_value->field_criticality.log_match(match_value.criticality(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_extensionValue.match(match_value.extensionValue(), legacy)){ TTCN_Logger::log_logmatch_info(".extensionValue"); single_value->field_extensionValue.log_match(match_value.extensionValue(), 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("{ id := "); single_value->field_id.log_match(match_value.id(), legacy); TTCN_Logger::log_event_str(", criticality := "); single_value->field_criticality.log_match(match_value.criticality(), legacy); TTCN_Logger::log_event_str(", extensionValue := "); single_value->field_extensionValue.log_match(match_value.extensionValue(), 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (id().is_bound()) id().set_implicit_omit(); if (criticality().is_bound()) criticality().set_implicit_omit(); if (extensionValue().is_bound()) extensionValue().set_implicit_omit(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_id.encode_text(text_buf); single_value->field_criticality.encode_text(text_buf); single_value->field_extensionValue.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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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_id.decode_text(text_buf); single_value->field_criticality.decode_text(text_buf); single_value->field_extensionValue.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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) criticality().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) extensionValue().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "criticality")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { criticality().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extensionValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extensionValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template* precondition = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template; precondition->set_param(*param.get_elem(0)); _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template* implied_template = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template; implied_template->set_param(*param.get_elem(1)); *this = _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1"); } is_ifpresent = param.get_ifpresent(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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_id.check_restriction(t_res, t_name ? t_name : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1"); 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 : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1"); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_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_idxref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::~_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::clean_up() { if (val_ptr != NULL) { if (val_ptr->ref_count > 1) { val_ptr->ref_count--; val_ptr = NULL; } else if (val_ptr->ref_count == 1) { for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL) delete val_ptr->value_elements[elem_count]; free_pointers((void**)val_ptr->value_elements); delete val_ptr; val_ptr = NULL; } else TTCN_error("Internal error: Invalid reference counter in a record of/set of value."); } } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator=(null_type) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator=(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return val_ptr->n_elements == 0 ; } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator==(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (val_ptr == other_value.val_ptr) return TRUE; if (val_ptr->n_elements != (other_value.val_ptr)->n_elements) return FALSE; for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ if ((other_value.val_ptr)->value_elements[elem_count] != NULL){ if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE; } else return FALSE; } else { if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE; } } return TRUE; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 using a negative index: %d.", index_value); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements; new_val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){ if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (index_value >= val_ptr->n_elements) set_size(index_value + 1); if (val_ptr->value_elements[index_value] == NULL) { val_ptr->value_elements[index_value] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2; } return *val_ptr->value_elements[index_value]; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return (*this)[(int)index_value]; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (index_value < 0) TTCN_error("Accessing an element of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements); return (val_ptr->value_elements[index_value] == NULL) ? UNBOUND_ELEM : *val_ptr->value_elements[index_value]; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return (*this)[(int)index_value]; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (val_ptr->n_elements == 0) return *this; int rc; if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements; else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements); if (rc == 0) return *this; _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 ret_val; ret_val.set_size(val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*val_ptr->value_elements[i]); } } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::operator+(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 ret_val; ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements); for (int i=0; in_elements; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*val_ptr->value_elements[i]); } } for (int i=0; in_elements; i++) { if (other_value.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2","element"); _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::replace(int index, int len, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); check_replace_arguments(val_ptr->n_elements, index, len, "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2","element"); _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 ret_val; ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len); for (int i = 0; i < index; i++) { if (val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*val_ptr->value_elements[i]); } } for (int i = 0; i < repl.val_ptr->n_elements; i++) { if (repl.val_ptr->value_elements[i] != NULL) { ret_val.val_ptr->value_elements[i+index] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*repl.val_ptr->value_elements[i]); } } for (int i = 0; i < val_ptr->n_elements - index - len; i++) { if (val_ptr->value_elements[index+i+len] != NULL) { ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::replace(int index, int len, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& repl) const { if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return replace(index, len, repl.valueof()); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (val_ptr == NULL) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } else if (val_ptr->ref_count > 1) { struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct; new_val_ptr->ref_count = 1; new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements; new_val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2**)allocate_pointers(new_val_ptr->n_elements); for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) { if (val_ptr->value_elements[elem_count] != NULL){ new_val_ptr->value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); #ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2: %d",new_size); #endif val_ptr->n_elements = new_size; } else if (new_size < val_ptr->n_elements) { for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++) if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count]; val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::is_value() const { if (val_ptr == NULL) return FALSE; for(int i = 0; i < val_ptr->n_elements; ++i) { if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE; } return TRUE; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return val_ptr->n_elements; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length; return 0; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::log() const { if (val_ptr == NULL) {; TTCN_Logger::log_event_unbound(); return; } switch (val_ptr->n_elements) { case 0: TTCN_Logger::log_event_str("{ }"); break; default: TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); (*this)[elem_count].log(); } TTCN_Logger::log_event_str(" }"); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::set_implicit_omit() { if (val_ptr == NULL) return; for (int i = 0; i < val_ptr->n_elements; i++) { if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit(); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value"); switch (param.get_operation_type()) { case Module_Param::OT_ASSIGN: if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) { *this = NULL_VALUE; return; } switch (param.get_type()) { case Module_Param::MP_Value_List: set_size(param.get_size()); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed) { (*this)[i].set_param(*curr); if (!(*this)[i].is_bound()) { delete val_ptr->value_elements[i]; val_ptr->value_elements[i] = NULL; } } } break; case Module_Param::MP_Indexed_List: for (size_t i=0; iget_id()->get_index()].set_param(*curr); if (!(*this)[curr->get_id()->get_index()].is_bound()) { delete val_ptr->value_elements[curr->get_id()->get_index()]; val_ptr->value_elements[curr->get_id()->get_index()] = NULL; } } break; default: param.type_error("record of value", "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2"); } break; case Module_Param::OT_CONCAT: switch (param.get_type()) { case Module_Param::MP_Value_List: { if (!is_bound()) *this = NULL_VALUE; int start_idx = lengthof(); for (size_t i=0; iget_type()!=Module_Param::MP_NotUsed)) { (*this)[start_idx+(int)i].set_param(*curr); } } } break; case Module_Param::MP_Indexed_List: param.error("Cannot concatenate an indexed value list"); break; default: param.type_error("record of value", "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); text_buf.push_int(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) (*this)[elem_count].encode_text(text_buf); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::decode_text(Text_Buf& text_buf) { clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = text_buf.pull_int().get_val(); if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2**)allocate_pointers(val_ptr->n_elements); for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) { val_ptr->value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=BER_encode_chk_bound(is_bound()); if(!new_tlv) { new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec; for(int elem_i=0; elem_in_elements; elem_i++) { ec.set_msg("Component #%d: ", elem_i); new_tlv->add_TLV((*this)[elem_i].BER_encode_TLV(*p_td.oftype_descr, p_coding)); } } new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '%s' type: ", p_td.name); stripped_tlv.chk_constructed_flag(TRUE); clean_up(); val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; TTCN_EncDec_ErrorContext ec_1("Component #"); TTCN_EncDec_ErrorContext ec_2("0: "); while(BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv)) { val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, val_ptr->n_elements + 1); val_ptr->n_elements++; val_ptr->value_elements[val_ptr->n_elements - 1] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2; val_ptr->value_elements[val_ptr->n_elements - 1]->BER_decode_TLV(*p_td.oftype_descr, tmp_tlv, L_form); ec_2.set_msg("%d: ", val_ptr->n_elements); } return TRUE; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::JSON_encode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return -1; } int enc_len = p_tok.put_next_token(p_td.json->as_map ? JSON_TOKEN_OBJECT_START : JSON_TOKEN_ARRAY_START, NULL); for (int i = 0; i < val_ptr->n_elements; ++i) { if (p_td.json->metainfo_unbound && !(*this)[i].is_bound()) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "metainfo []"); enc_len += p_tok.put_next_token(JSON_TOKEN_STRING, "\"unbound\""); enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } else { int ret_val = (*this)[i].JSON_encode(*p_td.oftype_descr, p_tok, p_td.json->as_map); if (0 > ret_val) break; enc_len += ret_val; } } enc_len += p_tok.put_next_token(p_td.json->as_map ? JSON_TOKEN_OBJECT_END : JSON_TOKEN_ARRAY_END, NULL); return enc_len; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } if (p_td.json->default_value.type == JD_LEGACY && 0 == p_tok.get_buffer_length()) { set_size(0); return strlen(p_td.json->default_value.str); } json_token_t token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_ERROR == token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if ((!p_td.json->as_map && JSON_TOKEN_ARRAY_START != token) || (p_td.json->as_map && JSON_TOKEN_OBJECT_START != token)) { return JSON_ERROR_INVALID_TOKEN; } set_size(0); for (int nof_elements = 0; TRUE; ++nof_elements) { size_t buf_pos = p_tok.get_buf_pos(); size_t ret_val; if (p_td.json->metainfo_unbound) { ret_val = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_OBJECT_START == token) { char* value = NULL; size_t value_len = 0; ret_val += p_tok.get_next_token(&token, &value, &value_len); if (JSON_TOKEN_NAME == token && 11 == value_len && 0 == strncmp(value, "metainfo []", 11)) { ret_val += p_tok.get_next_token(&token, &value, &value_len); if (JSON_TOKEN_STRING == token && 9 == value_len && 0 == strncmp(value, "\"unbound\"", 9)) { ret_val = p_tok.get_next_token(&token, NULL, NULL); if (JSON_TOKEN_OBJECT_END == token) { dec_len += ret_val; continue; } } } } p_tok.set_buf_pos(buf_pos); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2* val = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2; int ret_val2 = val->JSON_decode(*p_td.oftype_descr, p_tok, p_silent, p_td.json->as_map); if (JSON_ERROR_INVALID_TOKEN == ret_val2) { p_tok.set_buf_pos(buf_pos); delete val; break; } else if (JSON_ERROR_FATAL == ret_val2) { delete val; if (p_silent) { clean_up(); } return JSON_ERROR_FATAL; } val_ptr->value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2**)reallocate_pointers( (void**)val_ptr->value_elements, val_ptr->n_elements, nof_elements + 1); val_ptr->value_elements[nof_elements] = val; val_ptr->n_elements = nof_elements + 1; dec_len += (size_t)ret_val2; } dec_len += p_tok.get_next_token(&token, NULL, NULL); if ((!p_td.json->as_map && JSON_TOKEN_ARRAY_END != token) || (p_td.json->as_map && JSON_TOKEN_OBJECT_END != token)) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_REC_OF_END_TOKEN_ERROR, ""); if (p_silent) { clean_up(); } return JSON_ERROR_FATAL; } return (int)dec_len; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::OER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return -1; } encode_oer_length(val_ptr->n_elements, p_buf, TRUE); for (int i = 0; i < val_ptr->n_elements; ++i) { (*this)[i].OER_encode(*p_td.oftype_descr, p_buf); } return 0; } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::OER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, OER_struct& p_oer) { size_t nof_elem = decode_oer_length(p_buf, TRUE); set_size(nof_elem); for (size_t i = 0; i < nof_elem; i++) { (*this)[i].OER_decode(*p_td.oftype_descr, p_buf, p_oer); } return 0; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE OF value."); return; } const Per_Integer_Constraint* cons = dynamic_cast(p_td.per->c); if (cons == NULL) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INTERNAL, "Internal error: Invalid constraint in PER descriptor."); return; } INTEGER length(val_ptr->n_elements); boolean extendable = cons->has_extension_marker(); boolean within_ext_root = cons->is_within_extension_root(length); if (!within_ext_root && !extendable) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_CONSTRAINT, "Encoding an invalid SEQUENCE OF value (does not match PER-visible constraints)."); return; } boolean ext_bit = extendable && !within_ext_root; if (extendable) p_buf.PER_put_bit(ext_bit); INTEGER length_ub = cons->has_upper_bound() ? cons->get_upper_bound() : INTEGER(-1); if (length_ub >= PER_64K) length_ub = -1; INTEGER range = (ext_bit || length_ub < 0) ? INTEGER(0) : cons->get_nof_values(); if (range == 1 && length == 0) return; int mul_16k; int pos = 0; do { mul_16k = (range == 1) ? 0 : length.PER_encode_length(p_buf, p_options, range, cons->get_lower_bound(), length_ub); int elements_encoded = (mul_16k == 0) ? (int)length : mul_16k * PER_16K; for (int i = 0; i < elements_encoded; ++i) { (*this)[i + pos].PER_encode(*p_td.oftype_descr, p_buf, p_options); } if (mul_16k > 0) { pos += elements_encoded; length = length - elements_encoded; range = 0; } } while (mul_16k > 0); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { const Per_Integer_Constraint* cons = dynamic_cast(p_td.per->c); if (cons == NULL) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INTERNAL, "Internal error: Invalid constraint in PER descriptor."); return; } clean_up(); boolean extendable = cons->has_extension_marker(); boolean ext_bit = extendable ? p_buf.PER_get_bit() : FALSE; INTEGER length_ub = cons->has_upper_bound() ? cons->get_upper_bound() : INTEGER(-1); if (length_ub >= PER_64K) length_ub = -1; INTEGER range = (ext_bit || length_ub < 0) ? INTEGER(0) : cons->get_nof_values(); int mul_16k; INTEGER length; int current_size = 0; do { mul_16k = length.PER_decode_length(p_buf, p_options, range, cons->get_lower_bound(), length_ub); if (mul_16k != 0) range = 0; int new_size = current_size + (int)length; set_size(new_size); for (int i = current_size; i < new_size; ++i) { (*this)[i].PER_decode(*p_td.oftype_descr, p_buf, p_options); } current_size = new_size; } while (mul_16k > 0); if (!ext_bit && !cons->is_within_extension_root(val_ptr->n_elements)) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_CONSTRAINT, "Decoded SEQUENCE OF value does not match PER-visible constraints."); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::copy_value(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (other_value[elem_count].is_bound()) { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template; } } set_selection(SPECIFIC_VALUE); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::copy_template(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.n_elements = other_value.single_value.n_elements; single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template; } } 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 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_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 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(*other_value.implication_.precondition); implication_.implied_template = new _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_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 @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); break; } set_selection(other_value); } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy) { if (value_index >= 0) return ((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2*)value_ptr)[value_index], legacy); else return ((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template() { } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value) { copy_value(other_value); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 from an unbound optional field."); } } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template* p_precondition, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(Dynamic_Match_Interface<_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::~_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template() { clean_up(); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; free_pointers((void**)single_value.value_elements); 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; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator=(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value) { clean_up(); copy_value(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator=(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2&)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 @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); } return *this; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator=(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 using a negative index: %d.", index_value); switch (template_selection) { case SPECIFIC_VALUE: if(index_value < single_value.n_elements) break; // no break case OMIT_VALUE: case ANY_VALUE: case ANY_OR_OMIT: case UNINITIALIZED_TEMPLATE: set_size(index_value + 1); break; default: TTCN_error("Accessing an element of a non-specific template for type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); break; } return *single_value.value_elements[index_value]; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return (*this)[(int)index_value]; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements); return *single_value.value_elements[index_value]; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return (*this)[(int)index_value]; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); template_sel old_selection = template_selection; if (old_selection != SPECIFIC_VALUE) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; } if (new_size > single_value.n_elements) { single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(ANY_VALUE); } else { for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++) single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template; } single_value.n_elements = new_size; } else if (new_size < single_value.n_elements) { for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++) delete single_value.value_elements[elem_count]; single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::n_elem() const { switch (template_selection) { case SPECIFIC_VALUE: return single_value.n_elements; break; case VALUE_LIST: return value_list.n_values; break; default: TTCN_error("Performing n_elem"); } } int _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::size_of(boolean is_size) const { const char* op_name = is_size ? "size" : "length"; int min_size; boolean has_any_or_none; if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 which has an ifpresent attribute.", op_name); switch (template_selection) { case SPECIFIC_VALUE: { min_size = 0; has_any_or_none = FALSE; int elem_count = single_value.n_elements; if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; } for (int i=0; iget_selection()) { case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 containing omit element.", op_name); case ANY_OR_OMIT: has_any_or_none = TRUE; break; default: min_size++; break; } } } break; case OMIT_VALUE: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 containing omit value.", op_name); case ANY_VALUE: case ANY_OR_OMIT: min_size = 0; has_any_or_none = TRUE; break; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 containing an empty list.", op_name); int item_size = value_list.list_value[0].size_of(is_size); for (unsigned int i = 1; i < value_list.n_values; i++) { if (value_list.list_value[i].size_of(is_size)!=item_size) TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 containing a value list with different sizes.", op_name); } min_size = item_size; has_any_or_none = FALSE; break; } case COMPLEMENTED_LIST: TTCN_error("Performing %sof() operation on a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2"); } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::match(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value, boolean legacy) const { if (!other_value.is_bound()) return FALSE; int value_length = other_value.size_of(); if (!match_length(value_length)) return FALSE; switch (template_selection) { case SPECIFIC_VALUE: return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy); case OMIT_VALUE: return FALSE; case ANY_VALUE: case ANY_OR_OMIT: 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 with an uninitialized/unsupported template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); } return FALSE; } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (!single_value.value_elements[elem_count]->is_value()) return FALSE; return TRUE; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_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 @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 ret_val; ret_val.set_size(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) if (single_value.value_elements[elem_count]->is_bound()) { ret_val[elem_count] = single_value.value_elements[elem_count]->valueof(); } return ret_val; } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::substr(int index, int returncount) const { if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value."); return valueof().substr(index, returncount); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::replace(int index, int len, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl.valueof()); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::replace(int index, int len, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& repl) const { if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value."); return valueof().replace(index, len, repl); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::set_type(template_sel template_type, unsigned int list_length) { clean_up(); switch (template_type) { case VALUE_LIST: case COMPLEMENTED_LIST: case CONJUNCTION_MATCH: value_list.n_values = list_length; value_list.list_value = new _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); } set_selection(template_type); } _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::list_item(unsigned int list_index) { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return value_list.list_value[list_index]; } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: if (single_value.n_elements > 0) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation("); single_value.value_elements[elem_count]->log(); if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')'); } TTCN_Logger::log_event_str(" }"); } else 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_restricted(); log_ifpresent(); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::log_match(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){ TTCN_Logger::log_logmatch_info("[%d]", elem_count); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } log_match_length(single_value.n_elements); } 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 && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) { TTCN_Logger::log_event_str("{ "); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { if (elem_count > 0) TTCN_Logger::log_event_str(", "); single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy); } TTCN_Logger::log_event_str(" }"); log_match_length(single_value.n_elements); } 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 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::encode_text(Text_Buf& text_buf) const { encode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) single_value.value_elements[elem_count]->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 @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_permutation(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value.n_elements = text_buf.pull_int().get_val(); if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); single_value.value_elements = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template**)allocate_pointers(single_value.n_elements); for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) { single_value.value_elements[elem_count] = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template; single_value.value_elements[elem_count]->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 _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_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 for a template of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); } } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_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 i=0; iset_implicit_omit(); } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of 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: { _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template temp; 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_iget_id()->get_index())].set_param(*param.get_elem(p_i)); } break; case Module_Param::MP_Value_List: { set_size(param.get_size()); int curr_idx = 0; for (size_t p_i=0; p_iget_type()) { case Module_Param::MP_NotUsed: curr_idx++; break; case Module_Param::MP_Permutation_Template: { int perm_start_idx = curr_idx; Module_Param* param_i = param.get_elem(p_i); for (size_t perm_i=0; perm_iget_size(); perm_i++) { (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i))); curr_idx++; } int perm_end_idx = curr_idx - 1; add_permutation(perm_start_idx, perm_end_idx); } break; default: (*this)[curr_idx].set_param(*param.get_elem(p_i)); curr_idx++; } } } break; case Module_Param::MP_Implication_Template: { _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template* precondition = new _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template; precondition->set_param(*param.get_elem(0)); _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template* implied_template = new _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template; implied_template->set_param(*param.get_elem(1)); *this = _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template(precondition, implied_template); } break; default: param.type_error("record of template", "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_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; for (int i=0; icheck_restriction(t_res, t_name ? t_name : "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2"); 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 : "@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2"); } boolean _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_template::get_istemplate_kind(const char* type) const { if (!strcmp(type, "AnyElement")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_VALUE) { return TRUE; } } return FALSE; } else if (!strcmp(type, "AnyElementsOrNone")) { if (template_selection != SPECIFIC_VALUE) { return FALSE; } for (int i = 0; i < single_value.n_elements; i++) { if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) { return TRUE; } } return FALSE; } else if (!strcmp(type, "permutation")) { return number_of_permutations; } else if (!strcmp(type, "length")) { return length_restriction_type != NO_LENGTH_RESTRICTION; } else { return Base_Template::get_istemplate_kind(type); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::copy_value(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } union_selection = other_value.union_selection; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::~_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type() { clean_up(); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::operator==(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::ischosen(union_selection_type checked_selection) const { if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); return union_selection == checked_selection; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::set_param(Module_Param& param) { param.basic_check(Module_Param::BC_VALUE, "union value"); Module_Param_Ptr m_p = ¶m; if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return; if (m_p->get_type()!=Module_Param::MP_Assignment_List) { param.error("union value with field name was expected"); } Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); mp_last->error("Field %s does not exist in type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type.", last_name); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { default: TTCN_error("Text encoder: Encoding an unbound value of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { default: TTCN_error("Text decoder: Unrecognized union selector was received for type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(TRUE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t *_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv; TTCN_EncDec_ErrorContext ec_0("Alternative '"); TTCN_EncDec_ErrorContext ec_1; switch (union_selection) { case UNBOUND_VALUE: new_tlv = BER_encode_chk_bound(FALSE); break; default: TTCN_EncDec_ErrorContext::error_internal("Unknown selection."); new_tlv = NULL; } return ASN_BER_V2TLV(new_tlv, p_td, p_coding); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type' type: "); if (!BER_decode_TLV_CHOICE(*p_td.ber, stripped_tlv, L_form, tlv_opentype)) { tlv_opentype.Tlen = 0; return FALSE; } clean_up(); union_selection = UNBOUND_VALUE; return TRUE; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::BER_decode_opentypes(TTCN_Type_list& p_typelist, unsigned L_form) { if (union_selection != UNBOUND_VALUE) return; TTCN_EncDec_ErrorContext ec_0("While decoding open type '@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean) const { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Cannot encode union of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type, because it has zero alternatives."); return -1; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean, int p_chosen_field) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, "Cannot decode union of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); return -1; } return 0; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { size_t pos = decode_oer_length(p_buf, FALSE); size_t prev_pos = p_buf.get_pos(); p_buf.increase_pos(pos); p_oer.opentype_poses.push_back(prev_pos); return 0; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::OER_decode_opentypes(TTCN_Type_list& p_typelist, TTCN_Buffer& p_buf, OER_struct& p_oer) { if (union_selection != UNBOUND_VALUE) return; TTCN_EncDec_ErrorContext ec_0("While decoding open type '@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::copy_value(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { default: TTCN_error("Initializing a template with an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::copy_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value.union_selection = other_value.single_value.union_selection; switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_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 template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } set_selection(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template() { } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& other_value) { copy_value(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type from an unbound optional field."); } } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template* p_precondition, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template(Dynamic_Match_Interface<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::~_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template() { clean_up(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { default: break; } 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; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::operator=(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Assignment of an unbound optional field to a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::match(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& 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: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } } 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 template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } return FALSE; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::valueof() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type ret_val; switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } return ret_val; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::list_item(unsigned int list_index) const { if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); return value_list.list_value[list_index]; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_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 ("Internal error: Setting an invalid list for a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template[list_length]; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::ischosen(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); return single_value.union_selection == checked_selection; case VALUE_LIST: { if (value_list.n_values < 1) TTCN_error("Internal error: Performing ischosen() operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type containing an empty list."); boolean ret_val = value_list.list_value[0].ischosen(checked_selection); for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) { ret_val = value_list.list_value[list_count].ischosen(checked_selection); } return ret_val; } default: return FALSE; } return FALSE; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { default: 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::log_match(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& match_value, boolean legacy) const { if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){ TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(" matched"); return; } if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) { switch (single_value.union_selection) { default: TTCN_Logger::print_logmatch_buffer(); TTCN_Logger::log_event_str(""); } } else { TTCN_Logger::print_logmatch_buffer(); 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: text_buf.push_int(single_value.union_selection); switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } 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 template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::UNBOUND_VALUE; _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::union_selection_type new_selection = (_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } single_value.union_selection = new_selection; } 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_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: Unrecognized selector was received in a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_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 v_idx=0; v_idx(param.get_id()) != NULL && param.get_id()->next_name()) { char* param_field = param.get_id()->get_current_name(); if (param_field[0] >= '0' && param_field[0] <= '9') { param.error("Unexpected array index in module parameter, expected a valid field" " name for union template type `@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type'", param_field); } param.basic_check(Module_Param::BC_TEMPLATE, "union template"); Module_Param_Ptr m_p = ¶m; switch (m_p->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: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template new_temp; new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size()); for (size_t p_i=0; p_iget_size(); p_i++) { new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i)); } *this = new_temp; break; } case Module_Param::MP_Value_List: if (m_p->get_size()==0) break; param.type_error("union template", "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type"); break; case Module_Param::MP_Assignment_List: { Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1); char* last_name = mp_last->get_id()->get_name(); mp_last->error("Field %s does not exist in type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template* precondition = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template* implied_template = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_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; switch (single_value.union_selection) { default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type."); } 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 : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2.extensionValue.type"); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2() { } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(const INTEGER& par_id, const RUA__CommonDataTypes::Criticality& par_criticality, const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); if (other_value.id().is_bound()) field_id = other_value.id(); else field_id.clean_up(); if (other_value.criticality().is_bound()) field_criticality = other_value.criticality(); else field_criticality.clean_up(); if (other_value.extensionValue().is_bound()) field_extensionValue = other_value.extensionValue(); else field_extensionValue.clean_up(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::get_descriptor() const { return &_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_descr_; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); if (other_value.id().is_bound()) field_id = other_value.id(); else field_id.clean_up(); if (other_value.criticality().is_bound()) field_criticality = other_value.criticality(); else field_criticality.clean_up(); if (other_value.extensionValue().is_bound()) field_extensionValue = other_value.extensionValue(); else field_extensionValue.clean_up(); } return *this; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::operator==(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ id := "); field_id.log(); TTCN_Logger::log_event_str(", criticality := "); field_criticality.log(); TTCN_Logger::log_event_str(", extensionValue := "); field_extensionValue.log(); TTCN_Logger::log_event_str(" }"); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::set_implicit_omit() { if (id().is_bound()) id().set_implicit_omit(); if (criticality().is_bound()) criticality().set_implicit_omit(); if (extensionValue().is_bound()) extensionValue().set_implicit_omit(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::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 (30 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) criticality().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) extensionValue().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "criticality")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { criticality().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extensionValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extensionValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2"); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::encode_text(Text_Buf& text_buf) const { field_id.encode_text(text_buf); field_criticality.encode_text(text_buf); field_extensionValue.encode_text(text_buf); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::decode_text(Text_Buf& text_buf) { field_id.decode_text(text_buf); field_criticality.decode_text(text_buf); field_extensionValue.decode_text(text_buf); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name); unsigned BER_coding=va_arg(pvar, unsigned); BER_encode_chk_coding(BER_coding); ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding); tlv->put_in_buffer(p_buf); ASN_BER_TLV_t::destruct(tlv); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); RAW_enc_tr_pos rp; rp.level=0; rp.pos=NULL; RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw); RAW_encode(p_td, root); root.put_to_buf(p_buf); break;} case TTCN_EncDec::CT_TEXT: { TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); TEXT_encode(p_td,p_buf); break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0); p_buf.put_c('\n'); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok(va_arg(pvar, int) != 0); JSON_encode(p_td, tok, FALSE); p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_encode(p_td, p_buf); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name); if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); PER_encode(p_td, p_buf, opt); break; } default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) { va_list pvar; va_start(pvar, p_coding); switch(p_coding) { case TTCN_EncDec::CT_BER: { TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name); unsigned L_form=va_arg(pvar, unsigned); ASN_BER_TLV_t tlv; BER_decode_str2TLV(p_buf, tlv, L_form); BER_decode_TLV(p_td, tlv, L_form); if(tlv.isComplete) p_buf.increase_pos(tlv.get_len()); break;} case TTCN_EncDec::CT_RAW: { TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name); if(!p_td.raw) TTCN_EncDec_ErrorContext::error_internal ("No RAW descriptor available for type '%s'.", p_td.name); raw_order_t r_order; switch(p_td.raw->top_bit_order) { case TOP_BIT_LEFT: r_order=ORDER_LSB; break; case TOP_BIT_RIGHT: default: r_order=ORDER_MSB; } int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order); if(rawr<0) switch (-rawr) { case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name); break; case 1: default: ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name); break; } break;} case TTCN_EncDec::CT_TEXT: { Limit_Token_List limit; TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name); if(!p_td.text) TTCN_EncDec_ErrorContext::error_internal ("No TEXT descriptor available for type '%s'.", p_td.name); const unsigned char *b_data=p_buf.get_data(); int null_added=0; if(b_data[p_buf.get_len()-1]!='\0'){ null_added=1; p_buf.set_pos(p_buf.get_len()); p_buf.put_zero(8,ORDER_LSB); p_buf.rewind(); } if(TEXT_decode(p_td,p_buf,limit)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); if(null_added){ size_t actpos=p_buf.get_pos(); p_buf.set_pos(p_buf.get_len()-1); p_buf.cut_end(); p_buf.set_pos(actpos); } break;} case TTCN_EncDec::CT_XER: { TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name); unsigned XER_coding=va_arg(pvar, unsigned); XER_encode_chk_coding(XER_coding, p_td); XmlReaderWrap reader(p_buf); for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) { if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break; } XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0); size_t bytes = reader.ByteConsumed(); p_buf.set_pos(bytes); break;} case TTCN_EncDec::CT_JSON: { TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name); if(!p_td.json) TTCN_EncDec_ErrorContext::error_internal ("No JSON descriptor available for type '%s'.", p_td.name); JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len()); if(JSON_decode(p_td, tok, FALSE, FALSE)<0) ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name); p_buf.set_pos(tok.get_buf_pos()); break;} case TTCN_EncDec::CT_OER: { TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name); if(!p_td.oer) TTCN_EncDec_ErrorContext::error_internal ("No OER descriptor available for type '%s'.", p_td.name); OER_struct p_oer; OER_decode(p_td, p_buf, p_oer); break;} case TTCN_EncDec::CT_PER: { TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name); if(!p_td.per) TTCN_EncDec_ErrorContext::error_internal( "No PER descriptor available for type '%s'.", p_td.name); int opt = va_arg(pvar, int); try { PER_decode(p_td, p_buf, opt); p_buf.PER_octet_align(FALSE); } catch (PER_Buffer_Exception) { } break; } default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } ASN_BER_TLV_t* _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::BER_encode_TLV(const TTCN_Typedescriptor_t& p_td, unsigned p_coding) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); BER_chk_descr(p_td); ASN_BER_TLV_t *new_tlv=ASN_BER_TLV_t::construct(NULL); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("id': "); new_tlv->add_TLV(field_id.BER_encode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::BER_decode_TLV(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv, unsigned L_form) { BER_chk_descr(p_td); ASN_BER_TLV_t stripped_tlv; BER_decode_strip_tags(*p_td.ber, p_tlv, L_form, stripped_tlv); TTCN_EncDec_ErrorContext ec_0("While decoding '@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2' type: "); stripped_tlv.chk_constructed_flag(TRUE); size_t V_pos=0; ASN_BER_TLV_t tmp_tlv; boolean tlv_present=FALSE; { TTCN_EncDec_ErrorContext ec_1("Component '"); TTCN_EncDec_ErrorContext ec_2; ec_2.set_msg("id': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_id.BER_decode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("criticality': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_criticality.BER_decode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("extensionValue': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present){ ec_2.error(TTCN_EncDec::ET_INCOMPL_MSG,"Invalid or incomplete message was received."); return FALSE; } field_extensionValue.BER_decode_TLV(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, tmp_tlv, L_form); tlv_present=FALSE; } BER_decode_constdTLV_end(stripped_tlv, V_pos, L_form, tmp_tlv, tlv_present); TTCN_EncDec_ErrorContext ec_1("While decoding opentypes: "); TTCN_Type_list p_typelist; BER_decode_opentypes(p_typelist, L_form); return TRUE; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::BER_decode_opentypes(TTCN_Type_list& p_typelist, unsigned L_form) { p_typelist.push(this); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("id': "); field_id.BER_decode_opentypes(p_typelist, L_form); ec_1.set_msg("criticality': "); field_criticality.BER_decode_opentypes(p_typelist, L_form); ec_1.set_msg("extensionValue': "); field_extensionValue.BER_decode_opentypes(p_typelist, L_form); p_typelist.pop(); } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::JSON_encode(const TTCN_Typedescriptor_t&, JSON_Tokenizer& p_tok, boolean p_parent_is_map) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); return -1; } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "id"); enc_len += field_id.JSON_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer& p_tok, boolean p_silent, boolean p_parent_is_map, int) { if (p_td.json->default_value.type == JD_STANDARD && 0 == p_tok.get_buffer_length()) { *this = *static_cast(p_td.json->default_value.val); return 0; } json_token_t j_token = JSON_TOKEN_NONE; size_t dec_len = p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_BAD_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_OBJECT_START != j_token) { return JSON_ERROR_INVALID_TOKEN; } boolean id_found = FALSE; boolean criticality_found = FALSE; boolean extensionValue_found = FALSE; while (TRUE) { char* fld_name = 0; size_t name_len = 0; size_t buf_pos = p_tok.get_buf_pos(); dec_len += p_tok.get_next_token(&j_token, &fld_name, &name_len); if (JSON_TOKEN_ERROR == j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_NAME_TOKEN_ERROR); return JSON_ERROR_FATAL; } else if (JSON_TOKEN_NAME != j_token) { p_tok.set_buf_pos(buf_pos); break; } else { if (2 == name_len && 0 == strncmp(fld_name, "id", name_len)) { id_found = TRUE; int ret_val = field_id.JSON_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 2, "id"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (11 == name_len && 0 == strncmp(fld_name, "criticality", name_len)) { criticality_found = TRUE; int ret_val = field_criticality.JSON_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 11, "criticality"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (14 == name_len && 0 == strncmp(fld_name, "extensionValue", name_len)) { extensionValue_found = TRUE; int ret_val = field_extensionValue.JSON_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, p_tok, p_silent, FALSE); if (0 > ret_val) { if (JSON_ERROR_INVALID_TOKEN == ret_val) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, 14, "extensionValue"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else { if (p_silent) { return JSON_ERROR_INVALID_TOKEN; } JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_INVALID_NAME_ERROR, (int)name_len, fld_name); dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_NUMBER != j_token && JSON_TOKEN_STRING != j_token && JSON_TOKEN_LITERAL_TRUE != j_token && JSON_TOKEN_LITERAL_FALSE != j_token && JSON_TOKEN_LITERAL_NULL != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_FIELD_TOKEN_ERROR, (int)name_len, fld_name); return JSON_ERROR_FATAL; } } } } dec_len += p_tok.get_next_token(&j_token, NULL, NULL); if (JSON_TOKEN_OBJECT_END != j_token) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_OBJECT_END_TOKEN_ERROR, ""); return JSON_ERROR_FATAL; } if (!id_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "id"); return JSON_ERROR_FATAL; } if (!criticality_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "criticality"); return JSON_ERROR_FATAL; } if (!extensionValue_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "extensionValue"); return JSON_ERROR_FATAL; } return (int)dec_len; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound record value."); return -1; } field_id.OER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, p_buf); field_criticality.OER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, p_buf); return 0; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, p_buf, p_oer); TTCN_EncDec_ErrorContext ec_1("While decoding opentypes: "); TTCN_Type_list p_typelist; OER_decode_opentypes(p_typelist, p_buf, p_oer); return 0; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::OER_decode_opentypes(TTCN_Type_list& p_typelist, TTCN_Buffer& p_buf, OER_struct& p_oer) { p_typelist.push(this); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("id': "); field_id.OER_decode_opentypes(p_typelist, p_buf, p_oer); ec_1.set_msg("criticality': "); field_criticality.OER_decode_opentypes(p_typelist, p_buf, p_oer); ec_1.set_msg("extensionValue': "); field_extensionValue.OER_decode_opentypes(p_typelist, p_buf, p_oer); p_typelist.pop(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::PER_encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) const { if (!is_bound()) { TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound SEQUENCE value."); return; } field_id.PER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, p_buf, p_options); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, p_buf, p_options); TTCN_EncDec_ErrorContext ec_1("While decoding opentypes: ");TTCN_Type_list p_typelist; PER_decode_opentypes(p_typelist, p_options); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2::PER_decode_opentypes(TTCN_Type_list& p_typelist, int p_options) { p_typelist.push(this); TTCN_EncDec_ErrorContext ec_0("Component '"); TTCN_EncDec_ErrorContext ec_1; ec_1.set_msg("id': "); field_id.PER_decode_opentypes(p_typelist, p_options); ec_1.set_msg("criticality': "); field_criticality.PER_decode_opentypes(p_typelist, p_options); ec_1.set_msg("extensionValue': "); field_extensionValue.PER_decode_opentypes(p_typelist, p_options); p_typelist.pop(); } struct _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::single_value_struct { INTEGER_template field_id; RUA__CommonDataTypes::Criticality_template field_criticality; _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template field_extensionValue; }; void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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_id = ANY_VALUE; single_value->field_criticality = ANY_VALUE; single_value->field_extensionValue = ANY_VALUE; } } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::copy_value(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& other_value) { single_value = new single_value_struct; if (other_value.id().is_bound()) { single_value->field_id = other_value.id(); } else { single_value->field_id.clean_up(); } if (other_value.criticality().is_bound()) { single_value->field_criticality = other_value.criticality(); } else { single_value->field_criticality.clean_up(); } if (other_value.extensionValue().is_bound()) { single_value->field_extensionValue = other_value.extensionValue(); } else { single_value->field_extensionValue.clean_up(); } set_selection(SPECIFIC_VALUE); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::copy_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.id().get_selection()) { single_value->field_id = other_value.id(); } else { single_value->field_id.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.criticality().get_selection()) { single_value->field_criticality = other_value.criticality(); } else { single_value->field_criticality.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.extensionValue().get_selection()) { single_value->field_extensionValue = other_value.extensionValue(); } else { single_value->field_extensionValue.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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(*other_value.implication_.precondition); implication_.implied_template = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); break; } set_selection(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template() { } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& other_value) { copy_value(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 from an unbound optional field."); } } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template* p_precondition, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(Dynamic_Match_Interface<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& other_value) : Base_Template() { copy_template(other_value); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::~_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template() { clean_up(); } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& other_value) { clean_up(); copy_value(other_value); return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::operator=(const OPTIONAL<_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2&)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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); } return *this; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::operator=(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::match(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& 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.id().is_bound()) return FALSE; if(!single_value->field_id.match(other_value.id(), legacy))return FALSE; if(!other_value.criticality().is_bound()) return FALSE; if(!single_value->field_criticality.match(other_value.criticality(), legacy))return FALSE; if(!other_value.extensionValue().is_bound()) return FALSE; if(!single_value->field_extensionValue.match(other_value.extensionValue(), 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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); } return FALSE; } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_id.is_bound() || single_value->field_criticality.is_bound() || single_value->field_extensionValue.is_bound(); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_id.is_value() && single_value->field_criticality.is_value() && single_value->field_extensionValue.is_value(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2 ret_val; if (single_value->field_id.is_bound()) { ret_val.id() = single_value->field_id.valueof(); } if (single_value->field_criticality.is_bound()) { ret_val.criticality() = single_value->field_criticality.valueof(); } if (single_value->field_extensionValue.is_bound()) { ret_val.extensionValue() = single_value->field_extensionValue.valueof(); } return ret_val; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template[list_length]; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); return value_list.list_value[list_index]; } INTEGER_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); return single_value->field_id; } RUA__CommonDataTypes::Criticality_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::criticality() { set_specific(); return single_value->field_criticality; } const RUA__CommonDataTypes::Criticality_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); return single_value->field_criticality; } _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type_template& _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); return single_value->field_extensionValue; } int _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); } return 0; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ id := "); single_value->field_id.log(); TTCN_Logger::log_event_str(", criticality := "); single_value->field_criticality.log(); TTCN_Logger::log_event_str(", extensionValue := "); single_value->field_extensionValue.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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::log_match(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& 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_id.match(match_value.id(), legacy)){ TTCN_Logger::log_logmatch_info(".id"); single_value->field_id.log_match(match_value.id(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_criticality.match(match_value.criticality(), legacy)){ TTCN_Logger::log_logmatch_info(".criticality"); single_value->field_criticality.log_match(match_value.criticality(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_extensionValue.match(match_value.extensionValue(), legacy)){ TTCN_Logger::log_logmatch_info(".extensionValue"); single_value->field_extensionValue.log_match(match_value.extensionValue(), 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("{ id := "); single_value->field_id.log_match(match_value.id(), legacy); TTCN_Logger::log_event_str(", criticality := "); single_value->field_criticality.log_match(match_value.criticality(), legacy); TTCN_Logger::log_event_str(", extensionValue := "); single_value->field_extensionValue.log_match(match_value.extensionValue(), 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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (id().is_bound()) id().set_implicit_omit(); if (criticality().is_bound()) criticality().set_implicit_omit(); if (extensionValue().is_bound()) extensionValue().set_implicit_omit(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_id.encode_text(text_buf); single_value->field_criticality.encode_text(text_buf); single_value->field_extensionValue.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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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_id.decode_text(text_buf); single_value->field_criticality.decode_text(text_buf); single_value->field_extensionValue.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 _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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 @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2."); } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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_i0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) id().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) criticality().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) extensionValue().set_param(*param.get_elem(2)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "id")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { id().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "criticality")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { criticality().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extensionValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extensionValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template* precondition = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template; precondition->set_param(*param.get_elem(0)); _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template* implied_template = new _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template; implied_template->set_param(*param.get_elem(1)); *this = _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template(precondition, implied_template); } break; default: param.type_error("record template", "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2"); } is_ifpresent = param.get_ifpresent(); } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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_id.check_restriction(t_res, t_name ? t_name : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2"); 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 : "@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2"); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_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_idxn_elements == 0; } void CriticalityDiagnostics__IE__List_0_iECriticality_encoder(const RUA__CommonDataTypes::Criticality& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics__IE__List_0_iECriticality_decoder(OCTETSTRING& input_stream, RUA__CommonDataTypes::Criticality& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics__IE__List_0_iECriticality_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void CriticalityDiagnostics__IE__List_0_iE__ID_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics__IE__List_0_iE__ID_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics__IE__List_0_iE__ID_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void TypeOfError_encoder(const TypeOfError& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.TypeOfError' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TypeOfError_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TypeOfError_decoder(OCTETSTRING& input_stream, TypeOfError& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.TypeOfError' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TypeOfError_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void CriticalityDiagnostics__IE__List_0_typeOfError_encoder(const TypeOfError& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.TypeOfError' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics__IE__List_0_typeOfError_decoder(OCTETSTRING& input_stream, TypeOfError& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.TypeOfError' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics__IE__List_0_typeOfError_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } boolean operator==(null_type, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1."); return other_value.val_ptr->n_elements == 0; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_id_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_encoder(const RUA__CommonDataTypes::Criticality& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_decoder(OCTETSTRING& input_stream, RUA__CommonDataTypes::Criticality& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_criticality_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_encoder(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `open type' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_decoder(OCTETSTRING& input_stream, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_type& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `open type' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_extensionValue_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_encoder(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_decoder(OCTETSTRING& input_stream, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst1_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_encoder(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_decoder(OCTETSTRING& input_stream, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void CriticalityDiagnostics__IE__List_0_iE__Extensions_encoder(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics__IE__List_0_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst1& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics__IE__List_0_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void CriticalityDiagnostics__IE__List_0_encoder(const CriticalityDiagnostics__IE__List_0& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics__IE__List_0_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics__IE__List_0_decoder(OCTETSTRING& input_stream, CriticalityDiagnostics__IE__List_0& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.CriticalityDiagnostics-IE-List.SEQUENCE' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics__IE__List_0_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void CriticalityDiagnostics__IE__List_encoder(const CriticalityDiagnostics__IE__List& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.CriticalityDiagnostics-IE-List' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics__IE__List_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics__IE__List_decoder(OCTETSTRING& input_stream, CriticalityDiagnostics__IE__List& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.CriticalityDiagnostics-IE-List' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics__IE__List_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void CriticalityDiagnostics_iEsCriticalityDiagnostics_encoder(const CriticalityDiagnostics__IE__List& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.CriticalityDiagnostics-IE-List' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics_iEsCriticalityDiagnostics_decoder(OCTETSTRING& input_stream, CriticalityDiagnostics__IE__List& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.CriticalityDiagnostics-IE-List' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics_iEsCriticalityDiagnostics_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } boolean operator==(null_type, const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2."); return other_value.val_ptr->n_elements == 0; } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_encoder(const INTEGER& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_decoder(OCTETSTRING& input_stream, INTEGER& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `integer' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_id_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_encoder(const RUA__CommonDataTypes::Criticality& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_decoder(OCTETSTRING& input_stream, RUA__CommonDataTypes::Criticality& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_criticality_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_encoder(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `open type' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_decoder(OCTETSTRING& input_stream, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_type& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `open type' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_extensionValue_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_encoder(const _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_decoder(OCTETSTRING& input_stream, _root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-Containers.ProtocolExtensionField.RUA-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionField_RUA__IEs_inst2_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_encoder(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_decoder(OCTETSTRING& input_stream, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void CriticalityDiagnostics_iE__Extensions_encoder(const _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_RUA__Containers_ProtocolExtensionContainer_RUA__IEs_inst2& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.ProtocolExtensionContainer.RUA-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } void CriticalityDiagnostics_encoder(const CriticalityDiagnostics& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.CriticalityDiagnostics' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics_decoder(OCTETSTRING& input_stream, CriticalityDiagnostics& output_value, const UNIVERSAL_CHARSTRING& coding_name) { TTCN_EncDec::coding_t coding_type; unsigned int extra_options = 0; TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE); if (coding_type != TTCN_EncDec::CT_BER && coding_type != TTCN_EncDec::CT_PER && coding_type != TTCN_EncDec::CT_JSON && coding_type != TTCN_EncDec::CT_OER) { TTCN_Logger::begin_event_log2str(); coding_name.log(); TTCN_error("Type `@RUA-IEs.CriticalityDiagnostics' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics_descr_, ttcn_buf, coding_type, extra_options); switch (TTCN_EncDec::get_last_error_type()) { case TTCN_EncDec::ET_NONE: ttcn_buf.cut(); ttcn_buf.get_string(input_stream); return 0; case TTCN_EncDec::ET_INCOMPL_MSG: case TTCN_EncDec::ET_LEN_ERR: return 2; default: return 1; } } /* Bodies of static functions */ void pre_init_module() { TTCN_Location current_location("RUA_IEs.asn", 0, TTCN_Location::LOCATION_UNKNOWN, "RUA-IEs"); RUA__Constants::module_object.pre_init_module(); RUA__Containers::module_object.pre_init_module(); } } /* end of namespace */