// 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 "HNBAP_IEs.hh" namespace HNBAP__IEs { /* Global variable definitions */ // No XER for Access__stratum__release__indicator const TTCN_JSONdescriptor_t Access__stratum__release__indicator_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Access__stratum__release__indicator_oer_ext_arr_[0] = {}; const int Access__stratum__release__indicator_oer_p_[0] = {}; const TTCN_OERdescriptor_t Access__stratum__release__indicator_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Access__stratum__release__indicator_oer_ext_arr_, 0, Access__stratum__release__indicator_oer_p_}; static const Per_Constraint Access__stratum__release__indicator_per_cons_; const ASN_PERdescriptor_t Access__stratum__release__indicator_per_ = { &Access__stratum__release__indicator_per_cons_ }; const TTCN_Typedescriptor_t Access__stratum__release__indicator_descr_ = { "@HNBAP-IEs.Access-stratum-release-indicator", &ENUMERATED_ber_, NULL, NULL, NULL, &Access__stratum__release__indicator_json_, &Access__stratum__release__indicator_oer_, &Access__stratum__release__indicator_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Access__stratum__release__indicator_default_coding(""); // No XER for AccessResult const TTCN_JSONdescriptor_t AccessResult_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int AccessResult_oer_ext_arr_[0] = {}; const int AccessResult_oer_p_[0] = {}; const TTCN_OERdescriptor_t AccessResult_oer_ = { -1, TRUE, -1, FALSE, 0, 0, AccessResult_oer_ext_arr_, 0, AccessResult_oer_p_}; static const Per_Constraint AccessResult_per_cons_; const ASN_PERdescriptor_t AccessResult_per_ = { &AccessResult_per_cons_ }; const TTCN_Typedescriptor_t AccessResult_descr_ = { "@HNBAP-IEs.AccessResult", &ENUMERATED_ber_, NULL, NULL, NULL, &AccessResult_json_, &AccessResult_oer_, &AccessResult_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING AccessResult_default_coding(""); const ASN_Tag_t AltitudeAndDirection_directionOfAltitude_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t AltitudeAndDirection_directionOfAltitude_ber_ = { 1u, AltitudeAndDirection_directionOfAltitude_tag_ }; // No XER for AltitudeAndDirection_directionOfAltitude const TTCN_JSONdescriptor_t AltitudeAndDirection_directionOfAltitude_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int AltitudeAndDirection_directionOfAltitude_oer_ext_arr_[0] = {}; const int AltitudeAndDirection_directionOfAltitude_oer_p_[0] = {}; const TTCN_OERdescriptor_t AltitudeAndDirection_directionOfAltitude_oer_ = { -1, TRUE, -1, FALSE, 0, 0, AltitudeAndDirection_directionOfAltitude_oer_ext_arr_, 0, AltitudeAndDirection_directionOfAltitude_oer_p_}; static const Per_Constraint AltitudeAndDirection_directionOfAltitude_per_cons_; const ASN_PERdescriptor_t AltitudeAndDirection_directionOfAltitude_per_ = { &AltitudeAndDirection_directionOfAltitude_per_cons_ }; const TTCN_Typedescriptor_t AltitudeAndDirection_directionOfAltitude_descr_ = { "@HNBAP-IEs.AltitudeAndDirection.directionOfAltitude", &AltitudeAndDirection_directionOfAltitude_ber_, NULL, NULL, NULL, &AltitudeAndDirection_directionOfAltitude_json_, &AltitudeAndDirection_directionOfAltitude_oer_, &AltitudeAndDirection_directionOfAltitude_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING AltitudeAndDirection_directionOfAltitude_default_coding(""); const ASN_Tag_t AltitudeAndDirection_altitude_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t AltitudeAndDirection_altitude_ber_ = { 1u, AltitudeAndDirection_altitude_tag_ }; // No XER for AltitudeAndDirection_altitude const int AltitudeAndDirection_altitude_oer_ext_arr_[0] = {}; const int AltitudeAndDirection_altitude_oer_p_[0] = {}; const TTCN_OERdescriptor_t AltitudeAndDirection_altitude_oer_ = { 2, FALSE, -1, FALSE, 0, 0, AltitudeAndDirection_altitude_oer_ext_arr_, 0, AltitudeAndDirection_altitude_oer_p_}; static Per_Integer_Constraint AltitudeAndDirection_altitude_per_cons_(new INTEGER(0), new INTEGER(32767), FALSE); const ASN_PERdescriptor_t AltitudeAndDirection_altitude_per_ = { &AltitudeAndDirection_altitude_per_cons_ }; const TTCN_Typedescriptor_t AltitudeAndDirection_altitude_descr_ = { "@HNBAP-IEs.AltitudeAndDirection.altitude", &AltitudeAndDirection_altitude_ber_, NULL, NULL, NULL, &INTEGER_json_, &AltitudeAndDirection_altitude_oer_, &AltitudeAndDirection_altitude_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING AltitudeAndDirection_altitude_default_coding(""); // No XER for AltitudeAndDirection const TTCN_JSONdescriptor_t AltitudeAndDirection_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int AltitudeAndDirection_oer_ext_arr_[0] = {}; const int AltitudeAndDirection_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t AltitudeAndDirection_oer_ = { -1, TRUE, -1, TRUE, 2, 0, AltitudeAndDirection_oer_ext_arr_, 2, AltitudeAndDirection_oer_p_}; static const Per_Constraint AltitudeAndDirection_per_cons_; const ASN_PERdescriptor_t AltitudeAndDirection_per_ = { &AltitudeAndDirection_per_cons_ }; const TTCN_Typedescriptor_t AltitudeAndDirection_descr_ = { "@HNBAP-IEs.AltitudeAndDirection", &SEQUENCE_ber_, NULL, NULL, NULL, &AltitudeAndDirection_json_, &AltitudeAndDirection_oer_, &AltitudeAndDirection_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING AltitudeAndDirection_default_coding(""); // No XER for BackoffTimer const int BackoffTimer_oer_ext_arr_[0] = {}; const int BackoffTimer_oer_p_[0] = {}; const TTCN_OERdescriptor_t BackoffTimer_oer_ = { 2, FALSE, -1, FALSE, 0, 0, BackoffTimer_oer_ext_arr_, 0, BackoffTimer_oer_p_}; static Per_Integer_Constraint BackoffTimer_per_cons_(new INTEGER(0), new INTEGER(3600), FALSE); const ASN_PERdescriptor_t BackoffTimer_per_ = { &BackoffTimer_per_cons_ }; const TTCN_Typedescriptor_t BackoffTimer_descr_ = { "@HNBAP-IEs.BackoffTimer", &INTEGER_ber_, NULL, NULL, NULL, &INTEGER_json_, &BackoffTimer_oer_, &BackoffTimer_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING BackoffTimer_default_coding(""); // No XER for BindingID const int BindingID_oer_ext_arr_[0] = {}; const int BindingID_oer_p_[0] = {}; const TTCN_OERdescriptor_t BindingID_oer_ = { -1, TRUE, -1, FALSE, 0, 0, BindingID_oer_ext_arr_, 0, BindingID_oer_p_}; static Per_Integer_Constraint BindingID_per_cons_(new INTEGER(1), new INTEGER(4), TRUE); const ASN_PERdescriptor_t BindingID_per_ = { &BindingID_per_cons_ }; const TTCN_Typedescriptor_t BindingID_descr_ = { "@HNBAP-IEs.BindingID", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &BindingID_oer_, &BindingID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING BindingID_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_ = { "@HNBAP-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_ = { "@HNBAP-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_ = { "@HNBAP-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_ = { "@HNBAP-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_ = { "@HNBAP-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_ = { "@HNBAP-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_ = { "@HNBAP-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_ = { "@HNBAP-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_ = { "@HNBAP-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 CellIdentity const int CellIdentity_oer_ext_arr_[0] = {}; const int CellIdentity_oer_p_[0] = {}; const TTCN_OERdescriptor_t CellIdentity_oer_ = { -1, TRUE, 28, FALSE, 0, 0, CellIdentity_oer_ext_arr_, 0, CellIdentity_oer_p_}; static Per_Integer_Constraint CellIdentity_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(28), FALSE); static Per_BitString_Constraint CellIdentity_per_cons_(FALSE, &CellIdentity_size_per_cons_); const ASN_PERdescriptor_t CellIdentity_per_ = { &CellIdentity_per_cons_ }; const TTCN_Typedescriptor_t CellIdentity_descr_ = { "@HNBAP-IEs.CellIdentity", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &CellIdentity_oer_, &CellIdentity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CellIdentity_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_ = { "@HNBAP-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(""); // 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_ = { "@HNBAP-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_ = { "@HNBAP-IEs.CriticalityDiagnostics.procedureCode", &CriticalityDiagnostics_procedureCode_ber_, NULL, NULL, NULL, &INTEGER_json_, &CriticalityDiagnostics_procedureCode_oer_, &HNBAP__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_ = { "@HNBAP-IEs.CriticalityDiagnostics.triggeringMessage", &CriticalityDiagnostics_triggeringMessage_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::TriggeringMessage_json_, &CriticalityDiagnostics_triggeringMessage_oer_, &HNBAP__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_ = { "@HNBAP-IEs.CriticalityDiagnostics.procedureCriticality", &CriticalityDiagnostics_procedureCriticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &CriticalityDiagnostics_procedureCriticality_oer_, &HNBAP__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_ = { "@HNBAP-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_ = { "@HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE.iECriticality", &CriticalityDiagnostics__IE__List_0_iECriticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &CriticalityDiagnostics__IE__List_0_iECriticality_oer_, &HNBAP__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_ = { "@HNBAP-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_, &HNBAP__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_ = { "@HNBAP-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_ = { "@HNBAP-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_ = { "@HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_ = { "@HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE.iE-Extensions", &CriticalityDiagnostics__IE__List_0_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_json_, &CriticalityDiagnostics__IE__List_0_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_ = { "@HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_ = { "@HNBAP-IEs.CriticalityDiagnostics.iE-Extensions", &CriticalityDiagnostics_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_json_, &CriticalityDiagnostics_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CriticalityDiagnostics_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING CriticalityDiagnostics_default_coding(""); // No XER for CSG__ID const int CSG__ID_oer_ext_arr_[0] = {}; const int CSG__ID_oer_p_[0] = {}; const TTCN_OERdescriptor_t CSG__ID_oer_ = { -1, TRUE, 27, FALSE, 0, 0, CSG__ID_oer_ext_arr_, 0, CSG__ID_oer_p_}; static Per_Integer_Constraint CSG__ID_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(27), FALSE); static Per_BitString_Constraint CSG__ID_per_cons_(FALSE, &CSG__ID_size_per_cons_); const ASN_PERdescriptor_t CSG__ID_per_ = { &CSG__ID_per_cons_ }; const TTCN_Typedescriptor_t CSG__ID_descr_ = { "@HNBAP-IEs.CSG-ID", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &CSG__ID_oer_, &CSG__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CSG__ID_default_coding(""); // No XER for CSG__Capability const TTCN_JSONdescriptor_t CSG__Capability_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CSG__Capability_oer_ext_arr_[0] = {}; const int CSG__Capability_oer_p_[0] = {}; const TTCN_OERdescriptor_t CSG__Capability_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CSG__Capability_oer_ext_arr_, 0, CSG__Capability_oer_p_}; static const Per_Constraint CSG__Capability_per_cons_; const ASN_PERdescriptor_t CSG__Capability_per_ = { &CSG__Capability_per_cons_ }; const TTCN_Typedescriptor_t CSG__Capability_descr_ = { "@HNBAP-IEs.CSG-Capability", &ENUMERATED_ber_, NULL, NULL, NULL, &CSG__Capability_json_, &CSG__Capability_oer_, &CSG__Capability_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CSG__Capability_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_ = { "@HNBAP-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 PLMNidentity const int PLMNidentity_oer_ext_arr_[0] = {}; const int PLMNidentity_oer_p_[0] = {}; const TTCN_OERdescriptor_t PLMNidentity_oer_ = { -1, TRUE, 3, FALSE, 0, 0, PLMNidentity_oer_ext_arr_, 0, PLMNidentity_oer_p_}; static Per_Integer_Constraint PLMNidentity_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(3), FALSE); const ASN_PERdescriptor_t PLMNidentity_per_ = { &PLMNidentity_per_cons_ }; const TTCN_Typedescriptor_t PLMNidentity_descr_ = { "@HNBAP-IEs.PLMNidentity", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &PLMNidentity_oer_, &PLMNidentity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PLMNidentity_default_coding(""); const ASN_Tag_t CGI_pLMNidentity_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t CGI_pLMNidentity_ber_ = { 1u, CGI_pLMNidentity_tag_ }; // No XER for CGI_pLMNidentity const int CGI_pLMNidentity_oer_ext_arr_[0] = {}; const int CGI_pLMNidentity_oer_p_[0] = {}; const TTCN_OERdescriptor_t CGI_pLMNidentity_oer_ = { -1, TRUE, 3, FALSE, 0, 0, CGI_pLMNidentity_oer_ext_arr_, 0, CGI_pLMNidentity_oer_p_}; const TTCN_Typedescriptor_t CGI_pLMNidentity_descr_ = { "@HNBAP-IEs.CGI.pLMNidentity", &CGI_pLMNidentity_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &CGI_pLMNidentity_oer_, &PLMNidentity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CGI_pLMNidentity_default_coding(""); // No XER for LAC const int LAC_oer_ext_arr_[0] = {}; const int LAC_oer_p_[0] = {}; const TTCN_OERdescriptor_t LAC_oer_ = { -1, TRUE, 2, FALSE, 0, 0, LAC_oer_ext_arr_, 0, LAC_oer_p_}; static Per_Integer_Constraint LAC_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(2), FALSE); const ASN_PERdescriptor_t LAC_per_ = { &LAC_per_cons_ }; const TTCN_Typedescriptor_t LAC_descr_ = { "@HNBAP-IEs.LAC", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &LAC_oer_, &LAC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING LAC_default_coding(""); const ASN_Tag_t CGI_lAC_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t CGI_lAC_ber_ = { 1u, CGI_lAC_tag_ }; // No XER for CGI_lAC const int CGI_lAC_oer_ext_arr_[0] = {}; const int CGI_lAC_oer_p_[0] = {}; const TTCN_OERdescriptor_t CGI_lAC_oer_ = { -1, TRUE, 2, FALSE, 0, 0, CGI_lAC_oer_ext_arr_, 0, CGI_lAC_oer_p_}; const TTCN_Typedescriptor_t CGI_lAC_descr_ = { "@HNBAP-IEs.CGI.lAC", &CGI_lAC_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &CGI_lAC_oer_, &LAC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CGI_lAC_default_coding(""); // No XER for CI const int CI_oer_ext_arr_[0] = {}; const int CI_oer_p_[0] = {}; const TTCN_OERdescriptor_t CI_oer_ = { -1, TRUE, 2, FALSE, 0, 0, CI_oer_ext_arr_, 0, CI_oer_p_}; static Per_Integer_Constraint CI_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(2), FALSE); const ASN_PERdescriptor_t CI_per_ = { &CI_per_cons_ }; const TTCN_Typedescriptor_t CI_descr_ = { "@HNBAP-IEs.CI", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &CI_oer_, &CI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CI_default_coding(""); const ASN_Tag_t CGI_cI_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t CGI_cI_ber_ = { 1u, CGI_cI_tag_ }; // No XER for CGI_cI const int CGI_cI_oer_ext_arr_[0] = {}; const int CGI_cI_oer_p_[0] = {}; const TTCN_OERdescriptor_t CGI_cI_oer_ = { -1, TRUE, 2, FALSE, 0, 0, CGI_cI_oer_ext_arr_, 0, CGI_cI_oer_p_}; const TTCN_Typedescriptor_t CGI_cI_descr_ = { "@HNBAP-IEs.CGI.cI", &CGI_cI_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &CGI_cI_oer_, &CI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CGI_cI_default_coding(""); // No XER for CGI const TTCN_JSONdescriptor_t CGI_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int CGI_oer_ext_arr_[0] = {}; const int CGI_oer_p_[4] = {0, 1, 2, 3}; const TTCN_OERdescriptor_t CGI_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CGI_oer_ext_arr_, 4, CGI_oer_p_}; static const Per_Constraint CGI_per_cons_; const ASN_PERdescriptor_t CGI_per_ = { &CGI_per_cons_ }; const TTCN_Typedescriptor_t CGI_descr_ = { "@HNBAP-IEs.CGI", &SEQUENCE_ber_, NULL, NULL, NULL, &CGI_json_, &CGI_oer_, &CGI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_default_coding(""); const ASN_Tag_t CGI_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t CGI_iE__Extensions_ber_ = { 1u, CGI_iE__Extensions_tag_ }; // No XER for CGI_iE__Extensions const int CGI_iE__Extensions_oer_ext_arr_[0] = {}; const int CGI_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t CGI_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CGI_iE__Extensions_oer_ext_arr_, 0, CGI_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t CGI_iE__Extensions_descr_ = { "@HNBAP-IEs.CGI.iE-Extensions", &CGI_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_json_, &CGI_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING CGI_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING CGI_default_coding(""); // 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_ = { "@HNBAP-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 ESN const int ESN_oer_ext_arr_[0] = {}; const int ESN_oer_p_[0] = {}; const TTCN_OERdescriptor_t ESN_oer_ = { -1, TRUE, 32, FALSE, 0, 0, ESN_oer_ext_arr_, 0, ESN_oer_p_}; static Per_Integer_Constraint ESN_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(32), FALSE); static Per_BitString_Constraint ESN_per_cons_(FALSE, &ESN_size_per_cons_); const ASN_PERdescriptor_t ESN_per_ = { &ESN_per_cons_ }; const TTCN_Typedescriptor_t ESN_descr_ = { "@HNBAP-IEs.ESN", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &ESN_oer_, &ESN_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING ESN_default_coding(""); const ASN_Tag_t GeographicalCoordinates_latitudeSign_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t GeographicalCoordinates_latitudeSign_ber_ = { 1u, GeographicalCoordinates_latitudeSign_tag_ }; // No XER for GeographicalCoordinates_latitudeSign const TTCN_JSONdescriptor_t GeographicalCoordinates_latitudeSign_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int GeographicalCoordinates_latitudeSign_oer_ext_arr_[0] = {}; const int GeographicalCoordinates_latitudeSign_oer_p_[0] = {}; const TTCN_OERdescriptor_t GeographicalCoordinates_latitudeSign_oer_ = { -1, TRUE, -1, FALSE, 0, 0, GeographicalCoordinates_latitudeSign_oer_ext_arr_, 0, GeographicalCoordinates_latitudeSign_oer_p_}; static const Per_Constraint GeographicalCoordinates_latitudeSign_per_cons_; const ASN_PERdescriptor_t GeographicalCoordinates_latitudeSign_per_ = { &GeographicalCoordinates_latitudeSign_per_cons_ }; const TTCN_Typedescriptor_t GeographicalCoordinates_latitudeSign_descr_ = { "@HNBAP-IEs.GeographicalCoordinates.latitudeSign", &GeographicalCoordinates_latitudeSign_ber_, NULL, NULL, NULL, &GeographicalCoordinates_latitudeSign_json_, &GeographicalCoordinates_latitudeSign_oer_, &GeographicalCoordinates_latitudeSign_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GeographicalCoordinates_latitudeSign_default_coding(""); const ASN_Tag_t GeographicalCoordinates_latitude_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t GeographicalCoordinates_latitude_ber_ = { 1u, GeographicalCoordinates_latitude_tag_ }; // No XER for GeographicalCoordinates_latitude const int GeographicalCoordinates_latitude_oer_ext_arr_[0] = {}; const int GeographicalCoordinates_latitude_oer_p_[0] = {}; const TTCN_OERdescriptor_t GeographicalCoordinates_latitude_oer_ = { 4, FALSE, -1, FALSE, 0, 0, GeographicalCoordinates_latitude_oer_ext_arr_, 0, GeographicalCoordinates_latitude_oer_p_}; static Per_Integer_Constraint GeographicalCoordinates_latitude_per_cons_(new INTEGER(0), new INTEGER(8388607), FALSE); const ASN_PERdescriptor_t GeographicalCoordinates_latitude_per_ = { &GeographicalCoordinates_latitude_per_cons_ }; const TTCN_Typedescriptor_t GeographicalCoordinates_latitude_descr_ = { "@HNBAP-IEs.GeographicalCoordinates.latitude", &GeographicalCoordinates_latitude_ber_, NULL, NULL, NULL, &INTEGER_json_, &GeographicalCoordinates_latitude_oer_, &GeographicalCoordinates_latitude_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GeographicalCoordinates_latitude_default_coding(""); const ASN_Tag_t GeographicalCoordinates_longitude_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t GeographicalCoordinates_longitude_ber_ = { 1u, GeographicalCoordinates_longitude_tag_ }; // No XER for GeographicalCoordinates_longitude const int GeographicalCoordinates_longitude_oer_ext_arr_[0] = {}; const int GeographicalCoordinates_longitude_oer_p_[0] = {}; const TTCN_OERdescriptor_t GeographicalCoordinates_longitude_oer_ = { 4, TRUE, -1, FALSE, 0, 0, GeographicalCoordinates_longitude_oer_ext_arr_, 0, GeographicalCoordinates_longitude_oer_p_}; static Per_Integer_Constraint GeographicalCoordinates_longitude_per_cons_(new INTEGER(-8388608), new INTEGER(8388607), FALSE); const ASN_PERdescriptor_t GeographicalCoordinates_longitude_per_ = { &GeographicalCoordinates_longitude_per_cons_ }; const TTCN_Typedescriptor_t GeographicalCoordinates_longitude_descr_ = { "@HNBAP-IEs.GeographicalCoordinates.longitude", &GeographicalCoordinates_longitude_ber_, NULL, NULL, NULL, &INTEGER_json_, &GeographicalCoordinates_longitude_oer_, &GeographicalCoordinates_longitude_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GeographicalCoordinates_longitude_default_coding(""); // No XER for GeographicalCoordinates const TTCN_JSONdescriptor_t GeographicalCoordinates_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int GeographicalCoordinates_oer_ext_arr_[0] = {}; const int GeographicalCoordinates_oer_p_[4] = {0, 1, 2, 3}; const TTCN_OERdescriptor_t GeographicalCoordinates_oer_ = { -1, TRUE, -1, TRUE, 4, 0, GeographicalCoordinates_oer_ext_arr_, 4, GeographicalCoordinates_oer_p_}; static const Per_Constraint GeographicalCoordinates_per_cons_; const ASN_PERdescriptor_t GeographicalCoordinates_per_ = { &GeographicalCoordinates_per_cons_ }; const TTCN_Typedescriptor_t GeographicalCoordinates_descr_ = { "@HNBAP-IEs.GeographicalCoordinates", &SEQUENCE_ber_, NULL, NULL, NULL, &GeographicalCoordinates_json_, &GeographicalCoordinates_oer_, &GeographicalCoordinates_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_default_coding(""); const ASN_Tag_t GeographicalCoordinates_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t GeographicalCoordinates_iE__Extensions_ber_ = { 1u, GeographicalCoordinates_iE__Extensions_tag_ }; // No XER for GeographicalCoordinates_iE__Extensions const int GeographicalCoordinates_iE__Extensions_oer_ext_arr_[0] = {}; const int GeographicalCoordinates_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t GeographicalCoordinates_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, GeographicalCoordinates_iE__Extensions_oer_ext_arr_, 0, GeographicalCoordinates_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t GeographicalCoordinates_iE__Extensions_descr_ = { "@HNBAP-IEs.GeographicalCoordinates.iE-Extensions", &GeographicalCoordinates_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_json_, &GeographicalCoordinates_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GeographicalCoordinates_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING GeographicalCoordinates_default_coding(""); const ASN_Tag_t GeographicalLocation_geographicalCoordinates_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t GeographicalLocation_geographicalCoordinates_ber_ = { 1u, GeographicalLocation_geographicalCoordinates_tag_ }; // No XER for GeographicalLocation_geographicalCoordinates const int GeographicalLocation_geographicalCoordinates_oer_ext_arr_[0] = {}; const int GeographicalLocation_geographicalCoordinates_oer_p_[4] = {0, 1, 2, 3}; const TTCN_OERdescriptor_t GeographicalLocation_geographicalCoordinates_oer_ = { -1, TRUE, -1, TRUE, 4, 0, GeographicalLocation_geographicalCoordinates_oer_ext_arr_, 4, GeographicalLocation_geographicalCoordinates_oer_p_}; const TTCN_Typedescriptor_t GeographicalLocation_geographicalCoordinates_descr_ = { "@HNBAP-IEs.GeographicalLocation.geographicalCoordinates", &GeographicalLocation_geographicalCoordinates_ber_, NULL, NULL, NULL, &GeographicalCoordinates_json_, &GeographicalLocation_geographicalCoordinates_oer_, &GeographicalCoordinates_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GeographicalLocation_geographicalCoordinates_default_coding(""); const ASN_Tag_t GeographicalLocation_altitudeAndDirection_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t GeographicalLocation_altitudeAndDirection_ber_ = { 1u, GeographicalLocation_altitudeAndDirection_tag_ }; // No XER for GeographicalLocation_altitudeAndDirection const int GeographicalLocation_altitudeAndDirection_oer_ext_arr_[0] = {}; const int GeographicalLocation_altitudeAndDirection_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t GeographicalLocation_altitudeAndDirection_oer_ = { -1, TRUE, -1, TRUE, 2, 0, GeographicalLocation_altitudeAndDirection_oer_ext_arr_, 2, GeographicalLocation_altitudeAndDirection_oer_p_}; const TTCN_Typedescriptor_t GeographicalLocation_altitudeAndDirection_descr_ = { "@HNBAP-IEs.GeographicalLocation.altitudeAndDirection", &GeographicalLocation_altitudeAndDirection_ber_, NULL, NULL, NULL, &AltitudeAndDirection_json_, &GeographicalLocation_altitudeAndDirection_oer_, &AltitudeAndDirection_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GeographicalLocation_altitudeAndDirection_default_coding(""); // No XER for GeographicalLocation const TTCN_JSONdescriptor_t GeographicalLocation_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int GeographicalLocation_oer_ext_arr_[0] = {}; const int GeographicalLocation_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t GeographicalLocation_oer_ = { -1, TRUE, -1, TRUE, 3, 0, GeographicalLocation_oer_ext_arr_, 3, GeographicalLocation_oer_p_}; static const Per_Constraint GeographicalLocation_per_cons_; const ASN_PERdescriptor_t GeographicalLocation_per_ = { &GeographicalLocation_per_cons_ }; const TTCN_Typedescriptor_t GeographicalLocation_descr_ = { "@HNBAP-IEs.GeographicalLocation", &SEQUENCE_ber_, NULL, NULL, NULL, &GeographicalLocation_json_, &GeographicalLocation_oer_, &GeographicalLocation_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_default_coding(""); const ASN_Tag_t GeographicalLocation_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t GeographicalLocation_iE__Extensions_ber_ = { 1u, GeographicalLocation_iE__Extensions_tag_ }; // No XER for GeographicalLocation_iE__Extensions const int GeographicalLocation_iE__Extensions_oer_ext_arr_[0] = {}; const int GeographicalLocation_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t GeographicalLocation_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, GeographicalLocation_iE__Extensions_oer_ext_arr_, 0, GeographicalLocation_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t GeographicalLocation_iE__Extensions_descr_ = { "@HNBAP-IEs.GeographicalLocation.iE-Extensions", &GeographicalLocation_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_json_, &GeographicalLocation_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GeographicalLocation_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING GeographicalLocation_default_coding(""); // No XER for GTP__TEI const int GTP__TEI_oer_ext_arr_[0] = {}; const int GTP__TEI_oer_p_[0] = {}; const TTCN_OERdescriptor_t GTP__TEI_oer_ = { -1, TRUE, 4, FALSE, 0, 0, GTP__TEI_oer_ext_arr_, 0, GTP__TEI_oer_p_}; static Per_Integer_Constraint GTP__TEI_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(4), FALSE); const ASN_PERdescriptor_t GTP__TEI_per_ = { >P__TEI_per_cons_ }; const TTCN_Typedescriptor_t GTP__TEI_descr_ = { "@HNBAP-IEs.GTP-TEI", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, >P__TEI_oer_, >P__TEI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING GTP__TEI_default_coding(""); // No XER for HNB__Cell__Access__Mode const TTCN_JSONdescriptor_t HNB__Cell__Access__Mode_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int HNB__Cell__Access__Mode_oer_ext_arr_[0] = {}; const int HNB__Cell__Access__Mode_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__Cell__Access__Mode_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNB__Cell__Access__Mode_oer_ext_arr_, 0, HNB__Cell__Access__Mode_oer_p_}; static const Per_Constraint HNB__Cell__Access__Mode_per_cons_; const ASN_PERdescriptor_t HNB__Cell__Access__Mode_per_ = { &HNB__Cell__Access__Mode_per_cons_ }; const TTCN_Typedescriptor_t HNB__Cell__Access__Mode_descr_ = { "@HNBAP-IEs.HNB-Cell-Access-Mode", &ENUMERATED_ber_, NULL, NULL, NULL, &HNB__Cell__Access__Mode_json_, &HNB__Cell__Access__Mode_oer_, &HNB__Cell__Access__Mode_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Cell__Access__Mode_default_coding(""); const ASN_Tag_t HNB__Cell__Identifier_pLMNidentity_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t HNB__Cell__Identifier_pLMNidentity_ber_ = { 1u, HNB__Cell__Identifier_pLMNidentity_tag_ }; // No XER for HNB__Cell__Identifier_pLMNidentity const int HNB__Cell__Identifier_pLMNidentity_oer_ext_arr_[0] = {}; const int HNB__Cell__Identifier_pLMNidentity_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__Cell__Identifier_pLMNidentity_oer_ = { -1, TRUE, 3, FALSE, 0, 0, HNB__Cell__Identifier_pLMNidentity_oer_ext_arr_, 0, HNB__Cell__Identifier_pLMNidentity_oer_p_}; const TTCN_Typedescriptor_t HNB__Cell__Identifier_pLMNidentity_descr_ = { "@HNBAP-IEs.HNB-Cell-Identifier.pLMNidentity", &HNB__Cell__Identifier_pLMNidentity_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &HNB__Cell__Identifier_pLMNidentity_oer_, &PLMNidentity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Cell__Identifier_pLMNidentity_default_coding(""); const ASN_Tag_t HNB__Cell__Identifier_cellIdentity_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t HNB__Cell__Identifier_cellIdentity_ber_ = { 1u, HNB__Cell__Identifier_cellIdentity_tag_ }; // No XER for HNB__Cell__Identifier_cellIdentity const int HNB__Cell__Identifier_cellIdentity_oer_ext_arr_[0] = {}; const int HNB__Cell__Identifier_cellIdentity_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__Cell__Identifier_cellIdentity_oer_ = { -1, TRUE, 28, FALSE, 0, 0, HNB__Cell__Identifier_cellIdentity_oer_ext_arr_, 0, HNB__Cell__Identifier_cellIdentity_oer_p_}; const TTCN_Typedescriptor_t HNB__Cell__Identifier_cellIdentity_descr_ = { "@HNBAP-IEs.HNB-Cell-Identifier.cellIdentity", &HNB__Cell__Identifier_cellIdentity_ber_, NULL, NULL, NULL, &BITSTRING_json_, &HNB__Cell__Identifier_cellIdentity_oer_, &CellIdentity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Cell__Identifier_cellIdentity_default_coding(""); // No XER for HNB__Cell__Identifier const TTCN_JSONdescriptor_t HNB__Cell__Identifier_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int HNB__Cell__Identifier_oer_ext_arr_[0] = {}; const int HNB__Cell__Identifier_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t HNB__Cell__Identifier_oer_ = { -1, TRUE, -1, TRUE, 3, 0, HNB__Cell__Identifier_oer_ext_arr_, 3, HNB__Cell__Identifier_oer_p_}; static const Per_Constraint HNB__Cell__Identifier_per_cons_; const ASN_PERdescriptor_t HNB__Cell__Identifier_per_ = { &HNB__Cell__Identifier_per_cons_ }; const TTCN_Typedescriptor_t HNB__Cell__Identifier_descr_ = { "@HNBAP-IEs.HNB-Cell-Identifier", &SEQUENCE_ber_, NULL, NULL, NULL, &HNB__Cell__Identifier_json_, &HNB__Cell__Identifier_oer_, &HNB__Cell__Identifier_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_default_coding(""); const ASN_Tag_t HNB__Cell__Identifier_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t HNB__Cell__Identifier_iE__Extensions_ber_ = { 1u, HNB__Cell__Identifier_iE__Extensions_tag_ }; // No XER for HNB__Cell__Identifier_iE__Extensions const int HNB__Cell__Identifier_iE__Extensions_oer_ext_arr_[0] = {}; const int HNB__Cell__Identifier_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__Cell__Identifier_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNB__Cell__Identifier_iE__Extensions_oer_ext_arr_, 0, HNB__Cell__Identifier_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t HNB__Cell__Identifier_iE__Extensions_descr_ = { "@HNBAP-IEs.HNB-Cell-Identifier.iE-Extensions", &HNB__Cell__Identifier_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_json_, &HNB__Cell__Identifier_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Cell__Identifier_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING HNB__Cell__Identifier_default_coding(""); // No XER for HNB__RNL__Identity const TTCN_JSONdescriptor_t HNB__RNL__Identity_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int HNB__RNL__Identity_oer_ext_arr_[0] = {}; const int HNB__RNL__Identity_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__RNL__Identity_oer_ = { -1, TRUE, -1, TRUE, 1, 0, HNB__RNL__Identity_oer_ext_arr_, 0, HNB__RNL__Identity_oer_p_}; static const Per_Constraint HNB__RNL__Identity_per_cons_; const ASN_PERdescriptor_t HNB__RNL__Identity_per_ = { &HNB__RNL__Identity_per_cons_ }; const TTCN_Typedescriptor_t HNB__RNL__Identity_descr_ = { "@HNBAP-IEs.HNB-RNL-Identity", &CHOICE_ber_, NULL, NULL, NULL, &HNB__RNL__Identity_json_, &HNB__RNL__Identity_oer_, &HNB__RNL__Identity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_ber_ = { 1u, HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_tag_ }; // No XER for HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier const int HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_oer_ext_arr_[0] = {}; const int HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_oer_ = { -1, TRUE, -1, TRUE, 3, 0, HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_oer_ext_arr_, 3, HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_oer_p_}; const TTCN_Typedescriptor_t HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_ = { "@HNBAP-IEs.HNB-RNL-Identity.hNB-Identity-as-Cell-Identifier", &HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_ber_, NULL, NULL, NULL, &HNB__Cell__Identifier_json_, &HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_oer_, &HNB__Cell__Identifier_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_default_coding(""); UNIVERSAL_CHARSTRING HNB__RNL__Identity_default_coding(""); const ASN_Tag_t HNBConfigInfo_hnb__RNL__Identity_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t HNBConfigInfo_hnb__RNL__Identity_ber_ = { 1u, HNBConfigInfo_hnb__RNL__Identity_tag_ }; // No XER for HNBConfigInfo_hnb__RNL__Identity const int HNBConfigInfo_hnb__RNL__Identity_oer_ext_arr_[0] = {}; const int HNBConfigInfo_hnb__RNL__Identity_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigInfo_hnb__RNL__Identity_oer_ = { -1, TRUE, -1, TRUE, 1, 0, HNBConfigInfo_hnb__RNL__Identity_oer_ext_arr_, 0, HNBConfigInfo_hnb__RNL__Identity_oer_p_}; const TTCN_Typedescriptor_t HNBConfigInfo_hnb__RNL__Identity_descr_ = { "@HNBAP-IEs.HNBConfigInfo.hnb-RNL-Identity", &HNBConfigInfo_hnb__RNL__Identity_ber_, NULL, NULL, NULL, &HNB__RNL__Identity_json_, &HNBConfigInfo_hnb__RNL__Identity_oer_, &HNB__RNL__Identity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigInfo_hnb__RNL__Identity_default_coding(""); // No XER for ConfigurationInformation const TTCN_JSONdescriptor_t ConfigurationInformation_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int ConfigurationInformation_oer_ext_arr_[0] = {}; const int ConfigurationInformation_oer_p_[0] = {}; const TTCN_OERdescriptor_t ConfigurationInformation_oer_ = { -1, TRUE, -1, TRUE, 2, 0, ConfigurationInformation_oer_ext_arr_, 0, ConfigurationInformation_oer_p_}; static const Per_Constraint ConfigurationInformation_per_cons_; const ASN_PERdescriptor_t ConfigurationInformation_per_ = { &ConfigurationInformation_per_cons_ }; const TTCN_Typedescriptor_t ConfigurationInformation_descr_ = { "@HNBAP-IEs.ConfigurationInformation", &CHOICE_ber_, NULL, NULL, NULL, &ConfigurationInformation_json_, &ConfigurationInformation_oer_, &ConfigurationInformation_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_ber_ = { 1u, HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_tag_ }; // No XER for HNBConfigurationInformationProvided_hNB__Cell__Access__Mode const int HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_oer_ext_arr_, 0, HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_oer_p_}; const TTCN_Typedescriptor_t HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationProvided.hNB-Cell-Access-Mode", &HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_ber_, NULL, NULL, NULL, &HNB__Cell__Access__Mode_json_, &HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_oer_, &HNB__Cell__Access__Mode_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_default_coding(""); // No XER for Iurh__Signalling__TNL__AddressList const TTCN_JSONdescriptor_t Iurh__Signalling__TNL__AddressList_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Iurh__Signalling__TNL__AddressList_oer_ext_arr_[0] = {}; const int Iurh__Signalling__TNL__AddressList_oer_p_[0] = {}; const TTCN_OERdescriptor_t Iurh__Signalling__TNL__AddressList_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Iurh__Signalling__TNL__AddressList_oer_ext_arr_, 0, Iurh__Signalling__TNL__AddressList_oer_p_}; static Per_Integer_Constraint Iurh__Signalling__TNL__AddressList_per_cons_(new INTEGER(1), new INTEGER(3), FALSE); const ASN_PERdescriptor_t Iurh__Signalling__TNL__AddressList_per_ = { &Iurh__Signalling__TNL__AddressList_per_cons_ }; const TTCN_Typedescriptor_t Iurh__Signalling__TNL__AddressList_descr_ = { "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList", &SEQUENCE_ber_, NULL, NULL, NULL, &Iurh__Signalling__TNL__AddressList_json_, &Iurh__Signalling__TNL__AddressList_oer_, &Iurh__Signalling__TNL__AddressList_per_, &Iurh__Signalling__TNL__AddressList_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t IP__Address_ipaddress_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t IP__Address_ipaddress_ber_ = { 1u, IP__Address_ipaddress_tag_ }; // No XER for IP__Address_ipaddress const TTCN_JSONdescriptor_t IP__Address_ipaddress_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int IP__Address_ipaddress_oer_ext_arr_[0] = {}; const int IP__Address_ipaddress_oer_p_[0] = {}; const TTCN_OERdescriptor_t IP__Address_ipaddress_oer_ = { -1, TRUE, -1, TRUE, 2, 0, IP__Address_ipaddress_oer_ext_arr_, 0, IP__Address_ipaddress_oer_p_}; static const Per_Constraint IP__Address_ipaddress_per_cons_; const ASN_PERdescriptor_t IP__Address_ipaddress_per_ = { &IP__Address_ipaddress_per_cons_ }; const TTCN_Typedescriptor_t IP__Address_ipaddress_descr_ = { "@HNBAP-IEs.IP-Address.ipaddress", &IP__Address_ipaddress_ber_, NULL, NULL, NULL, &IP__Address_ipaddress_json_, &IP__Address_ipaddress_oer_, &IP__Address_ipaddress_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for Ipv4Address const int Ipv4Address_oer_ext_arr_[0] = {}; const int Ipv4Address_oer_p_[0] = {}; const TTCN_OERdescriptor_t Ipv4Address_oer_ = { -1, TRUE, 4, FALSE, 0, 0, Ipv4Address_oer_ext_arr_, 0, Ipv4Address_oer_p_}; static Per_Integer_Constraint Ipv4Address_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(4), FALSE); const ASN_PERdescriptor_t Ipv4Address_per_ = { &Ipv4Address_per_cons_ }; const TTCN_Typedescriptor_t Ipv4Address_descr_ = { "@HNBAP-IEs.Ipv4Address", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &Ipv4Address_oer_, &Ipv4Address_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Ipv4Address_default_coding(""); const ASN_Tag_t IP__Address_ipaddress_ipv4info_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t IP__Address_ipaddress_ipv4info_ber_ = { 1u, IP__Address_ipaddress_ipv4info_tag_ }; // No XER for IP__Address_ipaddress_ipv4info const int IP__Address_ipaddress_ipv4info_oer_ext_arr_[0] = {}; const int IP__Address_ipaddress_ipv4info_oer_p_[0] = {}; const TTCN_OERdescriptor_t IP__Address_ipaddress_ipv4info_oer_ = { -1, TRUE, 4, FALSE, 0, 0, IP__Address_ipaddress_ipv4info_oer_ext_arr_, 0, IP__Address_ipaddress_ipv4info_oer_p_}; const TTCN_Typedescriptor_t IP__Address_ipaddress_ipv4info_descr_ = { "@HNBAP-IEs.IP-Address.ipaddress.ipv4info", &IP__Address_ipaddress_ipv4info_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &IP__Address_ipaddress_ipv4info_oer_, &Ipv4Address_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IP__Address_ipaddress_ipv4info_default_coding(""); // No XER for Ipv6Address const int Ipv6Address_oer_ext_arr_[0] = {}; const int Ipv6Address_oer_p_[0] = {}; const TTCN_OERdescriptor_t Ipv6Address_oer_ = { -1, TRUE, 16, FALSE, 0, 0, Ipv6Address_oer_ext_arr_, 0, Ipv6Address_oer_p_}; static Per_Integer_Constraint Ipv6Address_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(16), FALSE); const ASN_PERdescriptor_t Ipv6Address_per_ = { &Ipv6Address_per_cons_ }; const TTCN_Typedescriptor_t Ipv6Address_descr_ = { "@HNBAP-IEs.Ipv6Address", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &Ipv6Address_oer_, &Ipv6Address_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Ipv6Address_default_coding(""); const ASN_Tag_t IP__Address_ipaddress_ipv6info_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t IP__Address_ipaddress_ipv6info_ber_ = { 1u, IP__Address_ipaddress_ipv6info_tag_ }; // No XER for IP__Address_ipaddress_ipv6info const int IP__Address_ipaddress_ipv6info_oer_ext_arr_[0] = {}; const int IP__Address_ipaddress_ipv6info_oer_p_[0] = {}; const TTCN_OERdescriptor_t IP__Address_ipaddress_ipv6info_oer_ = { -1, TRUE, 16, FALSE, 0, 0, IP__Address_ipaddress_ipv6info_oer_ext_arr_, 0, IP__Address_ipaddress_ipv6info_oer_p_}; const TTCN_Typedescriptor_t IP__Address_ipaddress_ipv6info_descr_ = { "@HNBAP-IEs.IP-Address.ipaddress.ipv6info", &IP__Address_ipaddress_ipv6info_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &IP__Address_ipaddress_ipv6info_oer_, &Ipv6Address_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IP__Address_ipaddress_ipv6info_default_coding(""); UNIVERSAL_CHARSTRING IP__Address_ipaddress_default_coding(""); // No XER for IP__Address const TTCN_JSONdescriptor_t IP__Address_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int IP__Address_oer_ext_arr_[0] = {}; const int IP__Address_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t IP__Address_oer_ = { -1, TRUE, -1, TRUE, 2, 0, IP__Address_oer_ext_arr_, 2, IP__Address_oer_p_}; static const Per_Constraint IP__Address_per_cons_; const ASN_PERdescriptor_t IP__Address_per_ = { &IP__Address_per_cons_ }; const TTCN_Typedescriptor_t IP__Address_descr_ = { "@HNBAP-IEs.IP-Address", &SEQUENCE_ber_, NULL, NULL, NULL, &IP__Address_json_, &IP__Address_oer_, &IP__Address_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_default_coding(""); const ASN_Tag_t IP__Address_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t IP__Address_iE__Extensions_ber_ = { 1u, IP__Address_iE__Extensions_tag_ }; // No XER for IP__Address_iE__Extensions const int IP__Address_iE__Extensions_oer_ext_arr_[0] = {}; const int IP__Address_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t IP__Address_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IP__Address_iE__Extensions_oer_ext_arr_, 0, IP__Address_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t IP__Address_iE__Extensions_descr_ = { "@HNBAP-IEs.IP-Address.iE-Extensions", &IP__Address_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_json_, &IP__Address_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IP__Address_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING IP__Address_default_coding(""); // No XER for Iurh__Signalling__TNL__AddressList_0 const int Iurh__Signalling__TNL__AddressList_0_oer_ext_arr_[0] = {}; const int Iurh__Signalling__TNL__AddressList_0_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t Iurh__Signalling__TNL__AddressList_0_oer_ = { -1, TRUE, -1, TRUE, 2, 0, Iurh__Signalling__TNL__AddressList_0_oer_ext_arr_, 2, Iurh__Signalling__TNL__AddressList_0_oer_p_}; const TTCN_Typedescriptor_t Iurh__Signalling__TNL__AddressList_0_descr_ = { "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList.", &SEQUENCE_ber_, NULL, NULL, NULL, &IP__Address_json_, &Iurh__Signalling__TNL__AddressList_0_oer_, &IP__Address_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Iurh__Signalling__TNL__AddressList_0_default_coding(""); UNIVERSAL_CHARSTRING Iurh__Signalling__TNL__AddressList_default_coding(""); const ASN_Tag_t HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_ber_ = { 1u, HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_tag_ }; // No XER for HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList const int HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_oer_ext_arr_, 0, HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_oer_p_}; const TTCN_Typedescriptor_t HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationProvided.iurh-Signalling-TNL-AddressList", &HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_ber_, NULL, NULL, NULL, &Iurh__Signalling__TNL__AddressList_json_, &HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_oer_, &Iurh__Signalling__TNL__AddressList_per_, &Iurh__Signalling__TNL__AddressList_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_default_coding(""); // No XER for HNBConfigurationInformationProvided const TTCN_JSONdescriptor_t HNBConfigurationInformationProvided_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int HNBConfigurationInformationProvided_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationProvided_oer_p_[5] = {0, 1, 2, 3, 4}; const TTCN_OERdescriptor_t HNBConfigurationInformationProvided_oer_ = { -1, TRUE, -1, TRUE, 5, 0, HNBConfigurationInformationProvided_oer_ext_arr_, 5, HNBConfigurationInformationProvided_oer_p_}; static const Per_Constraint HNBConfigurationInformationProvided_per_cons_; const ASN_PERdescriptor_t HNBConfigurationInformationProvided_per_ = { &HNBConfigurationInformationProvided_per_cons_ }; const TTCN_Typedescriptor_t HNBConfigurationInformationProvided_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationProvided", &SEQUENCE_ber_, NULL, NULL, NULL, &HNBConfigurationInformationProvided_json_, &HNBConfigurationInformationProvided_oer_, &HNBConfigurationInformationProvided_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for PSC const int PSC_oer_ext_arr_[0] = {}; const int PSC_oer_p_[0] = {}; const TTCN_OERdescriptor_t PSC_oer_ = { -1, TRUE, 9, FALSE, 0, 0, PSC_oer_ext_arr_, 0, PSC_oer_p_}; static Per_Integer_Constraint PSC_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(9), FALSE); static Per_BitString_Constraint PSC_per_cons_(FALSE, &PSC_size_per_cons_); const ASN_PERdescriptor_t PSC_per_ = { &PSC_per_cons_ }; const TTCN_Typedescriptor_t PSC_descr_ = { "@HNBAP-IEs.PSC", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &PSC_oer_, &PSC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PSC_default_coding(""); const ASN_Tag_t HNBConfigurationInformationProvided_psc_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t HNBConfigurationInformationProvided_psc_ber_ = { 1u, HNBConfigurationInformationProvided_psc_tag_ }; // No XER for HNBConfigurationInformationProvided_psc const int HNBConfigurationInformationProvided_psc_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationProvided_psc_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigurationInformationProvided_psc_oer_ = { -1, TRUE, 9, FALSE, 0, 0, HNBConfigurationInformationProvided_psc_oer_ext_arr_, 0, HNBConfigurationInformationProvided_psc_oer_p_}; const TTCN_Typedescriptor_t HNBConfigurationInformationProvided_psc_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationProvided.psc", &HNBConfigurationInformationProvided_psc_ber_, NULL, NULL, NULL, &BITSTRING_json_, &HNBConfigurationInformationProvided_psc_oer_, &PSC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigurationInformationProvided_psc_default_coding(""); const ASN_Tag_t HNBConfigurationInformationProvided_cSG__ID_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t HNBConfigurationInformationProvided_cSG__ID_ber_ = { 1u, HNBConfigurationInformationProvided_cSG__ID_tag_ }; // No XER for HNBConfigurationInformationProvided_cSG__ID const int HNBConfigurationInformationProvided_cSG__ID_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationProvided_cSG__ID_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigurationInformationProvided_cSG__ID_oer_ = { -1, TRUE, 27, FALSE, 0, 0, HNBConfigurationInformationProvided_cSG__ID_oer_ext_arr_, 0, HNBConfigurationInformationProvided_cSG__ID_oer_p_}; const TTCN_Typedescriptor_t HNBConfigurationInformationProvided_cSG__ID_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationProvided.cSG-ID", &HNBConfigurationInformationProvided_cSG__ID_ber_, NULL, NULL, NULL, &BITSTRING_json_, &HNBConfigurationInformationProvided_cSG__ID_oer_, &CSG__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigurationInformationProvided_cSG__ID_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_default_coding(""); const ASN_Tag_t HNBConfigurationInformationProvided_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 4u }}; const ASN_BERdescriptor_t HNBConfigurationInformationProvided_iE__Extensions_ber_ = { 1u, HNBConfigurationInformationProvided_iE__Extensions_tag_ }; // No XER for HNBConfigurationInformationProvided_iE__Extensions const int HNBConfigurationInformationProvided_iE__Extensions_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationProvided_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigurationInformationProvided_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNBConfigurationInformationProvided_iE__Extensions_oer_ext_arr_, 0, HNBConfigurationInformationProvided_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t HNBConfigurationInformationProvided_iE__Extensions_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationProvided.iE-Extensions", &HNBConfigurationInformationProvided_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_json_, &HNBConfigurationInformationProvided_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigurationInformationProvided_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING HNBConfigurationInformationProvided_default_coding(""); const ASN_Tag_t ConfigurationInformation_provided_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t ConfigurationInformation_provided_ber_ = { 1u, ConfigurationInformation_provided_tag_ }; // No XER for ConfigurationInformation_provided const int ConfigurationInformation_provided_oer_ext_arr_[0] = {}; const int ConfigurationInformation_provided_oer_p_[5] = {0, 1, 2, 3, 4}; const TTCN_OERdescriptor_t ConfigurationInformation_provided_oer_ = { -1, TRUE, -1, TRUE, 5, 0, ConfigurationInformation_provided_oer_ext_arr_, 5, ConfigurationInformation_provided_oer_p_}; const TTCN_Typedescriptor_t ConfigurationInformation_provided_descr_ = { "@HNBAP-IEs.ConfigurationInformation.provided", &ConfigurationInformation_provided_ber_, NULL, NULL, NULL, &HNBConfigurationInformationProvided_json_, &ConfigurationInformation_provided_oer_, &HNBConfigurationInformationProvided_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING ConfigurationInformation_provided_default_coding(""); const ASN_Tag_t HNBConfigurationInformationMissing_cause_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t HNBConfigurationInformationMissing_cause_ber_ = { 1u, HNBConfigurationInformationMissing_cause_tag_ }; // No XER for HNBConfigurationInformationMissing_cause const int HNBConfigurationInformationMissing_cause_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationMissing_cause_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigurationInformationMissing_cause_oer_ = { -1, TRUE, -1, TRUE, 4, 0, HNBConfigurationInformationMissing_cause_oer_ext_arr_, 0, HNBConfigurationInformationMissing_cause_oer_p_}; const TTCN_Typedescriptor_t HNBConfigurationInformationMissing_cause_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationMissing.cause", &HNBConfigurationInformationMissing_cause_ber_, NULL, NULL, NULL, &Cause_json_, &HNBConfigurationInformationMissing_cause_oer_, &Cause_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigurationInformationMissing_cause_default_coding(""); // No XER for HNBConfigurationInformationMissing const TTCN_JSONdescriptor_t HNBConfigurationInformationMissing_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int HNBConfigurationInformationMissing_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationMissing_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t HNBConfigurationInformationMissing_oer_ = { -1, TRUE, -1, TRUE, 2, 0, HNBConfigurationInformationMissing_oer_ext_arr_, 2, HNBConfigurationInformationMissing_oer_p_}; static const Per_Constraint HNBConfigurationInformationMissing_per_cons_; const ASN_PERdescriptor_t HNBConfigurationInformationMissing_per_ = { &HNBConfigurationInformationMissing_per_cons_ }; const TTCN_Typedescriptor_t HNBConfigurationInformationMissing_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationMissing", &SEQUENCE_ber_, NULL, NULL, NULL, &HNBConfigurationInformationMissing_json_, &HNBConfigurationInformationMissing_oer_, &HNBConfigurationInformationMissing_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_default_coding(""); const ASN_Tag_t HNBConfigurationInformationMissing_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t HNBConfigurationInformationMissing_iE__Extensions_ber_ = { 1u, HNBConfigurationInformationMissing_iE__Extensions_tag_ }; // No XER for HNBConfigurationInformationMissing_iE__Extensions const int HNBConfigurationInformationMissing_iE__Extensions_oer_ext_arr_[0] = {}; const int HNBConfigurationInformationMissing_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigurationInformationMissing_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNBConfigurationInformationMissing_iE__Extensions_oer_ext_arr_, 0, HNBConfigurationInformationMissing_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t HNBConfigurationInformationMissing_iE__Extensions_descr_ = { "@HNBAP-IEs.HNBConfigurationInformationMissing.iE-Extensions", &HNBConfigurationInformationMissing_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_json_, &HNBConfigurationInformationMissing_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigurationInformationMissing_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING HNBConfigurationInformationMissing_default_coding(""); const ASN_Tag_t ConfigurationInformation_missing_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t ConfigurationInformation_missing_ber_ = { 1u, ConfigurationInformation_missing_tag_ }; // No XER for ConfigurationInformation_missing const int ConfigurationInformation_missing_oer_ext_arr_[0] = {}; const int ConfigurationInformation_missing_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t ConfigurationInformation_missing_oer_ = { -1, TRUE, -1, TRUE, 2, 0, ConfigurationInformation_missing_oer_ext_arr_, 2, ConfigurationInformation_missing_oer_p_}; const TTCN_Typedescriptor_t ConfigurationInformation_missing_descr_ = { "@HNBAP-IEs.ConfigurationInformation.missing", &ConfigurationInformation_missing_ber_, NULL, NULL, NULL, &HNBConfigurationInformationMissing_json_, &ConfigurationInformation_missing_oer_, &HNBConfigurationInformationMissing_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING ConfigurationInformation_missing_default_coding(""); UNIVERSAL_CHARSTRING ConfigurationInformation_default_coding(""); const ASN_Tag_t HNBConfigInfo_configurationInformation_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t HNBConfigInfo_configurationInformation_ber_ = { 1u, HNBConfigInfo_configurationInformation_tag_ }; // No XER for HNBConfigInfo_configurationInformation const int HNBConfigInfo_configurationInformation_oer_ext_arr_[0] = {}; const int HNBConfigInfo_configurationInformation_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigInfo_configurationInformation_oer_ = { -1, TRUE, -1, TRUE, 2, 0, HNBConfigInfo_configurationInformation_oer_ext_arr_, 0, HNBConfigInfo_configurationInformation_oer_p_}; const TTCN_Typedescriptor_t HNBConfigInfo_configurationInformation_descr_ = { "@HNBAP-IEs.HNBConfigInfo.configurationInformation", &HNBConfigInfo_configurationInformation_ber_, NULL, NULL, NULL, &ConfigurationInformation_json_, &HNBConfigInfo_configurationInformation_oer_, &ConfigurationInformation_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigInfo_configurationInformation_default_coding(""); // No XER for HNBConfigInfo const TTCN_JSONdescriptor_t HNBConfigInfo_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int HNBConfigInfo_oer_ext_arr_[0] = {}; const int HNBConfigInfo_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t HNBConfigInfo_oer_ = { -1, TRUE, -1, TRUE, 3, 0, HNBConfigInfo_oer_ext_arr_, 3, HNBConfigInfo_oer_p_}; static const Per_Constraint HNBConfigInfo_per_cons_; const ASN_PERdescriptor_t HNBConfigInfo_per_ = { &HNBConfigInfo_per_cons_ }; const TTCN_Typedescriptor_t HNBConfigInfo_descr_ = { "@HNBAP-IEs.HNBConfigInfo", &SEQUENCE_ber_, NULL, NULL, NULL, &HNBConfigInfo_json_, &HNBConfigInfo_oer_, &HNBConfigInfo_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_default_coding(""); const ASN_Tag_t HNBConfigInfo_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t HNBConfigInfo_iE__Extensions_ber_ = { 1u, HNBConfigInfo_iE__Extensions_tag_ }; // No XER for HNBConfigInfo_iE__Extensions const int HNBConfigInfo_iE__Extensions_oer_ext_arr_[0] = {}; const int HNBConfigInfo_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNBConfigInfo_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNBConfigInfo_iE__Extensions_oer_ext_arr_, 0, HNBConfigInfo_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t HNBConfigInfo_iE__Extensions_descr_ = { "@HNBAP-IEs.HNBConfigInfo.iE-Extensions", &HNBConfigInfo_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_json_, &HNBConfigInfo_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNBConfigInfo_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING HNBConfigInfo_default_coding(""); // No XER for HNB__Location__Information const TTCN_JSONdescriptor_t HNB__Location__Information_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int HNB__Location__Information_oer_ext_arr_[0] = {}; const int HNB__Location__Information_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t HNB__Location__Information_oer_ = { -1, TRUE, -1, TRUE, 3, 0, HNB__Location__Information_oer_ext_arr_, 3, HNB__Location__Information_oer_p_}; static const Per_Constraint HNB__Location__Information_per_cons_; const ASN_PERdescriptor_t HNB__Location__Information_per_ = { &HNB__Location__Information_per_cons_ }; const TTCN_Typedescriptor_t HNB__Location__Information_descr_ = { "@HNBAP-IEs.HNB-Location-Information", &SEQUENCE_ber_, NULL, NULL, NULL, &HNB__Location__Information_json_, &HNB__Location__Information_oer_, &HNB__Location__Information_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for MacroCellID const TTCN_JSONdescriptor_t MacroCellID_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int MacroCellID_oer_ext_arr_[0] = {}; const int MacroCellID_oer_p_[0] = {}; const TTCN_OERdescriptor_t MacroCellID_oer_ = { -1, TRUE, -1, TRUE, 2, 0, MacroCellID_oer_ext_arr_, 0, MacroCellID_oer_p_}; static const Per_Constraint MacroCellID_per_cons_; const ASN_PERdescriptor_t MacroCellID_per_ = { &MacroCellID_per_cons_ }; const TTCN_Typedescriptor_t MacroCellID_descr_ = { "@HNBAP-IEs.MacroCellID", &CHOICE_ber_, NULL, NULL, NULL, &MacroCellID_json_, &MacroCellID_oer_, &MacroCellID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t UTRANCellID_lAC_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t UTRANCellID_lAC_ber_ = { 1u, UTRANCellID_lAC_tag_ }; // No XER for UTRANCellID_lAC const int UTRANCellID_lAC_oer_ext_arr_[0] = {}; const int UTRANCellID_lAC_oer_p_[0] = {}; const TTCN_OERdescriptor_t UTRANCellID_lAC_oer_ = { -1, TRUE, 2, FALSE, 0, 0, UTRANCellID_lAC_oer_ext_arr_, 0, UTRANCellID_lAC_oer_p_}; const TTCN_Typedescriptor_t UTRANCellID_lAC_descr_ = { "@HNBAP-IEs.UTRANCellID.lAC", &UTRANCellID_lAC_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &UTRANCellID_lAC_oer_, &LAC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UTRANCellID_lAC_default_coding(""); // No XER for RAC const int RAC_oer_ext_arr_[0] = {}; const int RAC_oer_p_[0] = {}; const TTCN_OERdescriptor_t RAC_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RAC_oer_ext_arr_, 0, RAC_oer_p_}; static Per_Integer_Constraint RAC_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(1), FALSE); const ASN_PERdescriptor_t RAC_per_ = { &RAC_per_cons_ }; const TTCN_Typedescriptor_t RAC_descr_ = { "@HNBAP-IEs.RAC", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &RAC_oer_, &RAC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RAC_default_coding(""); const ASN_Tag_t UTRANCellID_rAC_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t UTRANCellID_rAC_ber_ = { 1u, UTRANCellID_rAC_tag_ }; // No XER for UTRANCellID_rAC const int UTRANCellID_rAC_oer_ext_arr_[0] = {}; const int UTRANCellID_rAC_oer_p_[0] = {}; const TTCN_OERdescriptor_t UTRANCellID_rAC_oer_ = { -1, TRUE, 1, FALSE, 0, 0, UTRANCellID_rAC_oer_ext_arr_, 0, UTRANCellID_rAC_oer_p_}; const TTCN_Typedescriptor_t UTRANCellID_rAC_descr_ = { "@HNBAP-IEs.UTRANCellID.rAC", &UTRANCellID_rAC_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &UTRANCellID_rAC_oer_, &RAC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UTRANCellID_rAC_default_coding(""); const ASN_Tag_t UTRANCellID_pLMNidentity_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t UTRANCellID_pLMNidentity_ber_ = { 1u, UTRANCellID_pLMNidentity_tag_ }; // No XER for UTRANCellID_pLMNidentity const int UTRANCellID_pLMNidentity_oer_ext_arr_[0] = {}; const int UTRANCellID_pLMNidentity_oer_p_[0] = {}; const TTCN_OERdescriptor_t UTRANCellID_pLMNidentity_oer_ = { -1, TRUE, 3, FALSE, 0, 0, UTRANCellID_pLMNidentity_oer_ext_arr_, 0, UTRANCellID_pLMNidentity_oer_p_}; const TTCN_Typedescriptor_t UTRANCellID_pLMNidentity_descr_ = { "@HNBAP-IEs.UTRANCellID.pLMNidentity", &UTRANCellID_pLMNidentity_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &UTRANCellID_pLMNidentity_oer_, &PLMNidentity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UTRANCellID_pLMNidentity_default_coding(""); const ASN_Tag_t UTRANCellID_uTRANcellID_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t UTRANCellID_uTRANcellID_ber_ = { 1u, UTRANCellID_uTRANcellID_tag_ }; // No XER for UTRANCellID_uTRANcellID const int UTRANCellID_uTRANcellID_oer_ext_arr_[0] = {}; const int UTRANCellID_uTRANcellID_oer_p_[0] = {}; const TTCN_OERdescriptor_t UTRANCellID_uTRANcellID_oer_ = { -1, TRUE, 28, FALSE, 0, 0, UTRANCellID_uTRANcellID_oer_ext_arr_, 0, UTRANCellID_uTRANcellID_oer_p_}; const TTCN_Typedescriptor_t UTRANCellID_uTRANcellID_descr_ = { "@HNBAP-IEs.UTRANCellID.uTRANcellID", &UTRANCellID_uTRANcellID_ber_, NULL, NULL, NULL, &BITSTRING_json_, &UTRANCellID_uTRANcellID_oer_, &CellIdentity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UTRANCellID_uTRANcellID_default_coding(""); // No XER for UTRANCellID const TTCN_JSONdescriptor_t UTRANCellID_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int UTRANCellID_oer_ext_arr_[0] = {}; const int UTRANCellID_oer_p_[5] = {0, 1, 2, 3, 4}; const TTCN_OERdescriptor_t UTRANCellID_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UTRANCellID_oer_ext_arr_, 5, UTRANCellID_oer_p_}; static const Per_Constraint UTRANCellID_per_cons_; const ASN_PERdescriptor_t UTRANCellID_per_ = { &UTRANCellID_per_cons_ }; const TTCN_Typedescriptor_t UTRANCellID_descr_ = { "@HNBAP-IEs.UTRANCellID", &SEQUENCE_ber_, NULL, NULL, NULL, &UTRANCellID_json_, &UTRANCellID_oer_, &UTRANCellID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_default_coding(""); const ASN_Tag_t UTRANCellID_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 4u }}; const ASN_BERdescriptor_t UTRANCellID_iE__Extensions_ber_ = { 1u, UTRANCellID_iE__Extensions_tag_ }; // No XER for UTRANCellID_iE__Extensions const int UTRANCellID_iE__Extensions_oer_ext_arr_[0] = {}; const int UTRANCellID_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t UTRANCellID_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UTRANCellID_iE__Extensions_oer_ext_arr_, 0, UTRANCellID_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t UTRANCellID_iE__Extensions_descr_ = { "@HNBAP-IEs.UTRANCellID.iE-Extensions", &UTRANCellID_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_json_, &UTRANCellID_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UTRANCellID_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING UTRANCellID_default_coding(""); const ASN_Tag_t MacroCellID_uTRANCellID_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t MacroCellID_uTRANCellID_ber_ = { 1u, MacroCellID_uTRANCellID_tag_ }; // No XER for MacroCellID_uTRANCellID const int MacroCellID_uTRANCellID_oer_ext_arr_[0] = {}; const int MacroCellID_uTRANCellID_oer_p_[5] = {0, 1, 2, 3, 4}; const TTCN_OERdescriptor_t MacroCellID_uTRANCellID_oer_ = { -1, TRUE, -1, FALSE, 0, 0, MacroCellID_uTRANCellID_oer_ext_arr_, 5, MacroCellID_uTRANCellID_oer_p_}; const TTCN_Typedescriptor_t MacroCellID_uTRANCellID_descr_ = { "@HNBAP-IEs.MacroCellID.uTRANCellID", &MacroCellID_uTRANCellID_ber_, NULL, NULL, NULL, &UTRANCellID_json_, &MacroCellID_uTRANCellID_oer_, &UTRANCellID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING MacroCellID_uTRANCellID_default_coding(""); const ASN_Tag_t MacroCellID_gERANCellID_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t MacroCellID_gERANCellID_ber_ = { 1u, MacroCellID_gERANCellID_tag_ }; // No XER for MacroCellID_gERANCellID const int MacroCellID_gERANCellID_oer_ext_arr_[0] = {}; const int MacroCellID_gERANCellID_oer_p_[4] = {0, 1, 2, 3}; const TTCN_OERdescriptor_t MacroCellID_gERANCellID_oer_ = { -1, TRUE, -1, FALSE, 0, 0, MacroCellID_gERANCellID_oer_ext_arr_, 4, MacroCellID_gERANCellID_oer_p_}; const TTCN_Typedescriptor_t MacroCellID_gERANCellID_descr_ = { "@HNBAP-IEs.MacroCellID.gERANCellID", &MacroCellID_gERANCellID_ber_, NULL, NULL, NULL, &CGI_json_, &MacroCellID_gERANCellID_oer_, &CGI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING MacroCellID_gERANCellID_default_coding(""); UNIVERSAL_CHARSTRING MacroCellID_default_coding(""); const ASN_Tag_t MacroCoverageInformation_cellIdentity_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t MacroCoverageInformation_cellIdentity_ber_ = { 1u, MacroCoverageInformation_cellIdentity_tag_ }; // No XER for MacroCoverageInformation_cellIdentity const int MacroCoverageInformation_cellIdentity_oer_ext_arr_[0] = {}; const int MacroCoverageInformation_cellIdentity_oer_p_[0] = {}; const TTCN_OERdescriptor_t MacroCoverageInformation_cellIdentity_oer_ = { -1, TRUE, -1, TRUE, 2, 0, MacroCoverageInformation_cellIdentity_oer_ext_arr_, 0, MacroCoverageInformation_cellIdentity_oer_p_}; const TTCN_Typedescriptor_t MacroCoverageInformation_cellIdentity_descr_ = { "@HNBAP-IEs.MacroCoverageInformation.cellIdentity", &MacroCoverageInformation_cellIdentity_ber_, NULL, NULL, NULL, &MacroCellID_json_, &MacroCoverageInformation_cellIdentity_oer_, &MacroCellID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING MacroCoverageInformation_cellIdentity_default_coding(""); // No XER for MacroCoverageInformation const TTCN_JSONdescriptor_t MacroCoverageInformation_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int MacroCoverageInformation_oer_ext_arr_[0] = {}; const int MacroCoverageInformation_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t MacroCoverageInformation_oer_ = { -1, TRUE, -1, TRUE, 2, 0, MacroCoverageInformation_oer_ext_arr_, 2, MacroCoverageInformation_oer_p_}; static const Per_Constraint MacroCoverageInformation_per_cons_; const ASN_PERdescriptor_t MacroCoverageInformation_per_ = { &MacroCoverageInformation_per_cons_ }; const TTCN_Typedescriptor_t MacroCoverageInformation_descr_ = { "@HNBAP-IEs.MacroCoverageInformation", &SEQUENCE_ber_, NULL, NULL, NULL, &MacroCoverageInformation_json_, &MacroCoverageInformation_oer_, &MacroCoverageInformation_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_default_coding(""); const ASN_Tag_t MacroCoverageInformation_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t MacroCoverageInformation_iE__Extensions_ber_ = { 1u, MacroCoverageInformation_iE__Extensions_tag_ }; // No XER for MacroCoverageInformation_iE__Extensions const int MacroCoverageInformation_iE__Extensions_oer_ext_arr_[0] = {}; const int MacroCoverageInformation_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t MacroCoverageInformation_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, MacroCoverageInformation_iE__Extensions_oer_ext_arr_, 0, MacroCoverageInformation_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t MacroCoverageInformation_iE__Extensions_descr_ = { "@HNBAP-IEs.MacroCoverageInformation.iE-Extensions", &MacroCoverageInformation_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_json_, &MacroCoverageInformation_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING MacroCoverageInformation_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING MacroCoverageInformation_default_coding(""); const ASN_Tag_t HNB__Location__Information_macroCoverageInfo_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t HNB__Location__Information_macroCoverageInfo_ber_ = { 1u, HNB__Location__Information_macroCoverageInfo_tag_ }; // No XER for HNB__Location__Information_macroCoverageInfo const int HNB__Location__Information_macroCoverageInfo_oer_ext_arr_[0] = {}; const int HNB__Location__Information_macroCoverageInfo_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t HNB__Location__Information_macroCoverageInfo_oer_ = { -1, TRUE, -1, TRUE, 2, 0, HNB__Location__Information_macroCoverageInfo_oer_ext_arr_, 2, HNB__Location__Information_macroCoverageInfo_oer_p_}; const TTCN_Typedescriptor_t HNB__Location__Information_macroCoverageInfo_descr_ = { "@HNBAP-IEs.HNB-Location-Information.macroCoverageInfo", &HNB__Location__Information_macroCoverageInfo_ber_, NULL, NULL, NULL, &MacroCoverageInformation_json_, &HNB__Location__Information_macroCoverageInfo_oer_, &MacroCoverageInformation_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Location__Information_macroCoverageInfo_default_coding(""); const ASN_Tag_t HNB__Location__Information_geographicalCoordinates_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t HNB__Location__Information_geographicalCoordinates_ber_ = { 1u, HNB__Location__Information_geographicalCoordinates_tag_ }; // No XER for HNB__Location__Information_geographicalCoordinates const int HNB__Location__Information_geographicalCoordinates_oer_ext_arr_[0] = {}; const int HNB__Location__Information_geographicalCoordinates_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t HNB__Location__Information_geographicalCoordinates_oer_ = { -1, TRUE, -1, TRUE, 3, 0, HNB__Location__Information_geographicalCoordinates_oer_ext_arr_, 3, HNB__Location__Information_geographicalCoordinates_oer_p_}; const TTCN_Typedescriptor_t HNB__Location__Information_geographicalCoordinates_descr_ = { "@HNBAP-IEs.HNB-Location-Information.geographicalCoordinates", &HNB__Location__Information_geographicalCoordinates_ber_, NULL, NULL, NULL, &GeographicalLocation_json_, &HNB__Location__Information_geographicalCoordinates_oer_, &GeographicalLocation_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Location__Information_geographicalCoordinates_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for HNB__Location__Information__ExtIEs_1_Extension const int HNB__Location__Information__ExtIEs_1_Extension_oer_ext_arr_[0] = {}; const int HNB__Location__Information__ExtIEs_1_Extension_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t HNB__Location__Information__ExtIEs_1_Extension_oer_ = { -1, TRUE, -1, TRUE, 2, 0, HNB__Location__Information__ExtIEs_1_Extension_oer_ext_arr_, 2, HNB__Location__Information__ExtIEs_1_Extension_oer_p_}; const TTCN_Typedescriptor_t HNB__Location__Information__ExtIEs_1_Extension_descr_ = { "@HNBAP-IEs.HNB-Location-Information-ExtIEs.1.&Extension", &SEQUENCE_ber_, NULL, NULL, NULL, &IP__Address_json_, &HNB__Location__Information__ExtIEs_1_Extension_oer_, &IP__Address_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; HNBAP__CommonDataTypes::Criticality const_HNB__Location__Information__ExtIEs_1_criticality; const HNBAP__CommonDataTypes::Criticality& HNB__Location__Information__ExtIEs_1_criticality = const_HNB__Location__Information__ExtIEs_1_criticality; INTEGER const_HNB__Location__Information__ExtIEs_1_id; const INTEGER& HNB__Location__Information__ExtIEs_1_id = const_HNB__Location__Information__ExtIEs_1_id; HNBAP__CommonDataTypes::Presence const_HNB__Location__Information__ExtIEs_1_presence; const HNBAP__CommonDataTypes::Presence& HNB__Location__Information__ExtIEs_1_presence = const_HNB__Location__Information__ExtIEs_1_presence; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_default_coding(""); const ASN_Tag_t HNB__Location__Information_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t HNB__Location__Information_iE__Extensions_ber_ = { 1u, HNB__Location__Information_iE__Extensions_tag_ }; // No XER for HNB__Location__Information_iE__Extensions const int HNB__Location__Information_iE__Extensions_oer_ext_arr_[0] = {}; const int HNB__Location__Information_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__Location__Information_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNB__Location__Information_iE__Extensions_oer_ext_arr_, 0, HNB__Location__Information_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t HNB__Location__Information_iE__Extensions_descr_ = { "@HNBAP-IEs.HNB-Location-Information.iE-Extensions", &HNB__Location__Information_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_json_, &HNB__Location__Information_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Location__Information_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING HNB__Location__Information_default_coding(""); // No XER for HNB__Identity__Info const int HNB__Identity__Info_oer_ext_arr_[0] = {}; const int HNB__Identity__Info_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__Identity__Info_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNB__Identity__Info_oer_ext_arr_, 0, HNB__Identity__Info_oer_p_}; static Per_Integer_Constraint HNB__Identity__Info_per_cons_(new INTEGER(1), new INTEGER(255), FALSE); const ASN_PERdescriptor_t HNB__Identity__Info_per_ = { &HNB__Identity__Info_per_cons_ }; const TTCN_Typedescriptor_t HNB__Identity__Info_descr_ = { "@HNBAP-IEs.HNB-Identity-Info", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &HNB__Identity__Info_oer_, &HNB__Identity__Info_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Identity__Info_default_coding(""); const ASN_Tag_t HNB__Identity_hNB__Identity__Info_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t HNB__Identity_hNB__Identity__Info_ber_ = { 1u, HNB__Identity_hNB__Identity__Info_tag_ }; // No XER for HNB__Identity_hNB__Identity__Info const int HNB__Identity_hNB__Identity__Info_oer_ext_arr_[0] = {}; const int HNB__Identity_hNB__Identity__Info_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__Identity_hNB__Identity__Info_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNB__Identity_hNB__Identity__Info_oer_ext_arr_, 0, HNB__Identity_hNB__Identity__Info_oer_p_}; const TTCN_Typedescriptor_t HNB__Identity_hNB__Identity__Info_descr_ = { "@HNBAP-IEs.HNB-Identity.hNB-Identity-Info", &HNB__Identity_hNB__Identity__Info_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &HNB__Identity_hNB__Identity__Info_oer_, &HNB__Identity__Info_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Identity_hNB__Identity__Info_default_coding(""); // No XER for HNB__Identity const TTCN_JSONdescriptor_t HNB__Identity_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int HNB__Identity_oer_ext_arr_[0] = {}; const int HNB__Identity_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t HNB__Identity_oer_ = { -1, TRUE, -1, TRUE, 2, 0, HNB__Identity_oer_ext_arr_, 2, HNB__Identity_oer_p_}; static const Per_Constraint HNB__Identity_per_cons_; const ASN_PERdescriptor_t HNB__Identity_per_ = { &HNB__Identity_per_cons_ }; const TTCN_Typedescriptor_t HNB__Identity_descr_ = { "@HNBAP-IEs.HNB-Identity", &SEQUENCE_ber_, NULL, NULL, NULL, &HNB__Identity_json_, &HNB__Identity_oer_, &HNB__Identity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_default_coding(""); const ASN_Tag_t HNB__Identity_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t HNB__Identity_iE__Extensions_ber_ = { 1u, HNB__Identity_iE__Extensions_tag_ }; // No XER for HNB__Identity_iE__Extensions const int HNB__Identity_iE__Extensions_oer_ext_arr_[0] = {}; const int HNB__Identity_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t HNB__Identity_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, HNB__Identity_iE__Extensions_oer_ext_arr_, 0, HNB__Identity_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t HNB__Identity_iE__Extensions_descr_ = { "@HNBAP-IEs.HNB-Identity.iE-Extensions", &HNB__Identity_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_json_, &HNB__Identity_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING HNB__Identity_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING HNB__Identity_default_coding(""); // No XER for IMEI const int IMEI_oer_ext_arr_[0] = {}; const int IMEI_oer_p_[0] = {}; const TTCN_OERdescriptor_t IMEI_oer_ = { -1, TRUE, 60, FALSE, 0, 0, IMEI_oer_ext_arr_, 0, IMEI_oer_p_}; static Per_Integer_Constraint IMEI_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(60), FALSE); static Per_BitString_Constraint IMEI_per_cons_(FALSE, &IMEI_size_per_cons_); const ASN_PERdescriptor_t IMEI_per_ = { &IMEI_per_cons_ }; const TTCN_Typedescriptor_t IMEI_descr_ = { "@HNBAP-IEs.IMEI", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &IMEI_oer_, &IMEI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IMEI_default_coding(""); // No XER for IMSI const int IMSI_oer_ext_arr_[0] = {}; const int IMSI_oer_p_[0] = {}; const TTCN_OERdescriptor_t IMSI_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IMSI_oer_ext_arr_, 0, IMSI_oer_p_}; static Per_Integer_Constraint IMSI_per_cons_(new INTEGER(3), new INTEGER(8), FALSE); const ASN_PERdescriptor_t IMSI_per_ = { &IMSI_per_cons_ }; const TTCN_Typedescriptor_t IMSI_descr_ = { "@HNBAP-IEs.IMSI", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &IMSI_oer_, &IMSI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IMSI_default_coding(""); // No XER for IMSIDS41 const int IMSIDS41_oer_ext_arr_[0] = {}; const int IMSIDS41_oer_p_[0] = {}; const TTCN_OERdescriptor_t IMSIDS41_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IMSIDS41_oer_ext_arr_, 0, IMSIDS41_oer_p_}; static Per_Integer_Constraint IMSIDS41_per_cons_(new INTEGER(5), new INTEGER(7), FALSE); const ASN_PERdescriptor_t IMSIDS41_per_ = { &IMSIDS41_per_cons_ }; const TTCN_Typedescriptor_t IMSIDS41_descr_ = { "@HNBAP-IEs.IMSIDS41", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &IMSIDS41_oer_, &IMSIDS41_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IMSIDS41_default_coding(""); const ASN_Tag_t IMSIESN_iMSIDS41_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t IMSIESN_iMSIDS41_ber_ = { 1u, IMSIESN_iMSIDS41_tag_ }; // No XER for IMSIESN_iMSIDS41 const int IMSIESN_iMSIDS41_oer_ext_arr_[0] = {}; const int IMSIESN_iMSIDS41_oer_p_[0] = {}; const TTCN_OERdescriptor_t IMSIESN_iMSIDS41_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IMSIESN_iMSIDS41_oer_ext_arr_, 0, IMSIESN_iMSIDS41_oer_p_}; const TTCN_Typedescriptor_t IMSIESN_iMSIDS41_descr_ = { "@HNBAP-IEs.IMSIESN.iMSIDS41", &IMSIESN_iMSIDS41_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &IMSIESN_iMSIDS41_oer_, &IMSIDS41_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IMSIESN_iMSIDS41_default_coding(""); const ASN_Tag_t IMSIESN_eSN_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t IMSIESN_eSN_ber_ = { 1u, IMSIESN_eSN_tag_ }; // No XER for IMSIESN_eSN const int IMSIESN_eSN_oer_ext_arr_[0] = {}; const int IMSIESN_eSN_oer_p_[0] = {}; const TTCN_OERdescriptor_t IMSIESN_eSN_oer_ = { -1, TRUE, 32, FALSE, 0, 0, IMSIESN_eSN_oer_ext_arr_, 0, IMSIESN_eSN_oer_p_}; const TTCN_Typedescriptor_t IMSIESN_eSN_descr_ = { "@HNBAP-IEs.IMSIESN.eSN", &IMSIESN_eSN_ber_, NULL, NULL, NULL, &BITSTRING_json_, &IMSIESN_eSN_oer_, &ESN_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IMSIESN_eSN_default_coding(""); // No XER for IMSIESN const TTCN_JSONdescriptor_t IMSIESN_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int IMSIESN_oer_ext_arr_[0] = {}; const int IMSIESN_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t IMSIESN_oer_ = { -1, TRUE, -1, FALSE, 0, 0, IMSIESN_oer_ext_arr_, 2, IMSIESN_oer_p_}; static const Per_Constraint IMSIESN_per_cons_; const ASN_PERdescriptor_t IMSIESN_per_ = { &IMSIESN_per_cons_ }; const TTCN_Typedescriptor_t IMSIESN_descr_ = { "@HNBAP-IEs.IMSIESN", &SEQUENCE_ber_, NULL, NULL, NULL, &IMSIESN_json_, &IMSIESN_oer_, &IMSIESN_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING IMSIESN_default_coding(""); const ASN_Tag_t LAI_pLMNID_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t LAI_pLMNID_ber_ = { 1u, LAI_pLMNID_tag_ }; // No XER for LAI_pLMNID const int LAI_pLMNID_oer_ext_arr_[0] = {}; const int LAI_pLMNID_oer_p_[0] = {}; const TTCN_OERdescriptor_t LAI_pLMNID_oer_ = { -1, TRUE, 3, FALSE, 0, 0, LAI_pLMNID_oer_ext_arr_, 0, LAI_pLMNID_oer_p_}; const TTCN_Typedescriptor_t LAI_pLMNID_descr_ = { "@HNBAP-IEs.LAI.pLMNID", &LAI_pLMNID_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &LAI_pLMNID_oer_, &PLMNidentity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING LAI_pLMNID_default_coding(""); const ASN_Tag_t LAI_lAC_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t LAI_lAC_ber_ = { 1u, LAI_lAC_tag_ }; // No XER for LAI_lAC const int LAI_lAC_oer_ext_arr_[0] = {}; const int LAI_lAC_oer_p_[0] = {}; const TTCN_OERdescriptor_t LAI_lAC_oer_ = { -1, TRUE, 2, FALSE, 0, 0, LAI_lAC_oer_ext_arr_, 0, LAI_lAC_oer_p_}; const TTCN_Typedescriptor_t LAI_lAC_descr_ = { "@HNBAP-IEs.LAI.lAC", &LAI_lAC_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &LAI_lAC_oer_, &LAC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING LAI_lAC_default_coding(""); // No XER for LAI const TTCN_JSONdescriptor_t LAI_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int LAI_oer_ext_arr_[0] = {}; const int LAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t LAI_oer_ = { -1, TRUE, -1, TRUE, 2, 0, LAI_oer_ext_arr_, 2, LAI_oer_p_}; static const Per_Constraint LAI_per_cons_; const ASN_PERdescriptor_t LAI_per_ = { &LAI_per_cons_ }; const TTCN_Typedescriptor_t LAI_descr_ = { "@HNBAP-IEs.LAI", &SEQUENCE_ber_, NULL, NULL, NULL, &LAI_json_, &LAI_oer_, &LAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING LAI_default_coding(""); // No XER for MuxPortNumber const int MuxPortNumber_oer_ext_arr_[0] = {}; const int MuxPortNumber_oer_p_[0] = {}; const TTCN_OERdescriptor_t MuxPortNumber_oer_ = { 2, FALSE, -1, FALSE, 0, 0, MuxPortNumber_oer_ext_arr_, 0, MuxPortNumber_oer_p_}; static Per_Integer_Constraint MuxPortNumber_per_cons_(new INTEGER(1024), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t MuxPortNumber_per_ = { &MuxPortNumber_per_cons_ }; const TTCN_Typedescriptor_t MuxPortNumber_descr_ = { "@HNBAP-IEs.MuxPortNumber", &INTEGER_ber_, NULL, NULL, NULL, &INTEGER_json_, &MuxPortNumber_oer_, &MuxPortNumber_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING MuxPortNumber_default_coding(""); // No XER for NeighbourInfoList const TTCN_JSONdescriptor_t NeighbourInfoList_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int NeighbourInfoList_oer_ext_arr_[0] = {}; const int NeighbourInfoList_oer_p_[0] = {}; const TTCN_OERdescriptor_t NeighbourInfoList_oer_ = { -1, TRUE, -1, FALSE, 0, 0, NeighbourInfoList_oer_ext_arr_, 0, NeighbourInfoList_oer_p_}; static Per_Integer_Constraint NeighbourInfoList_per_cons_(new INTEGER(1), new INTEGER(32), FALSE); const ASN_PERdescriptor_t NeighbourInfoList_per_ = { &NeighbourInfoList_per_cons_ }; const TTCN_Typedescriptor_t NeighbourInfoList_descr_ = { "@HNBAP-IEs.NeighbourInfoList", &SEQUENCE_ber_, NULL, NULL, NULL, &NeighbourInfoList_json_, &NeighbourInfoList_oer_, &NeighbourInfoList_per_, &NeighbourInfoList_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; // No XER for NeighbourInfoList_0 const int NeighbourInfoList_0_oer_ext_arr_[0] = {}; const int NeighbourInfoList_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t NeighbourInfoList_0_oer_ = { -1, TRUE, -1, TRUE, 3, 0, NeighbourInfoList_0_oer_ext_arr_, 3, NeighbourInfoList_0_oer_p_}; const TTCN_Typedescriptor_t NeighbourInfoList_0_descr_ = { "@HNBAP-IEs.NeighbourInfoList.", &SEQUENCE_ber_, NULL, NULL, NULL, &HNBConfigInfo_json_, &NeighbourInfoList_0_oer_, &HNBConfigInfo_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING NeighbourInfoList_0_default_coding(""); UNIVERSAL_CHARSTRING NeighbourInfoList_default_coding(""); // No XER for NeighbourInfoRequestList const TTCN_JSONdescriptor_t NeighbourInfoRequestList_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int NeighbourInfoRequestList_oer_ext_arr_[0] = {}; const int NeighbourInfoRequestList_oer_p_[0] = {}; const TTCN_OERdescriptor_t NeighbourInfoRequestList_oer_ = { -1, TRUE, -1, FALSE, 0, 0, NeighbourInfoRequestList_oer_ext_arr_, 0, NeighbourInfoRequestList_oer_p_}; static Per_Integer_Constraint NeighbourInfoRequestList_per_cons_(new INTEGER(1), new INTEGER(32), FALSE); const ASN_PERdescriptor_t NeighbourInfoRequestList_per_ = { &NeighbourInfoRequestList_per_cons_ }; const TTCN_Typedescriptor_t NeighbourInfoRequestList_descr_ = { "@HNBAP-IEs.NeighbourInfoRequestList", &SEQUENCE_ber_, NULL, NULL, NULL, &NeighbourInfoRequestList_json_, &NeighbourInfoRequestList_oer_, &NeighbourInfoRequestList_per_, &NeighbourInfoRequestList_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t NeighbourInfoRequestItem_hnb__RNL__Identity_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t NeighbourInfoRequestItem_hnb__RNL__Identity_ber_ = { 1u, NeighbourInfoRequestItem_hnb__RNL__Identity_tag_ }; // No XER for NeighbourInfoRequestItem_hnb__RNL__Identity const int NeighbourInfoRequestItem_hnb__RNL__Identity_oer_ext_arr_[0] = {}; const int NeighbourInfoRequestItem_hnb__RNL__Identity_oer_p_[0] = {}; const TTCN_OERdescriptor_t NeighbourInfoRequestItem_hnb__RNL__Identity_oer_ = { -1, TRUE, -1, TRUE, 1, 0, NeighbourInfoRequestItem_hnb__RNL__Identity_oer_ext_arr_, 0, NeighbourInfoRequestItem_hnb__RNL__Identity_oer_p_}; const TTCN_Typedescriptor_t NeighbourInfoRequestItem_hnb__RNL__Identity_descr_ = { "@HNBAP-IEs.NeighbourInfoRequestItem.hnb-RNL-Identity", &NeighbourInfoRequestItem_hnb__RNL__Identity_ber_, NULL, NULL, NULL, &HNB__RNL__Identity_json_, &NeighbourInfoRequestItem_hnb__RNL__Identity_oer_, &HNB__RNL__Identity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING NeighbourInfoRequestItem_hnb__RNL__Identity_default_coding(""); // No XER for NeighbourInfoRequestItem const TTCN_JSONdescriptor_t NeighbourInfoRequestItem_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int NeighbourInfoRequestItem_oer_ext_arr_[0] = {}; const int NeighbourInfoRequestItem_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t NeighbourInfoRequestItem_oer_ = { -1, TRUE, -1, TRUE, 2, 0, NeighbourInfoRequestItem_oer_ext_arr_, 2, NeighbourInfoRequestItem_oer_p_}; static const Per_Constraint NeighbourInfoRequestItem_per_cons_; const ASN_PERdescriptor_t NeighbourInfoRequestItem_per_ = { &NeighbourInfoRequestItem_per_cons_ }; const TTCN_Typedescriptor_t NeighbourInfoRequestItem_descr_ = { "@HNBAP-IEs.NeighbourInfoRequestItem", &SEQUENCE_ber_, NULL, NULL, NULL, &NeighbourInfoRequestItem_json_, &NeighbourInfoRequestItem_oer_, &NeighbourInfoRequestItem_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_default_coding(""); const ASN_Tag_t NeighbourInfoRequestItem_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t NeighbourInfoRequestItem_iE__Extensions_ber_ = { 1u, NeighbourInfoRequestItem_iE__Extensions_tag_ }; // No XER for NeighbourInfoRequestItem_iE__Extensions const int NeighbourInfoRequestItem_iE__Extensions_oer_ext_arr_[0] = {}; const int NeighbourInfoRequestItem_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t NeighbourInfoRequestItem_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, NeighbourInfoRequestItem_iE__Extensions_oer_ext_arr_, 0, NeighbourInfoRequestItem_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t NeighbourInfoRequestItem_iE__Extensions_descr_ = { "@HNBAP-IEs.NeighbourInfoRequestItem.iE-Extensions", &NeighbourInfoRequestItem_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_json_, &NeighbourInfoRequestItem_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING NeighbourInfoRequestItem_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING NeighbourInfoRequestItem_default_coding(""); // No XER for NeighbourInfoRequestList_0 const int NeighbourInfoRequestList_0_oer_ext_arr_[0] = {}; const int NeighbourInfoRequestList_0_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t NeighbourInfoRequestList_0_oer_ = { -1, TRUE, -1, TRUE, 2, 0, NeighbourInfoRequestList_0_oer_ext_arr_, 2, NeighbourInfoRequestList_0_oer_p_}; const TTCN_Typedescriptor_t NeighbourInfoRequestList_0_descr_ = { "@HNBAP-IEs.NeighbourInfoRequestList.", &SEQUENCE_ber_, NULL, NULL, NULL, &NeighbourInfoRequestItem_json_, &NeighbourInfoRequestList_0_oer_, &NeighbourInfoRequestItem_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING NeighbourInfoRequestList_0_default_coding(""); UNIVERSAL_CHARSTRING NeighbourInfoRequestList_default_coding(""); // No XER for PTMSI const int PTMSI_oer_ext_arr_[0] = {}; const int PTMSI_oer_p_[0] = {}; const TTCN_OERdescriptor_t PTMSI_oer_ = { -1, TRUE, 32, FALSE, 0, 0, PTMSI_oer_ext_arr_, 0, PTMSI_oer_p_}; static Per_Integer_Constraint PTMSI_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(32), FALSE); static Per_BitString_Constraint PTMSI_per_cons_(FALSE, &PTMSI_size_per_cons_); const ASN_PERdescriptor_t PTMSI_per_ = { &PTMSI_per_cons_ }; const TTCN_Typedescriptor_t PTMSI_descr_ = { "@HNBAP-IEs.PTMSI", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &PTMSI_oer_, &PTMSI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PTMSI_default_coding(""); const ASN_Tag_t PTMSIRAI_pTMSI_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t PTMSIRAI_pTMSI_ber_ = { 1u, PTMSIRAI_pTMSI_tag_ }; // No XER for PTMSIRAI_pTMSI const int PTMSIRAI_pTMSI_oer_ext_arr_[0] = {}; const int PTMSIRAI_pTMSI_oer_p_[0] = {}; const TTCN_OERdescriptor_t PTMSIRAI_pTMSI_oer_ = { -1, TRUE, 32, FALSE, 0, 0, PTMSIRAI_pTMSI_oer_ext_arr_, 0, PTMSIRAI_pTMSI_oer_p_}; const TTCN_Typedescriptor_t PTMSIRAI_pTMSI_descr_ = { "@HNBAP-IEs.PTMSIRAI.pTMSI", &PTMSIRAI_pTMSI_ber_, NULL, NULL, NULL, &BITSTRING_json_, &PTMSIRAI_pTMSI_oer_, &PTMSI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PTMSIRAI_pTMSI_default_coding(""); const ASN_Tag_t RAI_lAI_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t RAI_lAI_ber_ = { 1u, RAI_lAI_tag_ }; // No XER for RAI_lAI const int RAI_lAI_oer_ext_arr_[0] = {}; const int RAI_lAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t RAI_lAI_oer_ = { -1, TRUE, -1, TRUE, 2, 0, RAI_lAI_oer_ext_arr_, 2, RAI_lAI_oer_p_}; const TTCN_Typedescriptor_t RAI_lAI_descr_ = { "@HNBAP-IEs.RAI.lAI", &RAI_lAI_ber_, NULL, NULL, NULL, &LAI_json_, &RAI_lAI_oer_, &LAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RAI_lAI_default_coding(""); const ASN_Tag_t RAI_rAC_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t RAI_rAC_ber_ = { 1u, RAI_rAC_tag_ }; // No XER for RAI_rAC const int RAI_rAC_oer_ext_arr_[0] = {}; const int RAI_rAC_oer_p_[0] = {}; const TTCN_OERdescriptor_t RAI_rAC_oer_ = { -1, TRUE, 1, FALSE, 0, 0, RAI_rAC_oer_ext_arr_, 0, RAI_rAC_oer_p_}; const TTCN_Typedescriptor_t RAI_rAC_descr_ = { "@HNBAP-IEs.RAI.rAC", &RAI_rAC_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &RAI_rAC_oer_, &RAC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RAI_rAC_default_coding(""); // No XER for RAI const TTCN_JSONdescriptor_t RAI_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int RAI_oer_ext_arr_[0] = {}; const int RAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t RAI_oer_ = { -1, TRUE, -1, TRUE, 2, 0, RAI_oer_ext_arr_, 2, RAI_oer_p_}; static const Per_Constraint RAI_per_cons_; const ASN_PERdescriptor_t RAI_per_ = { &RAI_per_cons_ }; const TTCN_Typedescriptor_t RAI_descr_ = { "@HNBAP-IEs.RAI", &SEQUENCE_ber_, NULL, NULL, NULL, &RAI_json_, &RAI_oer_, &RAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RAI_default_coding(""); const ASN_Tag_t PTMSIRAI_rAI_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t PTMSIRAI_rAI_ber_ = { 1u, PTMSIRAI_rAI_tag_ }; // No XER for PTMSIRAI_rAI const int PTMSIRAI_rAI_oer_ext_arr_[0] = {}; const int PTMSIRAI_rAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t PTMSIRAI_rAI_oer_ = { -1, TRUE, -1, TRUE, 2, 0, PTMSIRAI_rAI_oer_ext_arr_, 2, PTMSIRAI_rAI_oer_p_}; const TTCN_Typedescriptor_t PTMSIRAI_rAI_descr_ = { "@HNBAP-IEs.PTMSIRAI.rAI", &PTMSIRAI_rAI_ber_, NULL, NULL, NULL, &RAI_json_, &PTMSIRAI_rAI_oer_, &RAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PTMSIRAI_rAI_default_coding(""); // No XER for PTMSIRAI const TTCN_JSONdescriptor_t PTMSIRAI_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int PTMSIRAI_oer_ext_arr_[0] = {}; const int PTMSIRAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t PTMSIRAI_oer_ = { -1, TRUE, -1, TRUE, 2, 0, PTMSIRAI_oer_ext_arr_, 2, PTMSIRAI_oer_p_}; static const Per_Constraint PTMSIRAI_per_cons_; const ASN_PERdescriptor_t PTMSIRAI_per_ = { &PTMSIRAI_per_cons_ }; const TTCN_Typedescriptor_t PTMSIRAI_descr_ = { "@HNBAP-IEs.PTMSIRAI", &SEQUENCE_ber_, NULL, NULL, NULL, &PTMSIRAI_json_, &PTMSIRAI_oer_, &PTMSIRAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING PTMSIRAI_default_coding(""); // No XER for RAB__ID const int RAB__ID_oer_ext_arr_[0] = {}; const int RAB__ID_oer_p_[0] = {}; const TTCN_OERdescriptor_t RAB__ID_oer_ = { -1, TRUE, 8, FALSE, 0, 0, RAB__ID_oer_ext_arr_, 0, RAB__ID_oer_p_}; static Per_Integer_Constraint RAB__ID_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(8), FALSE); static Per_BitString_Constraint RAB__ID_per_cons_(FALSE, &RAB__ID_size_per_cons_); const ASN_PERdescriptor_t RAB__ID_per_ = { &RAB__ID_per_cons_ }; const TTCN_Typedescriptor_t RAB__ID_descr_ = { "@HNBAP-IEs.RAB-ID", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &RAB__ID_oer_, &RAB__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RAB__ID_default_coding(""); // No XER for RABList const TTCN_JSONdescriptor_t RABList_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int RABList_oer_ext_arr_[0] = {}; const int RABList_oer_p_[0] = {}; const TTCN_OERdescriptor_t RABList_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RABList_oer_ext_arr_, 0, RABList_oer_p_}; static Per_Integer_Constraint RABList_per_cons_(new INTEGER(1), new INTEGER(256), FALSE); const ASN_PERdescriptor_t RABList_per_ = { &RABList_per_cons_ }; const TTCN_Typedescriptor_t RABList_descr_ = { "@HNBAP-IEs.RABList", &SEQUENCE_ber_, NULL, NULL, NULL, &RABList_json_, &RABList_oer_, &RABList_per_, &RABList_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t RABListItem_rAB__ID_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t RABListItem_rAB__ID_ber_ = { 1u, RABListItem_rAB__ID_tag_ }; // No XER for RABListItem_rAB__ID const int RABListItem_rAB__ID_oer_ext_arr_[0] = {}; const int RABListItem_rAB__ID_oer_p_[0] = {}; const TTCN_OERdescriptor_t RABListItem_rAB__ID_oer_ = { -1, TRUE, 8, FALSE, 0, 0, RABListItem_rAB__ID_oer_ext_arr_, 0, RABListItem_rAB__ID_oer_p_}; const TTCN_Typedescriptor_t RABListItem_rAB__ID_descr_ = { "@HNBAP-IEs.RABListItem.rAB-ID", &RABListItem_rAB__ID_ber_, NULL, NULL, NULL, &BITSTRING_json_, &RABListItem_rAB__ID_oer_, &RAB__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RABListItem_rAB__ID_default_coding(""); // No XER for TransportLayerAddress const int TransportLayerAddress_oer_ext_arr_[0] = {}; const int TransportLayerAddress_oer_p_[0] = {}; const TTCN_OERdescriptor_t TransportLayerAddress_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TransportLayerAddress_oer_ext_arr_, 0, TransportLayerAddress_oer_p_}; static Per_Integer_Constraint TransportLayerAddress_size_per_cons_(new INTEGER(1), new INTEGER(160), TRUE); static Per_BitString_Constraint TransportLayerAddress_per_cons_(FALSE, &TransportLayerAddress_size_per_cons_); const ASN_PERdescriptor_t TransportLayerAddress_per_ = { &TransportLayerAddress_per_cons_ }; const TTCN_Typedescriptor_t TransportLayerAddress_descr_ = { "@HNBAP-IEs.TransportLayerAddress", &BITSTRING_ber_, NULL, NULL, NULL, &BITSTRING_json_, &TransportLayerAddress_oer_, &TransportLayerAddress_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TransportLayerAddress_default_coding(""); const ASN_Tag_t TransportInfo_transportLayerAddress_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t TransportInfo_transportLayerAddress_ber_ = { 1u, TransportInfo_transportLayerAddress_tag_ }; // No XER for TransportInfo_transportLayerAddress const int TransportInfo_transportLayerAddress_oer_ext_arr_[0] = {}; const int TransportInfo_transportLayerAddress_oer_p_[0] = {}; const TTCN_OERdescriptor_t TransportInfo_transportLayerAddress_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TransportInfo_transportLayerAddress_oer_ext_arr_, 0, TransportInfo_transportLayerAddress_oer_p_}; const TTCN_Typedescriptor_t TransportInfo_transportLayerAddress_descr_ = { "@HNBAP-IEs.TransportInfo.transportLayerAddress", &TransportInfo_transportLayerAddress_ber_, NULL, NULL, NULL, &BITSTRING_json_, &TransportInfo_transportLayerAddress_oer_, &TransportLayerAddress_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TransportInfo_transportLayerAddress_default_coding(""); const ASN_Tag_t TransportInfo_transportAssociation_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t TransportInfo_transportAssociation_ber_ = { 1u, TransportInfo_transportAssociation_tag_ }; // No XER for TransportInfo_transportAssociation const TTCN_JSONdescriptor_t TransportInfo_transportAssociation_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int TransportInfo_transportAssociation_oer_ext_arr_[0] = {}; const int TransportInfo_transportAssociation_oer_p_[0] = {}; const TTCN_OERdescriptor_t TransportInfo_transportAssociation_oer_ = { -1, TRUE, -1, TRUE, 2, 0, TransportInfo_transportAssociation_oer_ext_arr_, 0, TransportInfo_transportAssociation_oer_p_}; static const Per_Constraint TransportInfo_transportAssociation_per_cons_; const ASN_PERdescriptor_t TransportInfo_transportAssociation_per_ = { &TransportInfo_transportAssociation_per_cons_ }; const TTCN_Typedescriptor_t TransportInfo_transportAssociation_descr_ = { "@HNBAP-IEs.TransportInfo.transportAssociation", &TransportInfo_transportAssociation_ber_, NULL, NULL, NULL, &TransportInfo_transportAssociation_json_, &TransportInfo_transportAssociation_oer_, &TransportInfo_transportAssociation_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t TransportInfo_transportAssociation_gtp__TEI_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t TransportInfo_transportAssociation_gtp__TEI_ber_ = { 1u, TransportInfo_transportAssociation_gtp__TEI_tag_ }; // No XER for TransportInfo_transportAssociation_gtp__TEI const int TransportInfo_transportAssociation_gtp__TEI_oer_ext_arr_[0] = {}; const int TransportInfo_transportAssociation_gtp__TEI_oer_p_[0] = {}; const TTCN_OERdescriptor_t TransportInfo_transportAssociation_gtp__TEI_oer_ = { -1, TRUE, 4, FALSE, 0, 0, TransportInfo_transportAssociation_gtp__TEI_oer_ext_arr_, 0, TransportInfo_transportAssociation_gtp__TEI_oer_p_}; const TTCN_Typedescriptor_t TransportInfo_transportAssociation_gtp__TEI_descr_ = { "@HNBAP-IEs.TransportInfo.transportAssociation.gtp-TEI", &TransportInfo_transportAssociation_gtp__TEI_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &TransportInfo_transportAssociation_gtp__TEI_oer_, >P__TEI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TransportInfo_transportAssociation_gtp__TEI_default_coding(""); const ASN_Tag_t TransportInfo_transportAssociation_bindingID_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t TransportInfo_transportAssociation_bindingID_ber_ = { 1u, TransportInfo_transportAssociation_bindingID_tag_ }; // No XER for TransportInfo_transportAssociation_bindingID const int TransportInfo_transportAssociation_bindingID_oer_ext_arr_[0] = {}; const int TransportInfo_transportAssociation_bindingID_oer_p_[0] = {}; const TTCN_OERdescriptor_t TransportInfo_transportAssociation_bindingID_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TransportInfo_transportAssociation_bindingID_oer_ext_arr_, 0, TransportInfo_transportAssociation_bindingID_oer_p_}; const TTCN_Typedescriptor_t TransportInfo_transportAssociation_bindingID_descr_ = { "@HNBAP-IEs.TransportInfo.transportAssociation.bindingID", &TransportInfo_transportAssociation_bindingID_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &TransportInfo_transportAssociation_bindingID_oer_, &BindingID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TransportInfo_transportAssociation_bindingID_default_coding(""); UNIVERSAL_CHARSTRING TransportInfo_transportAssociation_default_coding(""); // No XER for TransportInfo const TTCN_JSONdescriptor_t TransportInfo_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int TransportInfo_oer_ext_arr_[0] = {}; const int TransportInfo_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t TransportInfo_oer_ = { -1, TRUE, -1, TRUE, 3, 0, TransportInfo_oer_ext_arr_, 3, TransportInfo_oer_p_}; static const Per_Constraint TransportInfo_per_cons_; const ASN_PERdescriptor_t TransportInfo_per_ = { &TransportInfo_per_cons_ }; const TTCN_Typedescriptor_t TransportInfo_descr_ = { "@HNBAP-IEs.TransportInfo", &SEQUENCE_ber_, NULL, NULL, NULL, &TransportInfo_json_, &TransportInfo_oer_, &TransportInfo_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_default_coding(""); const ASN_Tag_t TransportInfo_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t TransportInfo_iE__Extensions_ber_ = { 1u, TransportInfo_iE__Extensions_tag_ }; // No XER for TransportInfo_iE__Extensions const int TransportInfo_iE__Extensions_oer_ext_arr_[0] = {}; const int TransportInfo_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t TransportInfo_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TransportInfo_iE__Extensions_oer_ext_arr_, 0, TransportInfo_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t TransportInfo_iE__Extensions_descr_ = { "@HNBAP-IEs.TransportInfo.iE-Extensions", &TransportInfo_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_json_, &TransportInfo_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TransportInfo_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING TransportInfo_default_coding(""); const ASN_Tag_t RABListItem_old__transport__Info_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t RABListItem_old__transport__Info_ber_ = { 1u, RABListItem_old__transport__Info_tag_ }; // No XER for RABListItem_old__transport__Info const int RABListItem_old__transport__Info_oer_ext_arr_[0] = {}; const int RABListItem_old__transport__Info_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t RABListItem_old__transport__Info_oer_ = { -1, TRUE, -1, TRUE, 3, 0, RABListItem_old__transport__Info_oer_ext_arr_, 3, RABListItem_old__transport__Info_oer_p_}; const TTCN_Typedescriptor_t RABListItem_old__transport__Info_descr_ = { "@HNBAP-IEs.RABListItem.old-transport-Info", &RABListItem_old__transport__Info_ber_, NULL, NULL, NULL, &TransportInfo_json_, &RABListItem_old__transport__Info_oer_, &TransportInfo_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RABListItem_old__transport__Info_default_coding(""); const ASN_Tag_t RABListItem_new__transport__Info_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t RABListItem_new__transport__Info_ber_ = { 1u, RABListItem_new__transport__Info_tag_ }; // No XER for RABListItem_new__transport__Info const int RABListItem_new__transport__Info_oer_ext_arr_[0] = {}; const int RABListItem_new__transport__Info_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t RABListItem_new__transport__Info_oer_ = { -1, TRUE, -1, TRUE, 3, 0, RABListItem_new__transport__Info_oer_ext_arr_, 3, RABListItem_new__transport__Info_oer_p_}; const TTCN_Typedescriptor_t RABListItem_new__transport__Info_descr_ = { "@HNBAP-IEs.RABListItem.new-transport-Info", &RABListItem_new__transport__Info_ber_, NULL, NULL, NULL, &TransportInfo_json_, &RABListItem_new__transport__Info_oer_, &TransportInfo_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RABListItem_new__transport__Info_default_coding(""); const ASN_Tag_t RABListItem_cn__domain__indicator_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t RABListItem_cn__domain__indicator_ber_ = { 1u, RABListItem_cn__domain__indicator_tag_ }; // No XER for RABListItem_cn__domain__indicator const int RABListItem_cn__domain__indicator_oer_ext_arr_[0] = {}; const int RABListItem_cn__domain__indicator_oer_p_[0] = {}; const TTCN_OERdescriptor_t RABListItem_cn__domain__indicator_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RABListItem_cn__domain__indicator_oer_ext_arr_, 0, RABListItem_cn__domain__indicator_oer_p_}; const TTCN_Typedescriptor_t RABListItem_cn__domain__indicator_descr_ = { "@HNBAP-IEs.RABListItem.cn-domain-indicator", &RABListItem_cn__domain__indicator_ber_, NULL, NULL, NULL, &CN__DomainIndicator_json_, &RABListItem_cn__domain__indicator_oer_, &CN__DomainIndicator_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RABListItem_cn__domain__indicator_default_coding(""); // No XER for RABListItem const TTCN_JSONdescriptor_t RABListItem_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int RABListItem_oer_ext_arr_[0] = {}; const int RABListItem_oer_p_[5] = {0, 1, 2, 3, 4}; const TTCN_OERdescriptor_t RABListItem_oer_ = { -1, TRUE, -1, TRUE, 5, 0, RABListItem_oer_ext_arr_, 5, RABListItem_oer_p_}; static const Per_Constraint RABListItem_per_cons_; const ASN_PERdescriptor_t RABListItem_per_ = { &RABListItem_per_cons_ }; const TTCN_Typedescriptor_t RABListItem_descr_ = { "@HNBAP-IEs.RABListItem", &SEQUENCE_ber_, NULL, NULL, NULL, &RABListItem_json_, &RABListItem_oer_, &RABListItem_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_default_coding(""); const ASN_Tag_t RABListItem_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 4u }}; const ASN_BERdescriptor_t RABListItem_iE__Extensions_ber_ = { 1u, RABListItem_iE__Extensions_tag_ }; // No XER for RABListItem_iE__Extensions const int RABListItem_iE__Extensions_oer_ext_arr_[0] = {}; const int RABListItem_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t RABListItem_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RABListItem_iE__Extensions_oer_ext_arr_, 0, RABListItem_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t RABListItem_iE__Extensions_descr_ = { "@HNBAP-IEs.RABListItem.iE-Extensions", &RABListItem_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_json_, &RABListItem_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RABListItem_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING RABListItem_default_coding(""); // No XER for RABList_0 const int RABList_0_oer_ext_arr_[0] = {}; const int RABList_0_oer_p_[5] = {0, 1, 2, 3, 4}; const TTCN_OERdescriptor_t RABList_0_oer_ = { -1, TRUE, -1, TRUE, 5, 0, RABList_0_oer_ext_arr_, 5, RABList_0_oer_p_}; const TTCN_Typedescriptor_t RABList_0_descr_ = { "@HNBAP-IEs.RABList.", &SEQUENCE_ber_, NULL, NULL, NULL, &RABListItem_json_, &RABList_0_oer_, &RABListItem_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RABList_0_default_coding(""); UNIVERSAL_CHARSTRING RABList_default_coding(""); // No XER for Registration__Cause const TTCN_JSONdescriptor_t Registration__Cause_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Registration__Cause_oer_ext_arr_[0] = {}; const int Registration__Cause_oer_p_[0] = {}; const TTCN_OERdescriptor_t Registration__Cause_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Registration__Cause_oer_ext_arr_, 0, Registration__Cause_oer_p_}; static const Per_Constraint Registration__Cause_per_cons_; const ASN_PERdescriptor_t Registration__Cause_per_ = { &Registration__Cause_per_cons_ }; const TTCN_Typedescriptor_t Registration__Cause_descr_ = { "@HNBAP-IEs.Registration-Cause", &ENUMERATED_ber_, NULL, NULL, NULL, &Registration__Cause_json_, &Registration__Cause_oer_, &Registration__Cause_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Registration__Cause_default_coding(""); // No XER for RNC__ID const int RNC__ID_oer_ext_arr_[0] = {}; const int RNC__ID_oer_p_[0] = {}; const TTCN_OERdescriptor_t RNC__ID_oer_ = { 2, FALSE, -1, FALSE, 0, 0, RNC__ID_oer_ext_arr_, 0, RNC__ID_oer_p_}; static Per_Integer_Constraint RNC__ID_per_cons_(new INTEGER(0), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t RNC__ID_per_ = { &RNC__ID_per_cons_ }; const TTCN_Typedescriptor_t RNC__ID_descr_ = { "@HNBAP-IEs.RNC-ID", &INTEGER_ber_, NULL, NULL, NULL, &INTEGER_json_, &RNC__ID_oer_, &RNC__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING RNC__ID_default_coding(""); // No XER for SAC const int SAC_oer_ext_arr_[0] = {}; const int SAC_oer_p_[0] = {}; const TTCN_OERdescriptor_t SAC_oer_ = { -1, TRUE, 2, FALSE, 0, 0, SAC_oer_ext_arr_, 0, SAC_oer_p_}; static Per_Integer_Constraint SAC_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(2), FALSE); const ASN_PERdescriptor_t SAC_per_ = { &SAC_per_cons_ }; const TTCN_Typedescriptor_t SAC_descr_ = { "@HNBAP-IEs.SAC", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &SAC_oer_, &SAC_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING SAC_default_coding(""); const ASN_Tag_t TMSILAI_tMSI_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t TMSILAI_tMSI_ber_ = { 1u, TMSILAI_tMSI_tag_ }; // No XER for TMSILAI_tMSI const int TMSILAI_tMSI_oer_ext_arr_[0] = {}; const int TMSILAI_tMSI_oer_p_[0] = {}; const TTCN_OERdescriptor_t TMSILAI_tMSI_oer_ = { -1, TRUE, 32, FALSE, 0, 0, TMSILAI_tMSI_oer_ext_arr_, 0, TMSILAI_tMSI_oer_p_}; static Per_Integer_Constraint TMSILAI_tMSI_size_per_cons_(Per_Integer_Constraint::PER_INT_SINGLE_VALUE, new INTEGER(32), FALSE); static Per_BitString_Constraint TMSILAI_tMSI_per_cons_(FALSE, &TMSILAI_tMSI_size_per_cons_); const ASN_PERdescriptor_t TMSILAI_tMSI_per_ = { &TMSILAI_tMSI_per_cons_ }; const TTCN_Typedescriptor_t TMSILAI_tMSI_descr_ = { "@HNBAP-IEs.TMSILAI.tMSI", &TMSILAI_tMSI_ber_, NULL, NULL, NULL, &BITSTRING_json_, &TMSILAI_tMSI_oer_, &TMSILAI_tMSI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TMSILAI_tMSI_default_coding(""); const ASN_Tag_t TMSILAI_lAI_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t TMSILAI_lAI_ber_ = { 1u, TMSILAI_lAI_tag_ }; // No XER for TMSILAI_lAI const int TMSILAI_lAI_oer_ext_arr_[0] = {}; const int TMSILAI_lAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t TMSILAI_lAI_oer_ = { -1, TRUE, -1, TRUE, 2, 0, TMSILAI_lAI_oer_ext_arr_, 2, TMSILAI_lAI_oer_p_}; const TTCN_Typedescriptor_t TMSILAI_lAI_descr_ = { "@HNBAP-IEs.TMSILAI.lAI", &TMSILAI_lAI_ber_, NULL, NULL, NULL, &LAI_json_, &TMSILAI_lAI_oer_, &LAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TMSILAI_lAI_default_coding(""); // No XER for TMSILAI const TTCN_JSONdescriptor_t TMSILAI_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int TMSILAI_oer_ext_arr_[0] = {}; const int TMSILAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t TMSILAI_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TMSILAI_oer_ext_arr_, 2, TMSILAI_oer_p_}; static const Per_Constraint TMSILAI_per_cons_; const ASN_PERdescriptor_t TMSILAI_per_ = { &TMSILAI_per_cons_ }; const TTCN_Typedescriptor_t TMSILAI_descr_ = { "@HNBAP-IEs.TMSILAI", &SEQUENCE_ber_, NULL, NULL, NULL, &TMSILAI_json_, &TMSILAI_oer_, &TMSILAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TMSILAI_default_coding(""); // No XER for TMSIDS41 const int TMSIDS41_oer_ext_arr_[0] = {}; const int TMSIDS41_oer_p_[0] = {}; const TTCN_OERdescriptor_t TMSIDS41_oer_ = { -1, TRUE, -1, FALSE, 0, 0, TMSIDS41_oer_ext_arr_, 0, TMSIDS41_oer_p_}; static Per_Integer_Constraint TMSIDS41_per_cons_(new INTEGER(2), new INTEGER(17), FALSE); const ASN_PERdescriptor_t TMSIDS41_per_ = { &TMSIDS41_per_cons_ }; const TTCN_Typedescriptor_t TMSIDS41_descr_ = { "@HNBAP-IEs.TMSIDS41", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &TMSIDS41_oer_, &TMSIDS41_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING TMSIDS41_default_coding(""); const ASN_Tag_t UE__Capabilities_access__stratum__release__indicator_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t UE__Capabilities_access__stratum__release__indicator_ber_ = { 1u, UE__Capabilities_access__stratum__release__indicator_tag_ }; // No XER for UE__Capabilities_access__stratum__release__indicator const int UE__Capabilities_access__stratum__release__indicator_oer_ext_arr_[0] = {}; const int UE__Capabilities_access__stratum__release__indicator_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Capabilities_access__stratum__release__indicator_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UE__Capabilities_access__stratum__release__indicator_oer_ext_arr_, 0, UE__Capabilities_access__stratum__release__indicator_oer_p_}; const TTCN_Typedescriptor_t UE__Capabilities_access__stratum__release__indicator_descr_ = { "@HNBAP-IEs.UE-Capabilities.access-stratum-release-indicator", &UE__Capabilities_access__stratum__release__indicator_ber_, NULL, NULL, NULL, &Access__stratum__release__indicator_json_, &UE__Capabilities_access__stratum__release__indicator_oer_, &Access__stratum__release__indicator_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Capabilities_access__stratum__release__indicator_default_coding(""); const ASN_Tag_t UE__Capabilities_csg__capability_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t UE__Capabilities_csg__capability_ber_ = { 1u, UE__Capabilities_csg__capability_tag_ }; // No XER for UE__Capabilities_csg__capability const int UE__Capabilities_csg__capability_oer_ext_arr_[0] = {}; const int UE__Capabilities_csg__capability_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Capabilities_csg__capability_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UE__Capabilities_csg__capability_oer_ext_arr_, 0, UE__Capabilities_csg__capability_oer_p_}; const TTCN_Typedescriptor_t UE__Capabilities_csg__capability_descr_ = { "@HNBAP-IEs.UE-Capabilities.csg-capability", &UE__Capabilities_csg__capability_ber_, NULL, NULL, NULL, &CSG__Capability_json_, &UE__Capabilities_csg__capability_oer_, &CSG__Capability_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Capabilities_csg__capability_default_coding(""); // No XER for UE__Capabilities const TTCN_JSONdescriptor_t UE__Capabilities_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int UE__Capabilities_oer_ext_arr_[0] = {}; const int UE__Capabilities_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t UE__Capabilities_oer_ = { -1, TRUE, -1, TRUE, 3, 0, UE__Capabilities_oer_ext_arr_, 3, UE__Capabilities_oer_p_}; static const Per_Constraint UE__Capabilities_per_cons_; const ASN_PERdescriptor_t UE__Capabilities_per_ = { &UE__Capabilities_per_cons_ }; const TTCN_Typedescriptor_t UE__Capabilities_descr_ = { "@HNBAP-IEs.UE-Capabilities", &SEQUENCE_ber_, NULL, NULL, NULL, &UE__Capabilities_json_, &UE__Capabilities_oer_, &UE__Capabilities_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_oer_p_}; static Per_Integer_Constraint _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_per_cons_(new INTEGER(1), new INTEGER(65535), FALSE); const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_per_ = { &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_oer_ = { 2, FALSE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.id", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_ber_, NULL, NULL, NULL, &INTEGER_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_oer_, &HNBAP__CommonDataTypes::ProtocolIE__ID_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_default_coding(""); const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_oer_p_[0] = {}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_oer_ext_arr_, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.criticality", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_ber_, NULL, NULL, NULL, &HNBAP__CommonDataTypes::Criticality_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_oer_, &HNBAP__CommonDataTypes::Criticality_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type", &CHOICE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_ber_ = { 1u, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_tag_ }; // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue", &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18 const TTCN_JSONdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_oer_p_}; static const Per_Constraint _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_per_cons_; const ASN_PERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_per_ = { &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_per_cons_ }; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_descr_ = { "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_json_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_default_coding(""); // No XER for _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0 const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_oer_ext_arr_[0] = {}; const int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_oer_p_[3] = {0, 1, 2}; const TTCN_OERdescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_oer_ = { -1, TRUE, -1, FALSE, 0, 0, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_oer_ext_arr_, 3, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_oer_p_}; const TTCN_Typedescriptor_t _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_descr_ = { "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18.", &SEQUENCE_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_json_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_oer_, &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_default_coding(""); const ASN_Tag_t UE__Capabilities_iE__Extensions_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t UE__Capabilities_iE__Extensions_ber_ = { 1u, UE__Capabilities_iE__Extensions_tag_ }; // No XER for UE__Capabilities_iE__Extensions const int UE__Capabilities_iE__Extensions_oer_ext_arr_[0] = {}; const int UE__Capabilities_iE__Extensions_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Capabilities_iE__Extensions_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UE__Capabilities_iE__Extensions_oer_ext_arr_, 0, UE__Capabilities_iE__Extensions_oer_p_}; const TTCN_Typedescriptor_t UE__Capabilities_iE__Extensions_descr_ = { "@HNBAP-IEs.UE-Capabilities.iE-Extensions", &UE__Capabilities_iE__Extensions_ber_, NULL, NULL, NULL, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_json_, &UE__Capabilities_iE__Extensions_oer_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_per_, &_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_0_descr_, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Capabilities_iE__Extensions_default_coding(""); UNIVERSAL_CHARSTRING UE__Capabilities_default_coding(""); // No XER for UE__Identity const TTCN_JSONdescriptor_t UE__Identity_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int UE__Identity_oer_ext_arr_[0] = {}; const int UE__Identity_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Identity_oer_ = { -1, TRUE, -1, TRUE, 8, 0, UE__Identity_oer_ext_arr_, 0, UE__Identity_oer_p_}; static const Per_Constraint UE__Identity_per_cons_; const ASN_PERdescriptor_t UE__Identity_per_ = { &UE__Identity_per_cons_ }; const TTCN_Typedescriptor_t UE__Identity_descr_ = { "@HNBAP-IEs.UE-Identity", &CHOICE_ber_, NULL, NULL, NULL, &UE__Identity_json_, &UE__Identity_oer_, &UE__Identity_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; const ASN_Tag_t UE__Identity_iMSI_tag_[] = { { ASN_TAG_CONT, 0u }}; const ASN_BERdescriptor_t UE__Identity_iMSI_ber_ = { 1u, UE__Identity_iMSI_tag_ }; // No XER for UE__Identity_iMSI const int UE__Identity_iMSI_oer_ext_arr_[0] = {}; const int UE__Identity_iMSI_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Identity_iMSI_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UE__Identity_iMSI_oer_ext_arr_, 0, UE__Identity_iMSI_oer_p_}; const TTCN_Typedescriptor_t UE__Identity_iMSI_descr_ = { "@HNBAP-IEs.UE-Identity.iMSI", &UE__Identity_iMSI_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &UE__Identity_iMSI_oer_, &IMSI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Identity_iMSI_default_coding(""); const ASN_Tag_t UE__Identity_tMSILAI_tag_[] = { { ASN_TAG_CONT, 1u }}; const ASN_BERdescriptor_t UE__Identity_tMSILAI_ber_ = { 1u, UE__Identity_tMSILAI_tag_ }; // No XER for UE__Identity_tMSILAI const int UE__Identity_tMSILAI_oer_ext_arr_[0] = {}; const int UE__Identity_tMSILAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t UE__Identity_tMSILAI_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UE__Identity_tMSILAI_oer_ext_arr_, 2, UE__Identity_tMSILAI_oer_p_}; const TTCN_Typedescriptor_t UE__Identity_tMSILAI_descr_ = { "@HNBAP-IEs.UE-Identity.tMSILAI", &UE__Identity_tMSILAI_ber_, NULL, NULL, NULL, &TMSILAI_json_, &UE__Identity_tMSILAI_oer_, &TMSILAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Identity_tMSILAI_default_coding(""); const ASN_Tag_t UE__Identity_pTMSIRAI_tag_[] = { { ASN_TAG_CONT, 2u }}; const ASN_BERdescriptor_t UE__Identity_pTMSIRAI_ber_ = { 1u, UE__Identity_pTMSIRAI_tag_ }; // No XER for UE__Identity_pTMSIRAI const int UE__Identity_pTMSIRAI_oer_ext_arr_[0] = {}; const int UE__Identity_pTMSIRAI_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t UE__Identity_pTMSIRAI_oer_ = { -1, TRUE, -1, TRUE, 2, 0, UE__Identity_pTMSIRAI_oer_ext_arr_, 2, UE__Identity_pTMSIRAI_oer_p_}; const TTCN_Typedescriptor_t UE__Identity_pTMSIRAI_descr_ = { "@HNBAP-IEs.UE-Identity.pTMSIRAI", &UE__Identity_pTMSIRAI_ber_, NULL, NULL, NULL, &PTMSIRAI_json_, &UE__Identity_pTMSIRAI_oer_, &PTMSIRAI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Identity_pTMSIRAI_default_coding(""); const ASN_Tag_t UE__Identity_iMEI_tag_[] = { { ASN_TAG_CONT, 3u }}; const ASN_BERdescriptor_t UE__Identity_iMEI_ber_ = { 1u, UE__Identity_iMEI_tag_ }; // No XER for UE__Identity_iMEI const int UE__Identity_iMEI_oer_ext_arr_[0] = {}; const int UE__Identity_iMEI_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Identity_iMEI_oer_ = { -1, TRUE, 60, FALSE, 0, 0, UE__Identity_iMEI_oer_ext_arr_, 0, UE__Identity_iMEI_oer_p_}; const TTCN_Typedescriptor_t UE__Identity_iMEI_descr_ = { "@HNBAP-IEs.UE-Identity.iMEI", &UE__Identity_iMEI_ber_, NULL, NULL, NULL, &BITSTRING_json_, &UE__Identity_iMEI_oer_, &IMEI_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Identity_iMEI_default_coding(""); const ASN_Tag_t UE__Identity_eSN_tag_[] = { { ASN_TAG_CONT, 4u }}; const ASN_BERdescriptor_t UE__Identity_eSN_ber_ = { 1u, UE__Identity_eSN_tag_ }; // No XER for UE__Identity_eSN const int UE__Identity_eSN_oer_ext_arr_[0] = {}; const int UE__Identity_eSN_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Identity_eSN_oer_ = { -1, TRUE, 32, FALSE, 0, 0, UE__Identity_eSN_oer_ext_arr_, 0, UE__Identity_eSN_oer_p_}; const TTCN_Typedescriptor_t UE__Identity_eSN_descr_ = { "@HNBAP-IEs.UE-Identity.eSN", &UE__Identity_eSN_ber_, NULL, NULL, NULL, &BITSTRING_json_, &UE__Identity_eSN_oer_, &ESN_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Identity_eSN_default_coding(""); const ASN_Tag_t UE__Identity_iMSIDS41_tag_[] = { { ASN_TAG_CONT, 5u }}; const ASN_BERdescriptor_t UE__Identity_iMSIDS41_ber_ = { 1u, UE__Identity_iMSIDS41_tag_ }; // No XER for UE__Identity_iMSIDS41 const int UE__Identity_iMSIDS41_oer_ext_arr_[0] = {}; const int UE__Identity_iMSIDS41_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Identity_iMSIDS41_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UE__Identity_iMSIDS41_oer_ext_arr_, 0, UE__Identity_iMSIDS41_oer_p_}; const TTCN_Typedescriptor_t UE__Identity_iMSIDS41_descr_ = { "@HNBAP-IEs.UE-Identity.iMSIDS41", &UE__Identity_iMSIDS41_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &UE__Identity_iMSIDS41_oer_, &IMSIDS41_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Identity_iMSIDS41_default_coding(""); const ASN_Tag_t UE__Identity_iMSIESN_tag_[] = { { ASN_TAG_CONT, 6u }}; const ASN_BERdescriptor_t UE__Identity_iMSIESN_ber_ = { 1u, UE__Identity_iMSIESN_tag_ }; // No XER for UE__Identity_iMSIESN const int UE__Identity_iMSIESN_oer_ext_arr_[0] = {}; const int UE__Identity_iMSIESN_oer_p_[2] = {0, 1}; const TTCN_OERdescriptor_t UE__Identity_iMSIESN_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UE__Identity_iMSIESN_oer_ext_arr_, 2, UE__Identity_iMSIESN_oer_p_}; const TTCN_Typedescriptor_t UE__Identity_iMSIESN_descr_ = { "@HNBAP-IEs.UE-Identity.iMSIESN", &UE__Identity_iMSIESN_ber_, NULL, NULL, NULL, &IMSIESN_json_, &UE__Identity_iMSIESN_oer_, &IMSIESN_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Identity_iMSIESN_default_coding(""); const ASN_Tag_t UE__Identity_tMSIDS41_tag_[] = { { ASN_TAG_CONT, 7u }}; const ASN_BERdescriptor_t UE__Identity_tMSIDS41_ber_ = { 1u, UE__Identity_tMSIDS41_tag_ }; // No XER for UE__Identity_tMSIDS41 const int UE__Identity_tMSIDS41_oer_ext_arr_[0] = {}; const int UE__Identity_tMSIDS41_oer_p_[0] = {}; const TTCN_OERdescriptor_t UE__Identity_tMSIDS41_oer_ = { -1, TRUE, -1, FALSE, 0, 0, UE__Identity_tMSIDS41_oer_ext_arr_, 0, UE__Identity_tMSIDS41_oer_p_}; const TTCN_Typedescriptor_t UE__Identity_tMSIDS41_descr_ = { "@HNBAP-IEs.UE-Identity.tMSIDS41", &UE__Identity_tMSIDS41_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, NULL, &OCTETSTRING_json_, &UE__Identity_tMSIDS41_oer_, &TMSIDS41_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING UE__Identity_tMSIDS41_default_coding(""); UNIVERSAL_CHARSTRING UE__Identity_default_coding(""); // No XER for Update__cause const TTCN_JSONdescriptor_t Update__cause_json_ = { FALSE, NULL, FALSE, { JD_UNSET, NULL, NULL }, FALSE, FALSE, FALSE, 0, NULL, FALSE, ESCAPE_AS_SHORT }; const int Update__cause_oer_ext_arr_[0] = {}; const int Update__cause_oer_p_[0] = {}; const TTCN_OERdescriptor_t Update__cause_oer_ = { -1, TRUE, -1, FALSE, 0, 0, Update__cause_oer_ext_arr_, 0, Update__cause_oer_p_}; static const Per_Constraint Update__cause_per_cons_; const ASN_PERdescriptor_t Update__cause_per_ = { &Update__cause_per_cons_ }; const TTCN_Typedescriptor_t Update__cause_descr_ = { "@HNBAP-IEs.Update-cause", &ENUMERATED_ber_, NULL, NULL, NULL, &Update__cause_json_, &Update__cause_oer_, &Update__cause_per_, NULL, TTCN_Typedescriptor_t::DONTCARE }; UNIVERSAL_CHARSTRING Update__cause_default_coding(""); TTCN_Module module_object("HNBAP-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 */ Access__stratum__release__indicator::Access__stratum__release__indicator() { enum_value = UNBOUND_VALUE; } Access__stratum__release__indicator::Access__stratum__release__indicator(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @HNBAP-IEs.Access-stratum-release-indicator with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } Access__stratum__release__indicator::Access__stratum__release__indicator(enum_type other_value) { enum_value = other_value; } Access__stratum__release__indicator::Access__stratum__release__indicator(const Access__stratum__release__indicator& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); enum_value = other_value.enum_value; } Access__stratum__release__indicator& Access__stratum__release__indicator::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @HNBAP-IEs.Access-stratum-release-indicator.", other_value); enum_value = (enum_type)other_value; return *this; } Access__stratum__release__indicator& Access__stratum__release__indicator::operator=(enum_type other_value) { enum_value = other_value; return *this; } Access__stratum__release__indicator& Access__stratum__release__indicator::operator=(const Access__stratum__release__indicator& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); enum_value = other_value.enum_value; return *this; } boolean Access__stratum__release__indicator::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.Access-stratum-release-indicator comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator."); return enum_value == other_value; } boolean Access__stratum__release__indicator::operator==(const Access__stratum__release__indicator& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); return enum_value == other_value.enum_value; } boolean Access__stratum__release__indicator::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.Access-stratum-release-indicator comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator."); return enum_value < other_value; } boolean Access__stratum__release__indicator::operator<(const Access__stratum__release__indicator& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); return enum_value < other_value.enum_value; } boolean Access__stratum__release__indicator::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.Access-stratum-release-indicator comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator."); return enum_value > other_value; } boolean Access__stratum__release__indicator::operator>(const Access__stratum__release__indicator& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); return enum_value > other_value.enum_value; } const char *Access__stratum__release__indicator::enum_to_str(enum_type enum_par) { switch (enum_par) { case r99: return "r99"; case rel__4: return "rel_4"; case rel__5: return "rel_5"; case rel__6: return "rel_6"; case rel__7: return "rel_7"; case rel__8__and__beyond: return "rel_8_and_beyond"; default: return ""; } } Access__stratum__release__indicator::enum_type Access__stratum__release__indicator::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, "r99")) return r99; if (!strcmp(str_par, "rel_4")) return rel__4; if (!strcmp(str_par, "rel_5")) return rel__5; if (!strcmp(str_par, "rel_6")) return rel__6; if (!strcmp(str_par, "rel_7")) return rel__7; if (!strcmp(str_par, "rel_8_and_beyond")) return rel__8__and__beyond; } return UNKNOWN_VALUE; } boolean Access__stratum__release__indicator::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: case 3: case 4: case 5: return TRUE; default: return FALSE; } } int Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int Access__stratum__release__indicator::enum2int(const Access__stratum__release__indicator& 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 @HNBAP-IEs.Access-stratum-release-indicator.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void Access__stratum__release__indicator::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HNBAP-IEs.Access-stratum-release-indicator.", int_val); enum_value = (enum_type)int_val; } Access__stratum__release__indicator::operator Access__stratum__release__indicator::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); return enum_value; } void Access__stratum__release__indicator::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 Access__stratum__release__indicator::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", "@HNBAP-IEs.Access-stratum-release-indicator"); 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 @HNBAP-IEs.Access-stratum-release-indicator."); } } void Access__stratum__release__indicator::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); text_buf.push_int(enum_value); } void Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator.", enum_value); } void Access__stratum__release__indicator::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 Access__stratum__release__indicator::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* Access__stratum__release__indicator::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 Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator: "); 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 Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator."); 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 Access__stratum__release__indicator::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 = r99; } 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 Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator."); 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 Access__stratum__release__indicator::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 Access__stratum__release__indicator::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 r99: enc_val = 0; ext_bit = FALSE; break; case rel__4: enc_val = 1; ext_bit = FALSE; break; case rel__5: enc_val = 2; ext_bit = FALSE; break; case rel__6: enc_val = 3; ext_bit = FALSE; break; case rel__7: enc_val = 4; ext_bit = FALSE; break; case rel__8__and__beyond: enc_val = 5; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); } 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 Access__stratum__release__indicator::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 = r99; break; case 1: enum_value = rel__4; break; case 2: enum_value = rel__5; break; case 3: enum_value = rel__6; break; case 4: enum_value = rel__7; break; case 5: enum_value = rel__8__and__beyond; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @HNBAP-IEs.Access-stratum-release-indicator.", dec_int); break; } } void Access__stratum__release__indicator_template::copy_template(const Access__stratum__release__indicator_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 Access__stratum__release__indicator_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 Access__stratum__release__indicator_template(*other_value.implication_.precondition); implication_.implied_template = new Access__stratum__release__indicator_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 @HNBAP-IEs.Access-stratum-release-indicator."); } } Access__stratum__release__indicator_template::Access__stratum__release__indicator_template() { } Access__stratum__release__indicator_template::Access__stratum__release__indicator_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Access__stratum__release__indicator_template::Access__stratum__release__indicator_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!Access__stratum__release__indicator::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HNBAP-IEs.Access-stratum-release-indicator with unknown numeric value %d.", other_value); single_value = (Access__stratum__release__indicator::enum_type)other_value; } Access__stratum__release__indicator_template::Access__stratum__release__indicator_template(Access__stratum__release__indicator::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } Access__stratum__release__indicator_template::Access__stratum__release__indicator_template(const Access__stratum__release__indicator& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == Access__stratum__release__indicator::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); single_value = other_value.enum_value; } Access__stratum__release__indicator_template::Access__stratum__release__indicator_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (Access__stratum__release__indicator::enum_type)(const Access__stratum__release__indicator&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @HNBAP-IEs.Access-stratum-release-indicator from an unbound optional field."); } } Access__stratum__release__indicator_template::Access__stratum__release__indicator_template(Access__stratum__release__indicator_template* p_precondition, Access__stratum__release__indicator_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Access__stratum__release__indicator_template::Access__stratum__release__indicator_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; } Access__stratum__release__indicator_template::Access__stratum__release__indicator_template(const Access__stratum__release__indicator_template& other_value) : Base_Template() { copy_template(other_value); } Access__stratum__release__indicator_template::~Access__stratum__release__indicator_template() { clean_up(); } boolean Access__stratum__release__indicator_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean Access__stratum__release__indicator_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != Access__stratum__release__indicator::UNBOUND_VALUE; } void Access__stratum__release__indicator_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; } Access__stratum__release__indicator_template& Access__stratum__release__indicator_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Access__stratum__release__indicator_template& Access__stratum__release__indicator_template::operator=(int other_value) { if (!Access__stratum__release__indicator::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HNBAP-IEs.Access-stratum-release-indicator.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (Access__stratum__release__indicator::enum_type)other_value; return *this; } Access__stratum__release__indicator_template& Access__stratum__release__indicator_template::operator=(Access__stratum__release__indicator::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } Access__stratum__release__indicator_template& Access__stratum__release__indicator_template::operator=(const Access__stratum__release__indicator& other_value) { if (other_value.enum_value == Access__stratum__release__indicator::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.Access-stratum-release-indicator to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } Access__stratum__release__indicator_template& Access__stratum__release__indicator_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (Access__stratum__release__indicator::enum_type)(const Access__stratum__release__indicator&)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 @HNBAP-IEs.Access-stratum-release-indicator."); } return *this; } Access__stratum__release__indicator_template& Access__stratum__release__indicator_template::operator=(const Access__stratum__release__indicator_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Access__stratum__release__indicator_template::match(Access__stratum__release__indicator::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 @HNBAP-IEs.Access-stratum-release-indicator."); } return FALSE; } boolean Access__stratum__release__indicator_template::match(const Access__stratum__release__indicator& other_value, boolean) const { if (other_value.enum_value == Access__stratum__release__indicator::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HNBAP-IEs.Access-stratum-release-indicator with an unbound value."); return match(other_value.enum_value); } Access__stratum__release__indicator::enum_type Access__stratum__release__indicator_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 @HNBAP-IEs.Access-stratum-release-indicator."); return single_value; } void Access__stratum__release__indicator_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 Access__stratum__release__indicator_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); } } Access__stratum__release__indicator_template& Access__stratum__release__indicator_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 @HNBAP-IEs.Access-stratum-release-indicator."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-IEs.Access-stratum-release-indicator."); return value_list.list_value[list_index]; } void Access__stratum__release__indicator_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(Access__stratum__release__indicator::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 Access__stratum__release__indicator_template::log_match(const Access__stratum__release__indicator& 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 Access__stratum__release__indicator_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 @HNBAP-IEs.Access-stratum-release-indicator."); } } void Access__stratum__release__indicator_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (Access__stratum__release__indicator::enum_type)text_buf.pull_int().get_val(); if (!Access__stratum__release__indicator::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HNBAP-IEs.Access-stratum-release-indicator.", 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 Access__stratum__release__indicator_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 @HNBAP-IEs.Access-stratum-release-indicator."); } } boolean Access__stratum__release__indicator_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Access__stratum__release__indicator_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: { Access__stratum__release__indicator_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: { Access__stratum__release__indicator::enum_type enum_val = Access__stratum__release__indicator::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!Access__stratum__release__indicator::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @HNBAP-IEs.Access-stratum-release-indicator."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { Access__stratum__release__indicator_template* precondition = new Access__stratum__release__indicator_template; precondition->set_param(*m_p->get_elem(0)); Access__stratum__release__indicator_template* implied_template = new Access__stratum__release__indicator_template; implied_template->set_param(*m_p->get_elem(1)); *this = Access__stratum__release__indicator_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@HNBAP-IEs.Access-stratum-release-indicator"); } is_ifpresent = param.get_ifpresent(); } void Access__stratum__release__indicator_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 : "@HNBAP-IEs.Access-stratum-release-indicator"); } AccessResult::AccessResult() { enum_value = UNBOUND_VALUE; } AccessResult::AccessResult(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @HNBAP-IEs.AccessResult with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } AccessResult::AccessResult(enum_type other_value) { enum_value = other_value; } AccessResult::AccessResult(const AccessResult& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @HNBAP-IEs.AccessResult."); enum_value = other_value.enum_value; } AccessResult& AccessResult::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @HNBAP-IEs.AccessResult.", other_value); enum_value = (enum_type)other_value; return *this; } AccessResult& AccessResult::operator=(enum_type other_value) { enum_value = other_value; return *this; } AccessResult& AccessResult::operator=(const AccessResult& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.AccessResult."); enum_value = other_value.enum_value; return *this; } boolean AccessResult::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.AccessResult comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean AccessResult::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 @HNBAP-IEs.AccessResult."); return enum_value == other_value; } boolean AccessResult::operator==(const AccessResult& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); return enum_value == other_value.enum_value; } boolean AccessResult::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.AccessResult comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean AccessResult::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 @HNBAP-IEs.AccessResult."); return enum_value < other_value; } boolean AccessResult::operator<(const AccessResult& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); return enum_value < other_value.enum_value; } boolean AccessResult::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.AccessResult comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean AccessResult::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 @HNBAP-IEs.AccessResult."); return enum_value > other_value; } boolean AccessResult::operator>(const AccessResult& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AccessResult."); return enum_value > other_value.enum_value; } const char *AccessResult::enum_to_str(enum_type enum_par) { switch (enum_par) { case allowed: return "allowed"; case notAllowed: return "notAllowed"; default: return ""; } } AccessResult::enum_type AccessResult::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, "allowed")) return allowed; if (!strcmp(str_par, "notAllowed")) return notAllowed; } return UNKNOWN_VALUE; } boolean AccessResult::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int AccessResult::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 @HNBAP-IEs.AccessResult.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int AccessResult::enum2int(const AccessResult& 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 @HNBAP-IEs.AccessResult.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void AccessResult::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HNBAP-IEs.AccessResult.", int_val); enum_value = (enum_type)int_val; } AccessResult::operator AccessResult::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HNBAP-IEs.AccessResult."); return enum_value; } void AccessResult::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 AccessResult::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", "@HNBAP-IEs.AccessResult"); 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 @HNBAP-IEs.AccessResult."); } } void AccessResult::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HNBAP-IEs.AccessResult."); text_buf.push_int(enum_value); } void AccessResult::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 @HNBAP-IEs.AccessResult.", enum_value); } void AccessResult::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 AccessResult::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* AccessResult::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 AccessResult::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 @HNBAP-IEs.AccessResult: "); 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 AccessResult::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 @HNBAP-IEs.AccessResult."); 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 AccessResult::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 = allowed; } 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 AccessResult::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 @HNBAP-IEs.AccessResult."); 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 AccessResult::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 AccessResult::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 allowed: enc_val = 0; ext_bit = FALSE; break; case notAllowed: 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 @HNBAP-IEs.AccessResult."); } 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 AccessResult::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 = allowed; break; case 1: enum_value = notAllowed; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @HNBAP-IEs.AccessResult.", dec_int); break; } } void AccessResult_template::copy_template(const AccessResult_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 AccessResult_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 AccessResult_template(*other_value.implication_.precondition); implication_.implied_template = new AccessResult_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 @HNBAP-IEs.AccessResult."); } } AccessResult_template::AccessResult_template() { } AccessResult_template::AccessResult_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessResult_template::AccessResult_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!AccessResult::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HNBAP-IEs.AccessResult with unknown numeric value %d.", other_value); single_value = (AccessResult::enum_type)other_value; } AccessResult_template::AccessResult_template(AccessResult::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } AccessResult_template::AccessResult_template(const AccessResult& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == AccessResult::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HNBAP-IEs.AccessResult."); single_value = other_value.enum_value; } AccessResult_template::AccessResult_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (AccessResult::enum_type)(const AccessResult&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @HNBAP-IEs.AccessResult from an unbound optional field."); } } AccessResult_template::AccessResult_template(AccessResult_template* p_precondition, AccessResult_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessResult_template::AccessResult_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; } AccessResult_template::AccessResult_template(const AccessResult_template& other_value) : Base_Template() { copy_template(other_value); } AccessResult_template::~AccessResult_template() { clean_up(); } boolean AccessResult_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean AccessResult_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != AccessResult::UNBOUND_VALUE; } void AccessResult_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; } AccessResult_template& AccessResult_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessResult_template& AccessResult_template::operator=(int other_value) { if (!AccessResult::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HNBAP-IEs.AccessResult.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (AccessResult::enum_type)other_value; return *this; } AccessResult_template& AccessResult_template::operator=(AccessResult::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } AccessResult_template& AccessResult_template::operator=(const AccessResult& other_value) { if (other_value.enum_value == AccessResult::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.AccessResult to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } AccessResult_template& AccessResult_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (AccessResult::enum_type)(const AccessResult&)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 @HNBAP-IEs.AccessResult."); } return *this; } AccessResult_template& AccessResult_template::operator=(const AccessResult_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessResult_template::match(AccessResult::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 @HNBAP-IEs.AccessResult."); } return FALSE; } boolean AccessResult_template::match(const AccessResult& other_value, boolean) const { if (other_value.enum_value == AccessResult::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HNBAP-IEs.AccessResult with an unbound value."); return match(other_value.enum_value); } AccessResult::enum_type AccessResult_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 @HNBAP-IEs.AccessResult."); return single_value; } void AccessResult_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 AccessResult_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @HNBAP-IEs.AccessResult."); } } AccessResult_template& AccessResult_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 @HNBAP-IEs.AccessResult."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-IEs.AccessResult."); return value_list.list_value[list_index]; } void AccessResult_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(AccessResult::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 AccessResult_template::log_match(const AccessResult& 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 AccessResult_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 @HNBAP-IEs.AccessResult."); } } void AccessResult_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (AccessResult::enum_type)text_buf.pull_int().get_val(); if (!AccessResult::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HNBAP-IEs.AccessResult.", 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 AccessResult_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 @HNBAP-IEs.AccessResult."); } } boolean AccessResult_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessResult_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: { AccessResult_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: { AccessResult::enum_type enum_val = AccessResult::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!AccessResult::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @HNBAP-IEs.AccessResult."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { AccessResult_template* precondition = new AccessResult_template; precondition->set_param(*m_p->get_elem(0)); AccessResult_template* implied_template = new AccessResult_template; implied_template->set_param(*m_p->get_elem(1)); *this = AccessResult_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@HNBAP-IEs.AccessResult"); } is_ifpresent = param.get_ifpresent(); } void AccessResult_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 : "@HNBAP-IEs.AccessResult"); } AltitudeAndDirection_directionOfAltitude::AltitudeAndDirection_directionOfAltitude() { enum_value = UNBOUND_VALUE; } AltitudeAndDirection_directionOfAltitude::AltitudeAndDirection_directionOfAltitude(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } AltitudeAndDirection_directionOfAltitude::AltitudeAndDirection_directionOfAltitude(enum_type other_value) { enum_value = other_value; } AltitudeAndDirection_directionOfAltitude::AltitudeAndDirection_directionOfAltitude(const AltitudeAndDirection_directionOfAltitude& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); enum_value = other_value.enum_value; } AltitudeAndDirection_directionOfAltitude& AltitudeAndDirection_directionOfAltitude::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude.", other_value); enum_value = (enum_type)other_value; return *this; } AltitudeAndDirection_directionOfAltitude& AltitudeAndDirection_directionOfAltitude::operator=(enum_type other_value) { enum_value = other_value; return *this; } AltitudeAndDirection_directionOfAltitude& AltitudeAndDirection_directionOfAltitude::operator=(const AltitudeAndDirection_directionOfAltitude& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); enum_value = other_value.enum_value; return *this; } boolean AltitudeAndDirection_directionOfAltitude::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return enum_value == other_value; } boolean AltitudeAndDirection_directionOfAltitude::operator==(const AltitudeAndDirection_directionOfAltitude& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return enum_value == other_value.enum_value; } boolean AltitudeAndDirection_directionOfAltitude::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return enum_value < other_value; } boolean AltitudeAndDirection_directionOfAltitude::operator<(const AltitudeAndDirection_directionOfAltitude& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return enum_value < other_value.enum_value; } boolean AltitudeAndDirection_directionOfAltitude::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return enum_value > other_value; } boolean AltitudeAndDirection_directionOfAltitude::operator>(const AltitudeAndDirection_directionOfAltitude& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return enum_value > other_value.enum_value; } const char *AltitudeAndDirection_directionOfAltitude::enum_to_str(enum_type enum_par) { switch (enum_par) { case height: return "height"; case depth: return "depth"; default: return ""; } } AltitudeAndDirection_directionOfAltitude::enum_type AltitudeAndDirection_directionOfAltitude::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, "height")) return height; if (!strcmp(str_par, "depth")) return depth; } return UNKNOWN_VALUE; } boolean AltitudeAndDirection_directionOfAltitude::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int AltitudeAndDirection_directionOfAltitude::enum2int(const AltitudeAndDirection_directionOfAltitude& 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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void AltitudeAndDirection_directionOfAltitude::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude.", int_val); enum_value = (enum_type)int_val; } AltitudeAndDirection_directionOfAltitude::operator AltitudeAndDirection_directionOfAltitude::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return enum_value; } void AltitudeAndDirection_directionOfAltitude::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 AltitudeAndDirection_directionOfAltitude::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", "@HNBAP-IEs.AltitudeAndDirection.directionOfAltitude"); 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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } } void AltitudeAndDirection_directionOfAltitude::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); text_buf.push_int(enum_value); } void AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude.", enum_value); } void AltitudeAndDirection_directionOfAltitude::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 AltitudeAndDirection_directionOfAltitude::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* AltitudeAndDirection_directionOfAltitude::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 AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude: "); 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 AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); 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 AltitudeAndDirection_directionOfAltitude::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 = height; } 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 AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); 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 AltitudeAndDirection_directionOfAltitude::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 AltitudeAndDirection_directionOfAltitude::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; switch (enum_value) { case height: enc_val = 0; break; case depth: enc_val = 1; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } INTEGER::PER_encode_int(p_buf, enc_val, 1); } void AltitudeAndDirection_directionOfAltitude::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 = height; break; case 1: enum_value = depth; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude.", dec_int); break; } } void AltitudeAndDirection_directionOfAltitude_template::copy_template(const AltitudeAndDirection_directionOfAltitude_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 AltitudeAndDirection_directionOfAltitude_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 AltitudeAndDirection_directionOfAltitude_template(*other_value.implication_.precondition); implication_.implied_template = new AltitudeAndDirection_directionOfAltitude_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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_template() { } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!AltitudeAndDirection_directionOfAltitude::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude with unknown numeric value %d.", other_value); single_value = (AltitudeAndDirection_directionOfAltitude::enum_type)other_value; } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_template(AltitudeAndDirection_directionOfAltitude::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_template(const AltitudeAndDirection_directionOfAltitude& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == AltitudeAndDirection_directionOfAltitude::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); single_value = other_value.enum_value; } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (AltitudeAndDirection_directionOfAltitude::enum_type)(const AltitudeAndDirection_directionOfAltitude&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude from an unbound optional field."); } } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_template(AltitudeAndDirection_directionOfAltitude_template* p_precondition, AltitudeAndDirection_directionOfAltitude_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_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; } AltitudeAndDirection_directionOfAltitude_template::AltitudeAndDirection_directionOfAltitude_template(const AltitudeAndDirection_directionOfAltitude_template& other_value) : Base_Template() { copy_template(other_value); } AltitudeAndDirection_directionOfAltitude_template::~AltitudeAndDirection_directionOfAltitude_template() { clean_up(); } boolean AltitudeAndDirection_directionOfAltitude_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean AltitudeAndDirection_directionOfAltitude_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != AltitudeAndDirection_directionOfAltitude::UNBOUND_VALUE; } void AltitudeAndDirection_directionOfAltitude_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; } AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_directionOfAltitude_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_directionOfAltitude_template::operator=(int other_value) { if (!AltitudeAndDirection_directionOfAltitude::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (AltitudeAndDirection_directionOfAltitude::enum_type)other_value; return *this; } AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_directionOfAltitude_template::operator=(AltitudeAndDirection_directionOfAltitude::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_directionOfAltitude_template::operator=(const AltitudeAndDirection_directionOfAltitude& other_value) { if (other_value.enum_value == AltitudeAndDirection_directionOfAltitude::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_directionOfAltitude_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (AltitudeAndDirection_directionOfAltitude::enum_type)(const AltitudeAndDirection_directionOfAltitude&)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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } return *this; } AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_directionOfAltitude_template::operator=(const AltitudeAndDirection_directionOfAltitude_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AltitudeAndDirection_directionOfAltitude_template::match(AltitudeAndDirection_directionOfAltitude::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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } return FALSE; } boolean AltitudeAndDirection_directionOfAltitude_template::match(const AltitudeAndDirection_directionOfAltitude& other_value, boolean) const { if (other_value.enum_value == AltitudeAndDirection_directionOfAltitude::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude with an unbound value."); return match(other_value.enum_value); } AltitudeAndDirection_directionOfAltitude::enum_type AltitudeAndDirection_directionOfAltitude_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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return single_value; } void AltitudeAndDirection_directionOfAltitude_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 AltitudeAndDirection_directionOfAltitude_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } } AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_directionOfAltitude_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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); return value_list.list_value[list_index]; } void AltitudeAndDirection_directionOfAltitude_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(AltitudeAndDirection_directionOfAltitude::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 AltitudeAndDirection_directionOfAltitude_template::log_match(const AltitudeAndDirection_directionOfAltitude& 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 AltitudeAndDirection_directionOfAltitude_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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } } void AltitudeAndDirection_directionOfAltitude_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (AltitudeAndDirection_directionOfAltitude::enum_type)text_buf.pull_int().get_val(); if (!AltitudeAndDirection_directionOfAltitude::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude.", 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 AltitudeAndDirection_directionOfAltitude_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 @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } } boolean AltitudeAndDirection_directionOfAltitude_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AltitudeAndDirection_directionOfAltitude_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: { AltitudeAndDirection_directionOfAltitude_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: { AltitudeAndDirection_directionOfAltitude::enum_type enum_val = AltitudeAndDirection_directionOfAltitude::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!AltitudeAndDirection_directionOfAltitude::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @HNBAP-IEs.AltitudeAndDirection.directionOfAltitude."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { AltitudeAndDirection_directionOfAltitude_template* precondition = new AltitudeAndDirection_directionOfAltitude_template; precondition->set_param(*m_p->get_elem(0)); AltitudeAndDirection_directionOfAltitude_template* implied_template = new AltitudeAndDirection_directionOfAltitude_template; implied_template->set_param(*m_p->get_elem(1)); *this = AltitudeAndDirection_directionOfAltitude_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@HNBAP-IEs.AltitudeAndDirection.directionOfAltitude"); } is_ifpresent = param.get_ifpresent(); } void AltitudeAndDirection_directionOfAltitude_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 : "@HNBAP-IEs.AltitudeAndDirection.directionOfAltitude"); } AltitudeAndDirection::AltitudeAndDirection() { } AltitudeAndDirection::AltitudeAndDirection(const AltitudeAndDirection_directionOfAltitude& par_directionOfAltitude, const INTEGER& par_altitude) : field_directionOfAltitude(par_directionOfAltitude), field_altitude(par_altitude) { } AltitudeAndDirection::AltitudeAndDirection(const AltitudeAndDirection& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.AltitudeAndDirection."); if (other_value.directionOfAltitude().is_bound()) field_directionOfAltitude = other_value.directionOfAltitude(); else field_directionOfAltitude.clean_up(); if (other_value.altitude().is_bound()) field_altitude = other_value.altitude(); else field_altitude.clean_up(); } void AltitudeAndDirection::clean_up() { field_directionOfAltitude.clean_up(); field_altitude.clean_up(); } const TTCN_Typedescriptor_t* AltitudeAndDirection::get_descriptor() const { return &AltitudeAndDirection_descr_; } AltitudeAndDirection& AltitudeAndDirection::operator=(const AltitudeAndDirection& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.AltitudeAndDirection."); if (other_value.directionOfAltitude().is_bound()) field_directionOfAltitude = other_value.directionOfAltitude(); else field_directionOfAltitude.clean_up(); if (other_value.altitude().is_bound()) field_altitude = other_value.altitude(); else field_altitude.clean_up(); } return *this; } boolean AltitudeAndDirection::operator==(const AltitudeAndDirection& other_value) const { return field_directionOfAltitude==other_value.field_directionOfAltitude && field_altitude==other_value.field_altitude; } boolean AltitudeAndDirection::is_bound() const { return (field_directionOfAltitude.is_bound()) || (field_altitude.is_bound()); } boolean AltitudeAndDirection::is_value() const { return field_directionOfAltitude.is_value() && field_altitude.is_value(); } void AltitudeAndDirection::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ directionOfAltitude := "); field_directionOfAltitude.log(); TTCN_Logger::log_event_str(", altitude := "); field_altitude.log(); TTCN_Logger::log_event_str(" }"); } void AltitudeAndDirection::set_implicit_omit() { if (directionOfAltitude().is_bound()) directionOfAltitude().set_implicit_omit(); if (altitude().is_bound()) altitude().set_implicit_omit(); } void AltitudeAndDirection::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) directionOfAltitude().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) altitude().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(), "directionOfAltitude")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { directionOfAltitude().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "altitude")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { altitude().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.AltitudeAndDirection: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.AltitudeAndDirection"); } } void AltitudeAndDirection::encode_text(Text_Buf& text_buf) const { field_directionOfAltitude.encode_text(text_buf); field_altitude.encode_text(text_buf); } void AltitudeAndDirection::decode_text(Text_Buf& text_buf) { field_directionOfAltitude.decode_text(text_buf); field_altitude.decode_text(text_buf); } void AltitudeAndDirection::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 AltitudeAndDirection::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* AltitudeAndDirection::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("directionOfAltitude': "); new_tlv->add_TLV(field_directionOfAltitude.BER_encode_TLV(AltitudeAndDirection_directionOfAltitude_descr_, p_coding)); ec_1.set_msg("altitude': "); new_tlv->add_TLV(field_altitude.BER_encode_TLV(AltitudeAndDirection_altitude_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean AltitudeAndDirection::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 '@HNBAP-IEs.AltitudeAndDirection' 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("directionOfAltitude': "); 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_directionOfAltitude.BER_decode_TLV(AltitudeAndDirection_directionOfAltitude_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("altitude': "); 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_altitude.BER_decode_TLV(AltitudeAndDirection_altitude_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 AltitudeAndDirection::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 @HNBAP-IEs.AltitudeAndDirection."); 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, "directionOfAltitude"); enc_len += field_directionOfAltitude.JSON_encode(AltitudeAndDirection_directionOfAltitude_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "altitude"); enc_len += field_altitude.JSON_encode(AltitudeAndDirection_altitude_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int AltitudeAndDirection::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 directionOfAltitude_found = FALSE; boolean altitude_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 (19 == name_len && 0 == strncmp(fld_name, "directionOfAltitude", name_len)) { directionOfAltitude_found = TRUE; int ret_val = field_directionOfAltitude.JSON_decode(AltitudeAndDirection_directionOfAltitude_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, "directionOfAltitude"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (8 == name_len && 0 == strncmp(fld_name, "altitude", name_len)) { altitude_found = TRUE; int ret_val = field_altitude.JSON_decode(AltitudeAndDirection_altitude_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, "altitude"); } 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 (!directionOfAltitude_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "directionOfAltitude"); return JSON_ERROR_FATAL; } if (!altitude_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "altitude"); return JSON_ERROR_FATAL; } return (int)dec_len; } int AltitudeAndDirection::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; p_buf.put_c(c); field_directionOfAltitude.OER_encode(AltitudeAndDirection_directionOfAltitude_descr_, p_buf); field_altitude.OER_encode(AltitudeAndDirection_altitude_descr_, p_buf); return 0; } int AltitudeAndDirection::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_directionOfAltitude.OER_decode(AltitudeAndDirection_directionOfAltitude_descr_, p_buf, p_oer); field_altitude.OER_decode(AltitudeAndDirection_altitude_descr_, p_buf, p_oer); 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 AltitudeAndDirection::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); field_directionOfAltitude.PER_encode(AltitudeAndDirection_directionOfAltitude_descr_, p_buf, p_options); field_altitude.PER_encode(AltitudeAndDirection_altitude_descr_, p_buf, p_options); } void AltitudeAndDirection::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(); field_directionOfAltitude.PER_decode(AltitudeAndDirection_directionOfAltitude_descr_, p_buf, p_options); field_altitude.PER_decode(AltitudeAndDirection_altitude_descr_, p_buf, p_options); 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 AltitudeAndDirection_template::single_value_struct { AltitudeAndDirection_directionOfAltitude_template field_directionOfAltitude; INTEGER_template field_altitude; }; void AltitudeAndDirection_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_directionOfAltitude = ANY_VALUE; single_value->field_altitude = ANY_VALUE; } } } void AltitudeAndDirection_template::copy_value(const AltitudeAndDirection& other_value) { single_value = new single_value_struct; if (other_value.directionOfAltitude().is_bound()) { single_value->field_directionOfAltitude = other_value.directionOfAltitude(); } else { single_value->field_directionOfAltitude.clean_up(); } if (other_value.altitude().is_bound()) { single_value->field_altitude = other_value.altitude(); } else { single_value->field_altitude.clean_up(); } set_selection(SPECIFIC_VALUE); } void AltitudeAndDirection_template::copy_template(const AltitudeAndDirection_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.directionOfAltitude().get_selection()) { single_value->field_directionOfAltitude = other_value.directionOfAltitude(); } else { single_value->field_directionOfAltitude.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.altitude().get_selection()) { single_value->field_altitude = other_value.altitude(); } else { single_value->field_altitude.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 AltitudeAndDirection_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 AltitudeAndDirection_template(*other_value.implication_.precondition); implication_.implied_template = new AltitudeAndDirection_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 @HNBAP-IEs.AltitudeAndDirection."); break; } set_selection(other_value); } AltitudeAndDirection_template::AltitudeAndDirection_template() { } AltitudeAndDirection_template::AltitudeAndDirection_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AltitudeAndDirection_template::AltitudeAndDirection_template(const AltitudeAndDirection& other_value) { copy_value(other_value); } AltitudeAndDirection_template::AltitudeAndDirection_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AltitudeAndDirection&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.AltitudeAndDirection from an unbound optional field."); } } AltitudeAndDirection_template::AltitudeAndDirection_template(AltitudeAndDirection_template* p_precondition, AltitudeAndDirection_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AltitudeAndDirection_template::AltitudeAndDirection_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; } AltitudeAndDirection_template::AltitudeAndDirection_template(const AltitudeAndDirection_template& other_value) : Base_Template() { copy_template(other_value); } AltitudeAndDirection_template::~AltitudeAndDirection_template() { clean_up(); } AltitudeAndDirection_template& AltitudeAndDirection_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AltitudeAndDirection_template& AltitudeAndDirection_template::operator=(const AltitudeAndDirection& other_value) { clean_up(); copy_value(other_value); return *this; } AltitudeAndDirection_template& AltitudeAndDirection_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AltitudeAndDirection&)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 @HNBAP-IEs.AltitudeAndDirection."); } return *this; } AltitudeAndDirection_template& AltitudeAndDirection_template::operator=(const AltitudeAndDirection_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AltitudeAndDirection_template::match(const AltitudeAndDirection& 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.directionOfAltitude().is_bound()) return FALSE; if(!single_value->field_directionOfAltitude.match(other_value.directionOfAltitude(), legacy))return FALSE; if(!other_value.altitude().is_bound()) return FALSE; if(!single_value->field_altitude.match(other_value.altitude(), 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 @HNBAP-IEs.AltitudeAndDirection."); } return FALSE; } boolean AltitudeAndDirection_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_directionOfAltitude.is_bound() || single_value->field_altitude.is_bound(); } boolean AltitudeAndDirection_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_directionOfAltitude.is_value() && single_value->field_altitude.is_value(); } void AltitudeAndDirection_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; } AltitudeAndDirection AltitudeAndDirection_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 @HNBAP-IEs.AltitudeAndDirection."); AltitudeAndDirection ret_val; if (single_value->field_directionOfAltitude.is_bound()) { ret_val.directionOfAltitude() = single_value->field_directionOfAltitude.valueof(); } if (single_value->field_altitude.is_bound()) { ret_val.altitude() = single_value->field_altitude.valueof(); } return ret_val; } void AltitudeAndDirection_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 @HNBAP-IEs.AltitudeAndDirection."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AltitudeAndDirection_template[list_length]; } AltitudeAndDirection_template& AltitudeAndDirection_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 @HNBAP-IEs.AltitudeAndDirection."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.AltitudeAndDirection."); return value_list.list_value[list_index]; } AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_template::directionOfAltitude() { set_specific(); return single_value->field_directionOfAltitude; } const AltitudeAndDirection_directionOfAltitude_template& AltitudeAndDirection_template::directionOfAltitude() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field directionOfAltitude of a non-specific template of type @HNBAP-IEs.AltitudeAndDirection."); return single_value->field_directionOfAltitude; } INTEGER_template& AltitudeAndDirection_template::altitude() { set_specific(); return single_value->field_altitude; } const INTEGER_template& AltitudeAndDirection_template::altitude() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field altitude of a non-specific template of type @HNBAP-IEs.AltitudeAndDirection."); return single_value->field_altitude; } int AltitudeAndDirection_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.AltitudeAndDirection 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 @HNBAP-IEs.AltitudeAndDirection 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 @HNBAP-IEs.AltitudeAndDirection containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.AltitudeAndDirection containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.AltitudeAndDirection containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.AltitudeAndDirection containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.AltitudeAndDirection containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.AltitudeAndDirection containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.AltitudeAndDirection containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.AltitudeAndDirection."); } return 0; } void AltitudeAndDirection_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ directionOfAltitude := "); single_value->field_directionOfAltitude.log(); TTCN_Logger::log_event_str(", altitude := "); single_value->field_altitude.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 AltitudeAndDirection_template::log_match(const AltitudeAndDirection& 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_directionOfAltitude.match(match_value.directionOfAltitude(), legacy)){ TTCN_Logger::log_logmatch_info(".directionOfAltitude"); single_value->field_directionOfAltitude.log_match(match_value.directionOfAltitude(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_altitude.match(match_value.altitude(), legacy)){ TTCN_Logger::log_logmatch_info(".altitude"); single_value->field_altitude.log_match(match_value.altitude(), 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("{ directionOfAltitude := "); single_value->field_directionOfAltitude.log_match(match_value.directionOfAltitude(), legacy); TTCN_Logger::log_event_str(", altitude := "); single_value->field_altitude.log_match(match_value.altitude(), 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 AltitudeAndDirection_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (directionOfAltitude().is_bound()) directionOfAltitude().set_implicit_omit(); if (altitude().is_bound()) altitude().set_implicit_omit(); } void AltitudeAndDirection_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_directionOfAltitude.encode_text(text_buf); single_value->field_altitude.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 @HNBAP-IEs.AltitudeAndDirection."); } } void AltitudeAndDirection_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_directionOfAltitude.decode_text(text_buf); single_value->field_altitude.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 AltitudeAndDirection_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 @HNBAP-IEs.AltitudeAndDirection."); } } void AltitudeAndDirection_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: { AltitudeAndDirection_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) directionOfAltitude().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) altitude().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(), "directionOfAltitude")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { directionOfAltitude().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "altitude")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { altitude().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.AltitudeAndDirection: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AltitudeAndDirection_template* precondition = new AltitudeAndDirection_template; precondition->set_param(*param.get_elem(0)); AltitudeAndDirection_template* implied_template = new AltitudeAndDirection_template; implied_template->set_param(*param.get_elem(1)); *this = AltitudeAndDirection_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.AltitudeAndDirection"); } is_ifpresent = param.get_ifpresent(); } void AltitudeAndDirection_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_directionOfAltitude.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.AltitudeAndDirection"); single_value->field_altitude.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.AltitudeAndDirection"); 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 : "@HNBAP-IEs.AltitudeAndDirection"); } boolean AltitudeAndDirection_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AltitudeAndDirection_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 @HNBAP-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 @HNBAP-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 @HNBAP-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 '@HNBAP-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 @HNBAP-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 '@HNBAP-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 '@HNBAP-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 '@HNBAP-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 '@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.Cause."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.Cause."); if (single_value.union_selection != Cause::ALT_radioNetwork) TTCN_error("Accessing non-selected field radioNetwork in a template of union type @HNBAP-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 @HNBAP-IEs.Cause."); if (single_value.union_selection != Cause::ALT_transport) TTCN_error("Accessing non-selected field transport in a template of union type @HNBAP-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 @HNBAP-IEs.Cause."); if (single_value.union_selection != Cause::ALT_protocol) TTCN_error("Accessing non-selected field protocol in a template of union type @HNBAP-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 @HNBAP-IEs.Cause."); if (single_value.union_selection != Cause::ALT_misc) TTCN_error("Accessing non-selected field misc in a template of union type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 `@HNBAP-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 `@HNBAP-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", "@HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-IEs.Cause"); return; case Cause::ALT_transport: single_value.field_transport->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.Cause"); return; case Cause::ALT_protocol: single_value.field_protocol->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.Cause"); return; case Cause::ALT_misc: single_value.field_misc->check_restriction(t_res, t_name ? t_name : "@HNBAP-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 @HNBAP-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 : "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseRadioNetwork."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseRadioNetwork."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CauseRadioNetwork."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseRadioNetwork."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CauseRadioNetwork."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseRadioNetwork."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.CauseRadioNetwork."); return enum_value > other_value.enum_value; } const char *CauseRadioNetwork::enum_to_str(enum_type enum_par) { switch (enum_par) { case overload: return "overload"; case unauthorised__Location: return "unauthorised_Location"; case unauthorised__HNB: return "unauthorised_HNB"; case hNB__parameter__mismatch: return "hNB_parameter_mismatch"; case invalid__UE__identity: return "invalid_UE_identity"; case uE__not__allowed__on__this__HNB: return "uE_not_allowed_on_this_HNB"; case uE__unauthorised: return "uE_unauthorised"; case connection__with__UE__lost: return "connection_with_UE_lost"; case ue__RRC__telease: return "ue_RRC_telease"; case hNB__not__registered: return "hNB_not_registered"; case unspecified: return "unspecified"; case normal: return "normal"; case uE__relocated: return "uE_relocated"; case ue__registered__in__another__HNB: return "ue_registered_in_another_HNB"; 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, "overload")) return overload; if (!strcmp(str_par, "unauthorised_Location")) return unauthorised__Location; if (!strcmp(str_par, "unauthorised_HNB")) return unauthorised__HNB; if (!strcmp(str_par, "hNB_parameter_mismatch")) return hNB__parameter__mismatch; if (!strcmp(str_par, "invalid_UE_identity")) return invalid__UE__identity; if (!strcmp(str_par, "uE_not_allowed_on_this_HNB")) return uE__not__allowed__on__this__HNB; if (!strcmp(str_par, "uE_unauthorised")) return uE__unauthorised; if (!strcmp(str_par, "connection_with_UE_lost")) return connection__with__UE__lost; if (!strcmp(str_par, "ue_RRC_telease")) return ue__RRC__telease; if (!strcmp(str_par, "hNB_not_registered")) return hNB__not__registered; if (!strcmp(str_par, "unspecified")) return unspecified; if (!strcmp(str_par, "normal")) return normal; if (!strcmp(str_par, "uE_relocated")) return uE__relocated; if (!strcmp(str_par, "ue_registered_in_another_HNB")) return ue__registered__in__another__HNB; } return UNKNOWN_VALUE; } boolean CauseRadioNetwork::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11: case 12: case 13: 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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 = 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 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 @HNBAP-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 overload: enc_val = 0; ext_bit = FALSE; break; case unauthorised__Location: enc_val = 1; ext_bit = FALSE; break; case unauthorised__HNB: enc_val = 2; ext_bit = FALSE; break; case hNB__parameter__mismatch: enc_val = 3; ext_bit = FALSE; break; case invalid__UE__identity: enc_val = 4; ext_bit = FALSE; break; case uE__not__allowed__on__this__HNB: enc_val = 5; ext_bit = FALSE; break; case uE__unauthorised: enc_val = 6; ext_bit = FALSE; break; case connection__with__UE__lost: enc_val = 7; ext_bit = FALSE; break; case ue__RRC__telease: enc_val = 8; ext_bit = FALSE; break; case hNB__not__registered: enc_val = 9; ext_bit = FALSE; break; case unspecified: enc_val = 10; ext_bit = FALSE; break; case normal: enc_val = 11; ext_bit = FALSE; break; case uE__relocated: enc_val = 12; ext_bit = FALSE; break; case ue__registered__in__another__HNB: enc_val = 13; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @HNBAP-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, 4); } 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, 4, 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 = overload; break; case 1: enum_value = unauthorised__Location; break; case 2: enum_value = unauthorised__HNB; break; case 3: enum_value = hNB__parameter__mismatch; break; case 4: enum_value = invalid__UE__identity; break; case 5: enum_value = uE__not__allowed__on__this__HNB; break; case 6: enum_value = uE__unauthorised; break; case 7: enum_value = connection__with__UE__lost; break; case 8: enum_value = ue__RRC__telease; break; case 9: enum_value = hNB__not__registered; break; case 10: enum_value = unspecified; break; case 11: enum_value = normal; break; case 12: enum_value = uE__relocated; break; case 13: enum_value = ue__registered__in__another__HNB; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseRadioNetwork."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseTransport."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseTransport."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CauseTransport."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseTransport."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CauseTransport."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseTransport."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseTransport."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseProtocol."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseProtocol."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CauseProtocol."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseProtocol."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CauseProtocol."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseProtocol."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseProtocol."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseMisc."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseMisc."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CauseMisc."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseMisc."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CauseMisc."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseMisc."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CauseMisc."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-IEs.CauseMisc"); } CriticalityDiagnostics::CriticalityDiagnostics() { } CriticalityDiagnostics::CriticalityDiagnostics(const OPTIONAL< INTEGER >& par_procedureCode, const OPTIONAL< HNBAP__CommonDataTypes::TriggeringMessage >& par_triggeringMessage, const OPTIONAL< HNBAP__CommonDataTypes::Criticality >& par_procedureCriticality, const OPTIONAL< CriticalityDiagnostics__IE__List >& par_iEsCriticalityDiagnostics, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-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 '@HNBAP-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 @HNBAP-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; HNBAP__CommonDataTypes::TriggeringMessage_template field_triggeringMessage; HNBAP__CommonDataTypes::Criticality_template field_procedureCriticality; CriticalityDiagnostics__IE__List_template field_iEsCriticalityDiagnostics; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-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 HNBAP__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 HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics."); return single_value->field_procedureCode; } HNBAP__CommonDataTypes::TriggeringMessage_template& CriticalityDiagnostics_template::triggeringMessage() { set_specific(); return single_value->field_triggeringMessage; } const HNBAP__CommonDataTypes::TriggeringMessage_template& CriticalityDiagnostics_template::triggeringMessage() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field triggeringMessage of a non-specific template of type @HNBAP-IEs.CriticalityDiagnostics."); return single_value->field_triggeringMessage; } HNBAP__CommonDataTypes::Criticality_template& CriticalityDiagnostics_template::procedureCriticality() { set_specific(); return single_value->field_procedureCriticality; } const HNBAP__CommonDataTypes::Criticality_template& CriticalityDiagnostics_template::procedureCriticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field procedureCriticality of a non-specific template of type @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics."); return single_value->field_iEsCriticalityDiagnostics; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& CriticalityDiagnostics_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-IEs.CriticalityDiagnostics"); single_value->field_triggeringMessage.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CriticalityDiagnostics"); single_value->field_procedureCriticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CriticalityDiagnostics"); single_value->field_iEsCriticalityDiagnostics.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CriticalityDiagnostics"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-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 : "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.CriticalityDiagnostics-IE-List."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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", "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.CriticalityDiagnostics-IE-List.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-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 : "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.TypeOfError."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.TypeOfError."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.TypeOfError."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.TypeOfError."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.TypeOfError."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.TypeOfError."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.TypeOfError."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-IEs.TypeOfError"); } CriticalityDiagnostics__IE__List_0::CriticalityDiagnostics__IE__List_0() { } CriticalityDiagnostics__IE__List_0::CriticalityDiagnostics__IE__List_0(const HNBAP__CommonDataTypes::Criticality& par_iECriticality, const INTEGER& par_iE__ID, const TypeOfError& par_typeOfError, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-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 '@HNBAP-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 @HNBAP-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 { HNBAP__CommonDataTypes::Criticality_template field_iECriticality; INTEGER_template field_iE__ID; TypeOfError_template field_typeOfError; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); return value_list.list_value[list_index]; } HNBAP__CommonDataTypes::Criticality_template& CriticalityDiagnostics__IE__List_0_template::iECriticality() { set_specific(); return single_value->field_iECriticality; } const HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE."); return single_value->field_typeOfError; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& CriticalityDiagnostics__IE__List_0_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); single_value->field_iE__ID.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); single_value->field_typeOfError.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CriticalityDiagnostics-IE-List.SEQUENCE"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-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 : "@HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_idx(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.CSG-Capability."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.CSG-Capability comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean CSG__Capability::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 @HNBAP-IEs.CSG-Capability."); return enum_value > other_value; } boolean CSG__Capability::operator>(const CSG__Capability& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.CSG-Capability."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.CSG-Capability."); return enum_value > other_value.enum_value; } const char *CSG__Capability::enum_to_str(enum_type enum_par) { switch (enum_par) { case csg__capable: return "csg_capable"; case not__csg__capable: return "not_csg_capable"; default: return ""; } } CSG__Capability::enum_type CSG__Capability::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, "csg_capable")) return csg__capable; if (!strcmp(str_par, "not_csg_capable")) return not__csg__capable; } return UNKNOWN_VALUE; } boolean CSG__Capability::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int CSG__Capability::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 @HNBAP-IEs.CSG-Capability.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int CSG__Capability::enum2int(const CSG__Capability& 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 @HNBAP-IEs.CSG-Capability.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void CSG__Capability::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HNBAP-IEs.CSG-Capability.", int_val); enum_value = (enum_type)int_val; } CSG__Capability::operator CSG__Capability::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HNBAP-IEs.CSG-Capability."); return enum_value; } void CSG__Capability::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 CSG__Capability::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", "@HNBAP-IEs.CSG-Capability"); 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 @HNBAP-IEs.CSG-Capability."); } } void CSG__Capability::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HNBAP-IEs.CSG-Capability."); text_buf.push_int(enum_value); } void CSG__Capability::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 @HNBAP-IEs.CSG-Capability.", enum_value); } void CSG__Capability::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 CSG__Capability::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* CSG__Capability::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 CSG__Capability::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 @HNBAP-IEs.CSG-Capability: "); 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 CSG__Capability::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 @HNBAP-IEs.CSG-Capability."); 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 CSG__Capability::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 = csg__capable; } 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 CSG__Capability::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 @HNBAP-IEs.CSG-Capability."); 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 CSG__Capability::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 CSG__Capability::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 csg__capable: enc_val = 0; ext_bit = FALSE; break; case not__csg__capable: 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 @HNBAP-IEs.CSG-Capability."); } 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 CSG__Capability::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 = csg__capable; break; case 1: enum_value = not__csg__capable; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @HNBAP-IEs.CSG-Capability.", dec_int); break; } } void CSG__Capability_template::copy_template(const CSG__Capability_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 CSG__Capability_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 CSG__Capability_template(*other_value.implication_.precondition); implication_.implied_template = new CSG__Capability_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 @HNBAP-IEs.CSG-Capability."); } } CSG__Capability_template::CSG__Capability_template() { } CSG__Capability_template::CSG__Capability_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CSG__Capability_template::CSG__Capability_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!CSG__Capability::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HNBAP-IEs.CSG-Capability with unknown numeric value %d.", other_value); single_value = (CSG__Capability::enum_type)other_value; } CSG__Capability_template::CSG__Capability_template(CSG__Capability::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } CSG__Capability_template::CSG__Capability_template(const CSG__Capability& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == CSG__Capability::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HNBAP-IEs.CSG-Capability."); single_value = other_value.enum_value; } CSG__Capability_template::CSG__Capability_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CSG__Capability::enum_type)(const CSG__Capability&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @HNBAP-IEs.CSG-Capability from an unbound optional field."); } } CSG__Capability_template::CSG__Capability_template(CSG__Capability_template* p_precondition, CSG__Capability_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CSG__Capability_template::CSG__Capability_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; } CSG__Capability_template::CSG__Capability_template(const CSG__Capability_template& other_value) : Base_Template() { copy_template(other_value); } CSG__Capability_template::~CSG__Capability_template() { clean_up(); } boolean CSG__Capability_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean CSG__Capability_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != CSG__Capability::UNBOUND_VALUE; } void CSG__Capability_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; } CSG__Capability_template& CSG__Capability_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CSG__Capability_template& CSG__Capability_template::operator=(int other_value) { if (!CSG__Capability::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HNBAP-IEs.CSG-Capability.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (CSG__Capability::enum_type)other_value; return *this; } CSG__Capability_template& CSG__Capability_template::operator=(CSG__Capability::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } CSG__Capability_template& CSG__Capability_template::operator=(const CSG__Capability& other_value) { if (other_value.enum_value == CSG__Capability::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.CSG-Capability to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } CSG__Capability_template& CSG__Capability_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (CSG__Capability::enum_type)(const CSG__Capability&)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 @HNBAP-IEs.CSG-Capability."); } return *this; } CSG__Capability_template& CSG__Capability_template::operator=(const CSG__Capability_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CSG__Capability_template::match(CSG__Capability::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 @HNBAP-IEs.CSG-Capability."); } return FALSE; } boolean CSG__Capability_template::match(const CSG__Capability& other_value, boolean) const { if (other_value.enum_value == CSG__Capability::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HNBAP-IEs.CSG-Capability with an unbound value."); return match(other_value.enum_value); } CSG__Capability::enum_type CSG__Capability_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 @HNBAP-IEs.CSG-Capability."); return single_value; } void CSG__Capability_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 CSG__Capability_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @HNBAP-IEs.CSG-Capability."); } } CSG__Capability_template& CSG__Capability_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 @HNBAP-IEs.CSG-Capability."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-IEs.CSG-Capability."); return value_list.list_value[list_index]; } void CSG__Capability_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(CSG__Capability::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 CSG__Capability_template::log_match(const CSG__Capability& 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 CSG__Capability_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 @HNBAP-IEs.CSG-Capability."); } } void CSG__Capability_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (CSG__Capability::enum_type)text_buf.pull_int().get_val(); if (!CSG__Capability::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HNBAP-IEs.CSG-Capability.", 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 CSG__Capability_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 @HNBAP-IEs.CSG-Capability."); } } boolean CSG__Capability_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CSG__Capability_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: { CSG__Capability_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: { CSG__Capability::enum_type enum_val = CSG__Capability::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!CSG__Capability::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @HNBAP-IEs.CSG-Capability."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { CSG__Capability_template* precondition = new CSG__Capability_template; precondition->set_param(*m_p->get_elem(0)); CSG__Capability_template* implied_template = new CSG__Capability_template; implied_template->set_param(*m_p->get_elem(1)); *this = CSG__Capability_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@HNBAP-IEs.CSG-Capability"); } is_ifpresent = param.get_ifpresent(); } void CSG__Capability_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 : "@HNBAP-IEs.CSG-Capability"); } 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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CSGMembershipStatus."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CSGMembershipStatus."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CSGMembershipStatus."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CSGMembershipStatus."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-IEs.CSGMembershipStatus."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CSGMembershipStatus."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CSGMembershipStatus."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-IEs.CSGMembershipStatus"); } CGI::CGI() { } CGI::CGI(const OCTETSTRING& par_pLMNidentity, const OCTETSTRING& par_lAC, const OCTETSTRING& par_cI, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 >& par_iE__Extensions) : field_pLMNidentity(par_pLMNidentity), field_lAC(par_lAC), field_cI(par_cI), field_iE__Extensions(par_iE__Extensions) { } CGI::CGI(const CGI& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.CGI."); if (other_value.pLMNidentity().is_bound()) field_pLMNidentity = other_value.pLMNidentity(); else field_pLMNidentity.clean_up(); if (other_value.lAC().is_bound()) field_lAC = other_value.lAC(); else field_lAC.clean_up(); if (other_value.cI().is_bound()) field_cI = other_value.cI(); else field_cI.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void CGI::clean_up() { field_pLMNidentity.clean_up(); field_lAC.clean_up(); field_cI.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* CGI::get_descriptor() const { return &CGI_descr_; } CGI& CGI::operator=(const CGI& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.CGI."); if (other_value.pLMNidentity().is_bound()) field_pLMNidentity = other_value.pLMNidentity(); else field_pLMNidentity.clean_up(); if (other_value.lAC().is_bound()) field_lAC = other_value.lAC(); else field_lAC.clean_up(); if (other_value.cI().is_bound()) field_cI = other_value.cI(); else field_cI.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 CGI::operator==(const CGI& other_value) const { return field_pLMNidentity==other_value.field_pLMNidentity && field_lAC==other_value.field_lAC && field_cI==other_value.field_cI && field_iE__Extensions==other_value.field_iE__Extensions; } boolean CGI::is_bound() const { return (field_pLMNidentity.is_bound()) || (field_lAC.is_bound()) || (field_cI.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean CGI::is_value() const { return field_pLMNidentity.is_value() && field_lAC.is_value() && field_cI.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int CGI::size_of() const { int ret_val = 3; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void CGI::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ pLMNidentity := "); field_pLMNidentity.log(); TTCN_Logger::log_event_str(", lAC := "); field_lAC.log(); TTCN_Logger::log_event_str(", cI := "); field_cI.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void CGI::set_implicit_omit() { if (pLMNidentity().is_bound()) pLMNidentity().set_implicit_omit(); if (lAC().is_bound()) lAC().set_implicit_omit(); if (cI().is_bound()) cI().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void CGI::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) pLMNidentity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lAC().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cI().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(), "pLMNidentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pLMNidentity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cI().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 @HNBAP-IEs.CGI: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.CGI"); } } void CGI::encode_text(Text_Buf& text_buf) const { field_pLMNidentity.encode_text(text_buf); field_lAC.encode_text(text_buf); field_cI.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void CGI::decode_text(Text_Buf& text_buf) { field_pLMNidentity.decode_text(text_buf); field_lAC.decode_text(text_buf); field_cI.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void CGI::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 CGI::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* CGI::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("pLMNidentity': "); new_tlv->add_TLV(field_pLMNidentity.BER_encode_TLV(CGI_pLMNidentity_descr_, p_coding)); ec_1.set_msg("lAC': "); new_tlv->add_TLV(field_lAC.BER_encode_TLV(CGI_lAC_descr_, p_coding)); ec_1.set_msg("cI': "); new_tlv->add_TLV(field_cI.BER_encode_TLV(CGI_cI_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(CGI_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean CGI::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 '@HNBAP-IEs.CGI' 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("pLMNidentity': "); 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_pLMNidentity.BER_decode_TLV(CGI_pLMNidentity_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("lAC': "); 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_lAC.BER_decode_TLV(CGI_lAC_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("cI': "); 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_cI.BER_decode_TLV(CGI_cI_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(CGI_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 CGI::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 @HNBAP-IEs.CGI."); 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, "pLMNidentity"); enc_len += field_pLMNidentity.JSON_encode(CGI_pLMNidentity_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "lAC"); enc_len += field_lAC.JSON_encode(CGI_lAC_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "cI"); enc_len += field_cI.JSON_encode(CGI_cI_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(CGI_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int CGI::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 pLMNidentity_found = FALSE; boolean lAC_found = FALSE; boolean cI_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 (12 == name_len && 0 == strncmp(fld_name, "pLMNidentity", name_len)) { pLMNidentity_found = TRUE; int ret_val = field_pLMNidentity.JSON_decode(CGI_pLMNidentity_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, "pLMNidentity"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (3 == name_len && 0 == strncmp(fld_name, "lAC", name_len)) { lAC_found = TRUE; int ret_val = field_lAC.JSON_decode(CGI_lAC_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, 3, "lAC"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (2 == name_len && 0 == strncmp(fld_name, "cI", name_len)) { cI_found = TRUE; int ret_val = field_cI.JSON_decode(CGI_cI_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, "cI"); } 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(CGI_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 (!pLMNidentity_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "pLMNidentity"); return JSON_ERROR_FATAL; } if (!lAC_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "lAC"); return JSON_ERROR_FATAL; } if (!cI_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "cI"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int CGI::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 |= 128; } p_buf.put_c(c); field_pLMNidentity.OER_encode(CGI_pLMNidentity_descr_, p_buf); field_lAC.OER_encode(CGI_lAC_descr_, p_buf); field_cI.OER_encode(CGI_cI_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(CGI_iE__Extensions_descr_, p_buf); return 0; } int CGI::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); field_pLMNidentity.OER_decode(CGI_pLMNidentity_descr_, p_buf, p_oer); field_lAC.OER_decode(CGI_lAC_descr_, p_buf, p_oer); field_cI.OER_decode(CGI_cI_descr_, p_buf, p_oer); if (uc[0] & 128) field_iE__Extensions.OER_decode(CGI_iE__Extensions_descr_, p_buf, p_oer); else field_iE__Extensions = OMIT_VALUE; return 0; } void CGI::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 field_iE__Extensions_present = field_iE__Extensions.is_present(); p_buf.PER_put_bit(field_iE__Extensions_present); field_pLMNidentity.PER_encode(CGI_pLMNidentity_descr_, p_buf, p_options); field_lAC.PER_encode(CGI_lAC_descr_, p_buf, p_options); field_cI.PER_encode(CGI_cI_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(CGI_iE__Extensions_descr_, p_buf, p_options); } void CGI::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); boolean field_iE__Extensions_present = p_buf.PER_get_bit(); field_pLMNidentity.PER_decode(CGI_pLMNidentity_descr_, p_buf, p_options); field_lAC.PER_decode(CGI_lAC_descr_, p_buf, p_options); field_cI.PER_decode(CGI_cI_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(CGI_iE__Extensions_descr_, p_buf, p_options); else field_iE__Extensions = OMIT_VALUE; } struct CGI_template::single_value_struct { OCTETSTRING_template field_pLMNidentity; OCTETSTRING_template field_lAC; OCTETSTRING_template field_cI; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template field_iE__Extensions; }; void CGI_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_pLMNidentity = ANY_VALUE; single_value->field_lAC = ANY_VALUE; single_value->field_cI = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void CGI_template::copy_value(const CGI& other_value) { single_value = new single_value_struct; if (other_value.pLMNidentity().is_bound()) { single_value->field_pLMNidentity = other_value.pLMNidentity(); } else { single_value->field_pLMNidentity.clean_up(); } if (other_value.lAC().is_bound()) { single_value->field_lAC = other_value.lAC(); } else { single_value->field_lAC.clean_up(); } if (other_value.cI().is_bound()) { single_value->field_cI = other_value.cI(); } else { single_value->field_cI.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 CGI_template::copy_template(const CGI_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pLMNidentity().get_selection()) { single_value->field_pLMNidentity = other_value.pLMNidentity(); } else { single_value->field_pLMNidentity.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lAC().get_selection()) { single_value->field_lAC = other_value.lAC(); } else { single_value->field_lAC.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cI().get_selection()) { single_value->field_cI = other_value.cI(); } else { single_value->field_cI.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 CGI_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 CGI_template(*other_value.implication_.precondition); implication_.implied_template = new CGI_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 @HNBAP-IEs.CGI."); break; } set_selection(other_value); } CGI_template::CGI_template() { } CGI_template::CGI_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } CGI_template::CGI_template(const CGI& other_value) { copy_value(other_value); } CGI_template::CGI_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const CGI&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.CGI from an unbound optional field."); } } CGI_template::CGI_template(CGI_template* p_precondition, CGI_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } CGI_template::CGI_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; } CGI_template::CGI_template(const CGI_template& other_value) : Base_Template() { copy_template(other_value); } CGI_template::~CGI_template() { clean_up(); } CGI_template& CGI_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } CGI_template& CGI_template::operator=(const CGI& other_value) { clean_up(); copy_value(other_value); return *this; } CGI_template& CGI_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const CGI&)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 @HNBAP-IEs.CGI."); } return *this; } CGI_template& CGI_template::operator=(const CGI_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean CGI_template::match(const CGI& 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.pLMNidentity().is_bound()) return FALSE; if(!single_value->field_pLMNidentity.match(other_value.pLMNidentity(), legacy))return FALSE; if(!other_value.lAC().is_bound()) return FALSE; if(!single_value->field_lAC.match(other_value.lAC(), legacy))return FALSE; if(!other_value.cI().is_bound()) return FALSE; if(!single_value->field_cI.match(other_value.cI(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3&)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 @HNBAP-IEs.CGI."); } return FALSE; } boolean CGI_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_pLMNidentity.is_bound() || single_value->field_lAC.is_bound() || single_value->field_cI.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean CGI_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_pLMNidentity.is_value() && single_value->field_lAC.is_value() && single_value->field_cI.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void CGI_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; } CGI CGI_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 @HNBAP-IEs.CGI."); CGI ret_val; if (single_value->field_pLMNidentity.is_bound()) { ret_val.pLMNidentity() = single_value->field_pLMNidentity.valueof(); } if (single_value->field_lAC.is_bound()) { ret_val.lAC() = single_value->field_lAC.valueof(); } if (single_value->field_cI.is_bound()) { ret_val.cI() = single_value->field_cI.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 CGI_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 @HNBAP-IEs.CGI."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new CGI_template[list_length]; } CGI_template& CGI_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 @HNBAP-IEs.CGI."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.CGI."); return value_list.list_value[list_index]; } OCTETSTRING_template& CGI_template::pLMNidentity() { set_specific(); return single_value->field_pLMNidentity; } const OCTETSTRING_template& CGI_template::pLMNidentity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pLMNidentity of a non-specific template of type @HNBAP-IEs.CGI."); return single_value->field_pLMNidentity; } OCTETSTRING_template& CGI_template::lAC() { set_specific(); return single_value->field_lAC; } const OCTETSTRING_template& CGI_template::lAC() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lAC of a non-specific template of type @HNBAP-IEs.CGI."); return single_value->field_lAC; } OCTETSTRING_template& CGI_template::cI() { set_specific(); return single_value->field_cI; } const OCTETSTRING_template& CGI_template::cI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cI of a non-specific template of type @HNBAP-IEs.CGI."); return single_value->field_cI; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& CGI_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& CGI_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.CGI."); return single_value->field_iE__Extensions; } int CGI_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CGI 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 @HNBAP-IEs.CGI 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 @HNBAP-IEs.CGI containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CGI containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CGI containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CGI containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CGI containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CGI containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.CGI containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.CGI."); } return 0; } void CGI_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pLMNidentity := "); single_value->field_pLMNidentity.log(); TTCN_Logger::log_event_str(", lAC := "); single_value->field_lAC.log(); TTCN_Logger::log_event_str(", cI := "); single_value->field_cI.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 CGI_template::log_match(const CGI& 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_pLMNidentity.match(match_value.pLMNidentity(), legacy)){ TTCN_Logger::log_logmatch_info(".pLMNidentity"); single_value->field_pLMNidentity.log_match(match_value.pLMNidentity(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lAC.match(match_value.lAC(), legacy)){ TTCN_Logger::log_logmatch_info(".lAC"); single_value->field_lAC.log_match(match_value.lAC(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cI.match(match_value.cI(), legacy)){ TTCN_Logger::log_logmatch_info(".cI"); single_value->field_cI.log_match(match_value.cI(), 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("{ pLMNidentity := "); single_value->field_pLMNidentity.log_match(match_value.pLMNidentity(), legacy); TTCN_Logger::log_event_str(", lAC := "); single_value->field_lAC.log_match(match_value.lAC(), legacy); TTCN_Logger::log_event_str(", cI := "); single_value->field_cI.log_match(match_value.cI(), 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 CGI_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (pLMNidentity().is_bound()) pLMNidentity().set_implicit_omit(); if (lAC().is_bound()) lAC().set_implicit_omit(); if (cI().is_bound()) cI().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void CGI_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pLMNidentity.encode_text(text_buf); single_value->field_lAC.encode_text(text_buf); single_value->field_cI.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 @HNBAP-IEs.CGI."); } } void CGI_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_pLMNidentity.decode_text(text_buf); single_value->field_lAC.decode_text(text_buf); single_value->field_cI.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 CGI_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 @HNBAP-IEs.CGI."); } } void CGI_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: { CGI_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) pLMNidentity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lAC().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) cI().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(), "pLMNidentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pLMNidentity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cI().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 @HNBAP-IEs.CGI: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { CGI_template* precondition = new CGI_template; precondition->set_param(*param.get_elem(0)); CGI_template* implied_template = new CGI_template; implied_template->set_param(*param.get_elem(1)); *this = CGI_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.CGI"); } is_ifpresent = param.get_ifpresent(); } void CGI_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_pLMNidentity.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CGI"); single_value->field_lAC.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CGI"); single_value->field_cI.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CGI"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.CGI"); 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 : "@HNBAP-IEs.CGI"); } boolean CGI_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean CGI_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.CN-DomainIndicator."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CN-DomainIndicator."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-IEs.CN-DomainIndicator."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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 @HNBAP-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", "@HNBAP-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 : "@HNBAP-IEs.CN-DomainIndicator"); } GeographicalCoordinates_latitudeSign::GeographicalCoordinates_latitudeSign() { enum_value = UNBOUND_VALUE; } GeographicalCoordinates_latitudeSign::GeographicalCoordinates_latitudeSign(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } GeographicalCoordinates_latitudeSign::GeographicalCoordinates_latitudeSign(enum_type other_value) { enum_value = other_value; } GeographicalCoordinates_latitudeSign::GeographicalCoordinates_latitudeSign(const GeographicalCoordinates_latitudeSign& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); enum_value = other_value.enum_value; } GeographicalCoordinates_latitudeSign& GeographicalCoordinates_latitudeSign::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign.", other_value); enum_value = (enum_type)other_value; return *this; } GeographicalCoordinates_latitudeSign& GeographicalCoordinates_latitudeSign::operator=(enum_type other_value) { enum_value = other_value; return *this; } GeographicalCoordinates_latitudeSign& GeographicalCoordinates_latitudeSign::operator=(const GeographicalCoordinates_latitudeSign& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); enum_value = other_value.enum_value; return *this; } boolean GeographicalCoordinates_latitudeSign::operator==(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return enum_value == other_value; } boolean GeographicalCoordinates_latitudeSign::operator==(const GeographicalCoordinates_latitudeSign& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return enum_value == other_value.enum_value; } boolean GeographicalCoordinates_latitudeSign::operator<(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return enum_value < other_value; } boolean GeographicalCoordinates_latitudeSign::operator<(const GeographicalCoordinates_latitudeSign& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return enum_value < other_value.enum_value; } boolean GeographicalCoordinates_latitudeSign::operator>(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return enum_value > other_value; } boolean GeographicalCoordinates_latitudeSign::operator>(const GeographicalCoordinates_latitudeSign& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return enum_value > other_value.enum_value; } const char *GeographicalCoordinates_latitudeSign::enum_to_str(enum_type enum_par) { switch (enum_par) { case north: return "north"; case south: return "south"; default: return ""; } } GeographicalCoordinates_latitudeSign::enum_type GeographicalCoordinates_latitudeSign::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, "north")) return north; if (!strcmp(str_par, "south")) return south; } return UNKNOWN_VALUE; } boolean GeographicalCoordinates_latitudeSign::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: return TRUE; default: return FALSE; } } int GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int GeographicalCoordinates_latitudeSign::enum2int(const GeographicalCoordinates_latitudeSign& 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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void GeographicalCoordinates_latitudeSign::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign.", int_val); enum_value = (enum_type)int_val; } GeographicalCoordinates_latitudeSign::operator GeographicalCoordinates_latitudeSign::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return enum_value; } void GeographicalCoordinates_latitudeSign::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 GeographicalCoordinates_latitudeSign::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", "@HNBAP-IEs.GeographicalCoordinates.latitudeSign"); 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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } } void GeographicalCoordinates_latitudeSign::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); text_buf.push_int(enum_value); } void GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign.", enum_value); } void GeographicalCoordinates_latitudeSign::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 GeographicalCoordinates_latitudeSign::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* GeographicalCoordinates_latitudeSign::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 GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign: "); 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 GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); 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 GeographicalCoordinates_latitudeSign::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 = north; } 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 GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); 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 GeographicalCoordinates_latitudeSign::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 GeographicalCoordinates_latitudeSign::PER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) const { INTEGER enc_val; switch (enum_value) { case north: enc_val = 0; break; case south: enc_val = 1; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } INTEGER::PER_encode_int(p_buf, enc_val, 1); } void GeographicalCoordinates_latitudeSign::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 = north; break; case 1: enum_value = south; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign.", dec_int); break; } } void GeographicalCoordinates_latitudeSign_template::copy_template(const GeographicalCoordinates_latitudeSign_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 GeographicalCoordinates_latitudeSign_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 GeographicalCoordinates_latitudeSign_template(*other_value.implication_.precondition); implication_.implied_template = new GeographicalCoordinates_latitudeSign_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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_template() { } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!GeographicalCoordinates_latitudeSign::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign with unknown numeric value %d.", other_value); single_value = (GeographicalCoordinates_latitudeSign::enum_type)other_value; } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_template(GeographicalCoordinates_latitudeSign::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_template(const GeographicalCoordinates_latitudeSign& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == GeographicalCoordinates_latitudeSign::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); single_value = other_value.enum_value; } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (GeographicalCoordinates_latitudeSign::enum_type)(const GeographicalCoordinates_latitudeSign&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign from an unbound optional field."); } } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_template(GeographicalCoordinates_latitudeSign_template* p_precondition, GeographicalCoordinates_latitudeSign_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_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; } GeographicalCoordinates_latitudeSign_template::GeographicalCoordinates_latitudeSign_template(const GeographicalCoordinates_latitudeSign_template& other_value) : Base_Template() { copy_template(other_value); } GeographicalCoordinates_latitudeSign_template::~GeographicalCoordinates_latitudeSign_template() { clean_up(); } boolean GeographicalCoordinates_latitudeSign_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean GeographicalCoordinates_latitudeSign_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != GeographicalCoordinates_latitudeSign::UNBOUND_VALUE; } void GeographicalCoordinates_latitudeSign_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; } GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_latitudeSign_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_latitudeSign_template::operator=(int other_value) { if (!GeographicalCoordinates_latitudeSign::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (GeographicalCoordinates_latitudeSign::enum_type)other_value; return *this; } GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_latitudeSign_template::operator=(GeographicalCoordinates_latitudeSign::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_latitudeSign_template::operator=(const GeographicalCoordinates_latitudeSign& other_value) { if (other_value.enum_value == GeographicalCoordinates_latitudeSign::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_latitudeSign_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (GeographicalCoordinates_latitudeSign::enum_type)(const GeographicalCoordinates_latitudeSign&)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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } return *this; } GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_latitudeSign_template::operator=(const GeographicalCoordinates_latitudeSign_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GeographicalCoordinates_latitudeSign_template::match(GeographicalCoordinates_latitudeSign::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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } return FALSE; } boolean GeographicalCoordinates_latitudeSign_template::match(const GeographicalCoordinates_latitudeSign& other_value, boolean) const { if (other_value.enum_value == GeographicalCoordinates_latitudeSign::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign with an unbound value."); return match(other_value.enum_value); } GeographicalCoordinates_latitudeSign::enum_type GeographicalCoordinates_latitudeSign_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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return single_value; } void GeographicalCoordinates_latitudeSign_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 GeographicalCoordinates_latitudeSign_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } } GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_latitudeSign_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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); return value_list.list_value[list_index]; } void GeographicalCoordinates_latitudeSign_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(GeographicalCoordinates_latitudeSign::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 GeographicalCoordinates_latitudeSign_template::log_match(const GeographicalCoordinates_latitudeSign& 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 GeographicalCoordinates_latitudeSign_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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } } void GeographicalCoordinates_latitudeSign_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (GeographicalCoordinates_latitudeSign::enum_type)text_buf.pull_int().get_val(); if (!GeographicalCoordinates_latitudeSign::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HNBAP-IEs.GeographicalCoordinates.latitudeSign.", 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 GeographicalCoordinates_latitudeSign_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 @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } } boolean GeographicalCoordinates_latitudeSign_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GeographicalCoordinates_latitudeSign_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: { GeographicalCoordinates_latitudeSign_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: { GeographicalCoordinates_latitudeSign::enum_type enum_val = GeographicalCoordinates_latitudeSign::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!GeographicalCoordinates_latitudeSign::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @HNBAP-IEs.GeographicalCoordinates.latitudeSign."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { GeographicalCoordinates_latitudeSign_template* precondition = new GeographicalCoordinates_latitudeSign_template; precondition->set_param(*m_p->get_elem(0)); GeographicalCoordinates_latitudeSign_template* implied_template = new GeographicalCoordinates_latitudeSign_template; implied_template->set_param(*m_p->get_elem(1)); *this = GeographicalCoordinates_latitudeSign_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@HNBAP-IEs.GeographicalCoordinates.latitudeSign"); } is_ifpresent = param.get_ifpresent(); } void GeographicalCoordinates_latitudeSign_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 : "@HNBAP-IEs.GeographicalCoordinates.latitudeSign"); } GeographicalCoordinates::GeographicalCoordinates() { } GeographicalCoordinates::GeographicalCoordinates(const GeographicalCoordinates_latitudeSign& par_latitudeSign, const INTEGER& par_latitude, const INTEGER& par_longitude, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 >& par_iE__Extensions) : field_latitudeSign(par_latitudeSign), field_latitude(par_latitude), field_longitude(par_longitude), field_iE__Extensions(par_iE__Extensions) { } GeographicalCoordinates::GeographicalCoordinates(const GeographicalCoordinates& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.GeographicalCoordinates."); if (other_value.latitudeSign().is_bound()) field_latitudeSign = other_value.latitudeSign(); else field_latitudeSign.clean_up(); if (other_value.latitude().is_bound()) field_latitude = other_value.latitude(); else field_latitude.clean_up(); if (other_value.longitude().is_bound()) field_longitude = other_value.longitude(); else field_longitude.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void GeographicalCoordinates::clean_up() { field_latitudeSign.clean_up(); field_latitude.clean_up(); field_longitude.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* GeographicalCoordinates::get_descriptor() const { return &GeographicalCoordinates_descr_; } GeographicalCoordinates& GeographicalCoordinates::operator=(const GeographicalCoordinates& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.GeographicalCoordinates."); if (other_value.latitudeSign().is_bound()) field_latitudeSign = other_value.latitudeSign(); else field_latitudeSign.clean_up(); if (other_value.latitude().is_bound()) field_latitude = other_value.latitude(); else field_latitude.clean_up(); if (other_value.longitude().is_bound()) field_longitude = other_value.longitude(); else field_longitude.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 GeographicalCoordinates::operator==(const GeographicalCoordinates& other_value) const { return field_latitudeSign==other_value.field_latitudeSign && field_latitude==other_value.field_latitude && field_longitude==other_value.field_longitude && field_iE__Extensions==other_value.field_iE__Extensions; } boolean GeographicalCoordinates::is_bound() const { return (field_latitudeSign.is_bound()) || (field_latitude.is_bound()) || (field_longitude.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean GeographicalCoordinates::is_value() const { return field_latitudeSign.is_value() && field_latitude.is_value() && field_longitude.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int GeographicalCoordinates::size_of() const { int ret_val = 3; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void GeographicalCoordinates::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ latitudeSign := "); field_latitudeSign.log(); TTCN_Logger::log_event_str(", latitude := "); field_latitude.log(); TTCN_Logger::log_event_str(", longitude := "); field_longitude.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void GeographicalCoordinates::set_implicit_omit() { if (latitudeSign().is_bound()) latitudeSign().set_implicit_omit(); if (latitude().is_bound()) latitude().set_implicit_omit(); if (longitude().is_bound()) longitude().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void GeographicalCoordinates::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) latitudeSign().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) latitude().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) longitude().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(), "latitudeSign")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { latitudeSign().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "latitude")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { latitude().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "longitude")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { longitude().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 @HNBAP-IEs.GeographicalCoordinates: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.GeographicalCoordinates"); } } void GeographicalCoordinates::encode_text(Text_Buf& text_buf) const { field_latitudeSign.encode_text(text_buf); field_latitude.encode_text(text_buf); field_longitude.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void GeographicalCoordinates::decode_text(Text_Buf& text_buf) { field_latitudeSign.decode_text(text_buf); field_latitude.decode_text(text_buf); field_longitude.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void GeographicalCoordinates::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 GeographicalCoordinates::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* GeographicalCoordinates::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("latitudeSign': "); new_tlv->add_TLV(field_latitudeSign.BER_encode_TLV(GeographicalCoordinates_latitudeSign_descr_, p_coding)); ec_1.set_msg("latitude': "); new_tlv->add_TLV(field_latitude.BER_encode_TLV(GeographicalCoordinates_latitude_descr_, p_coding)); ec_1.set_msg("longitude': "); new_tlv->add_TLV(field_longitude.BER_encode_TLV(GeographicalCoordinates_longitude_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(GeographicalCoordinates_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean GeographicalCoordinates::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 '@HNBAP-IEs.GeographicalCoordinates' 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("latitudeSign': "); 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_latitudeSign.BER_decode_TLV(GeographicalCoordinates_latitudeSign_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("latitude': "); 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_latitude.BER_decode_TLV(GeographicalCoordinates_latitude_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("longitude': "); 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_longitude.BER_decode_TLV(GeographicalCoordinates_longitude_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(GeographicalCoordinates_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 GeographicalCoordinates::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 @HNBAP-IEs.GeographicalCoordinates."); 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, "latitudeSign"); enc_len += field_latitudeSign.JSON_encode(GeographicalCoordinates_latitudeSign_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "latitude"); enc_len += field_latitude.JSON_encode(GeographicalCoordinates_latitude_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "longitude"); enc_len += field_longitude.JSON_encode(GeographicalCoordinates_longitude_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(GeographicalCoordinates_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int GeographicalCoordinates::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 latitudeSign_found = FALSE; boolean latitude_found = FALSE; boolean longitude_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 (12 == name_len && 0 == strncmp(fld_name, "latitudeSign", name_len)) { latitudeSign_found = TRUE; int ret_val = field_latitudeSign.JSON_decode(GeographicalCoordinates_latitudeSign_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, "latitudeSign"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (8 == name_len && 0 == strncmp(fld_name, "latitude", name_len)) { latitude_found = TRUE; int ret_val = field_latitude.JSON_decode(GeographicalCoordinates_latitude_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, "latitude"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (9 == name_len && 0 == strncmp(fld_name, "longitude", name_len)) { longitude_found = TRUE; int ret_val = field_longitude.JSON_decode(GeographicalCoordinates_longitude_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, "longitude"); } 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(GeographicalCoordinates_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 (!latitudeSign_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "latitudeSign"); return JSON_ERROR_FATAL; } if (!latitude_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "latitude"); return JSON_ERROR_FATAL; } if (!longitude_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "longitude"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int GeographicalCoordinates::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_latitudeSign.OER_encode(GeographicalCoordinates_latitudeSign_descr_, p_buf); field_latitude.OER_encode(GeographicalCoordinates_latitude_descr_, p_buf); field_longitude.OER_encode(GeographicalCoordinates_longitude_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(GeographicalCoordinates_iE__Extensions_descr_, p_buf); return 0; } int GeographicalCoordinates::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_latitudeSign.OER_decode(GeographicalCoordinates_latitudeSign_descr_, p_buf, p_oer); field_latitude.OER_decode(GeographicalCoordinates_latitude_descr_, p_buf, p_oer); field_longitude.OER_decode(GeographicalCoordinates_longitude_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(GeographicalCoordinates_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 GeographicalCoordinates::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_latitudeSign.PER_encode(GeographicalCoordinates_latitudeSign_descr_, p_buf, p_options); field_latitude.PER_encode(GeographicalCoordinates_latitude_descr_, p_buf, p_options); field_longitude.PER_encode(GeographicalCoordinates_longitude_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(GeographicalCoordinates_iE__Extensions_descr_, p_buf, p_options); } void GeographicalCoordinates::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_latitudeSign.PER_decode(GeographicalCoordinates_latitudeSign_descr_, p_buf, p_options); field_latitude.PER_decode(GeographicalCoordinates_latitude_descr_, p_buf, p_options); field_longitude.PER_decode(GeographicalCoordinates_longitude_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(GeographicalCoordinates_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 GeographicalCoordinates_template::single_value_struct { GeographicalCoordinates_latitudeSign_template field_latitudeSign; INTEGER_template field_latitude; INTEGER_template field_longitude; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template field_iE__Extensions; }; void GeographicalCoordinates_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_latitudeSign = ANY_VALUE; single_value->field_latitude = ANY_VALUE; single_value->field_longitude = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void GeographicalCoordinates_template::copy_value(const GeographicalCoordinates& other_value) { single_value = new single_value_struct; if (other_value.latitudeSign().is_bound()) { single_value->field_latitudeSign = other_value.latitudeSign(); } else { single_value->field_latitudeSign.clean_up(); } if (other_value.latitude().is_bound()) { single_value->field_latitude = other_value.latitude(); } else { single_value->field_latitude.clean_up(); } if (other_value.longitude().is_bound()) { single_value->field_longitude = other_value.longitude(); } else { single_value->field_longitude.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 GeographicalCoordinates_template::copy_template(const GeographicalCoordinates_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.latitudeSign().get_selection()) { single_value->field_latitudeSign = other_value.latitudeSign(); } else { single_value->field_latitudeSign.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.latitude().get_selection()) { single_value->field_latitude = other_value.latitude(); } else { single_value->field_latitude.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.longitude().get_selection()) { single_value->field_longitude = other_value.longitude(); } else { single_value->field_longitude.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 GeographicalCoordinates_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 GeographicalCoordinates_template(*other_value.implication_.precondition); implication_.implied_template = new GeographicalCoordinates_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 @HNBAP-IEs.GeographicalCoordinates."); break; } set_selection(other_value); } GeographicalCoordinates_template::GeographicalCoordinates_template() { } GeographicalCoordinates_template::GeographicalCoordinates_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GeographicalCoordinates_template::GeographicalCoordinates_template(const GeographicalCoordinates& other_value) { copy_value(other_value); } GeographicalCoordinates_template::GeographicalCoordinates_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GeographicalCoordinates&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.GeographicalCoordinates from an unbound optional field."); } } GeographicalCoordinates_template::GeographicalCoordinates_template(GeographicalCoordinates_template* p_precondition, GeographicalCoordinates_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GeographicalCoordinates_template::GeographicalCoordinates_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; } GeographicalCoordinates_template::GeographicalCoordinates_template(const GeographicalCoordinates_template& other_value) : Base_Template() { copy_template(other_value); } GeographicalCoordinates_template::~GeographicalCoordinates_template() { clean_up(); } GeographicalCoordinates_template& GeographicalCoordinates_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GeographicalCoordinates_template& GeographicalCoordinates_template::operator=(const GeographicalCoordinates& other_value) { clean_up(); copy_value(other_value); return *this; } GeographicalCoordinates_template& GeographicalCoordinates_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GeographicalCoordinates&)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 @HNBAP-IEs.GeographicalCoordinates."); } return *this; } GeographicalCoordinates_template& GeographicalCoordinates_template::operator=(const GeographicalCoordinates_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GeographicalCoordinates_template::match(const GeographicalCoordinates& 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.latitudeSign().is_bound()) return FALSE; if(!single_value->field_latitudeSign.match(other_value.latitudeSign(), legacy))return FALSE; if(!other_value.latitude().is_bound()) return FALSE; if(!single_value->field_latitude.match(other_value.latitude(), legacy))return FALSE; if(!other_value.longitude().is_bound()) return FALSE; if(!single_value->field_longitude.match(other_value.longitude(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4&)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 @HNBAP-IEs.GeographicalCoordinates."); } return FALSE; } boolean GeographicalCoordinates_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_latitudeSign.is_bound() || single_value->field_latitude.is_bound() || single_value->field_longitude.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean GeographicalCoordinates_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_latitudeSign.is_value() && single_value->field_latitude.is_value() && single_value->field_longitude.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void GeographicalCoordinates_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; } GeographicalCoordinates GeographicalCoordinates_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 @HNBAP-IEs.GeographicalCoordinates."); GeographicalCoordinates ret_val; if (single_value->field_latitudeSign.is_bound()) { ret_val.latitudeSign() = single_value->field_latitudeSign.valueof(); } if (single_value->field_latitude.is_bound()) { ret_val.latitude() = single_value->field_latitude.valueof(); } if (single_value->field_longitude.is_bound()) { ret_val.longitude() = single_value->field_longitude.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 GeographicalCoordinates_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 @HNBAP-IEs.GeographicalCoordinates."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new GeographicalCoordinates_template[list_length]; } GeographicalCoordinates_template& GeographicalCoordinates_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 @HNBAP-IEs.GeographicalCoordinates."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.GeographicalCoordinates."); return value_list.list_value[list_index]; } GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_template::latitudeSign() { set_specific(); return single_value->field_latitudeSign; } const GeographicalCoordinates_latitudeSign_template& GeographicalCoordinates_template::latitudeSign() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field latitudeSign of a non-specific template of type @HNBAP-IEs.GeographicalCoordinates."); return single_value->field_latitudeSign; } INTEGER_template& GeographicalCoordinates_template::latitude() { set_specific(); return single_value->field_latitude; } const INTEGER_template& GeographicalCoordinates_template::latitude() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field latitude of a non-specific template of type @HNBAP-IEs.GeographicalCoordinates."); return single_value->field_latitude; } INTEGER_template& GeographicalCoordinates_template::longitude() { set_specific(); return single_value->field_longitude; } const INTEGER_template& GeographicalCoordinates_template::longitude() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field longitude of a non-specific template of type @HNBAP-IEs.GeographicalCoordinates."); return single_value->field_longitude; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& GeographicalCoordinates_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& GeographicalCoordinates_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.GeographicalCoordinates."); return single_value->field_iE__Extensions; } int GeographicalCoordinates_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalCoordinates 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 @HNBAP-IEs.GeographicalCoordinates 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 @HNBAP-IEs.GeographicalCoordinates containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalCoordinates containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalCoordinates containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalCoordinates containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalCoordinates containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalCoordinates containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalCoordinates containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.GeographicalCoordinates."); } return 0; } void GeographicalCoordinates_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ latitudeSign := "); single_value->field_latitudeSign.log(); TTCN_Logger::log_event_str(", latitude := "); single_value->field_latitude.log(); TTCN_Logger::log_event_str(", longitude := "); single_value->field_longitude.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 GeographicalCoordinates_template::log_match(const GeographicalCoordinates& 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_latitudeSign.match(match_value.latitudeSign(), legacy)){ TTCN_Logger::log_logmatch_info(".latitudeSign"); single_value->field_latitudeSign.log_match(match_value.latitudeSign(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_latitude.match(match_value.latitude(), legacy)){ TTCN_Logger::log_logmatch_info(".latitude"); single_value->field_latitude.log_match(match_value.latitude(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_longitude.match(match_value.longitude(), legacy)){ TTCN_Logger::log_logmatch_info(".longitude"); single_value->field_longitude.log_match(match_value.longitude(), 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("{ latitudeSign := "); single_value->field_latitudeSign.log_match(match_value.latitudeSign(), legacy); TTCN_Logger::log_event_str(", latitude := "); single_value->field_latitude.log_match(match_value.latitude(), legacy); TTCN_Logger::log_event_str(", longitude := "); single_value->field_longitude.log_match(match_value.longitude(), 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 GeographicalCoordinates_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (latitudeSign().is_bound()) latitudeSign().set_implicit_omit(); if (latitude().is_bound()) latitude().set_implicit_omit(); if (longitude().is_bound()) longitude().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void GeographicalCoordinates_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_latitudeSign.encode_text(text_buf); single_value->field_latitude.encode_text(text_buf); single_value->field_longitude.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 @HNBAP-IEs.GeographicalCoordinates."); } } void GeographicalCoordinates_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_latitudeSign.decode_text(text_buf); single_value->field_latitude.decode_text(text_buf); single_value->field_longitude.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 GeographicalCoordinates_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 @HNBAP-IEs.GeographicalCoordinates."); } } void GeographicalCoordinates_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: { GeographicalCoordinates_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) latitudeSign().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) latitude().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) longitude().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(), "latitudeSign")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { latitudeSign().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "latitude")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { latitude().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "longitude")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { longitude().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 @HNBAP-IEs.GeographicalCoordinates: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { GeographicalCoordinates_template* precondition = new GeographicalCoordinates_template; precondition->set_param(*param.get_elem(0)); GeographicalCoordinates_template* implied_template = new GeographicalCoordinates_template; implied_template->set_param(*param.get_elem(1)); *this = GeographicalCoordinates_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.GeographicalCoordinates"); } is_ifpresent = param.get_ifpresent(); } void GeographicalCoordinates_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_latitudeSign.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.GeographicalCoordinates"); single_value->field_latitude.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.GeographicalCoordinates"); single_value->field_longitude.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.GeographicalCoordinates"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.GeographicalCoordinates"); 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 : "@HNBAP-IEs.GeographicalCoordinates"); } boolean GeographicalCoordinates_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GeographicalCoordinates_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_iE__Extensions) : field_geographicalCoordinates(par_geographicalCoordinates), field_altitudeAndDirection(par_altitudeAndDirection), field_iE__Extensions(par_iE__Extensions) { } GeographicalLocation::GeographicalLocation(const GeographicalLocation& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.GeographicalLocation."); if (other_value.geographicalCoordinates().is_bound()) field_geographicalCoordinates = other_value.geographicalCoordinates(); else field_geographicalCoordinates.clean_up(); if (other_value.altitudeAndDirection().is_bound()) field_altitudeAndDirection = other_value.altitudeAndDirection(); else field_altitudeAndDirection.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void GeographicalLocation::clean_up() { field_geographicalCoordinates.clean_up(); field_altitudeAndDirection.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* GeographicalLocation::get_descriptor() const { return &GeographicalLocation_descr_; } GeographicalLocation& GeographicalLocation::operator=(const GeographicalLocation& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.GeographicalLocation."); if (other_value.geographicalCoordinates().is_bound()) field_geographicalCoordinates = other_value.geographicalCoordinates(); else field_geographicalCoordinates.clean_up(); if (other_value.altitudeAndDirection().is_bound()) field_altitudeAndDirection = other_value.altitudeAndDirection(); else field_altitudeAndDirection.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 GeographicalLocation::operator==(const GeographicalLocation& other_value) const { return field_geographicalCoordinates==other_value.field_geographicalCoordinates && field_altitudeAndDirection==other_value.field_altitudeAndDirection && field_iE__Extensions==other_value.field_iE__Extensions; } boolean GeographicalLocation::is_bound() const { return (field_geographicalCoordinates.is_bound()) || (field_altitudeAndDirection.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean GeographicalLocation::is_value() const { return field_geographicalCoordinates.is_value() && field_altitudeAndDirection.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int GeographicalLocation::size_of() const { int ret_val = 2; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void GeographicalLocation::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ geographicalCoordinates := "); field_geographicalCoordinates.log(); TTCN_Logger::log_event_str(", altitudeAndDirection := "); field_altitudeAndDirection.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void GeographicalLocation::set_implicit_omit() { if (geographicalCoordinates().is_bound()) geographicalCoordinates().set_implicit_omit(); if (altitudeAndDirection().is_bound()) altitudeAndDirection().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void GeographicalLocation::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) geographicalCoordinates().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) altitudeAndDirection().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "geographicalCoordinates")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { geographicalCoordinates().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "altitudeAndDirection")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { altitudeAndDirection().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 @HNBAP-IEs.GeographicalLocation: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.GeographicalLocation"); } } void GeographicalLocation::encode_text(Text_Buf& text_buf) const { field_geographicalCoordinates.encode_text(text_buf); field_altitudeAndDirection.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void GeographicalLocation::decode_text(Text_Buf& text_buf) { field_geographicalCoordinates.decode_text(text_buf); field_altitudeAndDirection.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void GeographicalLocation::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 GeographicalLocation::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* GeographicalLocation::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("geographicalCoordinates': "); new_tlv->add_TLV(field_geographicalCoordinates.BER_encode_TLV(GeographicalLocation_geographicalCoordinates_descr_, p_coding)); ec_1.set_msg("altitudeAndDirection': "); new_tlv->add_TLV(field_altitudeAndDirection.BER_encode_TLV(GeographicalLocation_altitudeAndDirection_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(GeographicalLocation_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean GeographicalLocation::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 '@HNBAP-IEs.GeographicalLocation' 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("geographicalCoordinates': "); 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_geographicalCoordinates.BER_decode_TLV(GeographicalLocation_geographicalCoordinates_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("altitudeAndDirection': "); 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_altitudeAndDirection.BER_decode_TLV(GeographicalLocation_altitudeAndDirection_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(GeographicalLocation_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 GeographicalLocation::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 @HNBAP-IEs.GeographicalLocation."); 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, "geographicalCoordinates"); enc_len += field_geographicalCoordinates.JSON_encode(GeographicalLocation_geographicalCoordinates_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "altitudeAndDirection"); enc_len += field_altitudeAndDirection.JSON_encode(GeographicalLocation_altitudeAndDirection_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(GeographicalLocation_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int GeographicalLocation::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 geographicalCoordinates_found = FALSE; boolean altitudeAndDirection_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 (23 == name_len && 0 == strncmp(fld_name, "geographicalCoordinates", name_len)) { geographicalCoordinates_found = TRUE; int ret_val = field_geographicalCoordinates.JSON_decode(GeographicalLocation_geographicalCoordinates_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, 23, "geographicalCoordinates"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (20 == name_len && 0 == strncmp(fld_name, "altitudeAndDirection", name_len)) { altitudeAndDirection_found = TRUE; int ret_val = field_altitudeAndDirection.JSON_decode(GeographicalLocation_altitudeAndDirection_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, "altitudeAndDirection"); } 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(GeographicalLocation_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 (!geographicalCoordinates_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "geographicalCoordinates"); return JSON_ERROR_FATAL; } if (!altitudeAndDirection_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "altitudeAndDirection"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int GeographicalLocation::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_geographicalCoordinates.OER_encode(GeographicalLocation_geographicalCoordinates_descr_, p_buf); field_altitudeAndDirection.OER_encode(GeographicalLocation_altitudeAndDirection_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(GeographicalLocation_iE__Extensions_descr_, p_buf); return 0; } int GeographicalLocation::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_geographicalCoordinates.OER_decode(GeographicalLocation_geographicalCoordinates_descr_, p_buf, p_oer); field_altitudeAndDirection.OER_decode(GeographicalLocation_altitudeAndDirection_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(GeographicalLocation_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 GeographicalLocation::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_geographicalCoordinates.PER_encode(GeographicalLocation_geographicalCoordinates_descr_, p_buf, p_options); field_altitudeAndDirection.PER_encode(GeographicalLocation_altitudeAndDirection_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(GeographicalLocation_iE__Extensions_descr_, p_buf, p_options); } void GeographicalLocation::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_geographicalCoordinates.PER_decode(GeographicalLocation_geographicalCoordinates_descr_, p_buf, p_options); field_altitudeAndDirection.PER_decode(GeographicalLocation_altitudeAndDirection_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(GeographicalLocation_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 GeographicalLocation_template::single_value_struct { GeographicalCoordinates_template field_geographicalCoordinates; AltitudeAndDirection_template field_altitudeAndDirection; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template field_iE__Extensions; }; void GeographicalLocation_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_geographicalCoordinates = ANY_VALUE; single_value->field_altitudeAndDirection = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void GeographicalLocation_template::copy_value(const GeographicalLocation& other_value) { single_value = new single_value_struct; if (other_value.geographicalCoordinates().is_bound()) { single_value->field_geographicalCoordinates = other_value.geographicalCoordinates(); } else { single_value->field_geographicalCoordinates.clean_up(); } if (other_value.altitudeAndDirection().is_bound()) { single_value->field_altitudeAndDirection = other_value.altitudeAndDirection(); } else { single_value->field_altitudeAndDirection.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 GeographicalLocation_template::copy_template(const GeographicalLocation_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.geographicalCoordinates().get_selection()) { single_value->field_geographicalCoordinates = other_value.geographicalCoordinates(); } else { single_value->field_geographicalCoordinates.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.altitudeAndDirection().get_selection()) { single_value->field_altitudeAndDirection = other_value.altitudeAndDirection(); } else { single_value->field_altitudeAndDirection.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 GeographicalLocation_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 GeographicalLocation_template(*other_value.implication_.precondition); implication_.implied_template = new GeographicalLocation_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 @HNBAP-IEs.GeographicalLocation."); break; } set_selection(other_value); } GeographicalLocation_template::GeographicalLocation_template() { } GeographicalLocation_template::GeographicalLocation_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GeographicalLocation_template::GeographicalLocation_template(const GeographicalLocation& other_value) { copy_value(other_value); } GeographicalLocation_template::GeographicalLocation_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GeographicalLocation&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.GeographicalLocation from an unbound optional field."); } } GeographicalLocation_template::GeographicalLocation_template(GeographicalLocation_template* p_precondition, GeographicalLocation_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GeographicalLocation_template::GeographicalLocation_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; } GeographicalLocation_template::GeographicalLocation_template(const GeographicalLocation_template& other_value) : Base_Template() { copy_template(other_value); } GeographicalLocation_template::~GeographicalLocation_template() { clean_up(); } GeographicalLocation_template& GeographicalLocation_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GeographicalLocation_template& GeographicalLocation_template::operator=(const GeographicalLocation& other_value) { clean_up(); copy_value(other_value); return *this; } GeographicalLocation_template& GeographicalLocation_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GeographicalLocation&)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 @HNBAP-IEs.GeographicalLocation."); } return *this; } GeographicalLocation_template& GeographicalLocation_template::operator=(const GeographicalLocation_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GeographicalLocation_template::match(const GeographicalLocation& 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.geographicalCoordinates().is_bound()) return FALSE; if(!single_value->field_geographicalCoordinates.match(other_value.geographicalCoordinates(), legacy))return FALSE; if(!other_value.altitudeAndDirection().is_bound()) return FALSE; if(!single_value->field_altitudeAndDirection.match(other_value.altitudeAndDirection(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5&)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 @HNBAP-IEs.GeographicalLocation."); } return FALSE; } boolean GeographicalLocation_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_geographicalCoordinates.is_bound() || single_value->field_altitudeAndDirection.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean GeographicalLocation_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_geographicalCoordinates.is_value() && single_value->field_altitudeAndDirection.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void GeographicalLocation_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; } GeographicalLocation GeographicalLocation_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 @HNBAP-IEs.GeographicalLocation."); GeographicalLocation ret_val; if (single_value->field_geographicalCoordinates.is_bound()) { ret_val.geographicalCoordinates() = single_value->field_geographicalCoordinates.valueof(); } if (single_value->field_altitudeAndDirection.is_bound()) { ret_val.altitudeAndDirection() = single_value->field_altitudeAndDirection.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 GeographicalLocation_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 @HNBAP-IEs.GeographicalLocation."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new GeographicalLocation_template[list_length]; } GeographicalLocation_template& GeographicalLocation_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 @HNBAP-IEs.GeographicalLocation."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.GeographicalLocation."); return value_list.list_value[list_index]; } GeographicalCoordinates_template& GeographicalLocation_template::geographicalCoordinates() { set_specific(); return single_value->field_geographicalCoordinates; } const GeographicalCoordinates_template& GeographicalLocation_template::geographicalCoordinates() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field geographicalCoordinates of a non-specific template of type @HNBAP-IEs.GeographicalLocation."); return single_value->field_geographicalCoordinates; } AltitudeAndDirection_template& GeographicalLocation_template::altitudeAndDirection() { set_specific(); return single_value->field_altitudeAndDirection; } const AltitudeAndDirection_template& GeographicalLocation_template::altitudeAndDirection() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field altitudeAndDirection of a non-specific template of type @HNBAP-IEs.GeographicalLocation."); return single_value->field_altitudeAndDirection; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& GeographicalLocation_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& GeographicalLocation_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.GeographicalLocation."); return single_value->field_iE__Extensions; } int GeographicalLocation_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalLocation which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 2; 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 @HNBAP-IEs.GeographicalLocation 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 @HNBAP-IEs.GeographicalLocation containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalLocation containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalLocation containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalLocation containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalLocation containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalLocation containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.GeographicalLocation containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.GeographicalLocation."); } return 0; } void GeographicalLocation_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ geographicalCoordinates := "); single_value->field_geographicalCoordinates.log(); TTCN_Logger::log_event_str(", altitudeAndDirection := "); single_value->field_altitudeAndDirection.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 GeographicalLocation_template::log_match(const GeographicalLocation& 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_geographicalCoordinates.match(match_value.geographicalCoordinates(), legacy)){ TTCN_Logger::log_logmatch_info(".geographicalCoordinates"); single_value->field_geographicalCoordinates.log_match(match_value.geographicalCoordinates(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_altitudeAndDirection.match(match_value.altitudeAndDirection(), legacy)){ TTCN_Logger::log_logmatch_info(".altitudeAndDirection"); single_value->field_altitudeAndDirection.log_match(match_value.altitudeAndDirection(), 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("{ geographicalCoordinates := "); single_value->field_geographicalCoordinates.log_match(match_value.geographicalCoordinates(), legacy); TTCN_Logger::log_event_str(", altitudeAndDirection := "); single_value->field_altitudeAndDirection.log_match(match_value.altitudeAndDirection(), 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 GeographicalLocation_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (geographicalCoordinates().is_bound()) geographicalCoordinates().set_implicit_omit(); if (altitudeAndDirection().is_bound()) altitudeAndDirection().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void GeographicalLocation_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_geographicalCoordinates.encode_text(text_buf); single_value->field_altitudeAndDirection.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 @HNBAP-IEs.GeographicalLocation."); } } void GeographicalLocation_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_geographicalCoordinates.decode_text(text_buf); single_value->field_altitudeAndDirection.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 GeographicalLocation_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 @HNBAP-IEs.GeographicalLocation."); } } void GeographicalLocation_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: { GeographicalLocation_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) geographicalCoordinates().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) altitudeAndDirection().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "geographicalCoordinates")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { geographicalCoordinates().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "altitudeAndDirection")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { altitudeAndDirection().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 @HNBAP-IEs.GeographicalLocation: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { GeographicalLocation_template* precondition = new GeographicalLocation_template; precondition->set_param(*param.get_elem(0)); GeographicalLocation_template* implied_template = new GeographicalLocation_template; implied_template->set_param(*param.get_elem(1)); *this = GeographicalLocation_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.GeographicalLocation"); } is_ifpresent = param.get_ifpresent(); } void GeographicalLocation_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_geographicalCoordinates.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.GeographicalLocation"); single_value->field_altitudeAndDirection.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.GeographicalLocation"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.GeographicalLocation"); 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 : "@HNBAP-IEs.GeographicalLocation"); } boolean GeographicalLocation_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GeographicalLocation_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean HNB__Cell__Access__Mode::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 @HNBAP-IEs.HNB-Cell-Access-Mode."); return enum_value > other_value; } boolean HNB__Cell__Access__Mode::operator>(const HNB__Cell__Access__Mode& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); return enum_value > other_value.enum_value; } const char *HNB__Cell__Access__Mode::enum_to_str(enum_type enum_par) { switch (enum_par) { case closed: return "closed"; case hybrid: return "hybrid"; case open: return "open"; default: return ""; } } HNB__Cell__Access__Mode::enum_type HNB__Cell__Access__Mode::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, "closed")) return closed; if (!strcmp(str_par, "hybrid")) return hybrid; if (!strcmp(str_par, "open")) return open; } return UNKNOWN_VALUE; } boolean HNB__Cell__Access__Mode::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: return TRUE; default: return FALSE; } } int HNB__Cell__Access__Mode::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 @HNBAP-IEs.HNB-Cell-Access-Mode.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int HNB__Cell__Access__Mode::enum2int(const HNB__Cell__Access__Mode& 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 @HNBAP-IEs.HNB-Cell-Access-Mode.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void HNB__Cell__Access__Mode::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode.", int_val); enum_value = (enum_type)int_val; } HNB__Cell__Access__Mode::operator HNB__Cell__Access__Mode::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); return enum_value; } void HNB__Cell__Access__Mode::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 HNB__Cell__Access__Mode::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", "@HNBAP-IEs.HNB-Cell-Access-Mode"); 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 @HNBAP-IEs.HNB-Cell-Access-Mode."); } } void HNB__Cell__Access__Mode::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); text_buf.push_int(enum_value); } void HNB__Cell__Access__Mode::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 @HNBAP-IEs.HNB-Cell-Access-Mode.", enum_value); } void HNB__Cell__Access__Mode::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 HNB__Cell__Access__Mode::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* HNB__Cell__Access__Mode::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 HNB__Cell__Access__Mode::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 @HNBAP-IEs.HNB-Cell-Access-Mode: "); 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 HNB__Cell__Access__Mode::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 @HNBAP-IEs.HNB-Cell-Access-Mode."); 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 HNB__Cell__Access__Mode::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 = closed; } 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 HNB__Cell__Access__Mode::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 @HNBAP-IEs.HNB-Cell-Access-Mode."); 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 HNB__Cell__Access__Mode::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 HNB__Cell__Access__Mode::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 closed: enc_val = 0; ext_bit = FALSE; break; case hybrid: enc_val = 1; ext_bit = FALSE; break; case open: enc_val = 2; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); } 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 HNB__Cell__Access__Mode::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 = closed; break; case 1: enum_value = hybrid; break; case 2: enum_value = open; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode.", dec_int); break; } } void HNB__Cell__Access__Mode_template::copy_template(const HNB__Cell__Access__Mode_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 HNB__Cell__Access__Mode_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 HNB__Cell__Access__Mode_template(*other_value.implication_.precondition); implication_.implied_template = new HNB__Cell__Access__Mode_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 @HNBAP-IEs.HNB-Cell-Access-Mode."); } } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_template() { } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!HNB__Cell__Access__Mode::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode with unknown numeric value %d.", other_value); single_value = (HNB__Cell__Access__Mode::enum_type)other_value; } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_template(HNB__Cell__Access__Mode::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_template(const HNB__Cell__Access__Mode& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == HNB__Cell__Access__Mode::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); single_value = other_value.enum_value; } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (HNB__Cell__Access__Mode::enum_type)(const HNB__Cell__Access__Mode&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode from an unbound optional field."); } } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_template(HNB__Cell__Access__Mode_template* p_precondition, HNB__Cell__Access__Mode_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_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; } HNB__Cell__Access__Mode_template::HNB__Cell__Access__Mode_template(const HNB__Cell__Access__Mode_template& other_value) : Base_Template() { copy_template(other_value); } HNB__Cell__Access__Mode_template::~HNB__Cell__Access__Mode_template() { clean_up(); } boolean HNB__Cell__Access__Mode_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean HNB__Cell__Access__Mode_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != HNB__Cell__Access__Mode::UNBOUND_VALUE; } void HNB__Cell__Access__Mode_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; } HNB__Cell__Access__Mode_template& HNB__Cell__Access__Mode_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNB__Cell__Access__Mode_template& HNB__Cell__Access__Mode_template::operator=(int other_value) { if (!HNB__Cell__Access__Mode::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (HNB__Cell__Access__Mode::enum_type)other_value; return *this; } HNB__Cell__Access__Mode_template& HNB__Cell__Access__Mode_template::operator=(HNB__Cell__Access__Mode::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } HNB__Cell__Access__Mode_template& HNB__Cell__Access__Mode_template::operator=(const HNB__Cell__Access__Mode& other_value) { if (other_value.enum_value == HNB__Cell__Access__Mode::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } HNB__Cell__Access__Mode_template& HNB__Cell__Access__Mode_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (HNB__Cell__Access__Mode::enum_type)(const HNB__Cell__Access__Mode&)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 @HNBAP-IEs.HNB-Cell-Access-Mode."); } return *this; } HNB__Cell__Access__Mode_template& HNB__Cell__Access__Mode_template::operator=(const HNB__Cell__Access__Mode_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNB__Cell__Access__Mode_template::match(HNB__Cell__Access__Mode::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 @HNBAP-IEs.HNB-Cell-Access-Mode."); } return FALSE; } boolean HNB__Cell__Access__Mode_template::match(const HNB__Cell__Access__Mode& other_value, boolean) const { if (other_value.enum_value == HNB__Cell__Access__Mode::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode with an unbound value."); return match(other_value.enum_value); } HNB__Cell__Access__Mode::enum_type HNB__Cell__Access__Mode_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 @HNBAP-IEs.HNB-Cell-Access-Mode."); return single_value; } void HNB__Cell__Access__Mode_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 HNB__Cell__Access__Mode_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); } } HNB__Cell__Access__Mode_template& HNB__Cell__Access__Mode_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 @HNBAP-IEs.HNB-Cell-Access-Mode."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode."); return value_list.list_value[list_index]; } void HNB__Cell__Access__Mode_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(HNB__Cell__Access__Mode::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 HNB__Cell__Access__Mode_template::log_match(const HNB__Cell__Access__Mode& 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 HNB__Cell__Access__Mode_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 @HNBAP-IEs.HNB-Cell-Access-Mode."); } } void HNB__Cell__Access__Mode_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (HNB__Cell__Access__Mode::enum_type)text_buf.pull_int().get_val(); if (!HNB__Cell__Access__Mode::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HNBAP-IEs.HNB-Cell-Access-Mode.", 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 HNB__Cell__Access__Mode_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 @HNBAP-IEs.HNB-Cell-Access-Mode."); } } boolean HNB__Cell__Access__Mode_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNB__Cell__Access__Mode_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: { HNB__Cell__Access__Mode_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: { HNB__Cell__Access__Mode::enum_type enum_val = HNB__Cell__Access__Mode::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!HNB__Cell__Access__Mode::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @HNBAP-IEs.HNB-Cell-Access-Mode."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { HNB__Cell__Access__Mode_template* precondition = new HNB__Cell__Access__Mode_template; precondition->set_param(*m_p->get_elem(0)); HNB__Cell__Access__Mode_template* implied_template = new HNB__Cell__Access__Mode_template; implied_template->set_param(*m_p->get_elem(1)); *this = HNB__Cell__Access__Mode_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@HNBAP-IEs.HNB-Cell-Access-Mode"); } is_ifpresent = param.get_ifpresent(); } void HNB__Cell__Access__Mode_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 : "@HNBAP-IEs.HNB-Cell-Access-Mode"); } HNB__Cell__Identifier::HNB__Cell__Identifier() { } HNB__Cell__Identifier::HNB__Cell__Identifier(const OCTETSTRING& par_pLMNidentity, const BITSTRING& par_cellIdentity, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 >& par_iE__Extensions) : field_pLMNidentity(par_pLMNidentity), field_cellIdentity(par_cellIdentity), field_iE__Extensions(par_iE__Extensions) { } HNB__Cell__Identifier::HNB__Cell__Identifier(const HNB__Cell__Identifier& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.HNB-Cell-Identifier."); if (other_value.pLMNidentity().is_bound()) field_pLMNidentity = other_value.pLMNidentity(); else field_pLMNidentity.clean_up(); if (other_value.cellIdentity().is_bound()) field_cellIdentity = other_value.cellIdentity(); else field_cellIdentity.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void HNB__Cell__Identifier::clean_up() { field_pLMNidentity.clean_up(); field_cellIdentity.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* HNB__Cell__Identifier::get_descriptor() const { return &HNB__Cell__Identifier_descr_; } HNB__Cell__Identifier& HNB__Cell__Identifier::operator=(const HNB__Cell__Identifier& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.HNB-Cell-Identifier."); if (other_value.pLMNidentity().is_bound()) field_pLMNidentity = other_value.pLMNidentity(); else field_pLMNidentity.clean_up(); if (other_value.cellIdentity().is_bound()) field_cellIdentity = other_value.cellIdentity(); else field_cellIdentity.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 HNB__Cell__Identifier::operator==(const HNB__Cell__Identifier& other_value) const { return field_pLMNidentity==other_value.field_pLMNidentity && field_cellIdentity==other_value.field_cellIdentity && field_iE__Extensions==other_value.field_iE__Extensions; } boolean HNB__Cell__Identifier::is_bound() const { return (field_pLMNidentity.is_bound()) || (field_cellIdentity.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean HNB__Cell__Identifier::is_value() const { return field_pLMNidentity.is_value() && field_cellIdentity.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int HNB__Cell__Identifier::size_of() const { int ret_val = 2; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void HNB__Cell__Identifier::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ pLMNidentity := "); field_pLMNidentity.log(); TTCN_Logger::log_event_str(", cellIdentity := "); field_cellIdentity.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void HNB__Cell__Identifier::set_implicit_omit() { if (pLMNidentity().is_bound()) pLMNidentity().set_implicit_omit(); if (cellIdentity().is_bound()) cellIdentity().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNB__Cell__Identifier::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) pLMNidentity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cellIdentity().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "pLMNidentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pLMNidentity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cellIdentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cellIdentity().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 @HNBAP-IEs.HNB-Cell-Identifier: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.HNB-Cell-Identifier"); } } void HNB__Cell__Identifier::encode_text(Text_Buf& text_buf) const { field_pLMNidentity.encode_text(text_buf); field_cellIdentity.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void HNB__Cell__Identifier::decode_text(Text_Buf& text_buf) { field_pLMNidentity.decode_text(text_buf); field_cellIdentity.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void HNB__Cell__Identifier::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 HNB__Cell__Identifier::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* HNB__Cell__Identifier::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("pLMNidentity': "); new_tlv->add_TLV(field_pLMNidentity.BER_encode_TLV(HNB__Cell__Identifier_pLMNidentity_descr_, p_coding)); ec_1.set_msg("cellIdentity': "); new_tlv->add_TLV(field_cellIdentity.BER_encode_TLV(HNB__Cell__Identifier_cellIdentity_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(HNB__Cell__Identifier_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean HNB__Cell__Identifier::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 '@HNBAP-IEs.HNB-Cell-Identifier' 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("pLMNidentity': "); 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_pLMNidentity.BER_decode_TLV(HNB__Cell__Identifier_pLMNidentity_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("cellIdentity': "); 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_cellIdentity.BER_decode_TLV(HNB__Cell__Identifier_cellIdentity_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(HNB__Cell__Identifier_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 HNB__Cell__Identifier::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 @HNBAP-IEs.HNB-Cell-Identifier."); 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, "pLMNidentity"); enc_len += field_pLMNidentity.JSON_encode(HNB__Cell__Identifier_pLMNidentity_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "cellIdentity"); enc_len += field_cellIdentity.JSON_encode(HNB__Cell__Identifier_cellIdentity_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(HNB__Cell__Identifier_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int HNB__Cell__Identifier::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 pLMNidentity_found = FALSE; boolean cellIdentity_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 (12 == name_len && 0 == strncmp(fld_name, "pLMNidentity", name_len)) { pLMNidentity_found = TRUE; int ret_val = field_pLMNidentity.JSON_decode(HNB__Cell__Identifier_pLMNidentity_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, "pLMNidentity"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (12 == name_len && 0 == strncmp(fld_name, "cellIdentity", name_len)) { cellIdentity_found = TRUE; int ret_val = field_cellIdentity.JSON_decode(HNB__Cell__Identifier_cellIdentity_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, "cellIdentity"); } 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(HNB__Cell__Identifier_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 (!pLMNidentity_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "pLMNidentity"); return JSON_ERROR_FATAL; } if (!cellIdentity_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "cellIdentity"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int HNB__Cell__Identifier::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_pLMNidentity.OER_encode(HNB__Cell__Identifier_pLMNidentity_descr_, p_buf); field_cellIdentity.OER_encode(HNB__Cell__Identifier_cellIdentity_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(HNB__Cell__Identifier_iE__Extensions_descr_, p_buf); return 0; } int HNB__Cell__Identifier::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_pLMNidentity.OER_decode(HNB__Cell__Identifier_pLMNidentity_descr_, p_buf, p_oer); field_cellIdentity.OER_decode(HNB__Cell__Identifier_cellIdentity_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(HNB__Cell__Identifier_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 HNB__Cell__Identifier::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_pLMNidentity.PER_encode(HNB__Cell__Identifier_pLMNidentity_descr_, p_buf, p_options); field_cellIdentity.PER_encode(HNB__Cell__Identifier_cellIdentity_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(HNB__Cell__Identifier_iE__Extensions_descr_, p_buf, p_options); } void HNB__Cell__Identifier::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_pLMNidentity.PER_decode(HNB__Cell__Identifier_pLMNidentity_descr_, p_buf, p_options); field_cellIdentity.PER_decode(HNB__Cell__Identifier_cellIdentity_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(HNB__Cell__Identifier_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 HNB__Cell__Identifier_template::single_value_struct { OCTETSTRING_template field_pLMNidentity; BITSTRING_template field_cellIdentity; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template field_iE__Extensions; }; void HNB__Cell__Identifier_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_pLMNidentity = ANY_VALUE; single_value->field_cellIdentity = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void HNB__Cell__Identifier_template::copy_value(const HNB__Cell__Identifier& other_value) { single_value = new single_value_struct; if (other_value.pLMNidentity().is_bound()) { single_value->field_pLMNidentity = other_value.pLMNidentity(); } else { single_value->field_pLMNidentity.clean_up(); } if (other_value.cellIdentity().is_bound()) { single_value->field_cellIdentity = other_value.cellIdentity(); } else { single_value->field_cellIdentity.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 HNB__Cell__Identifier_template::copy_template(const HNB__Cell__Identifier_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pLMNidentity().get_selection()) { single_value->field_pLMNidentity = other_value.pLMNidentity(); } else { single_value->field_pLMNidentity.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cellIdentity().get_selection()) { single_value->field_cellIdentity = other_value.cellIdentity(); } else { single_value->field_cellIdentity.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 HNB__Cell__Identifier_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 HNB__Cell__Identifier_template(*other_value.implication_.precondition); implication_.implied_template = new HNB__Cell__Identifier_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 @HNBAP-IEs.HNB-Cell-Identifier."); break; } set_selection(other_value); } HNB__Cell__Identifier_template::HNB__Cell__Identifier_template() { } HNB__Cell__Identifier_template::HNB__Cell__Identifier_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNB__Cell__Identifier_template::HNB__Cell__Identifier_template(const HNB__Cell__Identifier& other_value) { copy_value(other_value); } HNB__Cell__Identifier_template::HNB__Cell__Identifier_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNB__Cell__Identifier&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.HNB-Cell-Identifier from an unbound optional field."); } } HNB__Cell__Identifier_template::HNB__Cell__Identifier_template(HNB__Cell__Identifier_template* p_precondition, HNB__Cell__Identifier_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNB__Cell__Identifier_template::HNB__Cell__Identifier_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; } HNB__Cell__Identifier_template::HNB__Cell__Identifier_template(const HNB__Cell__Identifier_template& other_value) : Base_Template() { copy_template(other_value); } HNB__Cell__Identifier_template::~HNB__Cell__Identifier_template() { clean_up(); } HNB__Cell__Identifier_template& HNB__Cell__Identifier_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNB__Cell__Identifier_template& HNB__Cell__Identifier_template::operator=(const HNB__Cell__Identifier& other_value) { clean_up(); copy_value(other_value); return *this; } HNB__Cell__Identifier_template& HNB__Cell__Identifier_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNB__Cell__Identifier&)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 @HNBAP-IEs.HNB-Cell-Identifier."); } return *this; } HNB__Cell__Identifier_template& HNB__Cell__Identifier_template::operator=(const HNB__Cell__Identifier_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNB__Cell__Identifier_template::match(const HNB__Cell__Identifier& 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.pLMNidentity().is_bound()) return FALSE; if(!single_value->field_pLMNidentity.match(other_value.pLMNidentity(), legacy))return FALSE; if(!other_value.cellIdentity().is_bound()) return FALSE; if(!single_value->field_cellIdentity.match(other_value.cellIdentity(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6&)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 @HNBAP-IEs.HNB-Cell-Identifier."); } return FALSE; } boolean HNB__Cell__Identifier_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_pLMNidentity.is_bound() || single_value->field_cellIdentity.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean HNB__Cell__Identifier_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_pLMNidentity.is_value() && single_value->field_cellIdentity.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void HNB__Cell__Identifier_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; } HNB__Cell__Identifier HNB__Cell__Identifier_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 @HNBAP-IEs.HNB-Cell-Identifier."); HNB__Cell__Identifier ret_val; if (single_value->field_pLMNidentity.is_bound()) { ret_val.pLMNidentity() = single_value->field_pLMNidentity.valueof(); } if (single_value->field_cellIdentity.is_bound()) { ret_val.cellIdentity() = single_value->field_cellIdentity.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 HNB__Cell__Identifier_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 @HNBAP-IEs.HNB-Cell-Identifier."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HNB__Cell__Identifier_template[list_length]; } HNB__Cell__Identifier_template& HNB__Cell__Identifier_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 @HNBAP-IEs.HNB-Cell-Identifier."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.HNB-Cell-Identifier."); return value_list.list_value[list_index]; } OCTETSTRING_template& HNB__Cell__Identifier_template::pLMNidentity() { set_specific(); return single_value->field_pLMNidentity; } const OCTETSTRING_template& HNB__Cell__Identifier_template::pLMNidentity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pLMNidentity of a non-specific template of type @HNBAP-IEs.HNB-Cell-Identifier."); return single_value->field_pLMNidentity; } BITSTRING_template& HNB__Cell__Identifier_template::cellIdentity() { set_specific(); return single_value->field_cellIdentity; } const BITSTRING_template& HNB__Cell__Identifier_template::cellIdentity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cellIdentity of a non-specific template of type @HNBAP-IEs.HNB-Cell-Identifier."); return single_value->field_cellIdentity; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& HNB__Cell__Identifier_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& HNB__Cell__Identifier_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.HNB-Cell-Identifier."); return single_value->field_iE__Extensions; } int HNB__Cell__Identifier_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Cell-Identifier which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 2; 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 @HNBAP-IEs.HNB-Cell-Identifier 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 @HNBAP-IEs.HNB-Cell-Identifier containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Cell-Identifier containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Cell-Identifier containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Cell-Identifier containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Cell-Identifier containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Cell-Identifier containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Cell-Identifier containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.HNB-Cell-Identifier."); } return 0; } void HNB__Cell__Identifier_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pLMNidentity := "); single_value->field_pLMNidentity.log(); TTCN_Logger::log_event_str(", cellIdentity := "); single_value->field_cellIdentity.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 HNB__Cell__Identifier_template::log_match(const HNB__Cell__Identifier& 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_pLMNidentity.match(match_value.pLMNidentity(), legacy)){ TTCN_Logger::log_logmatch_info(".pLMNidentity"); single_value->field_pLMNidentity.log_match(match_value.pLMNidentity(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cellIdentity.match(match_value.cellIdentity(), legacy)){ TTCN_Logger::log_logmatch_info(".cellIdentity"); single_value->field_cellIdentity.log_match(match_value.cellIdentity(), 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("{ pLMNidentity := "); single_value->field_pLMNidentity.log_match(match_value.pLMNidentity(), legacy); TTCN_Logger::log_event_str(", cellIdentity := "); single_value->field_cellIdentity.log_match(match_value.cellIdentity(), 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 HNB__Cell__Identifier_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (pLMNidentity().is_bound()) pLMNidentity().set_implicit_omit(); if (cellIdentity().is_bound()) cellIdentity().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNB__Cell__Identifier_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pLMNidentity.encode_text(text_buf); single_value->field_cellIdentity.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 @HNBAP-IEs.HNB-Cell-Identifier."); } } void HNB__Cell__Identifier_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_pLMNidentity.decode_text(text_buf); single_value->field_cellIdentity.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 HNB__Cell__Identifier_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 @HNBAP-IEs.HNB-Cell-Identifier."); } } void HNB__Cell__Identifier_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: { HNB__Cell__Identifier_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) pLMNidentity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cellIdentity().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "pLMNidentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pLMNidentity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cellIdentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cellIdentity().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 @HNBAP-IEs.HNB-Cell-Identifier: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { HNB__Cell__Identifier_template* precondition = new HNB__Cell__Identifier_template; precondition->set_param(*param.get_elem(0)); HNB__Cell__Identifier_template* implied_template = new HNB__Cell__Identifier_template; implied_template->set_param(*param.get_elem(1)); *this = HNB__Cell__Identifier_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.HNB-Cell-Identifier"); } is_ifpresent = param.get_ifpresent(); } void HNB__Cell__Identifier_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_pLMNidentity.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-Cell-Identifier"); single_value->field_cellIdentity.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-Cell-Identifier"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-Cell-Identifier"); 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 : "@HNBAP-IEs.HNB-Cell-Identifier"); } boolean HNB__Cell__Identifier_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNB__Cell__Identifier_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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(); default: TTCN_error("Invalid selection in union is_bound");} } void HNB__RNL__Identity::clean_up() { switch (union_selection) { case ALT_hNB__Identity__as__Cell__Identifier: delete field_hNB__Identity__as__Cell__Identifier; break; default: break; } union_selection = UNBOUND_VALUE; } void HNB__RNL__Identity::log() const { switch (union_selection) { case ALT_hNB__Identity__as__Cell__Identifier: TTCN_Logger::log_event_str("{ hNB_Identity_as_Cell_Identifier := "); field_hNB__Identity__as__Cell__Identifier->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void HNB__RNL__Identity::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, "hNB_Identity_as_Cell_Identifier")) { hNB__Identity__as__Cell__Identifier().set_param(*mp_last); if (!hNB__Identity__as__Cell__Identifier().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.HNB-RNL-Identity.", last_name); } void HNB__RNL__Identity::set_implicit_omit() { switch (union_selection) { case ALT_hNB__Identity__as__Cell__Identifier: field_hNB__Identity__as__Cell__Identifier->set_implicit_omit(); break; default: break; } } void HNB__RNL__Identity::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_hNB__Identity__as__Cell__Identifier: field_hNB__Identity__as__Cell__Identifier->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @HNBAP-IEs.HNB-RNL-Identity."); } } void HNB__RNL__Identity::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_hNB__Identity__as__Cell__Identifier: hNB__Identity__as__Cell__Identifier().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @HNBAP-IEs.HNB-RNL-Identity."); } } void HNB__RNL__Identity::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 HNB__RNL__Identity::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 *HNB__RNL__Identity::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_hNB__Identity__as__Cell__Identifier: ec_1.set_msg("hNB_Identity_as_Cell_Identifier': "); new_tlv = field_hNB__Identity__as__Cell__Identifier->BER_encode_TLV(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_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 HNB__RNL__Identity::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_hNB__Identity__as__Cell__Identifier = new HNB__Cell__Identifier; union_selection = ALT_hNB__Identity__as__Cell__Identifier; if (field_hNB__Identity__as__Cell__Identifier->BER_decode_isMyMsg(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_, p_tlv)) return TRUE; delete field_hNB__Identity__as__Cell__Identifier; union_selection = UNBOUND_VALUE; return FALSE; } boolean HNB__RNL__Identity::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { HNB__RNL__Identity tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean HNB__RNL__Identity::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 '@HNBAP-IEs.HNB-RNL-Identity' 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_hNB__Identity__as__Cell__Identifier: ec_2.set_msg("hNB_Identity_as_Cell_Identifier': "); field_hNB__Identity__as__Cell__Identifier->BER_decode_TLV(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int HNB__RNL__Identity::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_hNB__Identity__as__Cell__Identifier: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "hNB_Identity_as_Cell_Identifier"); } enc_len += field_hNB__Identity__as__Cell__Identifier->JSON_encode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.HNB-RNL-Identity."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int HNB__RNL__Identity::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 && 1 > p_chosen_field) { switch (p_chosen_field) { case 0: return hNB__Identity__as__Cell__Identifier().JSON_decode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_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 '@HNBAP-IEs.HNB-RNL-Identity'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "string '@HNBAP-IEs.HNB-RNL-Identity'"); 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 '@HNBAP-IEs.HNB-RNL-Identity'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { p_tok.set_buf_pos(buf_pos); ret_val = hNB__Identity__as__Cell__Identifier().JSON_decode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_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 '@HNBAP-IEs.HNB-RNL-Identity'"); 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 (31 == name_len && 0 == strncmp(fld_name, "hNB_Identity_as_Cell_Identifier", name_len)) { int ret_val = hNB__Identity__as__Cell__Identifier().JSON_decode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_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, 31, "hNB_Identity_as_Cell_Identifier"); } 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 HNB__RNL__Identity::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_hNB__Identity__as__Cell__Identifier: {TTCN_Buffer buf; encode_oer_tag(*HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_.ber, p_buf); field_hNB__Identity__as__Cell__Identifier->OER_encode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.HNB-RNL-Identity."); return -1; } return 0; } int HNB__RNL__Identity::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 (HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_.ber->tags[HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_.ber->n_tags-1].tagclass == descr.tagclass && HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_.ber->tags[HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { hNB__Identity__as__Cell__Identifier().OER_decode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type HNB__RNL__Identity"); } return 0; } void HNB__RNL__Identity::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_hNB__Identity__as__Cell__Identifier: { field_hNB__Identity__as__Cell__Identifier->PER_encode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_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 HNB__RNL__Identity::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 { hNB__Identity__as__Cell__Identifier().PER_decode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_, p_buf, p_options); } } void HNB__RNL__Identity_template::copy_value(const HNB__RNL__Identity& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: single_value.field_hNB__Identity__as__Cell__Identifier = new HNB__Cell__Identifier_template(other_value.hNB__Identity__as__Cell__Identifier()); break; default: TTCN_error("Initializing a template with an unbound value of type @HNBAP-IEs.HNB-RNL-Identity."); } set_selection(SPECIFIC_VALUE); } void HNB__RNL__Identity_template::copy_template(const HNB__RNL__Identity_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 HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: single_value.field_hNB__Identity__as__Cell__Identifier = new HNB__Cell__Identifier_template(*other_value.single_value.field_hNB__Identity__as__Cell__Identifier); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @HNBAP-IEs.HNB-RNL-Identity."); } 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 HNB__RNL__Identity_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 HNB__RNL__Identity_template(*other_value.implication_.precondition); implication_.implied_template = new HNB__RNL__Identity_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 @HNBAP-IEs.HNB-RNL-Identity."); } set_selection(other_value); } HNB__RNL__Identity_template::HNB__RNL__Identity_template() { } HNB__RNL__Identity_template::HNB__RNL__Identity_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNB__RNL__Identity_template::HNB__RNL__Identity_template(const HNB__RNL__Identity& other_value) { copy_value(other_value); } HNB__RNL__Identity_template::HNB__RNL__Identity_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNB__RNL__Identity&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-IEs.HNB-RNL-Identity from an unbound optional field."); } } HNB__RNL__Identity_template::HNB__RNL__Identity_template(HNB__RNL__Identity_template* p_precondition, HNB__RNL__Identity_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNB__RNL__Identity_template::HNB__RNL__Identity_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; } HNB__RNL__Identity_template::HNB__RNL__Identity_template(const HNB__RNL__Identity_template& other_value) : Base_Template(){ copy_template(other_value); } HNB__RNL__Identity_template::~HNB__RNL__Identity_template() { clean_up(); } void HNB__RNL__Identity_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: delete single_value.field_hNB__Identity__as__Cell__Identifier; 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; } HNB__RNL__Identity_template& HNB__RNL__Identity_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNB__RNL__Identity_template& HNB__RNL__Identity_template::operator=(const HNB__RNL__Identity& other_value) { clean_up(); copy_value(other_value); return *this; } HNB__RNL__Identity_template& HNB__RNL__Identity_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNB__RNL__Identity&)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 @HNBAP-IEs.HNB-RNL-Identity."); } return *this; } HNB__RNL__Identity_template& HNB__RNL__Identity_template::operator=(const HNB__RNL__Identity_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNB__RNL__Identity_template::match(const HNB__RNL__Identity& 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: { HNB__RNL__Identity::union_selection_type value_selection = other_value.get_selection(); if (value_selection == HNB__RNL__Identity::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: return single_value.field_hNB__Identity__as__Cell__Identifier->match(other_value.hNB__Identity__as__Cell__Identifier(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @HNBAP-IEs.HNB-RNL-Identity."); } } 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 @HNBAP-IEs.HNB-RNL-Identity."); } return FALSE; } boolean HNB__RNL__Identity_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: return single_value.field_hNB__Identity__as__Cell__Identifier->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @HNBAP-IEs.HNB-RNL-Identity."); } } HNB__RNL__Identity HNB__RNL__Identity_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 @HNBAP-IEs.HNB-RNL-Identity."); HNB__RNL__Identity ret_val; switch (single_value.union_selection) { case HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: ret_val.hNB__Identity__as__Cell__Identifier() = single_value.field_hNB__Identity__as__Cell__Identifier->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @HNBAP-IEs.HNB-RNL-Identity."); } return ret_val; } HNB__RNL__Identity_template& HNB__RNL__Identity_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 @HNBAP-IEs.HNB-RNL-Identity."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-IEs.HNB-RNL-Identity."); return value_list.list_value[list_index]; } void HNB__RNL__Identity_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 @HNBAP-IEs.HNB-RNL-Identity."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HNB__RNL__Identity_template[list_length]; } HNB__Cell__Identifier_template& HNB__RNL__Identity_template::hNB__Identity__as__Cell__Identifier() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_hNB__Identity__as__Cell__Identifier = new HNB__Cell__Identifier_template(ANY_VALUE); else single_value.field_hNB__Identity__as__Cell__Identifier = new HNB__Cell__Identifier_template; single_value.union_selection = HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier; set_selection(SPECIFIC_VALUE); } return *single_value.field_hNB__Identity__as__Cell__Identifier; } const HNB__Cell__Identifier_template& HNB__RNL__Identity_template::hNB__Identity__as__Cell__Identifier() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hNB_Identity_as_Cell_Identifier in a non-specific template of union type @HNBAP-IEs.HNB-RNL-Identity."); if (single_value.union_selection != HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier) TTCN_error("Accessing non-selected field hNB_Identity_as_Cell_Identifier in a template of union type @HNBAP-IEs.HNB-RNL-Identity."); return *single_value.field_hNB__Identity__as__Cell__Identifier; } boolean HNB__RNL__Identity_template::ischosen(HNB__RNL__Identity::union_selection_type checked_selection) const { if (checked_selection == HNB__RNL__Identity::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-IEs.HNB-RNL-Identity."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == HNB__RNL__Identity::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-IEs.HNB-RNL-Identity."); 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 @HNBAP-IEs.HNB-RNL-Identity 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 HNB__RNL__Identity_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: TTCN_Logger::log_event_str("{ hNB_Identity_as_Cell_Identifier := "); single_value.field_hNB__Identity__as__Cell__Identifier->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 HNB__RNL__Identity_template::log_match(const HNB__RNL__Identity& 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 HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".hNB_Identity_as_Cell_Identifier"); single_value.field_hNB__Identity__as__Cell__Identifier->log_match(match_value.hNB__Identity__as__Cell__Identifier(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ hNB_Identity_as_Cell_Identifier := "); single_value.field_hNB__Identity__as__Cell__Identifier->log_match(match_value.hNB__Identity__as__Cell__Identifier(), 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 HNB__RNL__Identity_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: single_value.field_hNB__Identity__as__Cell__Identifier->set_implicit_omit(); break; default: break; } } void HNB__RNL__Identity_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 HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: single_value.field_hNB__Identity__as__Cell__Identifier->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @HNBAP-IEs.HNB-RNL-Identity."); } 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 @HNBAP-IEs.HNB-RNL-Identity."); } } void HNB__RNL__Identity_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = HNB__RNL__Identity::UNBOUND_VALUE; HNB__RNL__Identity::union_selection_type new_selection = (HNB__RNL__Identity::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: single_value.field_hNB__Identity__as__Cell__Identifier = new HNB__Cell__Identifier_template; single_value.field_hNB__Identity__as__Cell__Identifier->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @HNBAP-IEs.HNB-RNL-Identity."); } 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 HNB__RNL__Identity_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 @HNBAP-IEs.HNB-RNL-Identity."); } } boolean HNB__RNL__Identity_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNB__RNL__Identity_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 `@HNBAP-IEs.HNB-RNL-Identity'"); } if (strcmp("hNB_Identity_as_Cell_Identifier", param_field) == 0) { hNB__Identity__as__Cell__Identifier().set_param(param); return; } else param.error("Field `%s' not found in union template type `@HNBAP-IEs.HNB-RNL-Identity'", 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: { HNB__RNL__Identity_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", "@HNBAP-IEs.HNB-RNL-Identity"); 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, "hNB_Identity_as_Cell_Identifier")) { hNB__Identity__as__Cell__Identifier().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.HNB-RNL-Identity.", last_name); } break; case Module_Param::MP_Implication_Template: { HNB__RNL__Identity_template* precondition = new HNB__RNL__Identity_template; precondition->set_param(*m_p->get_elem(0)); HNB__RNL__Identity_template* implied_template = new HNB__RNL__Identity_template; implied_template->set_param(*m_p->get_elem(1)); *this = HNB__RNL__Identity_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-IEs.HNB-RNL-Identity"); } is_ifpresent = param.get_ifpresent(); } void HNB__RNL__Identity_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 HNB__RNL__Identity::ALT_hNB__Identity__as__Cell__Identifier: single_value.field_hNB__Identity__as__Cell__Identifier->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-RNL-Identity"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @HNBAP-IEs.HNB-RNL-Identity."); } 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 : "@HNBAP-IEs.HNB-RNL-Identity"); } void ConfigurationInformation::copy_value(const ConfigurationInformation& other_value) { switch (other_value.union_selection) { case ALT_provided: field_provided = new HNBConfigurationInformationProvided(*other_value.field_provided); break; case ALT_missing: field_missing = new HNBConfigurationInformationMissing(*other_value.field_missing); break; default: TTCN_error("Assignment of an unbound union value of type @HNBAP-IEs.ConfigurationInformation."); } union_selection = other_value.union_selection; } ConfigurationInformation::ConfigurationInformation() { union_selection = UNBOUND_VALUE; } ConfigurationInformation::ConfigurationInformation(const ConfigurationInformation& other_value) : Base_Type(){ copy_value(other_value); } ConfigurationInformation::~ConfigurationInformation() { clean_up(); } ConfigurationInformation& ConfigurationInformation::operator=(const ConfigurationInformation& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean ConfigurationInformation::operator==(const ConfigurationInformation& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-IEs.ConfigurationInformation."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-IEs.ConfigurationInformation."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { case ALT_provided: return *field_provided == *other_value.field_provided; case ALT_missing: return *field_missing == *other_value.field_missing; default: return FALSE; } } HNBConfigurationInformationProvided& ConfigurationInformation::provided() { if (union_selection != ALT_provided) { clean_up(); field_provided = new HNBConfigurationInformationProvided; union_selection = ALT_provided; } return *field_provided; } const HNBConfigurationInformationProvided& ConfigurationInformation::provided() const { if (union_selection != ALT_provided) TTCN_error("Using non-selected field provided in a value of union type @HNBAP-IEs.ConfigurationInformation."); return *field_provided; } HNBConfigurationInformationMissing& ConfigurationInformation::missing() { if (union_selection != ALT_missing) { clean_up(); field_missing = new HNBConfigurationInformationMissing; union_selection = ALT_missing; } return *field_missing; } const HNBConfigurationInformationMissing& ConfigurationInformation::missing() const { if (union_selection != ALT_missing) TTCN_error("Using non-selected field missing in a value of union type @HNBAP-IEs.ConfigurationInformation."); return *field_missing; } boolean ConfigurationInformation::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 @HNBAP-IEs.ConfigurationInformation."); return union_selection == checked_selection; } boolean ConfigurationInformation::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean ConfigurationInformation::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; case ALT_provided: return field_provided->is_value(); case ALT_missing: return field_missing->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void ConfigurationInformation::clean_up() { switch (union_selection) { case ALT_provided: delete field_provided; break; case ALT_missing: delete field_missing; break; default: break; } union_selection = UNBOUND_VALUE; } void ConfigurationInformation::log() const { switch (union_selection) { case ALT_provided: TTCN_Logger::log_event_str("{ provided := "); field_provided->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_missing: TTCN_Logger::log_event_str("{ missing := "); field_missing->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void ConfigurationInformation::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, "provided")) { provided().set_param(*mp_last); if (!provided().is_bound()) clean_up(); return; } if (!strcmp(last_name, "missing")) { missing().set_param(*mp_last); if (!missing().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.ConfigurationInformation.", last_name); } void ConfigurationInformation::set_implicit_omit() { switch (union_selection) { case ALT_provided: field_provided->set_implicit_omit(); break; case ALT_missing: field_missing->set_implicit_omit(); break; default: break; } } void ConfigurationInformation::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_provided: field_provided->encode_text(text_buf); break; case ALT_missing: field_missing->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @HNBAP-IEs.ConfigurationInformation."); } } void ConfigurationInformation::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_provided: provided().decode_text(text_buf); break; case ALT_missing: missing().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @HNBAP-IEs.ConfigurationInformation."); } } void ConfigurationInformation::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 ConfigurationInformation::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 *ConfigurationInformation::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_provided: ec_1.set_msg("provided': "); new_tlv = field_provided->BER_encode_TLV(ConfigurationInformation_provided_descr_, p_coding); break; case ALT_missing: ec_1.set_msg("missing': "); new_tlv = field_missing->BER_encode_TLV(ConfigurationInformation_missing_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 ConfigurationInformation::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_provided = new HNBConfigurationInformationProvided; union_selection = ALT_provided; if (field_provided->BER_decode_isMyMsg(ConfigurationInformation_provided_descr_, p_tlv)) return TRUE; delete field_provided; field_missing = new HNBConfigurationInformationMissing; union_selection = ALT_missing; if (field_missing->BER_decode_isMyMsg(ConfigurationInformation_missing_descr_, p_tlv)) return TRUE; delete field_missing; union_selection = UNBOUND_VALUE; return FALSE; } boolean ConfigurationInformation::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { ConfigurationInformation tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean ConfigurationInformation::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 '@HNBAP-IEs.ConfigurationInformation' 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_provided: ec_2.set_msg("provided': "); field_provided->BER_decode_TLV(ConfigurationInformation_provided_descr_, tmp_tlv, L_form); break; case ALT_missing: ec_2.set_msg("missing': "); field_missing->BER_decode_TLV(ConfigurationInformation_missing_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int ConfigurationInformation::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_provided: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "provided"); } enc_len += field_provided->JSON_encode(ConfigurationInformation_provided_descr_, p_tok, FALSE); break; case ALT_missing: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "missing"); } enc_len += field_missing->JSON_encode(ConfigurationInformation_missing_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.ConfigurationInformation."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int ConfigurationInformation::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 provided().JSON_decode(ConfigurationInformation_provided_descr_, p_tok, TRUE, FALSE); case 1: return missing().JSON_decode(ConfigurationInformation_missing_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 '@HNBAP-IEs.ConfigurationInformation'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "string '@HNBAP-IEs.ConfigurationInformation'"); 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 '@HNBAP-IEs.ConfigurationInformation'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { p_tok.set_buf_pos(buf_pos); ret_val = provided().JSON_decode(ConfigurationInformation_provided_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = missing().JSON_decode(ConfigurationInformation_missing_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 '@HNBAP-IEs.ConfigurationInformation'"); 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 (8 == name_len && 0 == strncmp(fld_name, "provided", name_len)) { int ret_val = provided().JSON_decode(ConfigurationInformation_provided_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, "provided"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (7 == name_len && 0 == strncmp(fld_name, "missing", name_len)) { int ret_val = missing().JSON_decode(ConfigurationInformation_missing_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, "missing"); } 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 ConfigurationInformation::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_provided: {TTCN_Buffer buf; encode_oer_tag(*ConfigurationInformation_provided_descr_.ber, p_buf); field_provided->OER_encode(ConfigurationInformation_provided_descr_, buf); p_buf.put_buf(buf); break; } case ALT_missing: {TTCN_Buffer buf; encode_oer_tag(*ConfigurationInformation_missing_descr_.ber, p_buf); field_missing->OER_encode(ConfigurationInformation_missing_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.ConfigurationInformation."); return -1; } return 0; } int ConfigurationInformation::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 (ConfigurationInformation_provided_descr_.ber->tags[ConfigurationInformation_provided_descr_.ber->n_tags-1].tagclass == descr.tagclass && ConfigurationInformation_provided_descr_.ber->tags[ConfigurationInformation_provided_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { provided().OER_decode(ConfigurationInformation_provided_descr_, p_buf, p_oer); } else if (ConfigurationInformation_missing_descr_.ber->tags[ConfigurationInformation_missing_descr_.ber->n_tags-1].tagclass == descr.tagclass && ConfigurationInformation_missing_descr_.ber->tags[ConfigurationInformation_missing_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { missing().OER_decode(ConfigurationInformation_missing_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type ConfigurationInformation"); } return 0; } void ConfigurationInformation::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_provided: { INTEGER::PER_encode_int(p_buf, 0, 1); field_provided->PER_encode(ConfigurationInformation_provided_descr_, p_buf, p_options); break; } case ALT_missing: { INTEGER::PER_encode_int(p_buf, 1, 1); field_missing->PER_encode(ConfigurationInformation_missing_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 ConfigurationInformation::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, 1, FALSE, sel_int); switch (sel_int) { case 0: provided().PER_decode(ConfigurationInformation_provided_descr_, p_buf, p_options); break; case 1: missing().PER_decode(ConfigurationInformation_missing_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 ConfigurationInformation_template::copy_value(const ConfigurationInformation& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case ConfigurationInformation::ALT_provided: single_value.field_provided = new HNBConfigurationInformationProvided_template(other_value.provided()); break; case ConfigurationInformation::ALT_missing: single_value.field_missing = new HNBConfigurationInformationMissing_template(other_value.missing()); break; default: TTCN_error("Initializing a template with an unbound value of type @HNBAP-IEs.ConfigurationInformation."); } set_selection(SPECIFIC_VALUE); } void ConfigurationInformation_template::copy_template(const ConfigurationInformation_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 ConfigurationInformation::ALT_provided: single_value.field_provided = new HNBConfigurationInformationProvided_template(*other_value.single_value.field_provided); break; case ConfigurationInformation::ALT_missing: single_value.field_missing = new HNBConfigurationInformationMissing_template(*other_value.single_value.field_missing); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @HNBAP-IEs.ConfigurationInformation."); } 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 ConfigurationInformation_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 ConfigurationInformation_template(*other_value.implication_.precondition); implication_.implied_template = new ConfigurationInformation_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 @HNBAP-IEs.ConfigurationInformation."); } set_selection(other_value); } ConfigurationInformation_template::ConfigurationInformation_template() { } ConfigurationInformation_template::ConfigurationInformation_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } ConfigurationInformation_template::ConfigurationInformation_template(const ConfigurationInformation& other_value) { copy_value(other_value); } ConfigurationInformation_template::ConfigurationInformation_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ConfigurationInformation&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-IEs.ConfigurationInformation from an unbound optional field."); } } ConfigurationInformation_template::ConfigurationInformation_template(ConfigurationInformation_template* p_precondition, ConfigurationInformation_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } ConfigurationInformation_template::ConfigurationInformation_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; } ConfigurationInformation_template::ConfigurationInformation_template(const ConfigurationInformation_template& other_value) : Base_Template(){ copy_template(other_value); } ConfigurationInformation_template::~ConfigurationInformation_template() { clean_up(); } void ConfigurationInformation_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case ConfigurationInformation::ALT_provided: delete single_value.field_provided; break; case ConfigurationInformation::ALT_missing: delete single_value.field_missing; 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; } ConfigurationInformation_template& ConfigurationInformation_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } ConfigurationInformation_template& ConfigurationInformation_template::operator=(const ConfigurationInformation& other_value) { clean_up(); copy_value(other_value); return *this; } ConfigurationInformation_template& ConfigurationInformation_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ConfigurationInformation&)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 @HNBAP-IEs.ConfigurationInformation."); } return *this; } ConfigurationInformation_template& ConfigurationInformation_template::operator=(const ConfigurationInformation_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean ConfigurationInformation_template::match(const ConfigurationInformation& 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: { ConfigurationInformation::union_selection_type value_selection = other_value.get_selection(); if (value_selection == ConfigurationInformation::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case ConfigurationInformation::ALT_provided: return single_value.field_provided->match(other_value.provided(), legacy); case ConfigurationInformation::ALT_missing: return single_value.field_missing->match(other_value.missing(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @HNBAP-IEs.ConfigurationInformation."); } } 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 @HNBAP-IEs.ConfigurationInformation."); } return FALSE; } boolean ConfigurationInformation_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case ConfigurationInformation::ALT_provided: return single_value.field_provided->is_value(); case ConfigurationInformation::ALT_missing: return single_value.field_missing->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @HNBAP-IEs.ConfigurationInformation."); } } ConfigurationInformation ConfigurationInformation_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 @HNBAP-IEs.ConfigurationInformation."); ConfigurationInformation ret_val; switch (single_value.union_selection) { case ConfigurationInformation::ALT_provided: ret_val.provided() = single_value.field_provided->valueof(); break; case ConfigurationInformation::ALT_missing: ret_val.missing() = single_value.field_missing->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @HNBAP-IEs.ConfigurationInformation."); } return ret_val; } ConfigurationInformation_template& ConfigurationInformation_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 @HNBAP-IEs.ConfigurationInformation."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-IEs.ConfigurationInformation."); return value_list.list_value[list_index]; } void ConfigurationInformation_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 @HNBAP-IEs.ConfigurationInformation."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new ConfigurationInformation_template[list_length]; } HNBConfigurationInformationProvided_template& ConfigurationInformation_template::provided() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ConfigurationInformation::ALT_provided) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_provided = new HNBConfigurationInformationProvided_template(ANY_VALUE); else single_value.field_provided = new HNBConfigurationInformationProvided_template; single_value.union_selection = ConfigurationInformation::ALT_provided; set_selection(SPECIFIC_VALUE); } return *single_value.field_provided; } const HNBConfigurationInformationProvided_template& ConfigurationInformation_template::provided() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field provided in a non-specific template of union type @HNBAP-IEs.ConfigurationInformation."); if (single_value.union_selection != ConfigurationInformation::ALT_provided) TTCN_error("Accessing non-selected field provided in a template of union type @HNBAP-IEs.ConfigurationInformation."); return *single_value.field_provided; } HNBConfigurationInformationMissing_template& ConfigurationInformation_template::missing() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != ConfigurationInformation::ALT_missing) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_missing = new HNBConfigurationInformationMissing_template(ANY_VALUE); else single_value.field_missing = new HNBConfigurationInformationMissing_template; single_value.union_selection = ConfigurationInformation::ALT_missing; set_selection(SPECIFIC_VALUE); } return *single_value.field_missing; } const HNBConfigurationInformationMissing_template& ConfigurationInformation_template::missing() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field missing in a non-specific template of union type @HNBAP-IEs.ConfigurationInformation."); if (single_value.union_selection != ConfigurationInformation::ALT_missing) TTCN_error("Accessing non-selected field missing in a template of union type @HNBAP-IEs.ConfigurationInformation."); return *single_value.field_missing; } boolean ConfigurationInformation_template::ischosen(ConfigurationInformation::union_selection_type checked_selection) const { if (checked_selection == ConfigurationInformation::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-IEs.ConfigurationInformation."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == ConfigurationInformation::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-IEs.ConfigurationInformation."); 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 @HNBAP-IEs.ConfigurationInformation 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 ConfigurationInformation_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case ConfigurationInformation::ALT_provided: TTCN_Logger::log_event_str("{ provided := "); single_value.field_provided->log(); TTCN_Logger::log_event_str(" }"); break; case ConfigurationInformation::ALT_missing: TTCN_Logger::log_event_str("{ missing := "); single_value.field_missing->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 ConfigurationInformation_template::log_match(const ConfigurationInformation& 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 ConfigurationInformation::ALT_provided: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".provided"); single_value.field_provided->log_match(match_value.provided(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ provided := "); single_value.field_provided->log_match(match_value.provided(), legacy); TTCN_Logger::log_event_str(" }"); } break; case ConfigurationInformation::ALT_missing: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".missing"); single_value.field_missing->log_match(match_value.missing(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ missing := "); single_value.field_missing->log_match(match_value.missing(), 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 ConfigurationInformation_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case ConfigurationInformation::ALT_provided: single_value.field_provided->set_implicit_omit(); break; case ConfigurationInformation::ALT_missing: single_value.field_missing->set_implicit_omit(); break; default: break; } } void ConfigurationInformation_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 ConfigurationInformation::ALT_provided: single_value.field_provided->encode_text(text_buf); break; case ConfigurationInformation::ALT_missing: single_value.field_missing->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @HNBAP-IEs.ConfigurationInformation."); } 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 @HNBAP-IEs.ConfigurationInformation."); } } void ConfigurationInformation_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = ConfigurationInformation::UNBOUND_VALUE; ConfigurationInformation::union_selection_type new_selection = (ConfigurationInformation::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case ConfigurationInformation::ALT_provided: single_value.field_provided = new HNBConfigurationInformationProvided_template; single_value.field_provided->decode_text(text_buf); break; case ConfigurationInformation::ALT_missing: single_value.field_missing = new HNBConfigurationInformationMissing_template; single_value.field_missing->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @HNBAP-IEs.ConfigurationInformation."); } 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 ConfigurationInformation_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 @HNBAP-IEs.ConfigurationInformation."); } } boolean ConfigurationInformation_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean ConfigurationInformation_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 `@HNBAP-IEs.ConfigurationInformation'"); } if (strcmp("provided", param_field) == 0) { provided().set_param(param); return; } else if (strcmp("missing", param_field) == 0) { missing().set_param(param); return; } else param.error("Field `%s' not found in union template type `@HNBAP-IEs.ConfigurationInformation'", 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: { ConfigurationInformation_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", "@HNBAP-IEs.ConfigurationInformation"); 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, "provided")) { provided().set_param(*mp_last); break; } if (!strcmp(last_name, "missing")) { missing().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.ConfigurationInformation.", last_name); } break; case Module_Param::MP_Implication_Template: { ConfigurationInformation_template* precondition = new ConfigurationInformation_template; precondition->set_param(*m_p->get_elem(0)); ConfigurationInformation_template* implied_template = new ConfigurationInformation_template; implied_template->set_param(*m_p->get_elem(1)); *this = ConfigurationInformation_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-IEs.ConfigurationInformation"); } is_ifpresent = param.get_ifpresent(); } void ConfigurationInformation_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 ConfigurationInformation::ALT_provided: single_value.field_provided->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.ConfigurationInformation"); return; case ConfigurationInformation::ALT_missing: single_value.field_missing->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.ConfigurationInformation"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @HNBAP-IEs.ConfigurationInformation."); } 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 : "@HNBAP-IEs.ConfigurationInformation"); } const IP__Address Iurh__Signalling__TNL__AddressList::UNBOUND_ELEM; Iurh__Signalling__TNL__AddressList::Iurh__Signalling__TNL__AddressList() { val_ptr = NULL; } Iurh__Signalling__TNL__AddressList::Iurh__Signalling__TNL__AddressList(null_type) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } Iurh__Signalling__TNL__AddressList::Iurh__Signalling__TNL__AddressList(const Iurh__Signalling__TNL__AddressList& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } Iurh__Signalling__TNL__AddressList::~Iurh__Signalling__TNL__AddressList() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void Iurh__Signalling__TNL__AddressList::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."); } } Iurh__Signalling__TNL__AddressList& Iurh__Signalling__TNL__AddressList::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; } Iurh__Signalling__TNL__AddressList& Iurh__Signalling__TNL__AddressList::operator=(const Iurh__Signalling__TNL__AddressList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean Iurh__Signalling__TNL__AddressList::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); return val_ptr->n_elements == 0 ; } boolean Iurh__Signalling__TNL__AddressList::operator==(const Iurh__Signalling__TNL__AddressList& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); 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; } IP__Address& Iurh__Signalling__TNL__AddressList::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList 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 = (IP__Address**)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 IP__Address(*(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 IP__Address; } return *val_ptr->value_elements[index_value]; } IP__Address& Iurh__Signalling__TNL__AddressList::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); return (*this)[(int)index_value]; } const IP__Address& Iurh__Signalling__TNL__AddressList::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList: 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 IP__Address& Iurh__Signalling__TNL__AddressList::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); return (*this)[(int)index_value]; } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); 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; Iurh__Signalling__TNL__AddressList 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 IP__Address(*val_ptr->value_elements[i]); } } return ret_val; } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList::operator+(const Iurh__Signalling__TNL__AddressList& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.Iurh-Signalling-TNL-AddressList concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; Iurh__Signalling__TNL__AddressList 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 IP__Address(*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 IP__Address(*other_value.val_ptr->value_elements[i]); } } return ret_val; } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList","element"); Iurh__Signalling__TNL__AddressList ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new IP__Address(*val_ptr->value_elements[i+index]); } } return ret_val; } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList::replace(int index, int len, const Iurh__Signalling__TNL__AddressList& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList","element"); Iurh__Signalling__TNL__AddressList 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 IP__Address(*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 IP__Address(*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 IP__Address(*val_ptr->value_elements[index+i+len]); } } return ret_val; } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList::replace(int index, int len, const Iurh__Signalling__TNL__AddressList_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 Iurh__Signalling__TNL__AddressList::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); 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 = (IP__Address**)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 IP__Address(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (IP__Address**)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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList: %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 = (IP__Address**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean Iurh__Signalling__TNL__AddressList::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 Iurh__Signalling__TNL__AddressList::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); return val_ptr->n_elements; } int Iurh__Signalling__TNL__AddressList::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); 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 Iurh__Signalling__TNL__AddressList::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 Iurh__Signalling__TNL__AddressList::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 Iurh__Signalling__TNL__AddressList::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", "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList"); } 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", "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void Iurh__Signalling__TNL__AddressList::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); 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 Iurh__Signalling__TNL__AddressList::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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); val_ptr->value_elements = (IP__Address**)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 IP__Address; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void Iurh__Signalling__TNL__AddressList::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 Iurh__Signalling__TNL__AddressList::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* Iurh__Signalling__TNL__AddressList::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 Iurh__Signalling__TNL__AddressList::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 = (IP__Address**)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 IP__Address; 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 Iurh__Signalling__TNL__AddressList::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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); 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 Iurh__Signalling__TNL__AddressList::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); } IP__Address* val = new IP__Address; 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 = (IP__Address**)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 Iurh__Signalling__TNL__AddressList::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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); 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 Iurh__Signalling__TNL__AddressList::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 Iurh__Signalling__TNL__AddressList::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 Iurh__Signalling__TNL__AddressList::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 Iurh__Signalling__TNL__AddressList_template::copy_value(const Iurh__Signalling__TNL__AddressList& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (IP__Address_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 IP__Address_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new IP__Address_template; } } set_selection(SPECIFIC_VALUE); } void Iurh__Signalling__TNL__AddressList_template::copy_template(const Iurh__Signalling__TNL__AddressList_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 = (IP__Address_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 IP__Address_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new IP__Address_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 Iurh__Signalling__TNL__AddressList_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 Iurh__Signalling__TNL__AddressList_template(*other_value.implication_.precondition); implication_.implied_template = new Iurh__Signalling__TNL__AddressList_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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); break; } set_selection(other_value); } boolean Iurh__Signalling__TNL__AddressList_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 Iurh__Signalling__TNL__AddressList_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const Iurh__Signalling__TNL__AddressList*)value_ptr)[value_index], legacy); else return ((const Iurh__Signalling__TNL__AddressList_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } Iurh__Signalling__TNL__AddressList_template::Iurh__Signalling__TNL__AddressList_template() { } Iurh__Signalling__TNL__AddressList_template::Iurh__Signalling__TNL__AddressList_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } Iurh__Signalling__TNL__AddressList_template::Iurh__Signalling__TNL__AddressList_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } Iurh__Signalling__TNL__AddressList_template::Iurh__Signalling__TNL__AddressList_template(const Iurh__Signalling__TNL__AddressList& other_value) { copy_value(other_value); } Iurh__Signalling__TNL__AddressList_template::Iurh__Signalling__TNL__AddressList_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Iurh__Signalling__TNL__AddressList&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList from an unbound optional field."); } } Iurh__Signalling__TNL__AddressList_template::Iurh__Signalling__TNL__AddressList_template(Iurh__Signalling__TNL__AddressList_template* p_precondition, Iurh__Signalling__TNL__AddressList_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Iurh__Signalling__TNL__AddressList_template::Iurh__Signalling__TNL__AddressList_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; } Iurh__Signalling__TNL__AddressList_template::Iurh__Signalling__TNL__AddressList_template(const Iurh__Signalling__TNL__AddressList_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } Iurh__Signalling__TNL__AddressList_template::~Iurh__Signalling__TNL__AddressList_template() { clean_up(); } void Iurh__Signalling__TNL__AddressList_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; } Iurh__Signalling__TNL__AddressList_template& Iurh__Signalling__TNL__AddressList_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Iurh__Signalling__TNL__AddressList_template& Iurh__Signalling__TNL__AddressList_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } Iurh__Signalling__TNL__AddressList_template& Iurh__Signalling__TNL__AddressList_template::operator=(const Iurh__Signalling__TNL__AddressList& other_value) { clean_up(); copy_value(other_value); return *this; } Iurh__Signalling__TNL__AddressList_template& Iurh__Signalling__TNL__AddressList_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Iurh__Signalling__TNL__AddressList&)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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); } return *this; } Iurh__Signalling__TNL__AddressList_template& Iurh__Signalling__TNL__AddressList_template::operator=(const Iurh__Signalling__TNL__AddressList_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } IP__Address_template& Iurh__Signalling__TNL__AddressList_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList 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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); break; } return *single_value.value_elements[index_value]; } IP__Address_template& Iurh__Signalling__TNL__AddressList_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); return (*this)[(int)index_value]; } const IP__Address_template& Iurh__Signalling__TNL__AddressList_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList: 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 IP__Address_template& Iurh__Signalling__TNL__AddressList_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); return (*this)[(int)index_value]; } void Iurh__Signalling__TNL__AddressList_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); 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 = (IP__Address_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 IP__Address_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 IP__Address_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 = (IP__Address_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int Iurh__Signalling__TNL__AddressList_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 Iurh__Signalling__TNL__AddressList_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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList 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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList 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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList 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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList 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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList 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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList"); } boolean Iurh__Signalling__TNL__AddressList_template::match(const Iurh__Signalling__TNL__AddressList& 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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); } return FALSE; } boolean Iurh__Signalling__TNL__AddressList_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; } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList_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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); Iurh__Signalling__TNL__AddressList 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; } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList_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); } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList_template::replace(int index, int len, const Iurh__Signalling__TNL__AddressList_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()); } Iurh__Signalling__TNL__AddressList Iurh__Signalling__TNL__AddressList_template::replace(int index, int len, const Iurh__Signalling__TNL__AddressList& 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 Iurh__Signalling__TNL__AddressList_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 Iurh__Signalling__TNL__AddressList_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); } set_selection(template_type); } Iurh__Signalling__TNL__AddressList_template& Iurh__Signalling__TNL__AddressList_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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); return value_list.list_value[list_index]; } void Iurh__Signalling__TNL__AddressList_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 Iurh__Signalling__TNL__AddressList_template::log_match(const Iurh__Signalling__TNL__AddressList& 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 Iurh__Signalling__TNL__AddressList_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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); } } void Iurh__Signalling__TNL__AddressList_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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); single_value.value_elements = (IP__Address_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 IP__Address_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 Iurh__Signalling__TNL__AddressList_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 @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); } } boolean Iurh__Signalling__TNL__AddressList_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Iurh__Signalling__TNL__AddressList_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 Iurh__Signalling__TNL__AddressList_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: { Iurh__Signalling__TNL__AddressList_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: { Iurh__Signalling__TNL__AddressList_template* precondition = new Iurh__Signalling__TNL__AddressList_template; precondition->set_param(*param.get_elem(0)); Iurh__Signalling__TNL__AddressList_template* implied_template = new Iurh__Signalling__TNL__AddressList_template; implied_template->set_param(*param.get_elem(1)); *this = Iurh__Signalling__TNL__AddressList_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void Iurh__Signalling__TNL__AddressList_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 : "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList"); 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 : "@HNBAP-IEs.Iurh-Signalling-TNL-AddressList"); } boolean Iurh__Signalling__TNL__AddressList_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 IP__Address_ipaddress::copy_value(const IP__Address_ipaddress& other_value) { switch (other_value.union_selection) { case ALT_ipv4info: field_ipv4info = new OCTETSTRING(*other_value.field_ipv4info); break; case ALT_ipv6info: field_ipv6info = new OCTETSTRING(*other_value.field_ipv6info); break; default: TTCN_error("Assignment of an unbound union value of type @HNBAP-IEs.IP-Address.ipaddress."); } union_selection = other_value.union_selection; } IP__Address_ipaddress::IP__Address_ipaddress() { union_selection = UNBOUND_VALUE; } IP__Address_ipaddress::IP__Address_ipaddress(const IP__Address_ipaddress& other_value) : Base_Type(){ copy_value(other_value); } IP__Address_ipaddress::~IP__Address_ipaddress() { clean_up(); } IP__Address_ipaddress& IP__Address_ipaddress::operator=(const IP__Address_ipaddress& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean IP__Address_ipaddress::operator==(const IP__Address_ipaddress& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-IEs.IP-Address.ipaddress."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-IEs.IP-Address.ipaddress."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { case ALT_ipv4info: return *field_ipv4info == *other_value.field_ipv4info; case ALT_ipv6info: return *field_ipv6info == *other_value.field_ipv6info; default: return FALSE; } } OCTETSTRING& IP__Address_ipaddress::ipv4info() { if (union_selection != ALT_ipv4info) { clean_up(); field_ipv4info = new OCTETSTRING; union_selection = ALT_ipv4info; } return *field_ipv4info; } const OCTETSTRING& IP__Address_ipaddress::ipv4info() const { if (union_selection != ALT_ipv4info) TTCN_error("Using non-selected field ipv4info in a value of union type @HNBAP-IEs.IP-Address.ipaddress."); return *field_ipv4info; } OCTETSTRING& IP__Address_ipaddress::ipv6info() { if (union_selection != ALT_ipv6info) { clean_up(); field_ipv6info = new OCTETSTRING; union_selection = ALT_ipv6info; } return *field_ipv6info; } const OCTETSTRING& IP__Address_ipaddress::ipv6info() const { if (union_selection != ALT_ipv6info) TTCN_error("Using non-selected field ipv6info in a value of union type @HNBAP-IEs.IP-Address.ipaddress."); return *field_ipv6info; } boolean IP__Address_ipaddress::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 @HNBAP-IEs.IP-Address.ipaddress."); return union_selection == checked_selection; } boolean IP__Address_ipaddress::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean IP__Address_ipaddress::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; case ALT_ipv4info: return field_ipv4info->is_value(); case ALT_ipv6info: return field_ipv6info->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void IP__Address_ipaddress::clean_up() { switch (union_selection) { case ALT_ipv4info: delete field_ipv4info; break; case ALT_ipv6info: delete field_ipv6info; break; default: break; } union_selection = UNBOUND_VALUE; } void IP__Address_ipaddress::log() const { switch (union_selection) { case ALT_ipv4info: TTCN_Logger::log_event_str("{ ipv4info := "); field_ipv4info->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_ipv6info: TTCN_Logger::log_event_str("{ ipv6info := "); field_ipv6info->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void IP__Address_ipaddress::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, "ipv4info")) { ipv4info().set_param(*mp_last); if (!ipv4info().is_bound()) clean_up(); return; } if (!strcmp(last_name, "ipv6info")) { ipv6info().set_param(*mp_last); if (!ipv6info().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.IP-Address.ipaddress.", last_name); } void IP__Address_ipaddress::set_implicit_omit() { switch (union_selection) { case ALT_ipv4info: field_ipv4info->set_implicit_omit(); break; case ALT_ipv6info: field_ipv6info->set_implicit_omit(); break; default: break; } } void IP__Address_ipaddress::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_ipv4info: field_ipv4info->encode_text(text_buf); break; case ALT_ipv6info: field_ipv6info->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @HNBAP-IEs.IP-Address.ipaddress."); } } void IP__Address_ipaddress::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_ipv4info: ipv4info().decode_text(text_buf); break; case ALT_ipv6info: ipv6info().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @HNBAP-IEs.IP-Address.ipaddress."); } } void IP__Address_ipaddress::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 IP__Address_ipaddress::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 *IP__Address_ipaddress::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_ipv4info: ec_1.set_msg("ipv4info': "); new_tlv = field_ipv4info->BER_encode_TLV(IP__Address_ipaddress_ipv4info_descr_, p_coding); break; case ALT_ipv6info: ec_1.set_msg("ipv6info': "); new_tlv = field_ipv6info->BER_encode_TLV(IP__Address_ipaddress_ipv6info_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 IP__Address_ipaddress::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_ipv4info = new OCTETSTRING; union_selection = ALT_ipv4info; if (field_ipv4info->BER_decode_isMyMsg(IP__Address_ipaddress_ipv4info_descr_, p_tlv)) return TRUE; delete field_ipv4info; field_ipv6info = new OCTETSTRING; union_selection = ALT_ipv6info; if (field_ipv6info->BER_decode_isMyMsg(IP__Address_ipaddress_ipv6info_descr_, p_tlv)) return TRUE; delete field_ipv6info; union_selection = UNBOUND_VALUE; return FALSE; } boolean IP__Address_ipaddress::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { IP__Address_ipaddress tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean IP__Address_ipaddress::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 '@HNBAP-IEs.IP-Address.ipaddress' 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_ipv4info: ec_2.set_msg("ipv4info': "); field_ipv4info->BER_decode_TLV(IP__Address_ipaddress_ipv4info_descr_, tmp_tlv, L_form); break; case ALT_ipv6info: ec_2.set_msg("ipv6info': "); field_ipv6info->BER_decode_TLV(IP__Address_ipaddress_ipv6info_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int IP__Address_ipaddress::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_ipv4info: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "ipv4info"); } enc_len += field_ipv4info->JSON_encode(IP__Address_ipaddress_ipv4info_descr_, p_tok, FALSE); break; case ALT_ipv6info: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "ipv6info"); } enc_len += field_ipv6info->JSON_encode(IP__Address_ipaddress_ipv6info_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.IP-Address.ipaddress."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int IP__Address_ipaddress::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 ipv4info().JSON_decode(IP__Address_ipaddress_ipv4info_descr_, p_tok, TRUE, FALSE); case 1: return ipv6info().JSON_decode(IP__Address_ipaddress_ipv6info_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 '@HNBAP-IEs.IP-Address.ipaddress'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { p_tok.set_buf_pos(buf_pos); ret_val = ipv4info().JSON_decode(IP__Address_ipaddress_ipv4info_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = ipv6info().JSON_decode(IP__Address_ipaddress_ipv6info_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 '@HNBAP-IEs.IP-Address.ipaddress'"); 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 '@HNBAP-IEs.IP-Address.ipaddress'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "object '@HNBAP-IEs.IP-Address.ipaddress'"); 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 (8 == name_len && 0 == strncmp(fld_name, "ipv4info", name_len)) { int ret_val = ipv4info().JSON_decode(IP__Address_ipaddress_ipv4info_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, "ipv4info"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (8 == name_len && 0 == strncmp(fld_name, "ipv6info", name_len)) { int ret_val = ipv6info().JSON_decode(IP__Address_ipaddress_ipv6info_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, "ipv6info"); } 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 IP__Address_ipaddress::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_ipv4info: {TTCN_Buffer buf; encode_oer_tag(*IP__Address_ipaddress_ipv4info_descr_.ber, p_buf); field_ipv4info->OER_encode(IP__Address_ipaddress_ipv4info_descr_, buf); p_buf.put_buf(buf); break; } case ALT_ipv6info: {TTCN_Buffer buf; encode_oer_tag(*IP__Address_ipaddress_ipv6info_descr_.ber, p_buf); field_ipv6info->OER_encode(IP__Address_ipaddress_ipv6info_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.IP-Address.ipaddress."); return -1; } return 0; } int IP__Address_ipaddress::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 (IP__Address_ipaddress_ipv4info_descr_.ber->tags[IP__Address_ipaddress_ipv4info_descr_.ber->n_tags-1].tagclass == descr.tagclass && IP__Address_ipaddress_ipv4info_descr_.ber->tags[IP__Address_ipaddress_ipv4info_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { ipv4info().OER_decode(IP__Address_ipaddress_ipv4info_descr_, p_buf, p_oer); } else if (IP__Address_ipaddress_ipv6info_descr_.ber->tags[IP__Address_ipaddress_ipv6info_descr_.ber->n_tags-1].tagclass == descr.tagclass && IP__Address_ipaddress_ipv6info_descr_.ber->tags[IP__Address_ipaddress_ipv6info_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { ipv6info().OER_decode(IP__Address_ipaddress_ipv6info_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type IP__Address_ipaddress"); } return 0; } void IP__Address_ipaddress::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_ipv4info: { INTEGER::PER_encode_int(p_buf, 0, 1); field_ipv4info->PER_encode(IP__Address_ipaddress_ipv4info_descr_, p_buf, p_options); break; } case ALT_ipv6info: { INTEGER::PER_encode_int(p_buf, 1, 1); field_ipv6info->PER_encode(IP__Address_ipaddress_ipv6info_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 IP__Address_ipaddress::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, 1, FALSE, sel_int); switch (sel_int) { case 0: ipv4info().PER_decode(IP__Address_ipaddress_ipv4info_descr_, p_buf, p_options); break; case 1: ipv6info().PER_decode(IP__Address_ipaddress_ipv6info_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 IP__Address_ipaddress_template::copy_value(const IP__Address_ipaddress& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case IP__Address_ipaddress::ALT_ipv4info: single_value.field_ipv4info = new OCTETSTRING_template(other_value.ipv4info()); break; case IP__Address_ipaddress::ALT_ipv6info: single_value.field_ipv6info = new OCTETSTRING_template(other_value.ipv6info()); break; default: TTCN_error("Initializing a template with an unbound value of type @HNBAP-IEs.IP-Address.ipaddress."); } set_selection(SPECIFIC_VALUE); } void IP__Address_ipaddress_template::copy_template(const IP__Address_ipaddress_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 IP__Address_ipaddress::ALT_ipv4info: single_value.field_ipv4info = new OCTETSTRING_template(*other_value.single_value.field_ipv4info); break; case IP__Address_ipaddress::ALT_ipv6info: single_value.field_ipv6info = new OCTETSTRING_template(*other_value.single_value.field_ipv6info); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @HNBAP-IEs.IP-Address.ipaddress."); } 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 IP__Address_ipaddress_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 IP__Address_ipaddress_template(*other_value.implication_.precondition); implication_.implied_template = new IP__Address_ipaddress_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 @HNBAP-IEs.IP-Address.ipaddress."); } set_selection(other_value); } IP__Address_ipaddress_template::IP__Address_ipaddress_template() { } IP__Address_ipaddress_template::IP__Address_ipaddress_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } IP__Address_ipaddress_template::IP__Address_ipaddress_template(const IP__Address_ipaddress& other_value) { copy_value(other_value); } IP__Address_ipaddress_template::IP__Address_ipaddress_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IP__Address_ipaddress&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-IEs.IP-Address.ipaddress from an unbound optional field."); } } IP__Address_ipaddress_template::IP__Address_ipaddress_template(IP__Address_ipaddress_template* p_precondition, IP__Address_ipaddress_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } IP__Address_ipaddress_template::IP__Address_ipaddress_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; } IP__Address_ipaddress_template::IP__Address_ipaddress_template(const IP__Address_ipaddress_template& other_value) : Base_Template(){ copy_template(other_value); } IP__Address_ipaddress_template::~IP__Address_ipaddress_template() { clean_up(); } void IP__Address_ipaddress_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case IP__Address_ipaddress::ALT_ipv4info: delete single_value.field_ipv4info; break; case IP__Address_ipaddress::ALT_ipv6info: delete single_value.field_ipv6info; 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; } IP__Address_ipaddress_template& IP__Address_ipaddress_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } IP__Address_ipaddress_template& IP__Address_ipaddress_template::operator=(const IP__Address_ipaddress& other_value) { clean_up(); copy_value(other_value); return *this; } IP__Address_ipaddress_template& IP__Address_ipaddress_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IP__Address_ipaddress&)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 @HNBAP-IEs.IP-Address.ipaddress."); } return *this; } IP__Address_ipaddress_template& IP__Address_ipaddress_template::operator=(const IP__Address_ipaddress_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean IP__Address_ipaddress_template::match(const IP__Address_ipaddress& 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: { IP__Address_ipaddress::union_selection_type value_selection = other_value.get_selection(); if (value_selection == IP__Address_ipaddress::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case IP__Address_ipaddress::ALT_ipv4info: return single_value.field_ipv4info->match(other_value.ipv4info(), legacy); case IP__Address_ipaddress::ALT_ipv6info: return single_value.field_ipv6info->match(other_value.ipv6info(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @HNBAP-IEs.IP-Address.ipaddress."); } } 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 @HNBAP-IEs.IP-Address.ipaddress."); } return FALSE; } boolean IP__Address_ipaddress_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case IP__Address_ipaddress::ALT_ipv4info: return single_value.field_ipv4info->is_value(); case IP__Address_ipaddress::ALT_ipv6info: return single_value.field_ipv6info->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @HNBAP-IEs.IP-Address.ipaddress."); } } IP__Address_ipaddress IP__Address_ipaddress_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 @HNBAP-IEs.IP-Address.ipaddress."); IP__Address_ipaddress ret_val; switch (single_value.union_selection) { case IP__Address_ipaddress::ALT_ipv4info: ret_val.ipv4info() = single_value.field_ipv4info->valueof(); break; case IP__Address_ipaddress::ALT_ipv6info: ret_val.ipv6info() = single_value.field_ipv6info->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @HNBAP-IEs.IP-Address.ipaddress."); } return ret_val; } IP__Address_ipaddress_template& IP__Address_ipaddress_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 @HNBAP-IEs.IP-Address.ipaddress."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-IEs.IP-Address.ipaddress."); return value_list.list_value[list_index]; } void IP__Address_ipaddress_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 @HNBAP-IEs.IP-Address.ipaddress."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new IP__Address_ipaddress_template[list_length]; } OCTETSTRING_template& IP__Address_ipaddress_template::ipv4info() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != IP__Address_ipaddress::ALT_ipv4info) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_ipv4info = new OCTETSTRING_template(ANY_VALUE); else single_value.field_ipv4info = new OCTETSTRING_template; single_value.union_selection = IP__Address_ipaddress::ALT_ipv4info; set_selection(SPECIFIC_VALUE); } return *single_value.field_ipv4info; } const OCTETSTRING_template& IP__Address_ipaddress_template::ipv4info() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ipv4info in a non-specific template of union type @HNBAP-IEs.IP-Address.ipaddress."); if (single_value.union_selection != IP__Address_ipaddress::ALT_ipv4info) TTCN_error("Accessing non-selected field ipv4info in a template of union type @HNBAP-IEs.IP-Address.ipaddress."); return *single_value.field_ipv4info; } OCTETSTRING_template& IP__Address_ipaddress_template::ipv6info() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != IP__Address_ipaddress::ALT_ipv6info) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_ipv6info = new OCTETSTRING_template(ANY_VALUE); else single_value.field_ipv6info = new OCTETSTRING_template; single_value.union_selection = IP__Address_ipaddress::ALT_ipv6info; set_selection(SPECIFIC_VALUE); } return *single_value.field_ipv6info; } const OCTETSTRING_template& IP__Address_ipaddress_template::ipv6info() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ipv6info in a non-specific template of union type @HNBAP-IEs.IP-Address.ipaddress."); if (single_value.union_selection != IP__Address_ipaddress::ALT_ipv6info) TTCN_error("Accessing non-selected field ipv6info in a template of union type @HNBAP-IEs.IP-Address.ipaddress."); return *single_value.field_ipv6info; } boolean IP__Address_ipaddress_template::ischosen(IP__Address_ipaddress::union_selection_type checked_selection) const { if (checked_selection == IP__Address_ipaddress::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-IEs.IP-Address.ipaddress."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == IP__Address_ipaddress::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-IEs.IP-Address.ipaddress."); 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 @HNBAP-IEs.IP-Address.ipaddress 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 IP__Address_ipaddress_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case IP__Address_ipaddress::ALT_ipv4info: TTCN_Logger::log_event_str("{ ipv4info := "); single_value.field_ipv4info->log(); TTCN_Logger::log_event_str(" }"); break; case IP__Address_ipaddress::ALT_ipv6info: TTCN_Logger::log_event_str("{ ipv6info := "); single_value.field_ipv6info->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 IP__Address_ipaddress_template::log_match(const IP__Address_ipaddress& 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 IP__Address_ipaddress::ALT_ipv4info: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".ipv4info"); single_value.field_ipv4info->log_match(match_value.ipv4info(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ ipv4info := "); single_value.field_ipv4info->log_match(match_value.ipv4info(), legacy); TTCN_Logger::log_event_str(" }"); } break; case IP__Address_ipaddress::ALT_ipv6info: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".ipv6info"); single_value.field_ipv6info->log_match(match_value.ipv6info(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ ipv6info := "); single_value.field_ipv6info->log_match(match_value.ipv6info(), 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 IP__Address_ipaddress_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case IP__Address_ipaddress::ALT_ipv4info: single_value.field_ipv4info->set_implicit_omit(); break; case IP__Address_ipaddress::ALT_ipv6info: single_value.field_ipv6info->set_implicit_omit(); break; default: break; } } void IP__Address_ipaddress_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 IP__Address_ipaddress::ALT_ipv4info: single_value.field_ipv4info->encode_text(text_buf); break; case IP__Address_ipaddress::ALT_ipv6info: single_value.field_ipv6info->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @HNBAP-IEs.IP-Address.ipaddress."); } 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 @HNBAP-IEs.IP-Address.ipaddress."); } } void IP__Address_ipaddress_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = IP__Address_ipaddress::UNBOUND_VALUE; IP__Address_ipaddress::union_selection_type new_selection = (IP__Address_ipaddress::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case IP__Address_ipaddress::ALT_ipv4info: single_value.field_ipv4info = new OCTETSTRING_template; single_value.field_ipv4info->decode_text(text_buf); break; case IP__Address_ipaddress::ALT_ipv6info: single_value.field_ipv6info = new OCTETSTRING_template; single_value.field_ipv6info->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @HNBAP-IEs.IP-Address.ipaddress."); } 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 IP__Address_ipaddress_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 @HNBAP-IEs.IP-Address.ipaddress."); } } boolean IP__Address_ipaddress_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean IP__Address_ipaddress_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 `@HNBAP-IEs.IP-Address.ipaddress'"); } if (strcmp("ipv4info", param_field) == 0) { ipv4info().set_param(param); return; } else if (strcmp("ipv6info", param_field) == 0) { ipv6info().set_param(param); return; } else param.error("Field `%s' not found in union template type `@HNBAP-IEs.IP-Address.ipaddress'", 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: { IP__Address_ipaddress_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", "@HNBAP-IEs.IP-Address.ipaddress"); 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, "ipv4info")) { ipv4info().set_param(*mp_last); break; } if (!strcmp(last_name, "ipv6info")) { ipv6info().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.IP-Address.ipaddress.", last_name); } break; case Module_Param::MP_Implication_Template: { IP__Address_ipaddress_template* precondition = new IP__Address_ipaddress_template; precondition->set_param(*m_p->get_elem(0)); IP__Address_ipaddress_template* implied_template = new IP__Address_ipaddress_template; implied_template->set_param(*m_p->get_elem(1)); *this = IP__Address_ipaddress_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-IEs.IP-Address.ipaddress"); } is_ifpresent = param.get_ifpresent(); } void IP__Address_ipaddress_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 IP__Address_ipaddress::ALT_ipv4info: single_value.field_ipv4info->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.IP-Address.ipaddress"); return; case IP__Address_ipaddress::ALT_ipv6info: single_value.field_ipv6info->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.IP-Address.ipaddress"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @HNBAP-IEs.IP-Address.ipaddress."); } 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 : "@HNBAP-IEs.IP-Address.ipaddress"); } IP__Address::IP__Address() { } IP__Address::IP__Address(const IP__Address_ipaddress& par_ipaddress, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 >& par_iE__Extensions) : field_ipaddress(par_ipaddress), field_iE__Extensions(par_iE__Extensions) { } IP__Address::IP__Address(const IP__Address& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.IP-Address."); if (other_value.ipaddress().is_bound()) field_ipaddress = other_value.ipaddress(); else field_ipaddress.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void IP__Address::clean_up() { field_ipaddress.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* IP__Address::get_descriptor() const { return &IP__Address_descr_; } IP__Address& IP__Address::operator=(const IP__Address& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.IP-Address."); if (other_value.ipaddress().is_bound()) field_ipaddress = other_value.ipaddress(); else field_ipaddress.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 IP__Address::operator==(const IP__Address& other_value) const { return field_ipaddress==other_value.field_ipaddress && field_iE__Extensions==other_value.field_iE__Extensions; } boolean IP__Address::is_bound() const { return (field_ipaddress.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean IP__Address::is_value() const { return field_ipaddress.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int IP__Address::size_of() const { int ret_val = 1; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void IP__Address::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ ipaddress := "); field_ipaddress.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void IP__Address::set_implicit_omit() { if (ipaddress().is_bound()) ipaddress().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void IP__Address::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) ipaddress().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "ipaddress")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ipaddress().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 @HNBAP-IEs.IP-Address: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.IP-Address"); } } void IP__Address::encode_text(Text_Buf& text_buf) const { field_ipaddress.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void IP__Address::decode_text(Text_Buf& text_buf) { field_ipaddress.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void IP__Address::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 IP__Address::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* IP__Address::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("ipaddress': "); new_tlv->add_TLV(field_ipaddress.BER_encode_TLV(IP__Address_ipaddress_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(IP__Address_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean IP__Address::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 '@HNBAP-IEs.IP-Address' 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("ipaddress': "); 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_ipaddress.BER_decode_TLV(IP__Address_ipaddress_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(IP__Address_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 IP__Address::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 @HNBAP-IEs.IP-Address."); 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, "ipaddress"); enc_len += field_ipaddress.JSON_encode(IP__Address_ipaddress_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(IP__Address_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int IP__Address::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 ipaddress_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 (9 == name_len && 0 == strncmp(fld_name, "ipaddress", name_len)) { ipaddress_found = TRUE; int ret_val = field_ipaddress.JSON_decode(IP__Address_ipaddress_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, "ipaddress"); } 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(IP__Address_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 (!ipaddress_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "ipaddress"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int IP__Address::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_ipaddress.OER_encode(IP__Address_ipaddress_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(IP__Address_iE__Extensions_descr_, p_buf); return 0; } int IP__Address::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_ipaddress.OER_decode(IP__Address_ipaddress_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(IP__Address_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 IP__Address::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_ipaddress.PER_encode(IP__Address_ipaddress_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(IP__Address_iE__Extensions_descr_, p_buf, p_options); } void IP__Address::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_ipaddress.PER_decode(IP__Address_ipaddress_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(IP__Address_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 IP__Address_template::single_value_struct { IP__Address_ipaddress_template field_ipaddress; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template field_iE__Extensions; }; void IP__Address_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_ipaddress = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void IP__Address_template::copy_value(const IP__Address& other_value) { single_value = new single_value_struct; if (other_value.ipaddress().is_bound()) { single_value->field_ipaddress = other_value.ipaddress(); } else { single_value->field_ipaddress.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 IP__Address_template::copy_template(const IP__Address_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.ipaddress().get_selection()) { single_value->field_ipaddress = other_value.ipaddress(); } else { single_value->field_ipaddress.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 IP__Address_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 IP__Address_template(*other_value.implication_.precondition); implication_.implied_template = new IP__Address_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 @HNBAP-IEs.IP-Address."); break; } set_selection(other_value); } IP__Address_template::IP__Address_template() { } IP__Address_template::IP__Address_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } IP__Address_template::IP__Address_template(const IP__Address& other_value) { copy_value(other_value); } IP__Address_template::IP__Address_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IP__Address&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.IP-Address from an unbound optional field."); } } IP__Address_template::IP__Address_template(IP__Address_template* p_precondition, IP__Address_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } IP__Address_template::IP__Address_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; } IP__Address_template::IP__Address_template(const IP__Address_template& other_value) : Base_Template() { copy_template(other_value); } IP__Address_template::~IP__Address_template() { clean_up(); } IP__Address_template& IP__Address_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } IP__Address_template& IP__Address_template::operator=(const IP__Address& other_value) { clean_up(); copy_value(other_value); return *this; } IP__Address_template& IP__Address_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IP__Address&)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 @HNBAP-IEs.IP-Address."); } return *this; } IP__Address_template& IP__Address_template::operator=(const IP__Address_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean IP__Address_template::match(const IP__Address& 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.ipaddress().is_bound()) return FALSE; if(!single_value->field_ipaddress.match(other_value.ipaddress(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7&)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 @HNBAP-IEs.IP-Address."); } return FALSE; } boolean IP__Address_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_ipaddress.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean IP__Address_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_ipaddress.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void IP__Address_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; } IP__Address IP__Address_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 @HNBAP-IEs.IP-Address."); IP__Address ret_val; if (single_value->field_ipaddress.is_bound()) { ret_val.ipaddress() = single_value->field_ipaddress.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 IP__Address_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 @HNBAP-IEs.IP-Address."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new IP__Address_template[list_length]; } IP__Address_template& IP__Address_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 @HNBAP-IEs.IP-Address."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.IP-Address."); return value_list.list_value[list_index]; } IP__Address_ipaddress_template& IP__Address_template::ipaddress() { set_specific(); return single_value->field_ipaddress; } const IP__Address_ipaddress_template& IP__Address_template::ipaddress() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ipaddress of a non-specific template of type @HNBAP-IEs.IP-Address."); return single_value->field_ipaddress; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& IP__Address_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& IP__Address_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.IP-Address."); return single_value->field_iE__Extensions; } int IP__Address_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IP-Address which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; 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 @HNBAP-IEs.IP-Address 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 @HNBAP-IEs.IP-Address containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IP-Address containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IP-Address containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IP-Address containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IP-Address containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IP-Address containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IP-Address containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.IP-Address."); } return 0; } void IP__Address_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ ipaddress := "); single_value->field_ipaddress.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 IP__Address_template::log_match(const IP__Address& 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_ipaddress.match(match_value.ipaddress(), legacy)){ TTCN_Logger::log_logmatch_info(".ipaddress"); single_value->field_ipaddress.log_match(match_value.ipaddress(), 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("{ ipaddress := "); single_value->field_ipaddress.log_match(match_value.ipaddress(), 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 IP__Address_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (ipaddress().is_bound()) ipaddress().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void IP__Address_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_ipaddress.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 @HNBAP-IEs.IP-Address."); } } void IP__Address_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_ipaddress.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 IP__Address_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 @HNBAP-IEs.IP-Address."); } } void IP__Address_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: { IP__Address_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) ipaddress().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "ipaddress")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ipaddress().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 @HNBAP-IEs.IP-Address: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { IP__Address_template* precondition = new IP__Address_template; precondition->set_param(*param.get_elem(0)); IP__Address_template* implied_template = new IP__Address_template; implied_template->set_param(*param.get_elem(1)); *this = IP__Address_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.IP-Address"); } is_ifpresent = param.get_ifpresent(); } void IP__Address_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_ipaddress.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.IP-Address"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.IP-Address"); 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 : "@HNBAP-IEs.IP-Address"); } boolean IP__Address_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean IP__Address_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_psc, const OPTIONAL< BITSTRING >& par_cSG__ID, const HNB__Cell__Access__Mode& par_hNB__Cell__Access__Mode, const Iurh__Signalling__TNL__AddressList& par_iurh__Signalling__TNL__AddressList, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 >& par_iE__Extensions) : field_psc(par_psc), field_cSG__ID(par_cSG__ID), field_hNB__Cell__Access__Mode(par_hNB__Cell__Access__Mode), field_iurh__Signalling__TNL__AddressList(par_iurh__Signalling__TNL__AddressList), field_iE__Extensions(par_iE__Extensions) { } HNBConfigurationInformationProvided::HNBConfigurationInformationProvided(const HNBConfigurationInformationProvided& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.HNBConfigurationInformationProvided."); if (other_value.psc().is_bound()) field_psc = other_value.psc(); else field_psc.clean_up(); if (other_value.cSG__ID().is_bound()) field_cSG__ID = other_value.cSG__ID(); else field_cSG__ID.clean_up(); if (other_value.hNB__Cell__Access__Mode().is_bound()) field_hNB__Cell__Access__Mode = other_value.hNB__Cell__Access__Mode(); else field_hNB__Cell__Access__Mode.clean_up(); if (other_value.iurh__Signalling__TNL__AddressList().is_bound()) field_iurh__Signalling__TNL__AddressList = other_value.iurh__Signalling__TNL__AddressList(); else field_iurh__Signalling__TNL__AddressList.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void HNBConfigurationInformationProvided::clean_up() { field_psc.clean_up(); field_cSG__ID.clean_up(); field_hNB__Cell__Access__Mode.clean_up(); field_iurh__Signalling__TNL__AddressList.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* HNBConfigurationInformationProvided::get_descriptor() const { return &HNBConfigurationInformationProvided_descr_; } HNBConfigurationInformationProvided& HNBConfigurationInformationProvided::operator=(const HNBConfigurationInformationProvided& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.HNBConfigurationInformationProvided."); if (other_value.psc().is_bound()) field_psc = other_value.psc(); else field_psc.clean_up(); if (other_value.cSG__ID().is_bound()) field_cSG__ID = other_value.cSG__ID(); else field_cSG__ID.clean_up(); if (other_value.hNB__Cell__Access__Mode().is_bound()) field_hNB__Cell__Access__Mode = other_value.hNB__Cell__Access__Mode(); else field_hNB__Cell__Access__Mode.clean_up(); if (other_value.iurh__Signalling__TNL__AddressList().is_bound()) field_iurh__Signalling__TNL__AddressList = other_value.iurh__Signalling__TNL__AddressList(); else field_iurh__Signalling__TNL__AddressList.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 HNBConfigurationInformationProvided::operator==(const HNBConfigurationInformationProvided& other_value) const { return field_psc==other_value.field_psc && field_cSG__ID==other_value.field_cSG__ID && field_hNB__Cell__Access__Mode==other_value.field_hNB__Cell__Access__Mode && field_iurh__Signalling__TNL__AddressList==other_value.field_iurh__Signalling__TNL__AddressList && field_iE__Extensions==other_value.field_iE__Extensions; } boolean HNBConfigurationInformationProvided::is_bound() const { return (OPTIONAL_OMIT == field_psc.get_selection() || field_psc.is_bound()) || (OPTIONAL_OMIT == field_cSG__ID.get_selection() || field_cSG__ID.is_bound()) || (field_hNB__Cell__Access__Mode.is_bound()) || (field_iurh__Signalling__TNL__AddressList.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean HNBConfigurationInformationProvided::is_value() const { return (OPTIONAL_OMIT == field_psc.get_selection() || field_psc.is_value()) && (OPTIONAL_OMIT == field_cSG__ID.get_selection() || field_cSG__ID.is_value()) && field_hNB__Cell__Access__Mode.is_value() && field_iurh__Signalling__TNL__AddressList.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int HNBConfigurationInformationProvided::size_of() const { int ret_val = 2; if (field_psc.ispresent()) ret_val++; if (field_cSG__ID.ispresent()) ret_val++; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void HNBConfigurationInformationProvided::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ psc := "); field_psc.log(); TTCN_Logger::log_event_str(", cSG_ID := "); field_cSG__ID.log(); TTCN_Logger::log_event_str(", hNB_Cell_Access_Mode := "); field_hNB__Cell__Access__Mode.log(); TTCN_Logger::log_event_str(", iurh_Signalling_TNL_AddressList := "); field_iurh__Signalling__TNL__AddressList.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void HNBConfigurationInformationProvided::set_implicit_omit() { if (!psc().is_bound()) psc() = OMIT_VALUE; else psc().set_implicit_omit(); if (!cSG__ID().is_bound()) cSG__ID() = OMIT_VALUE; else cSG__ID().set_implicit_omit(); if (hNB__Cell__Access__Mode().is_bound()) hNB__Cell__Access__Mode().set_implicit_omit(); if (iurh__Signalling__TNL__AddressList().is_bound()) iurh__Signalling__TNL__AddressList().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNBConfigurationInformationProvided::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) psc().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cSG__ID().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) hNB__Cell__Access__Mode().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iurh__Signalling__TNL__AddressList().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(), "psc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { psc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cSG_ID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cSG__ID().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hNB_Cell_Access_Mode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hNB__Cell__Access__Mode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iurh_Signalling_TNL_AddressList")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iurh__Signalling__TNL__AddressList().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 @HNBAP-IEs.HNBConfigurationInformationProvided: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.HNBConfigurationInformationProvided"); } } void HNBConfigurationInformationProvided::encode_text(Text_Buf& text_buf) const { field_psc.encode_text(text_buf); field_cSG__ID.encode_text(text_buf); field_hNB__Cell__Access__Mode.encode_text(text_buf); field_iurh__Signalling__TNL__AddressList.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void HNBConfigurationInformationProvided::decode_text(Text_Buf& text_buf) { field_psc.decode_text(text_buf); field_cSG__ID.decode_text(text_buf); field_hNB__Cell__Access__Mode.decode_text(text_buf); field_iurh__Signalling__TNL__AddressList.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void HNBConfigurationInformationProvided::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 HNBConfigurationInformationProvided::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* HNBConfigurationInformationProvided::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("psc': "); new_tlv->add_TLV(field_psc.BER_encode_TLV(HNBConfigurationInformationProvided_psc_descr_, p_coding)); ec_1.set_msg("cSG_ID': "); new_tlv->add_TLV(field_cSG__ID.BER_encode_TLV(HNBConfigurationInformationProvided_cSG__ID_descr_, p_coding)); ec_1.set_msg("hNB_Cell_Access_Mode': "); new_tlv->add_TLV(field_hNB__Cell__Access__Mode.BER_encode_TLV(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_, p_coding)); ec_1.set_msg("iurh_Signalling_TNL_AddressList': "); new_tlv->add_TLV(field_iurh__Signalling__TNL__AddressList.BER_encode_TLV(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(HNBConfigurationInformationProvided_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean HNBConfigurationInformationProvided::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 '@HNBAP-IEs.HNBConfigurationInformationProvided' 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("psc': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_psc=OMIT_VALUE; else { field_psc.BER_decode_TLV(HNBConfigurationInformationProvided_psc_descr_, tmp_tlv, L_form); if(field_psc.ispresent()) tlv_present=FALSE; } ec_2.set_msg("cSG_ID': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_cSG__ID=OMIT_VALUE; else { field_cSG__ID.BER_decode_TLV(HNBConfigurationInformationProvided_cSG__ID_descr_, tmp_tlv, L_form); if(field_cSG__ID.ispresent()) tlv_present=FALSE; } ec_2.set_msg("hNB_Cell_Access_Mode': "); 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_hNB__Cell__Access__Mode.BER_decode_TLV(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("iurh_Signalling_TNL_AddressList': "); 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_iurh__Signalling__TNL__AddressList.BER_decode_TLV(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_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(HNBConfigurationInformationProvided_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 HNBConfigurationInformationProvided::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 @HNBAP-IEs.HNBConfigurationInformationProvided."); return -1; } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); if (field_psc.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "psc"); enc_len += field_psc.JSON_encode(HNBConfigurationInformationProvided_psc_descr_, p_tok, FALSE); } if (field_cSG__ID.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "cSG_ID"); enc_len += field_cSG__ID.JSON_encode(HNBConfigurationInformationProvided_cSG__ID_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "hNB_Cell_Access_Mode"); enc_len += field_hNB__Cell__Access__Mode.JSON_encode(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iurh_Signalling_TNL_AddressList"); enc_len += field_iurh__Signalling__TNL__AddressList.JSON_encode(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_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(HNBConfigurationInformationProvided_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int HNBConfigurationInformationProvided::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 psc_found = FALSE; boolean cSG__ID_found = FALSE; boolean hNB__Cell__Access__Mode_found = FALSE; boolean iurh__Signalling__TNL__AddressList_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 (3 == name_len && 0 == strncmp(fld_name, "psc", name_len)) { psc_found = TRUE; int ret_val = field_psc.JSON_decode(HNBConfigurationInformationProvided_psc_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, 3, "psc"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (6 == name_len && 0 == strncmp(fld_name, "cSG_ID", name_len)) { cSG__ID_found = TRUE; int ret_val = field_cSG__ID.JSON_decode(HNBConfigurationInformationProvided_cSG__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, 6, "cSG_ID"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (20 == name_len && 0 == strncmp(fld_name, "hNB_Cell_Access_Mode", name_len)) { hNB__Cell__Access__Mode_found = TRUE; int ret_val = field_hNB__Cell__Access__Mode.JSON_decode(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_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, "hNB_Cell_Access_Mode"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (31 == name_len && 0 == strncmp(fld_name, "iurh_Signalling_TNL_AddressList", name_len)) { iurh__Signalling__TNL__AddressList_found = TRUE; int ret_val = field_iurh__Signalling__TNL__AddressList.JSON_decode(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_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, 31, "iurh_Signalling_TNL_AddressList"); } 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(HNBConfigurationInformationProvided_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 (!psc_found) { field_psc = OMIT_VALUE; } if (!cSG__ID_found) { field_cSG__ID = OMIT_VALUE; } if (!hNB__Cell__Access__Mode_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "hNB_Cell_Access_Mode"); return JSON_ERROR_FATAL; } if (!iurh__Signalling__TNL__AddressList_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "iurh_Signalling_TNL_AddressList"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int HNBConfigurationInformationProvided::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_psc.is_present()) { c |= 64; } if (field_cSG__ID.is_present()) { c |= 32; } if (field_iE__Extensions.is_present()) { c |= 16; } p_buf.put_c(c); if (field_psc.is_present()) field_psc.OER_encode(HNBConfigurationInformationProvided_psc_descr_, p_buf); if (field_cSG__ID.is_present()) field_cSG__ID.OER_encode(HNBConfigurationInformationProvided_cSG__ID_descr_, p_buf); field_hNB__Cell__Access__Mode.OER_encode(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_, p_buf); field_iurh__Signalling__TNL__AddressList.OER_encode(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(HNBConfigurationInformationProvided_iE__Extensions_descr_, p_buf); return 0; } int HNBConfigurationInformationProvided::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_psc.OER_decode(HNBConfigurationInformationProvided_psc_descr_, p_buf, p_oer); else field_psc = OMIT_VALUE; if (uc[0] & 32) field_cSG__ID.OER_decode(HNBConfigurationInformationProvided_cSG__ID_descr_, p_buf, p_oer); else field_cSG__ID = OMIT_VALUE; field_hNB__Cell__Access__Mode.OER_decode(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_, p_buf, p_oer); field_iurh__Signalling__TNL__AddressList.OER_decode(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_descr_, p_buf, p_oer); if (uc[0] & 16) field_iE__Extensions.OER_decode(HNBConfigurationInformationProvided_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 HNBConfigurationInformationProvided::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_psc_present = field_psc.is_present(); p_buf.PER_put_bit(field_psc_present); boolean field_cSG__ID_present = field_cSG__ID.is_present(); p_buf.PER_put_bit(field_cSG__ID_present); boolean field_iE__Extensions_present = field_iE__Extensions.is_present(); p_buf.PER_put_bit(field_iE__Extensions_present); if (field_psc_present) field_psc.PER_encode(HNBConfigurationInformationProvided_psc_descr_, p_buf, p_options); if (field_cSG__ID_present) field_cSG__ID.PER_encode(HNBConfigurationInformationProvided_cSG__ID_descr_, p_buf, p_options); field_hNB__Cell__Access__Mode.PER_encode(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_, p_buf, p_options); field_iurh__Signalling__TNL__AddressList.PER_encode(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(HNBConfigurationInformationProvided_iE__Extensions_descr_, p_buf, p_options); } void HNBConfigurationInformationProvided::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_psc_present = p_buf.PER_get_bit(); boolean field_cSG__ID_present = p_buf.PER_get_bit(); boolean field_iE__Extensions_present = p_buf.PER_get_bit(); if (field_psc_present) field_psc.PER_decode(HNBConfigurationInformationProvided_psc_descr_, p_buf, p_options); else field_psc = OMIT_VALUE; if (field_cSG__ID_present) field_cSG__ID.PER_decode(HNBConfigurationInformationProvided_cSG__ID_descr_, p_buf, p_options); else field_cSG__ID = OMIT_VALUE; field_hNB__Cell__Access__Mode.PER_decode(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_, p_buf, p_options); field_iurh__Signalling__TNL__AddressList.PER_decode(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(HNBConfigurationInformationProvided_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 HNBConfigurationInformationProvided_template::single_value_struct { BITSTRING_template field_psc; BITSTRING_template field_cSG__ID; HNB__Cell__Access__Mode_template field_hNB__Cell__Access__Mode; Iurh__Signalling__TNL__AddressList_template field_iurh__Signalling__TNL__AddressList; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template field_iE__Extensions; }; void HNBConfigurationInformationProvided_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_psc = ANY_OR_OMIT; single_value->field_cSG__ID = ANY_OR_OMIT; single_value->field_hNB__Cell__Access__Mode = ANY_VALUE; single_value->field_iurh__Signalling__TNL__AddressList = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void HNBConfigurationInformationProvided_template::copy_value(const HNBConfigurationInformationProvided& other_value) { single_value = new single_value_struct; if (other_value.psc().is_bound()) { if (other_value.psc().ispresent()) single_value->field_psc = other_value.psc()(); else single_value->field_psc = OMIT_VALUE; } else { single_value->field_psc.clean_up(); } if (other_value.cSG__ID().is_bound()) { if (other_value.cSG__ID().ispresent()) single_value->field_cSG__ID = other_value.cSG__ID()(); else single_value->field_cSG__ID = OMIT_VALUE; } else { single_value->field_cSG__ID.clean_up(); } if (other_value.hNB__Cell__Access__Mode().is_bound()) { single_value->field_hNB__Cell__Access__Mode = other_value.hNB__Cell__Access__Mode(); } else { single_value->field_hNB__Cell__Access__Mode.clean_up(); } if (other_value.iurh__Signalling__TNL__AddressList().is_bound()) { single_value->field_iurh__Signalling__TNL__AddressList = other_value.iurh__Signalling__TNL__AddressList(); } else { single_value->field_iurh__Signalling__TNL__AddressList.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 HNBConfigurationInformationProvided_template::copy_template(const HNBConfigurationInformationProvided_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.psc().get_selection()) { single_value->field_psc = other_value.psc(); } else { single_value->field_psc.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cSG__ID().get_selection()) { single_value->field_cSG__ID = other_value.cSG__ID(); } else { single_value->field_cSG__ID.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.hNB__Cell__Access__Mode().get_selection()) { single_value->field_hNB__Cell__Access__Mode = other_value.hNB__Cell__Access__Mode(); } else { single_value->field_hNB__Cell__Access__Mode.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.iurh__Signalling__TNL__AddressList().get_selection()) { single_value->field_iurh__Signalling__TNL__AddressList = other_value.iurh__Signalling__TNL__AddressList(); } else { single_value->field_iurh__Signalling__TNL__AddressList.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 HNBConfigurationInformationProvided_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 HNBConfigurationInformationProvided_template(*other_value.implication_.precondition); implication_.implied_template = new HNBConfigurationInformationProvided_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 @HNBAP-IEs.HNBConfigurationInformationProvided."); break; } set_selection(other_value); } HNBConfigurationInformationProvided_template::HNBConfigurationInformationProvided_template() { } HNBConfigurationInformationProvided_template::HNBConfigurationInformationProvided_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNBConfigurationInformationProvided_template::HNBConfigurationInformationProvided_template(const HNBConfigurationInformationProvided& other_value) { copy_value(other_value); } HNBConfigurationInformationProvided_template::HNBConfigurationInformationProvided_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNBConfigurationInformationProvided&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.HNBConfigurationInformationProvided from an unbound optional field."); } } HNBConfigurationInformationProvided_template::HNBConfigurationInformationProvided_template(HNBConfigurationInformationProvided_template* p_precondition, HNBConfigurationInformationProvided_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNBConfigurationInformationProvided_template::HNBConfigurationInformationProvided_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; } HNBConfigurationInformationProvided_template::HNBConfigurationInformationProvided_template(const HNBConfigurationInformationProvided_template& other_value) : Base_Template() { copy_template(other_value); } HNBConfigurationInformationProvided_template::~HNBConfigurationInformationProvided_template() { clean_up(); } HNBConfigurationInformationProvided_template& HNBConfigurationInformationProvided_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNBConfigurationInformationProvided_template& HNBConfigurationInformationProvided_template::operator=(const HNBConfigurationInformationProvided& other_value) { clean_up(); copy_value(other_value); return *this; } HNBConfigurationInformationProvided_template& HNBConfigurationInformationProvided_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNBConfigurationInformationProvided&)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 @HNBAP-IEs.HNBConfigurationInformationProvided."); } return *this; } HNBConfigurationInformationProvided_template& HNBConfigurationInformationProvided_template::operator=(const HNBConfigurationInformationProvided_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNBConfigurationInformationProvided_template::match(const HNBConfigurationInformationProvided& 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.psc().is_bound()) return FALSE; if((other_value.psc().ispresent() ? !single_value->field_psc.match((const BITSTRING&)other_value.psc(), legacy) : !single_value->field_psc.match_omit(legacy)))return FALSE; if(!other_value.cSG__ID().is_bound()) return FALSE; if((other_value.cSG__ID().ispresent() ? !single_value->field_cSG__ID.match((const BITSTRING&)other_value.cSG__ID(), legacy) : !single_value->field_cSG__ID.match_omit(legacy)))return FALSE; if(!other_value.hNB__Cell__Access__Mode().is_bound()) return FALSE; if(!single_value->field_hNB__Cell__Access__Mode.match(other_value.hNB__Cell__Access__Mode(), legacy))return FALSE; if(!other_value.iurh__Signalling__TNL__AddressList().is_bound()) return FALSE; if(!single_value->field_iurh__Signalling__TNL__AddressList.match(other_value.iurh__Signalling__TNL__AddressList(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8&)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 @HNBAP-IEs.HNBConfigurationInformationProvided."); } return FALSE; } boolean HNBConfigurationInformationProvided_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return (single_value->field_psc.is_omit() || single_value->field_psc.is_bound()) || (single_value->field_cSG__ID.is_omit() || single_value->field_cSG__ID.is_bound()) || single_value->field_hNB__Cell__Access__Mode.is_bound() || single_value->field_iurh__Signalling__TNL__AddressList.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean HNBConfigurationInformationProvided_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return (single_value->field_psc.is_omit() || single_value->field_psc.is_value()) && (single_value->field_cSG__ID.is_omit() || single_value->field_cSG__ID.is_value()) && single_value->field_hNB__Cell__Access__Mode.is_value() && single_value->field_iurh__Signalling__TNL__AddressList.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void HNBConfigurationInformationProvided_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; } HNBConfigurationInformationProvided HNBConfigurationInformationProvided_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 @HNBAP-IEs.HNBConfigurationInformationProvided."); HNBConfigurationInformationProvided ret_val; if (single_value->field_psc.is_omit()) ret_val.psc() = OMIT_VALUE; else if (single_value->field_psc.is_bound()) { ret_val.psc() = single_value->field_psc.valueof(); } if (single_value->field_cSG__ID.is_omit()) ret_val.cSG__ID() = OMIT_VALUE; else if (single_value->field_cSG__ID.is_bound()) { ret_val.cSG__ID() = single_value->field_cSG__ID.valueof(); } if (single_value->field_hNB__Cell__Access__Mode.is_bound()) { ret_val.hNB__Cell__Access__Mode() = single_value->field_hNB__Cell__Access__Mode.valueof(); } if (single_value->field_iurh__Signalling__TNL__AddressList.is_bound()) { ret_val.iurh__Signalling__TNL__AddressList() = single_value->field_iurh__Signalling__TNL__AddressList.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 HNBConfigurationInformationProvided_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 @HNBAP-IEs.HNBConfigurationInformationProvided."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HNBConfigurationInformationProvided_template[list_length]; } HNBConfigurationInformationProvided_template& HNBConfigurationInformationProvided_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 @HNBAP-IEs.HNBConfigurationInformationProvided."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.HNBConfigurationInformationProvided."); return value_list.list_value[list_index]; } BITSTRING_template& HNBConfigurationInformationProvided_template::psc() { set_specific(); return single_value->field_psc; } const BITSTRING_template& HNBConfigurationInformationProvided_template::psc() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field psc of a non-specific template of type @HNBAP-IEs.HNBConfigurationInformationProvided."); return single_value->field_psc; } BITSTRING_template& HNBConfigurationInformationProvided_template::cSG__ID() { set_specific(); return single_value->field_cSG__ID; } const BITSTRING_template& HNBConfigurationInformationProvided_template::cSG__ID() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cSG_ID of a non-specific template of type @HNBAP-IEs.HNBConfigurationInformationProvided."); return single_value->field_cSG__ID; } HNB__Cell__Access__Mode_template& HNBConfigurationInformationProvided_template::hNB__Cell__Access__Mode() { set_specific(); return single_value->field_hNB__Cell__Access__Mode; } const HNB__Cell__Access__Mode_template& HNBConfigurationInformationProvided_template::hNB__Cell__Access__Mode() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hNB_Cell_Access_Mode of a non-specific template of type @HNBAP-IEs.HNBConfigurationInformationProvided."); return single_value->field_hNB__Cell__Access__Mode; } Iurh__Signalling__TNL__AddressList_template& HNBConfigurationInformationProvided_template::iurh__Signalling__TNL__AddressList() { set_specific(); return single_value->field_iurh__Signalling__TNL__AddressList; } const Iurh__Signalling__TNL__AddressList_template& HNBConfigurationInformationProvided_template::iurh__Signalling__TNL__AddressList() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iurh_Signalling_TNL_AddressList of a non-specific template of type @HNBAP-IEs.HNBConfigurationInformationProvided."); return single_value->field_iurh__Signalling__TNL__AddressList; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& HNBConfigurationInformationProvided_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& HNBConfigurationInformationProvided_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.HNBConfigurationInformationProvided."); return single_value->field_iE__Extensions; } int HNBConfigurationInformationProvided_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationProvided which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 2; if (single_value->field_psc.is_present()) ret_val++; if (single_value->field_cSG__ID.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 @HNBAP-IEs.HNBConfigurationInformationProvided 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 @HNBAP-IEs.HNBConfigurationInformationProvided containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationProvided containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationProvided containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationProvided containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationProvided containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationProvided containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationProvided containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.HNBConfigurationInformationProvided."); } return 0; } void HNBConfigurationInformationProvided_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ psc := "); single_value->field_psc.log(); TTCN_Logger::log_event_str(", cSG_ID := "); single_value->field_cSG__ID.log(); TTCN_Logger::log_event_str(", hNB_Cell_Access_Mode := "); single_value->field_hNB__Cell__Access__Mode.log(); TTCN_Logger::log_event_str(", iurh_Signalling_TNL_AddressList := "); single_value->field_iurh__Signalling__TNL__AddressList.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 HNBConfigurationInformationProvided_template::log_match(const HNBConfigurationInformationProvided& 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.psc().ispresent()){ if(!single_value->field_psc.match(match_value.psc(), legacy)){ TTCN_Logger::log_logmatch_info(".psc"); single_value->field_psc.log_match(match_value.psc(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_psc.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".psc := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_psc.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.cSG__ID().ispresent()){ if(!single_value->field_cSG__ID.match(match_value.cSG__ID(), legacy)){ TTCN_Logger::log_logmatch_info(".cSG_ID"); single_value->field_cSG__ID.log_match(match_value.cSG__ID(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_cSG__ID.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".cSG_ID := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_cSG__ID.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_hNB__Cell__Access__Mode.match(match_value.hNB__Cell__Access__Mode(), legacy)){ TTCN_Logger::log_logmatch_info(".hNB_Cell_Access_Mode"); single_value->field_hNB__Cell__Access__Mode.log_match(match_value.hNB__Cell__Access__Mode(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_iurh__Signalling__TNL__AddressList.match(match_value.iurh__Signalling__TNL__AddressList(), legacy)){ TTCN_Logger::log_logmatch_info(".iurh_Signalling_TNL_AddressList"); single_value->field_iurh__Signalling__TNL__AddressList.log_match(match_value.iurh__Signalling__TNL__AddressList(), 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("{ psc := "); if (match_value.psc().ispresent()) { single_value->field_psc.log_match(match_value.psc(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_psc.log(); if (single_value->field_psc.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", cSG_ID := "); if (match_value.cSG__ID().ispresent()) { single_value->field_cSG__ID.log_match(match_value.cSG__ID(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_cSG__ID.log(); if (single_value->field_cSG__ID.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", hNB_Cell_Access_Mode := "); single_value->field_hNB__Cell__Access__Mode.log_match(match_value.hNB__Cell__Access__Mode(), legacy); TTCN_Logger::log_event_str(", iurh_Signalling_TNL_AddressList := "); single_value->field_iurh__Signalling__TNL__AddressList.log_match(match_value.iurh__Signalling__TNL__AddressList(), 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 HNBConfigurationInformationProvided_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (!psc().is_bound()) psc() = OMIT_VALUE; else psc().set_implicit_omit(); if (!cSG__ID().is_bound()) cSG__ID() = OMIT_VALUE; else cSG__ID().set_implicit_omit(); if (hNB__Cell__Access__Mode().is_bound()) hNB__Cell__Access__Mode().set_implicit_omit(); if (iurh__Signalling__TNL__AddressList().is_bound()) iurh__Signalling__TNL__AddressList().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNBConfigurationInformationProvided_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_psc.encode_text(text_buf); single_value->field_cSG__ID.encode_text(text_buf); single_value->field_hNB__Cell__Access__Mode.encode_text(text_buf); single_value->field_iurh__Signalling__TNL__AddressList.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 @HNBAP-IEs.HNBConfigurationInformationProvided."); } } void HNBConfigurationInformationProvided_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_psc.decode_text(text_buf); single_value->field_cSG__ID.decode_text(text_buf); single_value->field_hNB__Cell__Access__Mode.decode_text(text_buf); single_value->field_iurh__Signalling__TNL__AddressList.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 HNBConfigurationInformationProvided_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 @HNBAP-IEs.HNBConfigurationInformationProvided."); } } void HNBConfigurationInformationProvided_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: { HNBConfigurationInformationProvided_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) psc().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cSG__ID().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) hNB__Cell__Access__Mode().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) iurh__Signalling__TNL__AddressList().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(), "psc")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { psc().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cSG_ID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cSG__ID().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hNB_Cell_Access_Mode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hNB__Cell__Access__Mode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iurh_Signalling_TNL_AddressList")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iurh__Signalling__TNL__AddressList().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 @HNBAP-IEs.HNBConfigurationInformationProvided: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { HNBConfigurationInformationProvided_template* precondition = new HNBConfigurationInformationProvided_template; precondition->set_param(*param.get_elem(0)); HNBConfigurationInformationProvided_template* implied_template = new HNBConfigurationInformationProvided_template; implied_template->set_param(*param.get_elem(1)); *this = HNBConfigurationInformationProvided_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.HNBConfigurationInformationProvided"); } is_ifpresent = param.get_ifpresent(); } void HNBConfigurationInformationProvided_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_psc.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigurationInformationProvided"); single_value->field_cSG__ID.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigurationInformationProvided"); single_value->field_hNB__Cell__Access__Mode.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigurationInformationProvided"); single_value->field_iurh__Signalling__TNL__AddressList.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigurationInformationProvided"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigurationInformationProvided"); 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 : "@HNBAP-IEs.HNBConfigurationInformationProvided"); } boolean HNBConfigurationInformationProvided_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNBConfigurationInformationProvided_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_iE__Extensions) : field_cause(par_cause), field_iE__Extensions(par_iE__Extensions) { } HNBConfigurationInformationMissing::HNBConfigurationInformationMissing(const HNBConfigurationInformationMissing& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.HNBConfigurationInformationMissing."); if (other_value.cause().is_bound()) field_cause = other_value.cause(); else field_cause.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void HNBConfigurationInformationMissing::clean_up() { field_cause.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* HNBConfigurationInformationMissing::get_descriptor() const { return &HNBConfigurationInformationMissing_descr_; } HNBConfigurationInformationMissing& HNBConfigurationInformationMissing::operator=(const HNBConfigurationInformationMissing& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.HNBConfigurationInformationMissing."); if (other_value.cause().is_bound()) field_cause = other_value.cause(); else field_cause.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 HNBConfigurationInformationMissing::operator==(const HNBConfigurationInformationMissing& other_value) const { return field_cause==other_value.field_cause && field_iE__Extensions==other_value.field_iE__Extensions; } boolean HNBConfigurationInformationMissing::is_bound() const { return (field_cause.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean HNBConfigurationInformationMissing::is_value() const { return field_cause.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int HNBConfigurationInformationMissing::size_of() const { int ret_val = 1; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void HNBConfigurationInformationMissing::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ cause := "); field_cause.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void HNBConfigurationInformationMissing::set_implicit_omit() { if (cause().is_bound()) cause().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNBConfigurationInformationMissing::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cause().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "cause")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cause().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 @HNBAP-IEs.HNBConfigurationInformationMissing: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.HNBConfigurationInformationMissing"); } } void HNBConfigurationInformationMissing::encode_text(Text_Buf& text_buf) const { field_cause.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void HNBConfigurationInformationMissing::decode_text(Text_Buf& text_buf) { field_cause.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void HNBConfigurationInformationMissing::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 HNBConfigurationInformationMissing::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* HNBConfigurationInformationMissing::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("cause': "); new_tlv->add_TLV(field_cause.BER_encode_TLV(HNBConfigurationInformationMissing_cause_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(HNBConfigurationInformationMissing_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean HNBConfigurationInformationMissing::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 '@HNBAP-IEs.HNBConfigurationInformationMissing' 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("cause': "); 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_cause.BER_decode_TLV(HNBConfigurationInformationMissing_cause_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(HNBConfigurationInformationMissing_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 HNBConfigurationInformationMissing::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 @HNBAP-IEs.HNBConfigurationInformationMissing."); 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, "cause"); enc_len += field_cause.JSON_encode(HNBConfigurationInformationMissing_cause_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(HNBConfigurationInformationMissing_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int HNBConfigurationInformationMissing::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 cause_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 (5 == name_len && 0 == strncmp(fld_name, "cause", name_len)) { cause_found = TRUE; int ret_val = field_cause.JSON_decode(HNBConfigurationInformationMissing_cause_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, "cause"); } 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(HNBConfigurationInformationMissing_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 (!cause_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "cause"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int HNBConfigurationInformationMissing::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_cause.OER_encode(HNBConfigurationInformationMissing_cause_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(HNBConfigurationInformationMissing_iE__Extensions_descr_, p_buf); return 0; } int HNBConfigurationInformationMissing::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_cause.OER_decode(HNBConfigurationInformationMissing_cause_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(HNBConfigurationInformationMissing_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 HNBConfigurationInformationMissing::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_cause.PER_encode(HNBConfigurationInformationMissing_cause_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(HNBConfigurationInformationMissing_iE__Extensions_descr_, p_buf, p_options); } void HNBConfigurationInformationMissing::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_cause.PER_decode(HNBConfigurationInformationMissing_cause_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(HNBConfigurationInformationMissing_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 HNBConfigurationInformationMissing_template::single_value_struct { Cause_template field_cause; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template field_iE__Extensions; }; void HNBConfigurationInformationMissing_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_cause = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void HNBConfigurationInformationMissing_template::copy_value(const HNBConfigurationInformationMissing& other_value) { single_value = new single_value_struct; if (other_value.cause().is_bound()) { single_value->field_cause = other_value.cause(); } else { single_value->field_cause.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 HNBConfigurationInformationMissing_template::copy_template(const HNBConfigurationInformationMissing_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.cause().get_selection()) { single_value->field_cause = other_value.cause(); } else { single_value->field_cause.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 HNBConfigurationInformationMissing_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 HNBConfigurationInformationMissing_template(*other_value.implication_.precondition); implication_.implied_template = new HNBConfigurationInformationMissing_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 @HNBAP-IEs.HNBConfigurationInformationMissing."); break; } set_selection(other_value); } HNBConfigurationInformationMissing_template::HNBConfigurationInformationMissing_template() { } HNBConfigurationInformationMissing_template::HNBConfigurationInformationMissing_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNBConfigurationInformationMissing_template::HNBConfigurationInformationMissing_template(const HNBConfigurationInformationMissing& other_value) { copy_value(other_value); } HNBConfigurationInformationMissing_template::HNBConfigurationInformationMissing_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNBConfigurationInformationMissing&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.HNBConfigurationInformationMissing from an unbound optional field."); } } HNBConfigurationInformationMissing_template::HNBConfigurationInformationMissing_template(HNBConfigurationInformationMissing_template* p_precondition, HNBConfigurationInformationMissing_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNBConfigurationInformationMissing_template::HNBConfigurationInformationMissing_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; } HNBConfigurationInformationMissing_template::HNBConfigurationInformationMissing_template(const HNBConfigurationInformationMissing_template& other_value) : Base_Template() { copy_template(other_value); } HNBConfigurationInformationMissing_template::~HNBConfigurationInformationMissing_template() { clean_up(); } HNBConfigurationInformationMissing_template& HNBConfigurationInformationMissing_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNBConfigurationInformationMissing_template& HNBConfigurationInformationMissing_template::operator=(const HNBConfigurationInformationMissing& other_value) { clean_up(); copy_value(other_value); return *this; } HNBConfigurationInformationMissing_template& HNBConfigurationInformationMissing_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNBConfigurationInformationMissing&)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 @HNBAP-IEs.HNBConfigurationInformationMissing."); } return *this; } HNBConfigurationInformationMissing_template& HNBConfigurationInformationMissing_template::operator=(const HNBConfigurationInformationMissing_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNBConfigurationInformationMissing_template::match(const HNBConfigurationInformationMissing& 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.cause().is_bound()) return FALSE; if(!single_value->field_cause.match(other_value.cause(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9&)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 @HNBAP-IEs.HNBConfigurationInformationMissing."); } return FALSE; } boolean HNBConfigurationInformationMissing_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_cause.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean HNBConfigurationInformationMissing_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_cause.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void HNBConfigurationInformationMissing_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; } HNBConfigurationInformationMissing HNBConfigurationInformationMissing_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 @HNBAP-IEs.HNBConfigurationInformationMissing."); HNBConfigurationInformationMissing ret_val; if (single_value->field_cause.is_bound()) { ret_val.cause() = single_value->field_cause.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 HNBConfigurationInformationMissing_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 @HNBAP-IEs.HNBConfigurationInformationMissing."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HNBConfigurationInformationMissing_template[list_length]; } HNBConfigurationInformationMissing_template& HNBConfigurationInformationMissing_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 @HNBAP-IEs.HNBConfigurationInformationMissing."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.HNBConfigurationInformationMissing."); return value_list.list_value[list_index]; } Cause_template& HNBConfigurationInformationMissing_template::cause() { set_specific(); return single_value->field_cause; } const Cause_template& HNBConfigurationInformationMissing_template::cause() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cause of a non-specific template of type @HNBAP-IEs.HNBConfigurationInformationMissing."); return single_value->field_cause; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& HNBConfigurationInformationMissing_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& HNBConfigurationInformationMissing_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.HNBConfigurationInformationMissing."); return single_value->field_iE__Extensions; } int HNBConfigurationInformationMissing_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationMissing which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; 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 @HNBAP-IEs.HNBConfigurationInformationMissing 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 @HNBAP-IEs.HNBConfigurationInformationMissing containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationMissing containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationMissing containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationMissing containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationMissing containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationMissing containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigurationInformationMissing containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.HNBConfigurationInformationMissing."); } return 0; } void HNBConfigurationInformationMissing_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ cause := "); single_value->field_cause.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 HNBConfigurationInformationMissing_template::log_match(const HNBConfigurationInformationMissing& 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_cause.match(match_value.cause(), legacy)){ TTCN_Logger::log_logmatch_info(".cause"); single_value->field_cause.log_match(match_value.cause(), 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("{ cause := "); single_value->field_cause.log_match(match_value.cause(), 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 HNBConfigurationInformationMissing_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (cause().is_bound()) cause().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNBConfigurationInformationMissing_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_cause.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 @HNBAP-IEs.HNBConfigurationInformationMissing."); } } void HNBConfigurationInformationMissing_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_cause.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 HNBConfigurationInformationMissing_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 @HNBAP-IEs.HNBConfigurationInformationMissing."); } } void HNBConfigurationInformationMissing_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: { HNBConfigurationInformationMissing_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) cause().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "cause")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cause().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 @HNBAP-IEs.HNBConfigurationInformationMissing: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { HNBConfigurationInformationMissing_template* precondition = new HNBConfigurationInformationMissing_template; precondition->set_param(*param.get_elem(0)); HNBConfigurationInformationMissing_template* implied_template = new HNBConfigurationInformationMissing_template; implied_template->set_param(*param.get_elem(1)); *this = HNBConfigurationInformationMissing_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.HNBConfigurationInformationMissing"); } is_ifpresent = param.get_ifpresent(); } void HNBConfigurationInformationMissing_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_cause.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigurationInformationMissing"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigurationInformationMissing"); 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 : "@HNBAP-IEs.HNBConfigurationInformationMissing"); } boolean HNBConfigurationInformationMissing_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNBConfigurationInformationMissing_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_iE__Extensions) : field_hnb__RNL__Identity(par_hnb__RNL__Identity), field_configurationInformation(par_configurationInformation), field_iE__Extensions(par_iE__Extensions) { } HNBConfigInfo::HNBConfigInfo(const HNBConfigInfo& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.HNBConfigInfo."); if (other_value.hnb__RNL__Identity().is_bound()) field_hnb__RNL__Identity = other_value.hnb__RNL__Identity(); else field_hnb__RNL__Identity.clean_up(); if (other_value.configurationInformation().is_bound()) field_configurationInformation = other_value.configurationInformation(); else field_configurationInformation.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void HNBConfigInfo::clean_up() { field_hnb__RNL__Identity.clean_up(); field_configurationInformation.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* HNBConfigInfo::get_descriptor() const { return &HNBConfigInfo_descr_; } HNBConfigInfo& HNBConfigInfo::operator=(const HNBConfigInfo& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.HNBConfigInfo."); if (other_value.hnb__RNL__Identity().is_bound()) field_hnb__RNL__Identity = other_value.hnb__RNL__Identity(); else field_hnb__RNL__Identity.clean_up(); if (other_value.configurationInformation().is_bound()) field_configurationInformation = other_value.configurationInformation(); else field_configurationInformation.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 HNBConfigInfo::operator==(const HNBConfigInfo& other_value) const { return field_hnb__RNL__Identity==other_value.field_hnb__RNL__Identity && field_configurationInformation==other_value.field_configurationInformation && field_iE__Extensions==other_value.field_iE__Extensions; } boolean HNBConfigInfo::is_bound() const { return (field_hnb__RNL__Identity.is_bound()) || (field_configurationInformation.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean HNBConfigInfo::is_value() const { return field_hnb__RNL__Identity.is_value() && field_configurationInformation.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int HNBConfigInfo::size_of() const { int ret_val = 2; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void HNBConfigInfo::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ hnb_RNL_Identity := "); field_hnb__RNL__Identity.log(); TTCN_Logger::log_event_str(", configurationInformation := "); field_configurationInformation.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void HNBConfigInfo::set_implicit_omit() { if (hnb__RNL__Identity().is_bound()) hnb__RNL__Identity().set_implicit_omit(); if (configurationInformation().is_bound()) configurationInformation().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNBConfigInfo::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) hnb__RNL__Identity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) configurationInformation().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "hnb_RNL_Identity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__RNL__Identity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "configurationInformation")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { configurationInformation().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 @HNBAP-IEs.HNBConfigInfo: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.HNBConfigInfo"); } } void HNBConfigInfo::encode_text(Text_Buf& text_buf) const { field_hnb__RNL__Identity.encode_text(text_buf); field_configurationInformation.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void HNBConfigInfo::decode_text(Text_Buf& text_buf) { field_hnb__RNL__Identity.decode_text(text_buf); field_configurationInformation.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void HNBConfigInfo::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 HNBConfigInfo::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* HNBConfigInfo::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("hnb_RNL_Identity': "); new_tlv->add_TLV(field_hnb__RNL__Identity.BER_encode_TLV(HNBConfigInfo_hnb__RNL__Identity_descr_, p_coding)); ec_1.set_msg("configurationInformation': "); new_tlv->add_TLV(field_configurationInformation.BER_encode_TLV(HNBConfigInfo_configurationInformation_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(HNBConfigInfo_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean HNBConfigInfo::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 '@HNBAP-IEs.HNBConfigInfo' 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("hnb_RNL_Identity': "); 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_hnb__RNL__Identity.BER_decode_TLV(HNBConfigInfo_hnb__RNL__Identity_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("configurationInformation': "); 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_configurationInformation.BER_decode_TLV(HNBConfigInfo_configurationInformation_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(HNBConfigInfo_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 HNBConfigInfo::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 @HNBAP-IEs.HNBConfigInfo."); 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, "hnb_RNL_Identity"); enc_len += field_hnb__RNL__Identity.JSON_encode(HNBConfigInfo_hnb__RNL__Identity_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "configurationInformation"); enc_len += field_configurationInformation.JSON_encode(HNBConfigInfo_configurationInformation_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(HNBConfigInfo_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int HNBConfigInfo::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 hnb__RNL__Identity_found = FALSE; boolean configurationInformation_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 (16 == name_len && 0 == strncmp(fld_name, "hnb_RNL_Identity", name_len)) { hnb__RNL__Identity_found = TRUE; int ret_val = field_hnb__RNL__Identity.JSON_decode(HNBConfigInfo_hnb__RNL__Identity_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, "hnb_RNL_Identity"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (24 == name_len && 0 == strncmp(fld_name, "configurationInformation", name_len)) { configurationInformation_found = TRUE; int ret_val = field_configurationInformation.JSON_decode(HNBConfigInfo_configurationInformation_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, 24, "configurationInformation"); } 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(HNBConfigInfo_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 (!hnb__RNL__Identity_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "hnb_RNL_Identity"); return JSON_ERROR_FATAL; } if (!configurationInformation_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "configurationInformation"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int HNBConfigInfo::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_hnb__RNL__Identity.OER_encode(HNBConfigInfo_hnb__RNL__Identity_descr_, p_buf); field_configurationInformation.OER_encode(HNBConfigInfo_configurationInformation_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(HNBConfigInfo_iE__Extensions_descr_, p_buf); return 0; } int HNBConfigInfo::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_hnb__RNL__Identity.OER_decode(HNBConfigInfo_hnb__RNL__Identity_descr_, p_buf, p_oer); field_configurationInformation.OER_decode(HNBConfigInfo_configurationInformation_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(HNBConfigInfo_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 HNBConfigInfo::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_hnb__RNL__Identity.PER_encode(HNBConfigInfo_hnb__RNL__Identity_descr_, p_buf, p_options); field_configurationInformation.PER_encode(HNBConfigInfo_configurationInformation_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(HNBConfigInfo_iE__Extensions_descr_, p_buf, p_options); } void HNBConfigInfo::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_hnb__RNL__Identity.PER_decode(HNBConfigInfo_hnb__RNL__Identity_descr_, p_buf, p_options); field_configurationInformation.PER_decode(HNBConfigInfo_configurationInformation_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(HNBConfigInfo_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 HNBConfigInfo_template::single_value_struct { HNB__RNL__Identity_template field_hnb__RNL__Identity; ConfigurationInformation_template field_configurationInformation; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template field_iE__Extensions; }; void HNBConfigInfo_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_hnb__RNL__Identity = ANY_VALUE; single_value->field_configurationInformation = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void HNBConfigInfo_template::copy_value(const HNBConfigInfo& other_value) { single_value = new single_value_struct; if (other_value.hnb__RNL__Identity().is_bound()) { single_value->field_hnb__RNL__Identity = other_value.hnb__RNL__Identity(); } else { single_value->field_hnb__RNL__Identity.clean_up(); } if (other_value.configurationInformation().is_bound()) { single_value->field_configurationInformation = other_value.configurationInformation(); } else { single_value->field_configurationInformation.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 HNBConfigInfo_template::copy_template(const HNBConfigInfo_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.hnb__RNL__Identity().get_selection()) { single_value->field_hnb__RNL__Identity = other_value.hnb__RNL__Identity(); } else { single_value->field_hnb__RNL__Identity.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.configurationInformation().get_selection()) { single_value->field_configurationInformation = other_value.configurationInformation(); } else { single_value->field_configurationInformation.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 HNBConfigInfo_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 HNBConfigInfo_template(*other_value.implication_.precondition); implication_.implied_template = new HNBConfigInfo_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 @HNBAP-IEs.HNBConfigInfo."); break; } set_selection(other_value); } HNBConfigInfo_template::HNBConfigInfo_template() { } HNBConfigInfo_template::HNBConfigInfo_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNBConfigInfo_template::HNBConfigInfo_template(const HNBConfigInfo& other_value) { copy_value(other_value); } HNBConfigInfo_template::HNBConfigInfo_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNBConfigInfo&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.HNBConfigInfo from an unbound optional field."); } } HNBConfigInfo_template::HNBConfigInfo_template(HNBConfigInfo_template* p_precondition, HNBConfigInfo_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNBConfigInfo_template::HNBConfigInfo_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; } HNBConfigInfo_template::HNBConfigInfo_template(const HNBConfigInfo_template& other_value) : Base_Template() { copy_template(other_value); } HNBConfigInfo_template::~HNBConfigInfo_template() { clean_up(); } HNBConfigInfo_template& HNBConfigInfo_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNBConfigInfo_template& HNBConfigInfo_template::operator=(const HNBConfigInfo& other_value) { clean_up(); copy_value(other_value); return *this; } HNBConfigInfo_template& HNBConfigInfo_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNBConfigInfo&)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 @HNBAP-IEs.HNBConfigInfo."); } return *this; } HNBConfigInfo_template& HNBConfigInfo_template::operator=(const HNBConfigInfo_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNBConfigInfo_template::match(const HNBConfigInfo& 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.hnb__RNL__Identity().is_bound()) return FALSE; if(!single_value->field_hnb__RNL__Identity.match(other_value.hnb__RNL__Identity(), legacy))return FALSE; if(!other_value.configurationInformation().is_bound()) return FALSE; if(!single_value->field_configurationInformation.match(other_value.configurationInformation(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10&)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 @HNBAP-IEs.HNBConfigInfo."); } return FALSE; } boolean HNBConfigInfo_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_hnb__RNL__Identity.is_bound() || single_value->field_configurationInformation.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean HNBConfigInfo_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_hnb__RNL__Identity.is_value() && single_value->field_configurationInformation.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void HNBConfigInfo_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; } HNBConfigInfo HNBConfigInfo_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 @HNBAP-IEs.HNBConfigInfo."); HNBConfigInfo ret_val; if (single_value->field_hnb__RNL__Identity.is_bound()) { ret_val.hnb__RNL__Identity() = single_value->field_hnb__RNL__Identity.valueof(); } if (single_value->field_configurationInformation.is_bound()) { ret_val.configurationInformation() = single_value->field_configurationInformation.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 HNBConfigInfo_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 @HNBAP-IEs.HNBConfigInfo."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HNBConfigInfo_template[list_length]; } HNBConfigInfo_template& HNBConfigInfo_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 @HNBAP-IEs.HNBConfigInfo."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.HNBConfigInfo."); return value_list.list_value[list_index]; } HNB__RNL__Identity_template& HNBConfigInfo_template::hnb__RNL__Identity() { set_specific(); return single_value->field_hnb__RNL__Identity; } const HNB__RNL__Identity_template& HNBConfigInfo_template::hnb__RNL__Identity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hnb_RNL_Identity of a non-specific template of type @HNBAP-IEs.HNBConfigInfo."); return single_value->field_hnb__RNL__Identity; } ConfigurationInformation_template& HNBConfigInfo_template::configurationInformation() { set_specific(); return single_value->field_configurationInformation; } const ConfigurationInformation_template& HNBConfigInfo_template::configurationInformation() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field configurationInformation of a non-specific template of type @HNBAP-IEs.HNBConfigInfo."); return single_value->field_configurationInformation; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& HNBConfigInfo_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& HNBConfigInfo_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.HNBConfigInfo."); return single_value->field_iE__Extensions; } int HNBConfigInfo_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigInfo which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 2; 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 @HNBAP-IEs.HNBConfigInfo 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 @HNBAP-IEs.HNBConfigInfo containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigInfo containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigInfo containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigInfo containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigInfo containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigInfo containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNBConfigInfo containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.HNBConfigInfo."); } return 0; } void HNBConfigInfo_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ hnb_RNL_Identity := "); single_value->field_hnb__RNL__Identity.log(); TTCN_Logger::log_event_str(", configurationInformation := "); single_value->field_configurationInformation.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 HNBConfigInfo_template::log_match(const HNBConfigInfo& 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_hnb__RNL__Identity.match(match_value.hnb__RNL__Identity(), legacy)){ TTCN_Logger::log_logmatch_info(".hnb_RNL_Identity"); single_value->field_hnb__RNL__Identity.log_match(match_value.hnb__RNL__Identity(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_configurationInformation.match(match_value.configurationInformation(), legacy)){ TTCN_Logger::log_logmatch_info(".configurationInformation"); single_value->field_configurationInformation.log_match(match_value.configurationInformation(), 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("{ hnb_RNL_Identity := "); single_value->field_hnb__RNL__Identity.log_match(match_value.hnb__RNL__Identity(), legacy); TTCN_Logger::log_event_str(", configurationInformation := "); single_value->field_configurationInformation.log_match(match_value.configurationInformation(), 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 HNBConfigInfo_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (hnb__RNL__Identity().is_bound()) hnb__RNL__Identity().set_implicit_omit(); if (configurationInformation().is_bound()) configurationInformation().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNBConfigInfo_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_hnb__RNL__Identity.encode_text(text_buf); single_value->field_configurationInformation.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 @HNBAP-IEs.HNBConfigInfo."); } } void HNBConfigInfo_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_hnb__RNL__Identity.decode_text(text_buf); single_value->field_configurationInformation.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 HNBConfigInfo_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 @HNBAP-IEs.HNBConfigInfo."); } } void HNBConfigInfo_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: { HNBConfigInfo_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) hnb__RNL__Identity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) configurationInformation().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "hnb_RNL_Identity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__RNL__Identity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "configurationInformation")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { configurationInformation().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 @HNBAP-IEs.HNBConfigInfo: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { HNBConfigInfo_template* precondition = new HNBConfigInfo_template; precondition->set_param(*param.get_elem(0)); HNBConfigInfo_template* implied_template = new HNBConfigInfo_template; implied_template->set_param(*param.get_elem(1)); *this = HNBConfigInfo_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.HNBConfigInfo"); } is_ifpresent = param.get_ifpresent(); } void HNBConfigInfo_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_hnb__RNL__Identity.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigInfo"); single_value->field_configurationInformation.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigInfo"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNBConfigInfo"); 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 : "@HNBAP-IEs.HNBConfigInfo"); } boolean HNBConfigInfo_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNBConfigInfo_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_macroCoverageInfo, const OPTIONAL< GeographicalLocation >& par_geographicalCoordinates, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 >& par_iE__Extensions) : field_macroCoverageInfo(par_macroCoverageInfo), field_geographicalCoordinates(par_geographicalCoordinates), field_iE__Extensions(par_iE__Extensions) { } HNB__Location__Information::HNB__Location__Information(const HNB__Location__Information& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.HNB-Location-Information."); if (other_value.macroCoverageInfo().is_bound()) field_macroCoverageInfo = other_value.macroCoverageInfo(); else field_macroCoverageInfo.clean_up(); if (other_value.geographicalCoordinates().is_bound()) field_geographicalCoordinates = other_value.geographicalCoordinates(); else field_geographicalCoordinates.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void HNB__Location__Information::clean_up() { field_macroCoverageInfo.clean_up(); field_geographicalCoordinates.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* HNB__Location__Information::get_descriptor() const { return &HNB__Location__Information_descr_; } HNB__Location__Information& HNB__Location__Information::operator=(const HNB__Location__Information& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.HNB-Location-Information."); if (other_value.macroCoverageInfo().is_bound()) field_macroCoverageInfo = other_value.macroCoverageInfo(); else field_macroCoverageInfo.clean_up(); if (other_value.geographicalCoordinates().is_bound()) field_geographicalCoordinates = other_value.geographicalCoordinates(); else field_geographicalCoordinates.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 HNB__Location__Information::operator==(const HNB__Location__Information& other_value) const { return field_macroCoverageInfo==other_value.field_macroCoverageInfo && field_geographicalCoordinates==other_value.field_geographicalCoordinates && field_iE__Extensions==other_value.field_iE__Extensions; } boolean HNB__Location__Information::is_bound() const { return (OPTIONAL_OMIT == field_macroCoverageInfo.get_selection() || field_macroCoverageInfo.is_bound()) || (OPTIONAL_OMIT == field_geographicalCoordinates.get_selection() || field_geographicalCoordinates.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean HNB__Location__Information::is_value() const { return (OPTIONAL_OMIT == field_macroCoverageInfo.get_selection() || field_macroCoverageInfo.is_value()) && (OPTIONAL_OMIT == field_geographicalCoordinates.get_selection() || field_geographicalCoordinates.is_value()) && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int HNB__Location__Information::size_of() const { int ret_val = 0; if (field_macroCoverageInfo.ispresent()) ret_val++; if (field_geographicalCoordinates.ispresent()) ret_val++; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void HNB__Location__Information::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ macroCoverageInfo := "); field_macroCoverageInfo.log(); TTCN_Logger::log_event_str(", geographicalCoordinates := "); field_geographicalCoordinates.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void HNB__Location__Information::set_implicit_omit() { if (!macroCoverageInfo().is_bound()) macroCoverageInfo() = OMIT_VALUE; else macroCoverageInfo().set_implicit_omit(); if (!geographicalCoordinates().is_bound()) geographicalCoordinates() = OMIT_VALUE; else geographicalCoordinates().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNB__Location__Information::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) macroCoverageInfo().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) geographicalCoordinates().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "macroCoverageInfo")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { macroCoverageInfo().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "geographicalCoordinates")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { geographicalCoordinates().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 @HNBAP-IEs.HNB-Location-Information: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.HNB-Location-Information"); } } void HNB__Location__Information::encode_text(Text_Buf& text_buf) const { field_macroCoverageInfo.encode_text(text_buf); field_geographicalCoordinates.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void HNB__Location__Information::decode_text(Text_Buf& text_buf) { field_macroCoverageInfo.decode_text(text_buf); field_geographicalCoordinates.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void HNB__Location__Information::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 HNB__Location__Information::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* HNB__Location__Information::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("macroCoverageInfo': "); new_tlv->add_TLV(field_macroCoverageInfo.BER_encode_TLV(HNB__Location__Information_macroCoverageInfo_descr_, p_coding)); ec_1.set_msg("geographicalCoordinates': "); new_tlv->add_TLV(field_geographicalCoordinates.BER_encode_TLV(HNB__Location__Information_geographicalCoordinates_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(HNB__Location__Information_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean HNB__Location__Information::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 '@HNBAP-IEs.HNB-Location-Information' 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("macroCoverageInfo': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_macroCoverageInfo=OMIT_VALUE; else { field_macroCoverageInfo.BER_decode_TLV(HNB__Location__Information_macroCoverageInfo_descr_, tmp_tlv, L_form); if(field_macroCoverageInfo.ispresent()) tlv_present=FALSE; } ec_2.set_msg("geographicalCoordinates': "); if(!tlv_present) tlv_present=BER_decode_constdTLV_next(stripped_tlv, V_pos, L_form, tmp_tlv); if(!tlv_present) field_geographicalCoordinates=OMIT_VALUE; else { field_geographicalCoordinates.BER_decode_TLV(HNB__Location__Information_geographicalCoordinates_descr_, tmp_tlv, L_form); if(field_geographicalCoordinates.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(HNB__Location__Information_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 HNB__Location__Information::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 @HNBAP-IEs.HNB-Location-Information."); return -1; } int enc_len = p_tok.put_next_token(JSON_TOKEN_OBJECT_START, NULL); if (field_macroCoverageInfo.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "macroCoverageInfo"); enc_len += field_macroCoverageInfo.JSON_encode(HNB__Location__Information_macroCoverageInfo_descr_, p_tok, FALSE); } if (field_geographicalCoordinates.is_present()) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "geographicalCoordinates"); enc_len += field_geographicalCoordinates.JSON_encode(HNB__Location__Information_geographicalCoordinates_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(HNB__Location__Information_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int HNB__Location__Information::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 macroCoverageInfo_found = FALSE; boolean geographicalCoordinates_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 (17 == name_len && 0 == strncmp(fld_name, "macroCoverageInfo", name_len)) { macroCoverageInfo_found = TRUE; int ret_val = field_macroCoverageInfo.JSON_decode(HNB__Location__Information_macroCoverageInfo_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, "macroCoverageInfo"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (23 == name_len && 0 == strncmp(fld_name, "geographicalCoordinates", name_len)) { geographicalCoordinates_found = TRUE; int ret_val = field_geographicalCoordinates.JSON_decode(HNB__Location__Information_geographicalCoordinates_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, 23, "geographicalCoordinates"); } 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(HNB__Location__Information_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 (!macroCoverageInfo_found) { field_macroCoverageInfo = OMIT_VALUE; } if (!geographicalCoordinates_found) { field_geographicalCoordinates = OMIT_VALUE; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int HNB__Location__Information::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_macroCoverageInfo.is_present()) { c |= 64; } if (field_geographicalCoordinates.is_present()) { c |= 32; } if (field_iE__Extensions.is_present()) { c |= 16; } p_buf.put_c(c); if (field_macroCoverageInfo.is_present()) field_macroCoverageInfo.OER_encode(HNB__Location__Information_macroCoverageInfo_descr_, p_buf); if (field_geographicalCoordinates.is_present()) field_geographicalCoordinates.OER_encode(HNB__Location__Information_geographicalCoordinates_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(HNB__Location__Information_iE__Extensions_descr_, p_buf); return 0; } int HNB__Location__Information::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_macroCoverageInfo.OER_decode(HNB__Location__Information_macroCoverageInfo_descr_, p_buf, p_oer); else field_macroCoverageInfo = OMIT_VALUE; if (uc[0] & 32) field_geographicalCoordinates.OER_decode(HNB__Location__Information_geographicalCoordinates_descr_, p_buf, p_oer); else field_geographicalCoordinates = OMIT_VALUE; if (uc[0] & 16) field_iE__Extensions.OER_decode(HNB__Location__Information_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 HNB__Location__Information::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_macroCoverageInfo_present = field_macroCoverageInfo.is_present(); p_buf.PER_put_bit(field_macroCoverageInfo_present); boolean field_geographicalCoordinates_present = field_geographicalCoordinates.is_present(); p_buf.PER_put_bit(field_geographicalCoordinates_present); boolean field_iE__Extensions_present = field_iE__Extensions.is_present(); p_buf.PER_put_bit(field_iE__Extensions_present); if (field_macroCoverageInfo_present) field_macroCoverageInfo.PER_encode(HNB__Location__Information_macroCoverageInfo_descr_, p_buf, p_options); if (field_geographicalCoordinates_present) field_geographicalCoordinates.PER_encode(HNB__Location__Information_geographicalCoordinates_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(HNB__Location__Information_iE__Extensions_descr_, p_buf, p_options); } void HNB__Location__Information::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_macroCoverageInfo_present = p_buf.PER_get_bit(); boolean field_geographicalCoordinates_present = p_buf.PER_get_bit(); boolean field_iE__Extensions_present = p_buf.PER_get_bit(); if (field_macroCoverageInfo_present) field_macroCoverageInfo.PER_decode(HNB__Location__Information_macroCoverageInfo_descr_, p_buf, p_options); else field_macroCoverageInfo = OMIT_VALUE; if (field_geographicalCoordinates_present) field_geographicalCoordinates.PER_decode(HNB__Location__Information_geographicalCoordinates_descr_, p_buf, p_options); else field_geographicalCoordinates = OMIT_VALUE; if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(HNB__Location__Information_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 HNB__Location__Information_template::single_value_struct { MacroCoverageInformation_template field_macroCoverageInfo; GeographicalLocation_template field_geographicalCoordinates; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template field_iE__Extensions; }; void HNB__Location__Information_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_macroCoverageInfo = ANY_OR_OMIT; single_value->field_geographicalCoordinates = ANY_OR_OMIT; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void HNB__Location__Information_template::copy_value(const HNB__Location__Information& other_value) { single_value = new single_value_struct; if (other_value.macroCoverageInfo().is_bound()) { if (other_value.macroCoverageInfo().ispresent()) single_value->field_macroCoverageInfo = other_value.macroCoverageInfo()(); else single_value->field_macroCoverageInfo = OMIT_VALUE; } else { single_value->field_macroCoverageInfo.clean_up(); } if (other_value.geographicalCoordinates().is_bound()) { if (other_value.geographicalCoordinates().ispresent()) single_value->field_geographicalCoordinates = other_value.geographicalCoordinates()(); else single_value->field_geographicalCoordinates = OMIT_VALUE; } else { single_value->field_geographicalCoordinates.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 HNB__Location__Information_template::copy_template(const HNB__Location__Information_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.macroCoverageInfo().get_selection()) { single_value->field_macroCoverageInfo = other_value.macroCoverageInfo(); } else { single_value->field_macroCoverageInfo.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.geographicalCoordinates().get_selection()) { single_value->field_geographicalCoordinates = other_value.geographicalCoordinates(); } else { single_value->field_geographicalCoordinates.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 HNB__Location__Information_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 HNB__Location__Information_template(*other_value.implication_.precondition); implication_.implied_template = new HNB__Location__Information_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 @HNBAP-IEs.HNB-Location-Information."); break; } set_selection(other_value); } HNB__Location__Information_template::HNB__Location__Information_template() { } HNB__Location__Information_template::HNB__Location__Information_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNB__Location__Information_template::HNB__Location__Information_template(const HNB__Location__Information& other_value) { copy_value(other_value); } HNB__Location__Information_template::HNB__Location__Information_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNB__Location__Information&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.HNB-Location-Information from an unbound optional field."); } } HNB__Location__Information_template::HNB__Location__Information_template(HNB__Location__Information_template* p_precondition, HNB__Location__Information_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNB__Location__Information_template::HNB__Location__Information_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; } HNB__Location__Information_template::HNB__Location__Information_template(const HNB__Location__Information_template& other_value) : Base_Template() { copy_template(other_value); } HNB__Location__Information_template::~HNB__Location__Information_template() { clean_up(); } HNB__Location__Information_template& HNB__Location__Information_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNB__Location__Information_template& HNB__Location__Information_template::operator=(const HNB__Location__Information& other_value) { clean_up(); copy_value(other_value); return *this; } HNB__Location__Information_template& HNB__Location__Information_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNB__Location__Information&)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 @HNBAP-IEs.HNB-Location-Information."); } return *this; } HNB__Location__Information_template& HNB__Location__Information_template::operator=(const HNB__Location__Information_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNB__Location__Information_template::match(const HNB__Location__Information& 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.macroCoverageInfo().is_bound()) return FALSE; if((other_value.macroCoverageInfo().ispresent() ? !single_value->field_macroCoverageInfo.match((const MacroCoverageInformation&)other_value.macroCoverageInfo(), legacy) : !single_value->field_macroCoverageInfo.match_omit(legacy)))return FALSE; if(!other_value.geographicalCoordinates().is_bound()) return FALSE; if((other_value.geographicalCoordinates().ispresent() ? !single_value->field_geographicalCoordinates.match((const GeographicalLocation&)other_value.geographicalCoordinates(), legacy) : !single_value->field_geographicalCoordinates.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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13&)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 @HNBAP-IEs.HNB-Location-Information."); } return FALSE; } boolean HNB__Location__Information_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return (single_value->field_macroCoverageInfo.is_omit() || single_value->field_macroCoverageInfo.is_bound()) || (single_value->field_geographicalCoordinates.is_omit() || single_value->field_geographicalCoordinates.is_bound()) || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean HNB__Location__Information_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return (single_value->field_macroCoverageInfo.is_omit() || single_value->field_macroCoverageInfo.is_value()) && (single_value->field_geographicalCoordinates.is_omit() || single_value->field_geographicalCoordinates.is_value()) && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void HNB__Location__Information_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; } HNB__Location__Information HNB__Location__Information_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 @HNBAP-IEs.HNB-Location-Information."); HNB__Location__Information ret_val; if (single_value->field_macroCoverageInfo.is_omit()) ret_val.macroCoverageInfo() = OMIT_VALUE; else if (single_value->field_macroCoverageInfo.is_bound()) { ret_val.macroCoverageInfo() = single_value->field_macroCoverageInfo.valueof(); } if (single_value->field_geographicalCoordinates.is_omit()) ret_val.geographicalCoordinates() = OMIT_VALUE; else if (single_value->field_geographicalCoordinates.is_bound()) { ret_val.geographicalCoordinates() = single_value->field_geographicalCoordinates.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 HNB__Location__Information_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 @HNBAP-IEs.HNB-Location-Information."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HNB__Location__Information_template[list_length]; } HNB__Location__Information_template& HNB__Location__Information_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 @HNBAP-IEs.HNB-Location-Information."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.HNB-Location-Information."); return value_list.list_value[list_index]; } MacroCoverageInformation_template& HNB__Location__Information_template::macroCoverageInfo() { set_specific(); return single_value->field_macroCoverageInfo; } const MacroCoverageInformation_template& HNB__Location__Information_template::macroCoverageInfo() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field macroCoverageInfo of a non-specific template of type @HNBAP-IEs.HNB-Location-Information."); return single_value->field_macroCoverageInfo; } GeographicalLocation_template& HNB__Location__Information_template::geographicalCoordinates() { set_specific(); return single_value->field_geographicalCoordinates; } const GeographicalLocation_template& HNB__Location__Information_template::geographicalCoordinates() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field geographicalCoordinates of a non-specific template of type @HNBAP-IEs.HNB-Location-Information."); return single_value->field_geographicalCoordinates; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& HNB__Location__Information_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& HNB__Location__Information_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.HNB-Location-Information."); return single_value->field_iE__Extensions; } int HNB__Location__Information_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Location-Information which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 0; if (single_value->field_macroCoverageInfo.is_present()) ret_val++; if (single_value->field_geographicalCoordinates.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 @HNBAP-IEs.HNB-Location-Information 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 @HNBAP-IEs.HNB-Location-Information containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Location-Information containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Location-Information containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Location-Information containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Location-Information containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Location-Information containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Location-Information containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.HNB-Location-Information."); } return 0; } void HNB__Location__Information_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ macroCoverageInfo := "); single_value->field_macroCoverageInfo.log(); TTCN_Logger::log_event_str(", geographicalCoordinates := "); single_value->field_geographicalCoordinates.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 HNB__Location__Information_template::log_match(const HNB__Location__Information& 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.macroCoverageInfo().ispresent()){ if(!single_value->field_macroCoverageInfo.match(match_value.macroCoverageInfo(), legacy)){ TTCN_Logger::log_logmatch_info(".macroCoverageInfo"); single_value->field_macroCoverageInfo.log_match(match_value.macroCoverageInfo(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_macroCoverageInfo.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".macroCoverageInfo := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_macroCoverageInfo.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.geographicalCoordinates().ispresent()){ if(!single_value->field_geographicalCoordinates.match(match_value.geographicalCoordinates(), legacy)){ TTCN_Logger::log_logmatch_info(".geographicalCoordinates"); single_value->field_geographicalCoordinates.log_match(match_value.geographicalCoordinates(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_geographicalCoordinates.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".geographicalCoordinates := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_geographicalCoordinates.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("{ macroCoverageInfo := "); if (match_value.macroCoverageInfo().ispresent()) { single_value->field_macroCoverageInfo.log_match(match_value.macroCoverageInfo(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_macroCoverageInfo.log(); if (single_value->field_macroCoverageInfo.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", geographicalCoordinates := "); if (match_value.geographicalCoordinates().ispresent()) { single_value->field_geographicalCoordinates.log_match(match_value.geographicalCoordinates(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_geographicalCoordinates.log(); if (single_value->field_geographicalCoordinates.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 HNB__Location__Information_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (!macroCoverageInfo().is_bound()) macroCoverageInfo() = OMIT_VALUE; else macroCoverageInfo().set_implicit_omit(); if (!geographicalCoordinates().is_bound()) geographicalCoordinates() = OMIT_VALUE; else geographicalCoordinates().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNB__Location__Information_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_macroCoverageInfo.encode_text(text_buf); single_value->field_geographicalCoordinates.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 @HNBAP-IEs.HNB-Location-Information."); } } void HNB__Location__Information_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_macroCoverageInfo.decode_text(text_buf); single_value->field_geographicalCoordinates.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 HNB__Location__Information_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 @HNBAP-IEs.HNB-Location-Information."); } } void HNB__Location__Information_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: { HNB__Location__Information_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) macroCoverageInfo().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) geographicalCoordinates().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "macroCoverageInfo")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { macroCoverageInfo().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "geographicalCoordinates")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { geographicalCoordinates().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 @HNBAP-IEs.HNB-Location-Information: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { HNB__Location__Information_template* precondition = new HNB__Location__Information_template; precondition->set_param(*param.get_elem(0)); HNB__Location__Information_template* implied_template = new HNB__Location__Information_template; implied_template->set_param(*param.get_elem(1)); *this = HNB__Location__Information_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.HNB-Location-Information"); } is_ifpresent = param.get_ifpresent(); } void HNB__Location__Information_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_macroCoverageInfo.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-Location-Information"); single_value->field_geographicalCoordinates.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-Location-Information"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-Location-Information"); 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 : "@HNBAP-IEs.HNB-Location-Information"); } boolean HNB__Location__Information_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNB__Location__Information_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_gERANCellID: return field_gERANCellID->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void MacroCellID::clean_up() { switch (union_selection) { case ALT_uTRANCellID: delete field_uTRANCellID; break; case ALT_gERANCellID: delete field_gERANCellID; break; default: break; } union_selection = UNBOUND_VALUE; } void MacroCellID::log() const { switch (union_selection) { case ALT_uTRANCellID: TTCN_Logger::log_event_str("{ uTRANCellID := "); field_uTRANCellID->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_gERANCellID: TTCN_Logger::log_event_str("{ gERANCellID := "); field_gERANCellID->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void MacroCellID::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, "uTRANCellID")) { uTRANCellID().set_param(*mp_last); if (!uTRANCellID().is_bound()) clean_up(); return; } if (!strcmp(last_name, "gERANCellID")) { gERANCellID().set_param(*mp_last); if (!gERANCellID().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.MacroCellID.", last_name); } void MacroCellID::set_implicit_omit() { switch (union_selection) { case ALT_uTRANCellID: field_uTRANCellID->set_implicit_omit(); break; case ALT_gERANCellID: field_gERANCellID->set_implicit_omit(); break; default: break; } } void MacroCellID::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_uTRANCellID: field_uTRANCellID->encode_text(text_buf); break; case ALT_gERANCellID: field_gERANCellID->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @HNBAP-IEs.MacroCellID."); } } void MacroCellID::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_uTRANCellID: uTRANCellID().decode_text(text_buf); break; case ALT_gERANCellID: gERANCellID().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @HNBAP-IEs.MacroCellID."); } } void MacroCellID::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 MacroCellID::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 *MacroCellID::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_uTRANCellID: ec_1.set_msg("uTRANCellID': "); new_tlv = field_uTRANCellID->BER_encode_TLV(MacroCellID_uTRANCellID_descr_, p_coding); break; case ALT_gERANCellID: ec_1.set_msg("gERANCellID': "); new_tlv = field_gERANCellID->BER_encode_TLV(MacroCellID_gERANCellID_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 MacroCellID::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_uTRANCellID = new UTRANCellID; union_selection = ALT_uTRANCellID; if (field_uTRANCellID->BER_decode_isMyMsg(MacroCellID_uTRANCellID_descr_, p_tlv)) return TRUE; delete field_uTRANCellID; field_gERANCellID = new CGI; union_selection = ALT_gERANCellID; if (field_gERANCellID->BER_decode_isMyMsg(MacroCellID_gERANCellID_descr_, p_tlv)) return TRUE; delete field_gERANCellID; union_selection = UNBOUND_VALUE; return FALSE; } boolean MacroCellID::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { MacroCellID tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean MacroCellID::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 '@HNBAP-IEs.MacroCellID' 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_uTRANCellID: ec_2.set_msg("uTRANCellID': "); field_uTRANCellID->BER_decode_TLV(MacroCellID_uTRANCellID_descr_, tmp_tlv, L_form); break; case ALT_gERANCellID: ec_2.set_msg("gERANCellID': "); field_gERANCellID->BER_decode_TLV(MacroCellID_gERANCellID_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int MacroCellID::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_uTRANCellID: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "uTRANCellID"); } enc_len += field_uTRANCellID->JSON_encode(MacroCellID_uTRANCellID_descr_, p_tok, FALSE); break; case ALT_gERANCellID: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "gERANCellID"); } enc_len += field_gERANCellID->JSON_encode(MacroCellID_gERANCellID_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.MacroCellID."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int MacroCellID::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 uTRANCellID().JSON_decode(MacroCellID_uTRANCellID_descr_, p_tok, TRUE, FALSE); case 1: return gERANCellID().JSON_decode(MacroCellID_gERANCellID_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 '@HNBAP-IEs.MacroCellID'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "string '@HNBAP-IEs.MacroCellID'"); 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 '@HNBAP-IEs.MacroCellID'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { p_tok.set_buf_pos(buf_pos); ret_val = uTRANCellID().JSON_decode(MacroCellID_uTRANCellID_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = gERANCellID().JSON_decode(MacroCellID_gERANCellID_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 '@HNBAP-IEs.MacroCellID'"); 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 (11 == name_len && 0 == strncmp(fld_name, "uTRANCellID", name_len)) { int ret_val = uTRANCellID().JSON_decode(MacroCellID_uTRANCellID_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, "uTRANCellID"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (11 == name_len && 0 == strncmp(fld_name, "gERANCellID", name_len)) { int ret_val = gERANCellID().JSON_decode(MacroCellID_gERANCellID_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, "gERANCellID"); } 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 MacroCellID::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_uTRANCellID: {TTCN_Buffer buf; encode_oer_tag(*MacroCellID_uTRANCellID_descr_.ber, p_buf); field_uTRANCellID->OER_encode(MacroCellID_uTRANCellID_descr_, buf); p_buf.put_buf(buf); break; } case ALT_gERANCellID: {TTCN_Buffer buf; encode_oer_tag(*MacroCellID_gERANCellID_descr_.ber, p_buf); field_gERANCellID->OER_encode(MacroCellID_gERANCellID_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.MacroCellID."); return -1; } return 0; } int MacroCellID::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 (MacroCellID_uTRANCellID_descr_.ber->tags[MacroCellID_uTRANCellID_descr_.ber->n_tags-1].tagclass == descr.tagclass && MacroCellID_uTRANCellID_descr_.ber->tags[MacroCellID_uTRANCellID_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { uTRANCellID().OER_decode(MacroCellID_uTRANCellID_descr_, p_buf, p_oer); } else if (MacroCellID_gERANCellID_descr_.ber->tags[MacroCellID_gERANCellID_descr_.ber->n_tags-1].tagclass == descr.tagclass && MacroCellID_gERANCellID_descr_.ber->tags[MacroCellID_gERANCellID_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { gERANCellID().OER_decode(MacroCellID_gERANCellID_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type MacroCellID"); } return 0; } void MacroCellID::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_uTRANCellID: { INTEGER::PER_encode_int(p_buf, 0, 1); field_uTRANCellID->PER_encode(MacroCellID_uTRANCellID_descr_, p_buf, p_options); break; } case ALT_gERANCellID: { INTEGER::PER_encode_int(p_buf, 1, 1); field_gERANCellID->PER_encode(MacroCellID_gERANCellID_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 MacroCellID::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, 1, FALSE, sel_int); switch (sel_int) { case 0: uTRANCellID().PER_decode(MacroCellID_uTRANCellID_descr_, p_buf, p_options); break; case 1: gERANCellID().PER_decode(MacroCellID_gERANCellID_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 MacroCellID_template::copy_value(const MacroCellID& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case MacroCellID::ALT_uTRANCellID: single_value.field_uTRANCellID = new UTRANCellID_template(other_value.uTRANCellID()); break; case MacroCellID::ALT_gERANCellID: single_value.field_gERANCellID = new CGI_template(other_value.gERANCellID()); break; default: TTCN_error("Initializing a template with an unbound value of type @HNBAP-IEs.MacroCellID."); } set_selection(SPECIFIC_VALUE); } void MacroCellID_template::copy_template(const MacroCellID_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 MacroCellID::ALT_uTRANCellID: single_value.field_uTRANCellID = new UTRANCellID_template(*other_value.single_value.field_uTRANCellID); break; case MacroCellID::ALT_gERANCellID: single_value.field_gERANCellID = new CGI_template(*other_value.single_value.field_gERANCellID); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @HNBAP-IEs.MacroCellID."); } 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 MacroCellID_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 MacroCellID_template(*other_value.implication_.precondition); implication_.implied_template = new MacroCellID_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 @HNBAP-IEs.MacroCellID."); } set_selection(other_value); } MacroCellID_template::MacroCellID_template() { } MacroCellID_template::MacroCellID_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MacroCellID_template::MacroCellID_template(const MacroCellID& other_value) { copy_value(other_value); } MacroCellID_template::MacroCellID_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MacroCellID&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-IEs.MacroCellID from an unbound optional field."); } } MacroCellID_template::MacroCellID_template(MacroCellID_template* p_precondition, MacroCellID_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MacroCellID_template::MacroCellID_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; } MacroCellID_template::MacroCellID_template(const MacroCellID_template& other_value) : Base_Template(){ copy_template(other_value); } MacroCellID_template::~MacroCellID_template() { clean_up(); } void MacroCellID_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case MacroCellID::ALT_uTRANCellID: delete single_value.field_uTRANCellID; break; case MacroCellID::ALT_gERANCellID: delete single_value.field_gERANCellID; 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; } MacroCellID_template& MacroCellID_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MacroCellID_template& MacroCellID_template::operator=(const MacroCellID& other_value) { clean_up(); copy_value(other_value); return *this; } MacroCellID_template& MacroCellID_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MacroCellID&)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 @HNBAP-IEs.MacroCellID."); } return *this; } MacroCellID_template& MacroCellID_template::operator=(const MacroCellID_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MacroCellID_template::match(const MacroCellID& 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: { MacroCellID::union_selection_type value_selection = other_value.get_selection(); if (value_selection == MacroCellID::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case MacroCellID::ALT_uTRANCellID: return single_value.field_uTRANCellID->match(other_value.uTRANCellID(), legacy); case MacroCellID::ALT_gERANCellID: return single_value.field_gERANCellID->match(other_value.gERANCellID(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @HNBAP-IEs.MacroCellID."); } } 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 @HNBAP-IEs.MacroCellID."); } return FALSE; } boolean MacroCellID_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case MacroCellID::ALT_uTRANCellID: return single_value.field_uTRANCellID->is_value(); case MacroCellID::ALT_gERANCellID: return single_value.field_gERANCellID->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @HNBAP-IEs.MacroCellID."); } } MacroCellID MacroCellID_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 @HNBAP-IEs.MacroCellID."); MacroCellID ret_val; switch (single_value.union_selection) { case MacroCellID::ALT_uTRANCellID: ret_val.uTRANCellID() = single_value.field_uTRANCellID->valueof(); break; case MacroCellID::ALT_gERANCellID: ret_val.gERANCellID() = single_value.field_gERANCellID->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @HNBAP-IEs.MacroCellID."); } return ret_val; } MacroCellID_template& MacroCellID_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 @HNBAP-IEs.MacroCellID."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-IEs.MacroCellID."); return value_list.list_value[list_index]; } void MacroCellID_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 @HNBAP-IEs.MacroCellID."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MacroCellID_template[list_length]; } UTRANCellID_template& MacroCellID_template::uTRANCellID() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MacroCellID::ALT_uTRANCellID) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_uTRANCellID = new UTRANCellID_template(ANY_VALUE); else single_value.field_uTRANCellID = new UTRANCellID_template; single_value.union_selection = MacroCellID::ALT_uTRANCellID; set_selection(SPECIFIC_VALUE); } return *single_value.field_uTRANCellID; } const UTRANCellID_template& MacroCellID_template::uTRANCellID() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uTRANCellID in a non-specific template of union type @HNBAP-IEs.MacroCellID."); if (single_value.union_selection != MacroCellID::ALT_uTRANCellID) TTCN_error("Accessing non-selected field uTRANCellID in a template of union type @HNBAP-IEs.MacroCellID."); return *single_value.field_uTRANCellID; } CGI_template& MacroCellID_template::gERANCellID() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MacroCellID::ALT_gERANCellID) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gERANCellID = new CGI_template(ANY_VALUE); else single_value.field_gERANCellID = new CGI_template; single_value.union_selection = MacroCellID::ALT_gERANCellID; set_selection(SPECIFIC_VALUE); } return *single_value.field_gERANCellID; } const CGI_template& MacroCellID_template::gERANCellID() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gERANCellID in a non-specific template of union type @HNBAP-IEs.MacroCellID."); if (single_value.union_selection != MacroCellID::ALT_gERANCellID) TTCN_error("Accessing non-selected field gERANCellID in a template of union type @HNBAP-IEs.MacroCellID."); return *single_value.field_gERANCellID; } boolean MacroCellID_template::ischosen(MacroCellID::union_selection_type checked_selection) const { if (checked_selection == MacroCellID::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-IEs.MacroCellID."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == MacroCellID::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-IEs.MacroCellID."); 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 @HNBAP-IEs.MacroCellID 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 MacroCellID_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case MacroCellID::ALT_uTRANCellID: TTCN_Logger::log_event_str("{ uTRANCellID := "); single_value.field_uTRANCellID->log(); TTCN_Logger::log_event_str(" }"); break; case MacroCellID::ALT_gERANCellID: TTCN_Logger::log_event_str("{ gERANCellID := "); single_value.field_gERANCellID->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 MacroCellID_template::log_match(const MacroCellID& 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 MacroCellID::ALT_uTRANCellID: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".uTRANCellID"); single_value.field_uTRANCellID->log_match(match_value.uTRANCellID(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ uTRANCellID := "); single_value.field_uTRANCellID->log_match(match_value.uTRANCellID(), legacy); TTCN_Logger::log_event_str(" }"); } break; case MacroCellID::ALT_gERANCellID: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".gERANCellID"); single_value.field_gERANCellID->log_match(match_value.gERANCellID(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ gERANCellID := "); single_value.field_gERANCellID->log_match(match_value.gERANCellID(), 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 MacroCellID_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case MacroCellID::ALT_uTRANCellID: single_value.field_uTRANCellID->set_implicit_omit(); break; case MacroCellID::ALT_gERANCellID: single_value.field_gERANCellID->set_implicit_omit(); break; default: break; } } void MacroCellID_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 MacroCellID::ALT_uTRANCellID: single_value.field_uTRANCellID->encode_text(text_buf); break; case MacroCellID::ALT_gERANCellID: single_value.field_gERANCellID->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @HNBAP-IEs.MacroCellID."); } 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 @HNBAP-IEs.MacroCellID."); } } void MacroCellID_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = MacroCellID::UNBOUND_VALUE; MacroCellID::union_selection_type new_selection = (MacroCellID::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case MacroCellID::ALT_uTRANCellID: single_value.field_uTRANCellID = new UTRANCellID_template; single_value.field_uTRANCellID->decode_text(text_buf); break; case MacroCellID::ALT_gERANCellID: single_value.field_gERANCellID = new CGI_template; single_value.field_gERANCellID->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @HNBAP-IEs.MacroCellID."); } 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 MacroCellID_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 @HNBAP-IEs.MacroCellID."); } } boolean MacroCellID_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MacroCellID_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 `@HNBAP-IEs.MacroCellID'"); } if (strcmp("uTRANCellID", param_field) == 0) { uTRANCellID().set_param(param); return; } else if (strcmp("gERANCellID", param_field) == 0) { gERANCellID().set_param(param); return; } else param.error("Field `%s' not found in union template type `@HNBAP-IEs.MacroCellID'", 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: { MacroCellID_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", "@HNBAP-IEs.MacroCellID"); 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, "uTRANCellID")) { uTRANCellID().set_param(*mp_last); break; } if (!strcmp(last_name, "gERANCellID")) { gERANCellID().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.MacroCellID.", last_name); } break; case Module_Param::MP_Implication_Template: { MacroCellID_template* precondition = new MacroCellID_template; precondition->set_param(*m_p->get_elem(0)); MacroCellID_template* implied_template = new MacroCellID_template; implied_template->set_param(*m_p->get_elem(1)); *this = MacroCellID_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-IEs.MacroCellID"); } is_ifpresent = param.get_ifpresent(); } void MacroCellID_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 MacroCellID::ALT_uTRANCellID: single_value.field_uTRANCellID->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.MacroCellID"); return; case MacroCellID::ALT_gERANCellID: single_value.field_gERANCellID->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.MacroCellID"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @HNBAP-IEs.MacroCellID."); } 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 : "@HNBAP-IEs.MacroCellID"); } UTRANCellID::UTRANCellID() { } UTRANCellID::UTRANCellID(const OCTETSTRING& par_lAC, const OCTETSTRING& par_rAC, const OCTETSTRING& par_pLMNidentity, const BITSTRING& par_uTRANcellID, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 >& par_iE__Extensions) : field_lAC(par_lAC), field_rAC(par_rAC), field_pLMNidentity(par_pLMNidentity), field_uTRANcellID(par_uTRANcellID), field_iE__Extensions(par_iE__Extensions) { } UTRANCellID::UTRANCellID(const UTRANCellID& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.UTRANCellID."); if (other_value.lAC().is_bound()) field_lAC = other_value.lAC(); else field_lAC.clean_up(); if (other_value.rAC().is_bound()) field_rAC = other_value.rAC(); else field_rAC.clean_up(); if (other_value.pLMNidentity().is_bound()) field_pLMNidentity = other_value.pLMNidentity(); else field_pLMNidentity.clean_up(); if (other_value.uTRANcellID().is_bound()) field_uTRANcellID = other_value.uTRANcellID(); else field_uTRANcellID.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void UTRANCellID::clean_up() { field_lAC.clean_up(); field_rAC.clean_up(); field_pLMNidentity.clean_up(); field_uTRANcellID.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* UTRANCellID::get_descriptor() const { return &UTRANCellID_descr_; } UTRANCellID& UTRANCellID::operator=(const UTRANCellID& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.UTRANCellID."); if (other_value.lAC().is_bound()) field_lAC = other_value.lAC(); else field_lAC.clean_up(); if (other_value.rAC().is_bound()) field_rAC = other_value.rAC(); else field_rAC.clean_up(); if (other_value.pLMNidentity().is_bound()) field_pLMNidentity = other_value.pLMNidentity(); else field_pLMNidentity.clean_up(); if (other_value.uTRANcellID().is_bound()) field_uTRANcellID = other_value.uTRANcellID(); else field_uTRANcellID.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 UTRANCellID::operator==(const UTRANCellID& other_value) const { return field_lAC==other_value.field_lAC && field_rAC==other_value.field_rAC && field_pLMNidentity==other_value.field_pLMNidentity && field_uTRANcellID==other_value.field_uTRANcellID && field_iE__Extensions==other_value.field_iE__Extensions; } boolean UTRANCellID::is_bound() const { return (field_lAC.is_bound()) || (field_rAC.is_bound()) || (field_pLMNidentity.is_bound()) || (field_uTRANcellID.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean UTRANCellID::is_value() const { return field_lAC.is_value() && field_rAC.is_value() && field_pLMNidentity.is_value() && field_uTRANcellID.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int UTRANCellID::size_of() const { int ret_val = 4; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void UTRANCellID::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ lAC := "); field_lAC.log(); TTCN_Logger::log_event_str(", rAC := "); field_rAC.log(); TTCN_Logger::log_event_str(", pLMNidentity := "); field_pLMNidentity.log(); TTCN_Logger::log_event_str(", uTRANcellID := "); field_uTRANcellID.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void UTRANCellID::set_implicit_omit() { if (lAC().is_bound()) lAC().set_implicit_omit(); if (rAC().is_bound()) rAC().set_implicit_omit(); if (pLMNidentity().is_bound()) pLMNidentity().set_implicit_omit(); if (uTRANcellID().is_bound()) uTRANcellID().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void UTRANCellID::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) lAC().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rAC().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pLMNidentity().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) uTRANcellID().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(), "lAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pLMNidentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pLMNidentity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "uTRANcellID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { uTRANcellID().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 @HNBAP-IEs.UTRANCellID: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.UTRANCellID"); } } void UTRANCellID::encode_text(Text_Buf& text_buf) const { field_lAC.encode_text(text_buf); field_rAC.encode_text(text_buf); field_pLMNidentity.encode_text(text_buf); field_uTRANcellID.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void UTRANCellID::decode_text(Text_Buf& text_buf) { field_lAC.decode_text(text_buf); field_rAC.decode_text(text_buf); field_pLMNidentity.decode_text(text_buf); field_uTRANcellID.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void UTRANCellID::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 UTRANCellID::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* UTRANCellID::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("lAC': "); new_tlv->add_TLV(field_lAC.BER_encode_TLV(UTRANCellID_lAC_descr_, p_coding)); ec_1.set_msg("rAC': "); new_tlv->add_TLV(field_rAC.BER_encode_TLV(UTRANCellID_rAC_descr_, p_coding)); ec_1.set_msg("pLMNidentity': "); new_tlv->add_TLV(field_pLMNidentity.BER_encode_TLV(UTRANCellID_pLMNidentity_descr_, p_coding)); ec_1.set_msg("uTRANcellID': "); new_tlv->add_TLV(field_uTRANcellID.BER_encode_TLV(UTRANCellID_uTRANcellID_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(UTRANCellID_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean UTRANCellID::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 '@HNBAP-IEs.UTRANCellID' 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("lAC': "); 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_lAC.BER_decode_TLV(UTRANCellID_lAC_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("rAC': "); 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_rAC.BER_decode_TLV(UTRANCellID_rAC_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("pLMNidentity': "); 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_pLMNidentity.BER_decode_TLV(UTRANCellID_pLMNidentity_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("uTRANcellID': "); 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_uTRANcellID.BER_decode_TLV(UTRANCellID_uTRANcellID_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(UTRANCellID_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 UTRANCellID::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 @HNBAP-IEs.UTRANCellID."); 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, "lAC"); enc_len += field_lAC.JSON_encode(UTRANCellID_lAC_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "rAC"); enc_len += field_rAC.JSON_encode(UTRANCellID_rAC_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "pLMNidentity"); enc_len += field_pLMNidentity.JSON_encode(UTRANCellID_pLMNidentity_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "uTRANcellID"); enc_len += field_uTRANcellID.JSON_encode(UTRANCellID_uTRANcellID_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(UTRANCellID_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int UTRANCellID::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 lAC_found = FALSE; boolean rAC_found = FALSE; boolean pLMNidentity_found = FALSE; boolean uTRANcellID_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 (3 == name_len && 0 == strncmp(fld_name, "lAC", name_len)) { lAC_found = TRUE; int ret_val = field_lAC.JSON_decode(UTRANCellID_lAC_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, 3, "lAC"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (3 == name_len && 0 == strncmp(fld_name, "rAC", name_len)) { rAC_found = TRUE; int ret_val = field_rAC.JSON_decode(UTRANCellID_rAC_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, 3, "rAC"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (12 == name_len && 0 == strncmp(fld_name, "pLMNidentity", name_len)) { pLMNidentity_found = TRUE; int ret_val = field_pLMNidentity.JSON_decode(UTRANCellID_pLMNidentity_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, "pLMNidentity"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (11 == name_len && 0 == strncmp(fld_name, "uTRANcellID", name_len)) { uTRANcellID_found = TRUE; int ret_val = field_uTRANcellID.JSON_decode(UTRANCellID_uTRANcellID_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, "uTRANcellID"); } 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(UTRANCellID_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 (!lAC_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "lAC"); return JSON_ERROR_FATAL; } if (!rAC_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "rAC"); return JSON_ERROR_FATAL; } if (!pLMNidentity_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "pLMNidentity"); return JSON_ERROR_FATAL; } if (!uTRANcellID_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "uTRANcellID"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int UTRANCellID::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 |= 128; } p_buf.put_c(c); field_lAC.OER_encode(UTRANCellID_lAC_descr_, p_buf); field_rAC.OER_encode(UTRANCellID_rAC_descr_, p_buf); field_pLMNidentity.OER_encode(UTRANCellID_pLMNidentity_descr_, p_buf); field_uTRANcellID.OER_encode(UTRANCellID_uTRANcellID_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(UTRANCellID_iE__Extensions_descr_, p_buf); return 0; } int UTRANCellID::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); field_lAC.OER_decode(UTRANCellID_lAC_descr_, p_buf, p_oer); field_rAC.OER_decode(UTRANCellID_rAC_descr_, p_buf, p_oer); field_pLMNidentity.OER_decode(UTRANCellID_pLMNidentity_descr_, p_buf, p_oer); field_uTRANcellID.OER_decode(UTRANCellID_uTRANcellID_descr_, p_buf, p_oer); if (uc[0] & 128) field_iE__Extensions.OER_decode(UTRANCellID_iE__Extensions_descr_, p_buf, p_oer); else field_iE__Extensions = OMIT_VALUE; return 0; } void UTRANCellID::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 field_iE__Extensions_present = field_iE__Extensions.is_present(); p_buf.PER_put_bit(field_iE__Extensions_present); field_lAC.PER_encode(UTRANCellID_lAC_descr_, p_buf, p_options); field_rAC.PER_encode(UTRANCellID_rAC_descr_, p_buf, p_options); field_pLMNidentity.PER_encode(UTRANCellID_pLMNidentity_descr_, p_buf, p_options); field_uTRANcellID.PER_encode(UTRANCellID_uTRANcellID_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(UTRANCellID_iE__Extensions_descr_, p_buf, p_options); } void UTRANCellID::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); boolean field_iE__Extensions_present = p_buf.PER_get_bit(); field_lAC.PER_decode(UTRANCellID_lAC_descr_, p_buf, p_options); field_rAC.PER_decode(UTRANCellID_rAC_descr_, p_buf, p_options); field_pLMNidentity.PER_decode(UTRANCellID_pLMNidentity_descr_, p_buf, p_options); field_uTRANcellID.PER_decode(UTRANCellID_uTRANcellID_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(UTRANCellID_iE__Extensions_descr_, p_buf, p_options); else field_iE__Extensions = OMIT_VALUE; } struct UTRANCellID_template::single_value_struct { OCTETSTRING_template field_lAC; OCTETSTRING_template field_rAC; OCTETSTRING_template field_pLMNidentity; BITSTRING_template field_uTRANcellID; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template field_iE__Extensions; }; void UTRANCellID_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_lAC = ANY_VALUE; single_value->field_rAC = ANY_VALUE; single_value->field_pLMNidentity = ANY_VALUE; single_value->field_uTRANcellID = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void UTRANCellID_template::copy_value(const UTRANCellID& other_value) { single_value = new single_value_struct; if (other_value.lAC().is_bound()) { single_value->field_lAC = other_value.lAC(); } else { single_value->field_lAC.clean_up(); } if (other_value.rAC().is_bound()) { single_value->field_rAC = other_value.rAC(); } else { single_value->field_rAC.clean_up(); } if (other_value.pLMNidentity().is_bound()) { single_value->field_pLMNidentity = other_value.pLMNidentity(); } else { single_value->field_pLMNidentity.clean_up(); } if (other_value.uTRANcellID().is_bound()) { single_value->field_uTRANcellID = other_value.uTRANcellID(); } else { single_value->field_uTRANcellID.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 UTRANCellID_template::copy_template(const UTRANCellID_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.lAC().get_selection()) { single_value->field_lAC = other_value.lAC(); } else { single_value->field_lAC.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rAC().get_selection()) { single_value->field_rAC = other_value.rAC(); } else { single_value->field_rAC.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pLMNidentity().get_selection()) { single_value->field_pLMNidentity = other_value.pLMNidentity(); } else { single_value->field_pLMNidentity.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.uTRANcellID().get_selection()) { single_value->field_uTRANcellID = other_value.uTRANcellID(); } else { single_value->field_uTRANcellID.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 UTRANCellID_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 UTRANCellID_template(*other_value.implication_.precondition); implication_.implied_template = new UTRANCellID_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 @HNBAP-IEs.UTRANCellID."); break; } set_selection(other_value); } UTRANCellID_template::UTRANCellID_template() { } UTRANCellID_template::UTRANCellID_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } UTRANCellID_template::UTRANCellID_template(const UTRANCellID& other_value) { copy_value(other_value); } UTRANCellID_template::UTRANCellID_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const UTRANCellID&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.UTRANCellID from an unbound optional field."); } } UTRANCellID_template::UTRANCellID_template(UTRANCellID_template* p_precondition, UTRANCellID_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } UTRANCellID_template::UTRANCellID_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; } UTRANCellID_template::UTRANCellID_template(const UTRANCellID_template& other_value) : Base_Template() { copy_template(other_value); } UTRANCellID_template::~UTRANCellID_template() { clean_up(); } UTRANCellID_template& UTRANCellID_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } UTRANCellID_template& UTRANCellID_template::operator=(const UTRANCellID& other_value) { clean_up(); copy_value(other_value); return *this; } UTRANCellID_template& UTRANCellID_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const UTRANCellID&)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 @HNBAP-IEs.UTRANCellID."); } return *this; } UTRANCellID_template& UTRANCellID_template::operator=(const UTRANCellID_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean UTRANCellID_template::match(const UTRANCellID& 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.lAC().is_bound()) return FALSE; if(!single_value->field_lAC.match(other_value.lAC(), legacy))return FALSE; if(!other_value.rAC().is_bound()) return FALSE; if(!single_value->field_rAC.match(other_value.rAC(), legacy))return FALSE; if(!other_value.pLMNidentity().is_bound()) return FALSE; if(!single_value->field_pLMNidentity.match(other_value.pLMNidentity(), legacy))return FALSE; if(!other_value.uTRANcellID().is_bound()) return FALSE; if(!single_value->field_uTRANcellID.match(other_value.uTRANcellID(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11&)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 @HNBAP-IEs.UTRANCellID."); } return FALSE; } boolean UTRANCellID_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_lAC.is_bound() || single_value->field_rAC.is_bound() || single_value->field_pLMNidentity.is_bound() || single_value->field_uTRANcellID.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean UTRANCellID_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_lAC.is_value() && single_value->field_rAC.is_value() && single_value->field_pLMNidentity.is_value() && single_value->field_uTRANcellID.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void UTRANCellID_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; } UTRANCellID UTRANCellID_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 @HNBAP-IEs.UTRANCellID."); UTRANCellID ret_val; if (single_value->field_lAC.is_bound()) { ret_val.lAC() = single_value->field_lAC.valueof(); } if (single_value->field_rAC.is_bound()) { ret_val.rAC() = single_value->field_rAC.valueof(); } if (single_value->field_pLMNidentity.is_bound()) { ret_val.pLMNidentity() = single_value->field_pLMNidentity.valueof(); } if (single_value->field_uTRANcellID.is_bound()) { ret_val.uTRANcellID() = single_value->field_uTRANcellID.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 UTRANCellID_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 @HNBAP-IEs.UTRANCellID."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new UTRANCellID_template[list_length]; } UTRANCellID_template& UTRANCellID_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 @HNBAP-IEs.UTRANCellID."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.UTRANCellID."); return value_list.list_value[list_index]; } OCTETSTRING_template& UTRANCellID_template::lAC() { set_specific(); return single_value->field_lAC; } const OCTETSTRING_template& UTRANCellID_template::lAC() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lAC of a non-specific template of type @HNBAP-IEs.UTRANCellID."); return single_value->field_lAC; } OCTETSTRING_template& UTRANCellID_template::rAC() { set_specific(); return single_value->field_rAC; } const OCTETSTRING_template& UTRANCellID_template::rAC() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAC of a non-specific template of type @HNBAP-IEs.UTRANCellID."); return single_value->field_rAC; } OCTETSTRING_template& UTRANCellID_template::pLMNidentity() { set_specific(); return single_value->field_pLMNidentity; } const OCTETSTRING_template& UTRANCellID_template::pLMNidentity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pLMNidentity of a non-specific template of type @HNBAP-IEs.UTRANCellID."); return single_value->field_pLMNidentity; } BITSTRING_template& UTRANCellID_template::uTRANcellID() { set_specific(); return single_value->field_uTRANcellID; } const BITSTRING_template& UTRANCellID_template::uTRANcellID() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uTRANcellID of a non-specific template of type @HNBAP-IEs.UTRANCellID."); return single_value->field_uTRANcellID; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& UTRANCellID_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& UTRANCellID_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.UTRANCellID."); return single_value->field_iE__Extensions; } int UTRANCellID_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UTRANCellID which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; 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 @HNBAP-IEs.UTRANCellID 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 @HNBAP-IEs.UTRANCellID containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UTRANCellID containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UTRANCellID containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UTRANCellID containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UTRANCellID containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UTRANCellID containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UTRANCellID containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.UTRANCellID."); } return 0; } void UTRANCellID_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ lAC := "); single_value->field_lAC.log(); TTCN_Logger::log_event_str(", rAC := "); single_value->field_rAC.log(); TTCN_Logger::log_event_str(", pLMNidentity := "); single_value->field_pLMNidentity.log(); TTCN_Logger::log_event_str(", uTRANcellID := "); single_value->field_uTRANcellID.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 UTRANCellID_template::log_match(const UTRANCellID& 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_lAC.match(match_value.lAC(), legacy)){ TTCN_Logger::log_logmatch_info(".lAC"); single_value->field_lAC.log_match(match_value.lAC(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_rAC.match(match_value.rAC(), legacy)){ TTCN_Logger::log_logmatch_info(".rAC"); single_value->field_rAC.log_match(match_value.rAC(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_pLMNidentity.match(match_value.pLMNidentity(), legacy)){ TTCN_Logger::log_logmatch_info(".pLMNidentity"); single_value->field_pLMNidentity.log_match(match_value.pLMNidentity(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_uTRANcellID.match(match_value.uTRANcellID(), legacy)){ TTCN_Logger::log_logmatch_info(".uTRANcellID"); single_value->field_uTRANcellID.log_match(match_value.uTRANcellID(), 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("{ lAC := "); single_value->field_lAC.log_match(match_value.lAC(), legacy); TTCN_Logger::log_event_str(", rAC := "); single_value->field_rAC.log_match(match_value.rAC(), legacy); TTCN_Logger::log_event_str(", pLMNidentity := "); single_value->field_pLMNidentity.log_match(match_value.pLMNidentity(), legacy); TTCN_Logger::log_event_str(", uTRANcellID := "); single_value->field_uTRANcellID.log_match(match_value.uTRANcellID(), 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 UTRANCellID_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (lAC().is_bound()) lAC().set_implicit_omit(); if (rAC().is_bound()) rAC().set_implicit_omit(); if (pLMNidentity().is_bound()) pLMNidentity().set_implicit_omit(); if (uTRANcellID().is_bound()) uTRANcellID().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void UTRANCellID_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_lAC.encode_text(text_buf); single_value->field_rAC.encode_text(text_buf); single_value->field_pLMNidentity.encode_text(text_buf); single_value->field_uTRANcellID.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 @HNBAP-IEs.UTRANCellID."); } } void UTRANCellID_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_lAC.decode_text(text_buf); single_value->field_rAC.decode_text(text_buf); single_value->field_pLMNidentity.decode_text(text_buf); single_value->field_uTRANcellID.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 UTRANCellID_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 @HNBAP-IEs.UTRANCellID."); } } void UTRANCellID_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: { UTRANCellID_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) lAC().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rAC().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) pLMNidentity().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) uTRANcellID().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(), "lAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pLMNidentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pLMNidentity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "uTRANcellID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { uTRANcellID().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 @HNBAP-IEs.UTRANCellID: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { UTRANCellID_template* precondition = new UTRANCellID_template; precondition->set_param(*param.get_elem(0)); UTRANCellID_template* implied_template = new UTRANCellID_template; implied_template->set_param(*param.get_elem(1)); *this = UTRANCellID_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.UTRANCellID"); } is_ifpresent = param.get_ifpresent(); } void UTRANCellID_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_lAC.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UTRANCellID"); single_value->field_rAC.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UTRANCellID"); single_value->field_pLMNidentity.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UTRANCellID"); single_value->field_uTRANcellID.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UTRANCellID"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UTRANCellID"); 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 : "@HNBAP-IEs.UTRANCellID"); } boolean UTRANCellID_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean UTRANCellID_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_iE__Extensions) : field_cellIdentity(par_cellIdentity), field_iE__Extensions(par_iE__Extensions) { } MacroCoverageInformation::MacroCoverageInformation(const MacroCoverageInformation& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.MacroCoverageInformation."); if (other_value.cellIdentity().is_bound()) field_cellIdentity = other_value.cellIdentity(); else field_cellIdentity.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void MacroCoverageInformation::clean_up() { field_cellIdentity.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* MacroCoverageInformation::get_descriptor() const { return &MacroCoverageInformation_descr_; } MacroCoverageInformation& MacroCoverageInformation::operator=(const MacroCoverageInformation& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.MacroCoverageInformation."); if (other_value.cellIdentity().is_bound()) field_cellIdentity = other_value.cellIdentity(); else field_cellIdentity.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 MacroCoverageInformation::operator==(const MacroCoverageInformation& other_value) const { return field_cellIdentity==other_value.field_cellIdentity && field_iE__Extensions==other_value.field_iE__Extensions; } boolean MacroCoverageInformation::is_bound() const { return (field_cellIdentity.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean MacroCoverageInformation::is_value() const { return field_cellIdentity.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int MacroCoverageInformation::size_of() const { int ret_val = 1; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void MacroCoverageInformation::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ cellIdentity := "); field_cellIdentity.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void MacroCoverageInformation::set_implicit_omit() { if (cellIdentity().is_bound()) cellIdentity().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void MacroCoverageInformation::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) cellIdentity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "cellIdentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cellIdentity().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 @HNBAP-IEs.MacroCoverageInformation: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.MacroCoverageInformation"); } } void MacroCoverageInformation::encode_text(Text_Buf& text_buf) const { field_cellIdentity.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void MacroCoverageInformation::decode_text(Text_Buf& text_buf) { field_cellIdentity.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void MacroCoverageInformation::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 MacroCoverageInformation::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* MacroCoverageInformation::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("cellIdentity': "); new_tlv->add_TLV(field_cellIdentity.BER_encode_TLV(MacroCoverageInformation_cellIdentity_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(MacroCoverageInformation_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean MacroCoverageInformation::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 '@HNBAP-IEs.MacroCoverageInformation' 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("cellIdentity': "); 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_cellIdentity.BER_decode_TLV(MacroCoverageInformation_cellIdentity_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(MacroCoverageInformation_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 MacroCoverageInformation::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 @HNBAP-IEs.MacroCoverageInformation."); 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, "cellIdentity"); enc_len += field_cellIdentity.JSON_encode(MacroCoverageInformation_cellIdentity_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(MacroCoverageInformation_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int MacroCoverageInformation::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 cellIdentity_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 (12 == name_len && 0 == strncmp(fld_name, "cellIdentity", name_len)) { cellIdentity_found = TRUE; int ret_val = field_cellIdentity.JSON_decode(MacroCoverageInformation_cellIdentity_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, "cellIdentity"); } 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(MacroCoverageInformation_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 (!cellIdentity_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "cellIdentity"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int MacroCoverageInformation::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_cellIdentity.OER_encode(MacroCoverageInformation_cellIdentity_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(MacroCoverageInformation_iE__Extensions_descr_, p_buf); return 0; } int MacroCoverageInformation::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_cellIdentity.OER_decode(MacroCoverageInformation_cellIdentity_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(MacroCoverageInformation_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 MacroCoverageInformation::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_cellIdentity.PER_encode(MacroCoverageInformation_cellIdentity_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(MacroCoverageInformation_iE__Extensions_descr_, p_buf, p_options); } void MacroCoverageInformation::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_cellIdentity.PER_decode(MacroCoverageInformation_cellIdentity_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(MacroCoverageInformation_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 MacroCoverageInformation_template::single_value_struct { MacroCellID_template field_cellIdentity; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template field_iE__Extensions; }; void MacroCoverageInformation_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_cellIdentity = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void MacroCoverageInformation_template::copy_value(const MacroCoverageInformation& other_value) { single_value = new single_value_struct; if (other_value.cellIdentity().is_bound()) { single_value->field_cellIdentity = other_value.cellIdentity(); } else { single_value->field_cellIdentity.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 MacroCoverageInformation_template::copy_template(const MacroCoverageInformation_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.cellIdentity().get_selection()) { single_value->field_cellIdentity = other_value.cellIdentity(); } else { single_value->field_cellIdentity.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 MacroCoverageInformation_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 MacroCoverageInformation_template(*other_value.implication_.precondition); implication_.implied_template = new MacroCoverageInformation_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 @HNBAP-IEs.MacroCoverageInformation."); break; } set_selection(other_value); } MacroCoverageInformation_template::MacroCoverageInformation_template() { } MacroCoverageInformation_template::MacroCoverageInformation_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MacroCoverageInformation_template::MacroCoverageInformation_template(const MacroCoverageInformation& other_value) { copy_value(other_value); } MacroCoverageInformation_template::MacroCoverageInformation_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MacroCoverageInformation&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.MacroCoverageInformation from an unbound optional field."); } } MacroCoverageInformation_template::MacroCoverageInformation_template(MacroCoverageInformation_template* p_precondition, MacroCoverageInformation_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MacroCoverageInformation_template::MacroCoverageInformation_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; } MacroCoverageInformation_template::MacroCoverageInformation_template(const MacroCoverageInformation_template& other_value) : Base_Template() { copy_template(other_value); } MacroCoverageInformation_template::~MacroCoverageInformation_template() { clean_up(); } MacroCoverageInformation_template& MacroCoverageInformation_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MacroCoverageInformation_template& MacroCoverageInformation_template::operator=(const MacroCoverageInformation& other_value) { clean_up(); copy_value(other_value); return *this; } MacroCoverageInformation_template& MacroCoverageInformation_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MacroCoverageInformation&)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 @HNBAP-IEs.MacroCoverageInformation."); } return *this; } MacroCoverageInformation_template& MacroCoverageInformation_template::operator=(const MacroCoverageInformation_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MacroCoverageInformation_template::match(const MacroCoverageInformation& 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.cellIdentity().is_bound()) return FALSE; if(!single_value->field_cellIdentity.match(other_value.cellIdentity(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12&)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 @HNBAP-IEs.MacroCoverageInformation."); } return FALSE; } boolean MacroCoverageInformation_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_cellIdentity.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean MacroCoverageInformation_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_cellIdentity.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void MacroCoverageInformation_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; } MacroCoverageInformation MacroCoverageInformation_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 @HNBAP-IEs.MacroCoverageInformation."); MacroCoverageInformation ret_val; if (single_value->field_cellIdentity.is_bound()) { ret_val.cellIdentity() = single_value->field_cellIdentity.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 MacroCoverageInformation_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 @HNBAP-IEs.MacroCoverageInformation."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MacroCoverageInformation_template[list_length]; } MacroCoverageInformation_template& MacroCoverageInformation_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 @HNBAP-IEs.MacroCoverageInformation."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.MacroCoverageInformation."); return value_list.list_value[list_index]; } MacroCellID_template& MacroCoverageInformation_template::cellIdentity() { set_specific(); return single_value->field_cellIdentity; } const MacroCellID_template& MacroCoverageInformation_template::cellIdentity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cellIdentity of a non-specific template of type @HNBAP-IEs.MacroCoverageInformation."); return single_value->field_cellIdentity; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& MacroCoverageInformation_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& MacroCoverageInformation_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.MacroCoverageInformation."); return single_value->field_iE__Extensions; } int MacroCoverageInformation_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.MacroCoverageInformation which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; 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 @HNBAP-IEs.MacroCoverageInformation 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 @HNBAP-IEs.MacroCoverageInformation containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.MacroCoverageInformation containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.MacroCoverageInformation containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.MacroCoverageInformation containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.MacroCoverageInformation containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.MacroCoverageInformation containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.MacroCoverageInformation containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.MacroCoverageInformation."); } return 0; } void MacroCoverageInformation_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ cellIdentity := "); single_value->field_cellIdentity.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 MacroCoverageInformation_template::log_match(const MacroCoverageInformation& 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_cellIdentity.match(match_value.cellIdentity(), legacy)){ TTCN_Logger::log_logmatch_info(".cellIdentity"); single_value->field_cellIdentity.log_match(match_value.cellIdentity(), 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("{ cellIdentity := "); single_value->field_cellIdentity.log_match(match_value.cellIdentity(), 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 MacroCoverageInformation_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (cellIdentity().is_bound()) cellIdentity().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void MacroCoverageInformation_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_cellIdentity.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 @HNBAP-IEs.MacroCoverageInformation."); } } void MacroCoverageInformation_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_cellIdentity.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 MacroCoverageInformation_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 @HNBAP-IEs.MacroCoverageInformation."); } } void MacroCoverageInformation_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: { MacroCoverageInformation_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) cellIdentity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "cellIdentity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cellIdentity().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 @HNBAP-IEs.MacroCoverageInformation: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MacroCoverageInformation_template* precondition = new MacroCoverageInformation_template; precondition->set_param(*param.get_elem(0)); MacroCoverageInformation_template* implied_template = new MacroCoverageInformation_template; implied_template->set_param(*param.get_elem(1)); *this = MacroCoverageInformation_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.MacroCoverageInformation"); } is_ifpresent = param.get_ifpresent(); } void MacroCoverageInformation_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_cellIdentity.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.MacroCoverageInformation"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.MacroCoverageInformation"); 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 : "@HNBAP-IEs.MacroCoverageInformation"); } boolean MacroCoverageInformation_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MacroCoverageInformation_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& other_value) { switch (other_value.union_selection) { case ALT_iP__Address: field_iP__Address = new IP__Address(*other_value.field_iP__Address); break; default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { case ALT_iP__Address: return *field_iP__Address == *other_value.field_iP__Address; default: return FALSE; } } IP__Address& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::iP__Address() { if (union_selection != ALT_iP__Address) { clean_up(); field_iP__Address = new IP__Address; union_selection = ALT_iP__Address; } return *field_iP__Address; } const IP__Address& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::iP__Address() const { if (union_selection != ALT_iP__Address) TTCN_error("Using non-selected field iP_Address in a value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); return *field_iP__Address; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; case ALT_iP__Address: return field_iP__Address->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::clean_up() { switch (union_selection) { case ALT_iP__Address: delete field_iP__Address; break; default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::log() const { switch (union_selection) { case ALT_iP__Address: TTCN_Logger::log_event_str("{ iP_Address := "); field_iP__Address->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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(); if (!strcmp(last_name, "iP_Address")) { iP__Address().set_param(*mp_last); if (!iP__Address().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::set_implicit_omit() { switch (union_selection) { case ALT_iP__Address: field_iP__Address->set_implicit_omit(); break; default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_iP__Address: field_iP__Address->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_iP__Address: iP__Address().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 ALT_iP__Address: ec_1.set_msg("iP_Address': "); new_tlv = field_iP__Address->BER_encode_TLV(HNB__Location__Information__ExtIEs_1_Extension_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 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_iP__Address = new IP__Address; union_selection = ALT_iP__Address; if (field_iP__Address->BER_decode_isMyMsg(HNB__Location__Information__ExtIEs_1_Extension_descr_, p_tlv)) return TRUE; delete field_iP__Address; union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type': "); const INTEGER& f_1 = static_cast(p_typelist.get_nth(0))->id(); { TTCN_EncDec_ErrorContext ec_1("Alternative '"); TTCN_EncDec_ErrorContext ec_2; if (f_1 == HNB__Location__Information__ExtIEs_1_id) { union_selection = ALT_iP__Address; field_iP__Address = new IP__Address; ec_2.set_msg("iP-Address': "); field_iP__Address->BER_decode_TLV(HNB__Location__Information__ExtIEs_1_Extension_descr_, tlv_opentype, L_form); } } if (union_selection == UNBOUND_VALUE) { ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: broken component relation constraint."); if (TTCN_EncDec::get_error_behavior(TTCN_EncDec::ET_DEC_OPENTYPE) != TTCN_EncDec::EB_IGNORE) { TTCN_Logger::log_str(TTCN_WARNING, "The value of constraining component:"); TTCN_Logger::begin_event(TTCN_WARNING); TTCN_Logger::log_event_str("Component '@.id': "); f_1.log(); TTCN_Logger::end_event(); } } } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_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_iP__Address: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iP_Address"); } enc_len += field_iP__Address->JSON_encode(HNB__Location__Information__ExtIEs_1_Extension_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_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 && 1 > p_chosen_field) { switch (p_chosen_field) { case 0: return iP__Address().JSON_decode(HNB__Location__Information__ExtIEs_1_Extension_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "string '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { p_tok.set_buf_pos(buf_pos); ret_val = iP__Address().JSON_decode(HNB__Location__Information__ExtIEs_1_Extension_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.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 (10 == name_len && 0 == strncmp(fld_name, "iP_Address", name_len)) { int ret_val = iP__Address().JSON_decode(HNB__Location__Information__ExtIEs_1_Extension_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, "iP_Address"); } 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 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_iP__Address: { TTCN_Buffer buf; field_iP__Address->OER_encode(HNB__Location__Information__ExtIEs_1_Extension_descr_, buf); encode_oer_length(buf.get_len(), p_buf, FALSE); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type': "); const INTEGER& f_1 = static_cast(p_typelist.get_nth(0))->id(); { TTCN_EncDec_ErrorContext ec_1("Alternative '"); TTCN_EncDec_ErrorContext ec_2; if (f_1 == HNB__Location__Information__ExtIEs_1_id) { union_selection = ALT_iP__Address; field_iP__Address = new IP__Address; ec_2.set_msg("iP-Address': "); size_t pos_1 = p_buf.get_pos(); p_buf.set_pos(p_oer.opentype_poses.at(0)); p_oer.opentype_poses.erase_at(0); OER_struct tmp_oer_1; field_iP__Address->OER_decode(HNB__Location__Information__ExtIEs_1_Extension_descr_, p_buf, tmp_oer_1); p_buf.set_pos(pos_1); } } if (union_selection == UNBOUND_VALUE) { ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: broken component relation constraint."); if (TTCN_EncDec::get_error_behavior(TTCN_EncDec::ET_DEC_OPENTYPE) != TTCN_EncDec::EB_IGNORE) { TTCN_Logger::log_str(TTCN_WARNING, "The value of constraining component:"); TTCN_Logger::begin_event(TTCN_WARNING); TTCN_Logger::log_event_str("Component '@.id': "); f_1.log(); TTCN_Logger::end_event(); } } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_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 open type value."); return; } switch (union_selection) { case ALT_iP__Address: { TTCN_Buffer ot_buf; field_iP__Address->PER_encode(HNB__Location__Information__ExtIEs_1_Extension_descr_, ot_buf, p_options); PER_encode_opentype(p_buf, ot_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 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::PER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, int p_options) { clean_up(); PER_decode_opentype(p_buf, per_ot_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::PER_decode_opentypes(TTCN_Type_list& p_typelist, int p_options) { if (union_selection != UNBOUND_VALUE) return; TTCN_EncDec_ErrorContext ec_0("While decoding open type '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type': "); const INTEGER& f_1 = static_cast(p_typelist.get_nth(0))->id(); { TTCN_EncDec_ErrorContext ec_1("Alternative '"); TTCN_EncDec_ErrorContext ec_2; if (f_1 == HNB__Location__Information__ExtIEs_1_id) { union_selection = ALT_iP__Address; field_iP__Address = new IP__Address; ec_2.set_msg("iP-Address': "); field_iP__Address->PER_decode(HNB__Location__Information__ExtIEs_1_Extension_descr_, per_ot_buf, p_options); } } if (union_selection == UNBOUND_VALUE) { ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: broken component relation constraint."); if (TTCN_EncDec::get_error_behavior(TTCN_EncDec::ET_DEC_OPENTYPE) != TTCN_EncDec::EB_IGNORE) { TTCN_Logger::log_str(TTCN_WARNING, "The value of constraining component:"); TTCN_Logger::begin_event(TTCN_WARNING); TTCN_Logger::log_event_str("Component '@.id': "); f_1.log(); TTCN_Logger::end_event(); } } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: single_value.field_iP__Address = new IP__Address_template(other_value.iP__Address()); break; default: TTCN_error("Initializing a template with an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: single_value.field_iP__Address = new IP__Address_template(*other_value.single_value.field_iP__Address); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: delete single_value.field_iP__Address; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: return single_value.field_iP__Address->match(other_value.iP__Address(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: return single_value.field_iP__Address->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type ret_val; switch (single_value.union_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: ret_val.iP__Address() = single_value.field_iP__Address->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template[list_length]; } IP__Address_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::iP__Address() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_iP__Address = new IP__Address_template(ANY_VALUE); else single_value.field_iP__Address = new IP__Address_template; single_value.union_selection = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address; set_selection(SPECIFIC_VALUE); } return *single_value.field_iP__Address; } const IP__Address_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::iP__Address() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iP_Address in a non-specific template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); if (single_value.union_selection != _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address) TTCN_error("Accessing non-selected field iP_Address in a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); return *single_value.field_iP__Address; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: TTCN_Logger::log_event_str("{ iP_Address := "); single_value.field_iP__Address->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 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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()) { size_t previous_size = TTCN_Logger::get_logmatch_buffer_len(); switch (single_value.union_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".iP_Address"); single_value.field_iP__Address->log_match(match_value.iP__Address(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ iP_Address := "); single_value.field_iP__Address->log_match(match_value.iP__Address(), 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 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: single_value.field_iP__Address->set_implicit_omit(); break; default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: single_value.field_iP__Address->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: single_value.field_iP__Address = new IP__Address_template; single_value.field_iP__Address->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type'"); } if (strcmp("iP_Address", param_field) == 0) { iP__Address().set_param(param); return; } else param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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(); if (!strcmp(last_name, "iP_Address")) { iP__Address().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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) { case _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type::ALT_iP__Address: single_value.field_iP__Address->check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_iE__Extensions) : field_hNB__Identity__Info(par_hNB__Identity__Info), field_iE__Extensions(par_iE__Extensions) { } HNB__Identity::HNB__Identity(const HNB__Identity& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.HNB-Identity."); if (other_value.hNB__Identity__Info().is_bound()) field_hNB__Identity__Info = other_value.hNB__Identity__Info(); else field_hNB__Identity__Info.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void HNB__Identity::clean_up() { field_hNB__Identity__Info.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* HNB__Identity::get_descriptor() const { return &HNB__Identity_descr_; } HNB__Identity& HNB__Identity::operator=(const HNB__Identity& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.HNB-Identity."); if (other_value.hNB__Identity__Info().is_bound()) field_hNB__Identity__Info = other_value.hNB__Identity__Info(); else field_hNB__Identity__Info.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 HNB__Identity::operator==(const HNB__Identity& other_value) const { return field_hNB__Identity__Info==other_value.field_hNB__Identity__Info && field_iE__Extensions==other_value.field_iE__Extensions; } boolean HNB__Identity::is_bound() const { return (field_hNB__Identity__Info.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean HNB__Identity::is_value() const { return field_hNB__Identity__Info.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int HNB__Identity::size_of() const { int ret_val = 1; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void HNB__Identity::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ hNB_Identity_Info := "); field_hNB__Identity__Info.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void HNB__Identity::set_implicit_omit() { if (hNB__Identity__Info().is_bound()) hNB__Identity__Info().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNB__Identity::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hNB__Identity__Info().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "hNB_Identity_Info")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hNB__Identity__Info().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 @HNBAP-IEs.HNB-Identity: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.HNB-Identity"); } } void HNB__Identity::encode_text(Text_Buf& text_buf) const { field_hNB__Identity__Info.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void HNB__Identity::decode_text(Text_Buf& text_buf) { field_hNB__Identity__Info.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void HNB__Identity::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 HNB__Identity::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* HNB__Identity::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("hNB_Identity_Info': "); new_tlv->add_TLV(field_hNB__Identity__Info.BER_encode_TLV(HNB__Identity_hNB__Identity__Info_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(HNB__Identity_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean HNB__Identity::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 '@HNBAP-IEs.HNB-Identity' 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("hNB_Identity_Info': "); 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_hNB__Identity__Info.BER_decode_TLV(HNB__Identity_hNB__Identity__Info_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(HNB__Identity_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 HNB__Identity::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 @HNBAP-IEs.HNB-Identity."); 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, "hNB_Identity_Info"); enc_len += field_hNB__Identity__Info.JSON_encode(HNB__Identity_hNB__Identity__Info_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(HNB__Identity_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int HNB__Identity::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 hNB__Identity__Info_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 (17 == name_len && 0 == strncmp(fld_name, "hNB_Identity_Info", name_len)) { hNB__Identity__Info_found = TRUE; int ret_val = field_hNB__Identity__Info.JSON_decode(HNB__Identity_hNB__Identity__Info_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, "hNB_Identity_Info"); } 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(HNB__Identity_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 (!hNB__Identity__Info_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "hNB_Identity_Info"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int HNB__Identity::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_hNB__Identity__Info.OER_encode(HNB__Identity_hNB__Identity__Info_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(HNB__Identity_iE__Extensions_descr_, p_buf); return 0; } int HNB__Identity::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_hNB__Identity__Info.OER_decode(HNB__Identity_hNB__Identity__Info_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(HNB__Identity_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 HNB__Identity::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_hNB__Identity__Info.PER_encode(HNB__Identity_hNB__Identity__Info_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(HNB__Identity_iE__Extensions_descr_, p_buf, p_options); } void HNB__Identity::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_hNB__Identity__Info.PER_decode(HNB__Identity_hNB__Identity__Info_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(HNB__Identity_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 HNB__Identity_template::single_value_struct { OCTETSTRING_template field_hNB__Identity__Info; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template field_iE__Extensions; }; void HNB__Identity_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_hNB__Identity__Info = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void HNB__Identity_template::copy_value(const HNB__Identity& other_value) { single_value = new single_value_struct; if (other_value.hNB__Identity__Info().is_bound()) { single_value->field_hNB__Identity__Info = other_value.hNB__Identity__Info(); } else { single_value->field_hNB__Identity__Info.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 HNB__Identity_template::copy_template(const HNB__Identity_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.hNB__Identity__Info().get_selection()) { single_value->field_hNB__Identity__Info = other_value.hNB__Identity__Info(); } else { single_value->field_hNB__Identity__Info.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 HNB__Identity_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 HNB__Identity_template(*other_value.implication_.precondition); implication_.implied_template = new HNB__Identity_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 @HNBAP-IEs.HNB-Identity."); break; } set_selection(other_value); } HNB__Identity_template::HNB__Identity_template() { } HNB__Identity_template::HNB__Identity_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } HNB__Identity_template::HNB__Identity_template(const HNB__Identity& other_value) { copy_value(other_value); } HNB__Identity_template::HNB__Identity_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNB__Identity&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.HNB-Identity from an unbound optional field."); } } HNB__Identity_template::HNB__Identity_template(HNB__Identity_template* p_precondition, HNB__Identity_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } HNB__Identity_template::HNB__Identity_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; } HNB__Identity_template::HNB__Identity_template(const HNB__Identity_template& other_value) : Base_Template() { copy_template(other_value); } HNB__Identity_template::~HNB__Identity_template() { clean_up(); } HNB__Identity_template& HNB__Identity_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } HNB__Identity_template& HNB__Identity_template::operator=(const HNB__Identity& other_value) { clean_up(); copy_value(other_value); return *this; } HNB__Identity_template& HNB__Identity_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const HNB__Identity&)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 @HNBAP-IEs.HNB-Identity."); } return *this; } HNB__Identity_template& HNB__Identity_template::operator=(const HNB__Identity_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean HNB__Identity_template::match(const HNB__Identity& 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.hNB__Identity__Info().is_bound()) return FALSE; if(!single_value->field_hNB__Identity__Info.match(other_value.hNB__Identity__Info(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14&)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 @HNBAP-IEs.HNB-Identity."); } return FALSE; } boolean HNB__Identity_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_hNB__Identity__Info.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean HNB__Identity_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_hNB__Identity__Info.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void HNB__Identity_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; } HNB__Identity HNB__Identity_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 @HNBAP-IEs.HNB-Identity."); HNB__Identity ret_val; if (single_value->field_hNB__Identity__Info.is_bound()) { ret_val.hNB__Identity__Info() = single_value->field_hNB__Identity__Info.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 HNB__Identity_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 @HNBAP-IEs.HNB-Identity."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new HNB__Identity_template[list_length]; } HNB__Identity_template& HNB__Identity_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 @HNBAP-IEs.HNB-Identity."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.HNB-Identity."); return value_list.list_value[list_index]; } OCTETSTRING_template& HNB__Identity_template::hNB__Identity__Info() { set_specific(); return single_value->field_hNB__Identity__Info; } const OCTETSTRING_template& HNB__Identity_template::hNB__Identity__Info() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hNB_Identity_Info of a non-specific template of type @HNBAP-IEs.HNB-Identity."); return single_value->field_hNB__Identity__Info; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& HNB__Identity_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& HNB__Identity_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.HNB-Identity."); return single_value->field_iE__Extensions; } int HNB__Identity_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Identity which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; 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 @HNBAP-IEs.HNB-Identity 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 @HNBAP-IEs.HNB-Identity containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Identity containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Identity containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Identity containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Identity containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Identity containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.HNB-Identity containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.HNB-Identity."); } return 0; } void HNB__Identity_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ hNB_Identity_Info := "); single_value->field_hNB__Identity__Info.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 HNB__Identity_template::log_match(const HNB__Identity& 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_hNB__Identity__Info.match(match_value.hNB__Identity__Info(), legacy)){ TTCN_Logger::log_logmatch_info(".hNB_Identity_Info"); single_value->field_hNB__Identity__Info.log_match(match_value.hNB__Identity__Info(), 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("{ hNB_Identity_Info := "); single_value->field_hNB__Identity__Info.log_match(match_value.hNB__Identity__Info(), 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 HNB__Identity_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (hNB__Identity__Info().is_bound()) hNB__Identity__Info().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void HNB__Identity_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_hNB__Identity__Info.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 @HNBAP-IEs.HNB-Identity."); } } void HNB__Identity_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_hNB__Identity__Info.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 HNB__Identity_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 @HNBAP-IEs.HNB-Identity."); } } void HNB__Identity_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: { HNB__Identity_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) hNB__Identity__Info().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "hNB_Identity_Info")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hNB__Identity__Info().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 @HNBAP-IEs.HNB-Identity: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { HNB__Identity_template* precondition = new HNB__Identity_template; precondition->set_param(*param.get_elem(0)); HNB__Identity_template* implied_template = new HNB__Identity_template; implied_template->set_param(*param.get_elem(1)); *this = HNB__Identity_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.HNB-Identity"); } is_ifpresent = param.get_ifpresent(); } void HNB__Identity_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_hNB__Identity__Info.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-Identity"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.HNB-Identity"); 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 : "@HNBAP-IEs.HNB-Identity"); } boolean HNB__Identity_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean HNB__Identity_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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) iMSIDS41().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eSN().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(), "iMSIDS41")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iMSIDS41().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eSN")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eSN().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.IMSIESN: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.IMSIESN"); } } void IMSIESN::encode_text(Text_Buf& text_buf) const { field_iMSIDS41.encode_text(text_buf); field_eSN.encode_text(text_buf); } void IMSIESN::decode_text(Text_Buf& text_buf) { field_iMSIDS41.decode_text(text_buf); field_eSN.decode_text(text_buf); } void IMSIESN::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 IMSIESN::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* IMSIESN::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("iMSIDS41': "); new_tlv->add_TLV(field_iMSIDS41.BER_encode_TLV(IMSIESN_iMSIDS41_descr_, p_coding)); ec_1.set_msg("eSN': "); new_tlv->add_TLV(field_eSN.BER_encode_TLV(IMSIESN_eSN_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean IMSIESN::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 '@HNBAP-IEs.IMSIESN' 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("iMSIDS41': "); 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_iMSIDS41.BER_decode_TLV(IMSIESN_iMSIDS41_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("eSN': "); 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_eSN.BER_decode_TLV(IMSIESN_eSN_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 IMSIESN::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 @HNBAP-IEs.IMSIESN."); 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, "iMSIDS41"); enc_len += field_iMSIDS41.JSON_encode(IMSIESN_iMSIDS41_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "eSN"); enc_len += field_eSN.JSON_encode(IMSIESN_eSN_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int IMSIESN::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 iMSIDS41_found = FALSE; boolean eSN_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 (8 == name_len && 0 == strncmp(fld_name, "iMSIDS41", name_len)) { iMSIDS41_found = TRUE; int ret_val = field_iMSIDS41.JSON_decode(IMSIESN_iMSIDS41_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, "iMSIDS41"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (3 == name_len && 0 == strncmp(fld_name, "eSN", name_len)) { eSN_found = TRUE; int ret_val = field_eSN.JSON_decode(IMSIESN_eSN_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, 3, "eSN"); } 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 (!iMSIDS41_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "iMSIDS41"); return JSON_ERROR_FATAL; } if (!eSN_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "eSN"); return JSON_ERROR_FATAL; } return (int)dec_len; } int IMSIESN::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_iMSIDS41.OER_encode(IMSIESN_iMSIDS41_descr_, p_buf); field_eSN.OER_encode(IMSIESN_eSN_descr_, p_buf); return 0; } int IMSIESN::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_iMSIDS41.OER_decode(IMSIESN_iMSIDS41_descr_, p_buf, p_oer); field_eSN.OER_decode(IMSIESN_eSN_descr_, p_buf, p_oer); return 0; } void IMSIESN::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_iMSIDS41.PER_encode(IMSIESN_iMSIDS41_descr_, p_buf, p_options); field_eSN.PER_encode(IMSIESN_eSN_descr_, p_buf, p_options); } void IMSIESN::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_iMSIDS41.PER_decode(IMSIESN_iMSIDS41_descr_, p_buf, p_options); field_eSN.PER_decode(IMSIESN_eSN_descr_, p_buf, p_options); } struct IMSIESN_template::single_value_struct { OCTETSTRING_template field_iMSIDS41; BITSTRING_template field_eSN; }; void IMSIESN_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_iMSIDS41 = ANY_VALUE; single_value->field_eSN = ANY_VALUE; } } } void IMSIESN_template::copy_value(const IMSIESN& other_value) { single_value = new single_value_struct; if (other_value.iMSIDS41().is_bound()) { single_value->field_iMSIDS41 = other_value.iMSIDS41(); } else { single_value->field_iMSIDS41.clean_up(); } if (other_value.eSN().is_bound()) { single_value->field_eSN = other_value.eSN(); } else { single_value->field_eSN.clean_up(); } set_selection(SPECIFIC_VALUE); } void IMSIESN_template::copy_template(const IMSIESN_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iMSIDS41().get_selection()) { single_value->field_iMSIDS41 = other_value.iMSIDS41(); } else { single_value->field_iMSIDS41.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eSN().get_selection()) { single_value->field_eSN = other_value.eSN(); } else { single_value->field_eSN.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 IMSIESN_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 IMSIESN_template(*other_value.implication_.precondition); implication_.implied_template = new IMSIESN_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 @HNBAP-IEs.IMSIESN."); break; } set_selection(other_value); } IMSIESN_template::IMSIESN_template() { } IMSIESN_template::IMSIESN_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } IMSIESN_template::IMSIESN_template(const IMSIESN& other_value) { copy_value(other_value); } IMSIESN_template::IMSIESN_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IMSIESN&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.IMSIESN from an unbound optional field."); } } IMSIESN_template::IMSIESN_template(IMSIESN_template* p_precondition, IMSIESN_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } IMSIESN_template::IMSIESN_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; } IMSIESN_template::IMSIESN_template(const IMSIESN_template& other_value) : Base_Template() { copy_template(other_value); } IMSIESN_template::~IMSIESN_template() { clean_up(); } IMSIESN_template& IMSIESN_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } IMSIESN_template& IMSIESN_template::operator=(const IMSIESN& other_value) { clean_up(); copy_value(other_value); return *this; } IMSIESN_template& IMSIESN_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const IMSIESN&)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 @HNBAP-IEs.IMSIESN."); } return *this; } IMSIESN_template& IMSIESN_template::operator=(const IMSIESN_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean IMSIESN_template::match(const IMSIESN& 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.iMSIDS41().is_bound()) return FALSE; if(!single_value->field_iMSIDS41.match(other_value.iMSIDS41(), legacy))return FALSE; if(!other_value.eSN().is_bound()) return FALSE; if(!single_value->field_eSN.match(other_value.eSN(), 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 @HNBAP-IEs.IMSIESN."); } return FALSE; } boolean IMSIESN_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iMSIDS41.is_bound() || single_value->field_eSN.is_bound(); } boolean IMSIESN_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iMSIDS41.is_value() && single_value->field_eSN.is_value(); } void IMSIESN_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; } IMSIESN IMSIESN_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 @HNBAP-IEs.IMSIESN."); IMSIESN ret_val; if (single_value->field_iMSIDS41.is_bound()) { ret_val.iMSIDS41() = single_value->field_iMSIDS41.valueof(); } if (single_value->field_eSN.is_bound()) { ret_val.eSN() = single_value->field_eSN.valueof(); } return ret_val; } void IMSIESN_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 @HNBAP-IEs.IMSIESN."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new IMSIESN_template[list_length]; } IMSIESN_template& IMSIESN_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 @HNBAP-IEs.IMSIESN."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.IMSIESN."); return value_list.list_value[list_index]; } OCTETSTRING_template& IMSIESN_template::iMSIDS41() { set_specific(); return single_value->field_iMSIDS41; } const OCTETSTRING_template& IMSIESN_template::iMSIDS41() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iMSIDS41 of a non-specific template of type @HNBAP-IEs.IMSIESN."); return single_value->field_iMSIDS41; } BITSTRING_template& IMSIESN_template::eSN() { set_specific(); return single_value->field_eSN; } const BITSTRING_template& IMSIESN_template::eSN() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eSN of a non-specific template of type @HNBAP-IEs.IMSIESN."); return single_value->field_eSN; } int IMSIESN_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IMSIESN 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 @HNBAP-IEs.IMSIESN 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 @HNBAP-IEs.IMSIESN containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IMSIESN containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IMSIESN containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IMSIESN containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IMSIESN containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IMSIESN containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.IMSIESN containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.IMSIESN."); } return 0; } void IMSIESN_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iMSIDS41 := "); single_value->field_iMSIDS41.log(); TTCN_Logger::log_event_str(", eSN := "); single_value->field_eSN.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 IMSIESN_template::log_match(const IMSIESN& 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_iMSIDS41.match(match_value.iMSIDS41(), legacy)){ TTCN_Logger::log_logmatch_info(".iMSIDS41"); single_value->field_iMSIDS41.log_match(match_value.iMSIDS41(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eSN.match(match_value.eSN(), legacy)){ TTCN_Logger::log_logmatch_info(".eSN"); single_value->field_eSN.log_match(match_value.eSN(), 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("{ iMSIDS41 := "); single_value->field_iMSIDS41.log_match(match_value.iMSIDS41(), legacy); TTCN_Logger::log_event_str(", eSN := "); single_value->field_eSN.log_match(match_value.eSN(), 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 IMSIESN_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (iMSIDS41().is_bound()) iMSIDS41().set_implicit_omit(); if (eSN().is_bound()) eSN().set_implicit_omit(); } void IMSIESN_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iMSIDS41.encode_text(text_buf); single_value->field_eSN.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 @HNBAP-IEs.IMSIESN."); } } void IMSIESN_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_iMSIDS41.decode_text(text_buf); single_value->field_eSN.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 IMSIESN_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 @HNBAP-IEs.IMSIESN."); } } void IMSIESN_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: { IMSIESN_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) iMSIDS41().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eSN().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(), "iMSIDS41")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iMSIDS41().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eSN")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eSN().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.IMSIESN: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { IMSIESN_template* precondition = new IMSIESN_template; precondition->set_param(*param.get_elem(0)); IMSIESN_template* implied_template = new IMSIESN_template; implied_template->set_param(*param.get_elem(1)); *this = IMSIESN_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.IMSIESN"); } is_ifpresent = param.get_ifpresent(); } void IMSIESN_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_iMSIDS41.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.IMSIESN"); single_value->field_eSN.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.IMSIESN"); 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 : "@HNBAP-IEs.IMSIESN"); } boolean IMSIESN_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean IMSIESN_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) pLMNID().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lAC().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(), "pLMNID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pLMNID().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.LAI: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.LAI"); } } void LAI::encode_text(Text_Buf& text_buf) const { field_pLMNID.encode_text(text_buf); field_lAC.encode_text(text_buf); } void LAI::decode_text(Text_Buf& text_buf) { field_pLMNID.decode_text(text_buf); field_lAC.decode_text(text_buf); } void LAI::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 LAI::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* LAI::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("pLMNID': "); new_tlv->add_TLV(field_pLMNID.BER_encode_TLV(LAI_pLMNID_descr_, p_coding)); ec_1.set_msg("lAC': "); new_tlv->add_TLV(field_lAC.BER_encode_TLV(LAI_lAC_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean LAI::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 '@HNBAP-IEs.LAI' 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("pLMNID': "); 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_pLMNID.BER_decode_TLV(LAI_pLMNID_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("lAC': "); 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_lAC.BER_decode_TLV(LAI_lAC_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 LAI::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 @HNBAP-IEs.LAI."); 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, "pLMNID"); enc_len += field_pLMNID.JSON_encode(LAI_pLMNID_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "lAC"); enc_len += field_lAC.JSON_encode(LAI_lAC_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int LAI::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 pLMNID_found = FALSE; boolean lAC_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 (6 == name_len && 0 == strncmp(fld_name, "pLMNID", name_len)) { pLMNID_found = TRUE; int ret_val = field_pLMNID.JSON_decode(LAI_pLMNID_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, "pLMNID"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (3 == name_len && 0 == strncmp(fld_name, "lAC", name_len)) { lAC_found = TRUE; int ret_val = field_lAC.JSON_decode(LAI_lAC_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, 3, "lAC"); } 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 (!pLMNID_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "pLMNID"); return JSON_ERROR_FATAL; } if (!lAC_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "lAC"); return JSON_ERROR_FATAL; } return (int)dec_len; } int LAI::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; p_buf.put_c(c); field_pLMNID.OER_encode(LAI_pLMNID_descr_, p_buf); field_lAC.OER_encode(LAI_lAC_descr_, p_buf); return 0; } int LAI::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_pLMNID.OER_decode(LAI_pLMNID_descr_, p_buf, p_oer); field_lAC.OER_decode(LAI_lAC_descr_, p_buf, p_oer); 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 LAI::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); field_pLMNID.PER_encode(LAI_pLMNID_descr_, p_buf, p_options); field_lAC.PER_encode(LAI_lAC_descr_, p_buf, p_options); } void LAI::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(); field_pLMNID.PER_decode(LAI_pLMNID_descr_, p_buf, p_options); field_lAC.PER_decode(LAI_lAC_descr_, p_buf, p_options); 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 LAI_template::single_value_struct { OCTETSTRING_template field_pLMNID; OCTETSTRING_template field_lAC; }; void LAI_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_pLMNID = ANY_VALUE; single_value->field_lAC = ANY_VALUE; } } } void LAI_template::copy_value(const LAI& other_value) { single_value = new single_value_struct; if (other_value.pLMNID().is_bound()) { single_value->field_pLMNID = other_value.pLMNID(); } else { single_value->field_pLMNID.clean_up(); } if (other_value.lAC().is_bound()) { single_value->field_lAC = other_value.lAC(); } else { single_value->field_lAC.clean_up(); } set_selection(SPECIFIC_VALUE); } void LAI_template::copy_template(const LAI_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pLMNID().get_selection()) { single_value->field_pLMNID = other_value.pLMNID(); } else { single_value->field_pLMNID.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lAC().get_selection()) { single_value->field_lAC = other_value.lAC(); } else { single_value->field_lAC.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 LAI_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 LAI_template(*other_value.implication_.precondition); implication_.implied_template = new LAI_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 @HNBAP-IEs.LAI."); break; } set_selection(other_value); } LAI_template::LAI_template() { } LAI_template::LAI_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } LAI_template::LAI_template(const LAI& other_value) { copy_value(other_value); } LAI_template::LAI_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const LAI&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.LAI from an unbound optional field."); } } LAI_template::LAI_template(LAI_template* p_precondition, LAI_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } LAI_template::LAI_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; } LAI_template::LAI_template(const LAI_template& other_value) : Base_Template() { copy_template(other_value); } LAI_template::~LAI_template() { clean_up(); } LAI_template& LAI_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } LAI_template& LAI_template::operator=(const LAI& other_value) { clean_up(); copy_value(other_value); return *this; } LAI_template& LAI_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const LAI&)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 @HNBAP-IEs.LAI."); } return *this; } LAI_template& LAI_template::operator=(const LAI_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean LAI_template::match(const LAI& 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.pLMNID().is_bound()) return FALSE; if(!single_value->field_pLMNID.match(other_value.pLMNID(), legacy))return FALSE; if(!other_value.lAC().is_bound()) return FALSE; if(!single_value->field_lAC.match(other_value.lAC(), 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 @HNBAP-IEs.LAI."); } return FALSE; } boolean LAI_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_pLMNID.is_bound() || single_value->field_lAC.is_bound(); } boolean LAI_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_pLMNID.is_value() && single_value->field_lAC.is_value(); } void LAI_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; } LAI LAI_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 @HNBAP-IEs.LAI."); LAI ret_val; if (single_value->field_pLMNID.is_bound()) { ret_val.pLMNID() = single_value->field_pLMNID.valueof(); } if (single_value->field_lAC.is_bound()) { ret_val.lAC() = single_value->field_lAC.valueof(); } return ret_val; } void LAI_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 @HNBAP-IEs.LAI."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new LAI_template[list_length]; } LAI_template& LAI_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 @HNBAP-IEs.LAI."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.LAI."); return value_list.list_value[list_index]; } OCTETSTRING_template& LAI_template::pLMNID() { set_specific(); return single_value->field_pLMNID; } const OCTETSTRING_template& LAI_template::pLMNID() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pLMNID of a non-specific template of type @HNBAP-IEs.LAI."); return single_value->field_pLMNID; } OCTETSTRING_template& LAI_template::lAC() { set_specific(); return single_value->field_lAC; } const OCTETSTRING_template& LAI_template::lAC() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lAC of a non-specific template of type @HNBAP-IEs.LAI."); return single_value->field_lAC; } int LAI_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.LAI 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 @HNBAP-IEs.LAI 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 @HNBAP-IEs.LAI containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.LAI containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.LAI containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.LAI containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.LAI containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.LAI containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.LAI containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.LAI."); } return 0; } void LAI_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pLMNID := "); single_value->field_pLMNID.log(); TTCN_Logger::log_event_str(", lAC := "); single_value->field_lAC.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 LAI_template::log_match(const LAI& 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_pLMNID.match(match_value.pLMNID(), legacy)){ TTCN_Logger::log_logmatch_info(".pLMNID"); single_value->field_pLMNID.log_match(match_value.pLMNID(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lAC.match(match_value.lAC(), legacy)){ TTCN_Logger::log_logmatch_info(".lAC"); single_value->field_lAC.log_match(match_value.lAC(), 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("{ pLMNID := "); single_value->field_pLMNID.log_match(match_value.pLMNID(), legacy); TTCN_Logger::log_event_str(", lAC := "); single_value->field_lAC.log_match(match_value.lAC(), 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 LAI_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (pLMNID().is_bound()) pLMNID().set_implicit_omit(); if (lAC().is_bound()) lAC().set_implicit_omit(); } void LAI_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pLMNID.encode_text(text_buf); single_value->field_lAC.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 @HNBAP-IEs.LAI."); } } void LAI_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_pLMNID.decode_text(text_buf); single_value->field_lAC.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 LAI_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 @HNBAP-IEs.LAI."); } } void LAI_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: { LAI_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) pLMNID().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lAC().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(), "pLMNID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pLMNID().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.LAI: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { LAI_template* precondition = new LAI_template; precondition->set_param(*param.get_elem(0)); LAI_template* implied_template = new LAI_template; implied_template->set_param(*param.get_elem(1)); *this = LAI_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.LAI"); } is_ifpresent = param.get_ifpresent(); } void LAI_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_pLMNID.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.LAI"); single_value->field_lAC.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.LAI"); 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 : "@HNBAP-IEs.LAI"); } boolean LAI_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean LAI_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; } NeighbourInfoList::NeighbourInfoList(const NeighbourInfoList& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.NeighbourInfoList."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } NeighbourInfoList::~NeighbourInfoList() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void NeighbourInfoList::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."); } } NeighbourInfoList& NeighbourInfoList::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; } NeighbourInfoList& NeighbourInfoList::operator=(const NeighbourInfoList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.NeighbourInfoList."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean NeighbourInfoList::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.NeighbourInfoList."); return val_ptr->n_elements == 0 ; } boolean NeighbourInfoList::operator==(const NeighbourInfoList& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.NeighbourInfoList."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.NeighbourInfoList."); 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; } HNBConfigInfo& NeighbourInfoList::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.NeighbourInfoList 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 = (HNBConfigInfo**)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 HNBConfigInfo(*(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 HNBConfigInfo; } return *val_ptr->value_elements[index_value]; } HNBConfigInfo& NeighbourInfoList::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.NeighbourInfoList."); return (*this)[(int)index_value]; } const HNBConfigInfo& NeighbourInfoList::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.NeighbourInfoList."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.NeighbourInfoList using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.NeighbourInfoList: 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 HNBConfigInfo& NeighbourInfoList::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.NeighbourInfoList."); return (*this)[(int)index_value]; } NeighbourInfoList NeighbourInfoList::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } NeighbourInfoList NeighbourInfoList::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } NeighbourInfoList NeighbourInfoList::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } NeighbourInfoList NeighbourInfoList::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.NeighbourInfoList."); 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; NeighbourInfoList 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 HNBConfigInfo(*val_ptr->value_elements[i]); } } return ret_val; } NeighbourInfoList NeighbourInfoList::operator+(const NeighbourInfoList& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.NeighbourInfoList concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; NeighbourInfoList 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 HNBConfigInfo(*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 HNBConfigInfo(*other_value.val_ptr->value_elements[i]); } } return ret_val; } NeighbourInfoList NeighbourInfoList::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.NeighbourInfoList."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.NeighbourInfoList","element"); NeighbourInfoList ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new HNBConfigInfo(*val_ptr->value_elements[i+index]); } } return ret_val; } NeighbourInfoList NeighbourInfoList::replace(int index, int len, const NeighbourInfoList& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.NeighbourInfoList."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.NeighbourInfoList."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.NeighbourInfoList","element"); NeighbourInfoList 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 HNBConfigInfo(*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 HNBConfigInfo(*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 HNBConfigInfo(*val_ptr->value_elements[index+i+len]); } } return ret_val; } NeighbourInfoList NeighbourInfoList::replace(int index, int len, const NeighbourInfoList_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 NeighbourInfoList::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.NeighbourInfoList."); 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 = (HNBConfigInfo**)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 HNBConfigInfo(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (HNBConfigInfo**)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 @HNBAP-IEs.NeighbourInfoList: %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 = (HNBConfigInfo**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean NeighbourInfoList::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 NeighbourInfoList::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.NeighbourInfoList."); return val_ptr->n_elements; } int NeighbourInfoList::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.NeighbourInfoList."); 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 NeighbourInfoList::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 NeighbourInfoList::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 NeighbourInfoList::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", "@HNBAP-IEs.NeighbourInfoList"); } 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", "@HNBAP-IEs.NeighbourInfoList"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void NeighbourInfoList::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.NeighbourInfoList."); 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 NeighbourInfoList::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 @HNBAP-IEs.NeighbourInfoList."); val_ptr->value_elements = (HNBConfigInfo**)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 HNBConfigInfo; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void NeighbourInfoList::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 NeighbourInfoList::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* NeighbourInfoList::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 NeighbourInfoList::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 = (HNBConfigInfo**)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 HNBConfigInfo; 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 NeighbourInfoList::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 @HNBAP-IEs.NeighbourInfoList."); 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 NeighbourInfoList::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); } HNBConfigInfo* val = new HNBConfigInfo; 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 = (HNBConfigInfo**)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 NeighbourInfoList::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 @HNBAP-IEs.NeighbourInfoList."); 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 NeighbourInfoList::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 NeighbourInfoList::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 NeighbourInfoList::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 NeighbourInfoList_template::copy_value(const NeighbourInfoList& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.NeighbourInfoList with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (HNBConfigInfo_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 HNBConfigInfo_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new HNBConfigInfo_template; } } set_selection(SPECIFIC_VALUE); } void NeighbourInfoList_template::copy_template(const NeighbourInfoList_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 = (HNBConfigInfo_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 HNBConfigInfo_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new HNBConfigInfo_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 NeighbourInfoList_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 NeighbourInfoList_template(*other_value.implication_.precondition); implication_.implied_template = new NeighbourInfoList_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 @HNBAP-IEs.NeighbourInfoList."); break; } set_selection(other_value); } boolean NeighbourInfoList_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 NeighbourInfoList_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const NeighbourInfoList*)value_ptr)[value_index], legacy); else return ((const NeighbourInfoList_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } NeighbourInfoList_template::NeighbourInfoList_template() { } NeighbourInfoList_template::NeighbourInfoList_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } NeighbourInfoList_template::NeighbourInfoList_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } NeighbourInfoList_template::NeighbourInfoList_template(const NeighbourInfoList& other_value) { copy_value(other_value); } NeighbourInfoList_template::NeighbourInfoList_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const NeighbourInfoList&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.NeighbourInfoList from an unbound optional field."); } } NeighbourInfoList_template::NeighbourInfoList_template(NeighbourInfoList_template* p_precondition, NeighbourInfoList_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } NeighbourInfoList_template::NeighbourInfoList_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; } NeighbourInfoList_template::NeighbourInfoList_template(const NeighbourInfoList_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } NeighbourInfoList_template::~NeighbourInfoList_template() { clean_up(); } void NeighbourInfoList_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; } NeighbourInfoList_template& NeighbourInfoList_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } NeighbourInfoList_template& NeighbourInfoList_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } NeighbourInfoList_template& NeighbourInfoList_template::operator=(const NeighbourInfoList& other_value) { clean_up(); copy_value(other_value); return *this; } NeighbourInfoList_template& NeighbourInfoList_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const NeighbourInfoList&)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 @HNBAP-IEs.NeighbourInfoList."); } return *this; } NeighbourInfoList_template& NeighbourInfoList_template::operator=(const NeighbourInfoList_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } HNBConfigInfo_template& NeighbourInfoList_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.NeighbourInfoList 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 @HNBAP-IEs.NeighbourInfoList."); break; } return *single_value.value_elements[index_value]; } HNBConfigInfo_template& NeighbourInfoList_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.NeighbourInfoList."); return (*this)[(int)index_value]; } const HNBConfigInfo_template& NeighbourInfoList_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.NeighbourInfoList using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.NeighbourInfoList."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.NeighbourInfoList: 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 HNBConfigInfo_template& NeighbourInfoList_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.NeighbourInfoList."); return (*this)[(int)index_value]; } void NeighbourInfoList_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.NeighbourInfoList."); 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 = (HNBConfigInfo_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 HNBConfigInfo_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 HNBConfigInfo_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 = (HNBConfigInfo_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int NeighbourInfoList_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 NeighbourInfoList_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 @HNBAP-IEs.NeighbourInfoList 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 @HNBAP-IEs.NeighbourInfoList 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 @HNBAP-IEs.NeighbourInfoList 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 @HNBAP-IEs.NeighbourInfoList 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 @HNBAP-IEs.NeighbourInfoList 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 @HNBAP-IEs.NeighbourInfoList containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.NeighbourInfoList.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.NeighbourInfoList"); } boolean NeighbourInfoList_template::match(const NeighbourInfoList& 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 @HNBAP-IEs.NeighbourInfoList."); } return FALSE; } boolean NeighbourInfoList_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; } NeighbourInfoList NeighbourInfoList_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 @HNBAP-IEs.NeighbourInfoList."); NeighbourInfoList 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; } NeighbourInfoList NeighbourInfoList_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); } NeighbourInfoList NeighbourInfoList_template::replace(int index, int len, const NeighbourInfoList_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()); } NeighbourInfoList NeighbourInfoList_template::replace(int index, int len, const NeighbourInfoList& 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 NeighbourInfoList_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 NeighbourInfoList_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.NeighbourInfoList."); } set_selection(template_type); } NeighbourInfoList_template& NeighbourInfoList_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 @HNBAP-IEs.NeighbourInfoList."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.NeighbourInfoList."); return value_list.list_value[list_index]; } void NeighbourInfoList_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 NeighbourInfoList_template::log_match(const NeighbourInfoList& 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 NeighbourInfoList_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 @HNBAP-IEs.NeighbourInfoList."); } } void NeighbourInfoList_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 @HNBAP-IEs.NeighbourInfoList."); single_value.value_elements = (HNBConfigInfo_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 HNBConfigInfo_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 NeighbourInfoList_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 @HNBAP-IEs.NeighbourInfoList."); } } boolean NeighbourInfoList_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean NeighbourInfoList_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 NeighbourInfoList_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: { NeighbourInfoList_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: { NeighbourInfoList_template* precondition = new NeighbourInfoList_template; precondition->set_param(*param.get_elem(0)); NeighbourInfoList_template* implied_template = new NeighbourInfoList_template; implied_template->set_param(*param.get_elem(1)); *this = NeighbourInfoList_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.NeighbourInfoList"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void NeighbourInfoList_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 : "@HNBAP-IEs.NeighbourInfoList"); 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 : "@HNBAP-IEs.NeighbourInfoList"); } boolean NeighbourInfoList_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); } } const NeighbourInfoRequestItem NeighbourInfoRequestList::UNBOUND_ELEM; NeighbourInfoRequestList::NeighbourInfoRequestList() { val_ptr = NULL; } NeighbourInfoRequestList::NeighbourInfoRequestList(null_type) { val_ptr = new recordof_setof_struct; val_ptr->ref_count = 1; val_ptr->n_elements = 0; val_ptr->value_elements = NULL; } NeighbourInfoRequestList::NeighbourInfoRequestList(const NeighbourInfoRequestList& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } NeighbourInfoRequestList::~NeighbourInfoRequestList() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void NeighbourInfoRequestList::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."); } } NeighbourInfoRequestList& NeighbourInfoRequestList::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; } NeighbourInfoRequestList& NeighbourInfoRequestList::operator=(const NeighbourInfoRequestList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean NeighbourInfoRequestList::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); return val_ptr->n_elements == 0 ; } boolean NeighbourInfoRequestList::operator==(const NeighbourInfoRequestList& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); 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; } NeighbourInfoRequestItem& NeighbourInfoRequestList::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.NeighbourInfoRequestList 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 = (NeighbourInfoRequestItem**)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 NeighbourInfoRequestItem(*(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 NeighbourInfoRequestItem; } return *val_ptr->value_elements[index_value]; } NeighbourInfoRequestItem& NeighbourInfoRequestList::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.NeighbourInfoRequestList."); return (*this)[(int)index_value]; } const NeighbourInfoRequestItem& NeighbourInfoRequestList::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.NeighbourInfoRequestList using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.NeighbourInfoRequestList: 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 NeighbourInfoRequestItem& NeighbourInfoRequestList::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.NeighbourInfoRequestList."); return (*this)[(int)index_value]; } NeighbourInfoRequestList NeighbourInfoRequestList::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } NeighbourInfoRequestList NeighbourInfoRequestList::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } NeighbourInfoRequestList NeighbourInfoRequestList::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } NeighbourInfoRequestList NeighbourInfoRequestList::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); 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; NeighbourInfoRequestList 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 NeighbourInfoRequestItem(*val_ptr->value_elements[i]); } } return ret_val; } NeighbourInfoRequestList NeighbourInfoRequestList::operator+(const NeighbourInfoRequestList& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.NeighbourInfoRequestList concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; NeighbourInfoRequestList 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 NeighbourInfoRequestItem(*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 NeighbourInfoRequestItem(*other_value.val_ptr->value_elements[i]); } } return ret_val; } NeighbourInfoRequestList NeighbourInfoRequestList::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.NeighbourInfoRequestList","element"); NeighbourInfoRequestList ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new NeighbourInfoRequestItem(*val_ptr->value_elements[i+index]); } } return ret_val; } NeighbourInfoRequestList NeighbourInfoRequestList::replace(int index, int len, const NeighbourInfoRequestList& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.NeighbourInfoRequestList","element"); NeighbourInfoRequestList 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 NeighbourInfoRequestItem(*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 NeighbourInfoRequestItem(*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 NeighbourInfoRequestItem(*val_ptr->value_elements[index+i+len]); } } return ret_val; } NeighbourInfoRequestList NeighbourInfoRequestList::replace(int index, int len, const NeighbourInfoRequestList_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 NeighbourInfoRequestList::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.NeighbourInfoRequestList."); 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 = (NeighbourInfoRequestItem**)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 NeighbourInfoRequestItem(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (NeighbourInfoRequestItem**)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 @HNBAP-IEs.NeighbourInfoRequestList: %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 = (NeighbourInfoRequestItem**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean NeighbourInfoRequestList::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 NeighbourInfoRequestList::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); return val_ptr->n_elements; } int NeighbourInfoRequestList::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); 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 NeighbourInfoRequestList::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 NeighbourInfoRequestList::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 NeighbourInfoRequestList::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", "@HNBAP-IEs.NeighbourInfoRequestList"); } 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", "@HNBAP-IEs.NeighbourInfoRequestList"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void NeighbourInfoRequestList::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); 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 NeighbourInfoRequestList::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 @HNBAP-IEs.NeighbourInfoRequestList."); val_ptr->value_elements = (NeighbourInfoRequestItem**)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 NeighbourInfoRequestItem; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void NeighbourInfoRequestList::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 NeighbourInfoRequestList::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* NeighbourInfoRequestList::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 NeighbourInfoRequestList::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 = (NeighbourInfoRequestItem**)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 NeighbourInfoRequestItem; 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 NeighbourInfoRequestList::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 @HNBAP-IEs.NeighbourInfoRequestList."); 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 NeighbourInfoRequestList::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); } NeighbourInfoRequestItem* val = new NeighbourInfoRequestItem; 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 = (NeighbourInfoRequestItem**)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 NeighbourInfoRequestList::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 @HNBAP-IEs.NeighbourInfoRequestList."); 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 NeighbourInfoRequestList::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 NeighbourInfoRequestList::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 NeighbourInfoRequestList::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 NeighbourInfoRequestList_template::copy_value(const NeighbourInfoRequestList& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.NeighbourInfoRequestList with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (NeighbourInfoRequestItem_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 NeighbourInfoRequestItem_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new NeighbourInfoRequestItem_template; } } set_selection(SPECIFIC_VALUE); } void NeighbourInfoRequestList_template::copy_template(const NeighbourInfoRequestList_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 = (NeighbourInfoRequestItem_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 NeighbourInfoRequestItem_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new NeighbourInfoRequestItem_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 NeighbourInfoRequestList_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 NeighbourInfoRequestList_template(*other_value.implication_.precondition); implication_.implied_template = new NeighbourInfoRequestList_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 @HNBAP-IEs.NeighbourInfoRequestList."); break; } set_selection(other_value); } boolean NeighbourInfoRequestList_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 NeighbourInfoRequestList_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const NeighbourInfoRequestList*)value_ptr)[value_index], legacy); else return ((const NeighbourInfoRequestList_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } NeighbourInfoRequestList_template::NeighbourInfoRequestList_template() { } NeighbourInfoRequestList_template::NeighbourInfoRequestList_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } NeighbourInfoRequestList_template::NeighbourInfoRequestList_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } NeighbourInfoRequestList_template::NeighbourInfoRequestList_template(const NeighbourInfoRequestList& other_value) { copy_value(other_value); } NeighbourInfoRequestList_template::NeighbourInfoRequestList_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const NeighbourInfoRequestList&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.NeighbourInfoRequestList from an unbound optional field."); } } NeighbourInfoRequestList_template::NeighbourInfoRequestList_template(NeighbourInfoRequestList_template* p_precondition, NeighbourInfoRequestList_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } NeighbourInfoRequestList_template::NeighbourInfoRequestList_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; } NeighbourInfoRequestList_template::NeighbourInfoRequestList_template(const NeighbourInfoRequestList_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } NeighbourInfoRequestList_template::~NeighbourInfoRequestList_template() { clean_up(); } void NeighbourInfoRequestList_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; } NeighbourInfoRequestList_template& NeighbourInfoRequestList_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } NeighbourInfoRequestList_template& NeighbourInfoRequestList_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } NeighbourInfoRequestList_template& NeighbourInfoRequestList_template::operator=(const NeighbourInfoRequestList& other_value) { clean_up(); copy_value(other_value); return *this; } NeighbourInfoRequestList_template& NeighbourInfoRequestList_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const NeighbourInfoRequestList&)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 @HNBAP-IEs.NeighbourInfoRequestList."); } return *this; } NeighbourInfoRequestList_template& NeighbourInfoRequestList_template::operator=(const NeighbourInfoRequestList_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } NeighbourInfoRequestItem_template& NeighbourInfoRequestList_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.NeighbourInfoRequestList 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 @HNBAP-IEs.NeighbourInfoRequestList."); break; } return *single_value.value_elements[index_value]; } NeighbourInfoRequestItem_template& NeighbourInfoRequestList_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.NeighbourInfoRequestList."); return (*this)[(int)index_value]; } const NeighbourInfoRequestItem_template& NeighbourInfoRequestList_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.NeighbourInfoRequestList using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.NeighbourInfoRequestList."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.NeighbourInfoRequestList: 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 NeighbourInfoRequestItem_template& NeighbourInfoRequestList_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.NeighbourInfoRequestList."); return (*this)[(int)index_value]; } void NeighbourInfoRequestList_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.NeighbourInfoRequestList."); 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 = (NeighbourInfoRequestItem_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 NeighbourInfoRequestItem_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 NeighbourInfoRequestItem_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 = (NeighbourInfoRequestItem_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int NeighbourInfoRequestList_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 NeighbourInfoRequestList_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 @HNBAP-IEs.NeighbourInfoRequestList 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 @HNBAP-IEs.NeighbourInfoRequestList 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 @HNBAP-IEs.NeighbourInfoRequestList 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 @HNBAP-IEs.NeighbourInfoRequestList 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 @HNBAP-IEs.NeighbourInfoRequestList 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 @HNBAP-IEs.NeighbourInfoRequestList containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.NeighbourInfoRequestList.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.NeighbourInfoRequestList"); } boolean NeighbourInfoRequestList_template::match(const NeighbourInfoRequestList& 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 @HNBAP-IEs.NeighbourInfoRequestList."); } return FALSE; } boolean NeighbourInfoRequestList_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; } NeighbourInfoRequestList NeighbourInfoRequestList_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 @HNBAP-IEs.NeighbourInfoRequestList."); NeighbourInfoRequestList 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; } NeighbourInfoRequestList NeighbourInfoRequestList_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); } NeighbourInfoRequestList NeighbourInfoRequestList_template::replace(int index, int len, const NeighbourInfoRequestList_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()); } NeighbourInfoRequestList NeighbourInfoRequestList_template::replace(int index, int len, const NeighbourInfoRequestList& 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 NeighbourInfoRequestList_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 NeighbourInfoRequestList_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.NeighbourInfoRequestList."); } set_selection(template_type); } NeighbourInfoRequestList_template& NeighbourInfoRequestList_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 @HNBAP-IEs.NeighbourInfoRequestList."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.NeighbourInfoRequestList."); return value_list.list_value[list_index]; } void NeighbourInfoRequestList_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 NeighbourInfoRequestList_template::log_match(const NeighbourInfoRequestList& 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 NeighbourInfoRequestList_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 @HNBAP-IEs.NeighbourInfoRequestList."); } } void NeighbourInfoRequestList_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 @HNBAP-IEs.NeighbourInfoRequestList."); single_value.value_elements = (NeighbourInfoRequestItem_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 NeighbourInfoRequestItem_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 NeighbourInfoRequestList_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 @HNBAP-IEs.NeighbourInfoRequestList."); } } boolean NeighbourInfoRequestList_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean NeighbourInfoRequestList_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 NeighbourInfoRequestList_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: { NeighbourInfoRequestList_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: { NeighbourInfoRequestList_template* precondition = new NeighbourInfoRequestList_template; precondition->set_param(*param.get_elem(0)); NeighbourInfoRequestList_template* implied_template = new NeighbourInfoRequestList_template; implied_template->set_param(*param.get_elem(1)); *this = NeighbourInfoRequestList_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.NeighbourInfoRequestList"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void NeighbourInfoRequestList_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 : "@HNBAP-IEs.NeighbourInfoRequestList"); 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 : "@HNBAP-IEs.NeighbourInfoRequestList"); } boolean NeighbourInfoRequestList_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); } } NeighbourInfoRequestItem::NeighbourInfoRequestItem() { } NeighbourInfoRequestItem::NeighbourInfoRequestItem(const HNB__RNL__Identity& par_hnb__RNL__Identity, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 >& par_iE__Extensions) : field_hnb__RNL__Identity(par_hnb__RNL__Identity), field_iE__Extensions(par_iE__Extensions) { } NeighbourInfoRequestItem::NeighbourInfoRequestItem(const NeighbourInfoRequestItem& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.NeighbourInfoRequestItem."); if (other_value.hnb__RNL__Identity().is_bound()) field_hnb__RNL__Identity = other_value.hnb__RNL__Identity(); else field_hnb__RNL__Identity.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void NeighbourInfoRequestItem::clean_up() { field_hnb__RNL__Identity.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* NeighbourInfoRequestItem::get_descriptor() const { return &NeighbourInfoRequestItem_descr_; } NeighbourInfoRequestItem& NeighbourInfoRequestItem::operator=(const NeighbourInfoRequestItem& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.NeighbourInfoRequestItem."); if (other_value.hnb__RNL__Identity().is_bound()) field_hnb__RNL__Identity = other_value.hnb__RNL__Identity(); else field_hnb__RNL__Identity.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 NeighbourInfoRequestItem::operator==(const NeighbourInfoRequestItem& other_value) const { return field_hnb__RNL__Identity==other_value.field_hnb__RNL__Identity && field_iE__Extensions==other_value.field_iE__Extensions; } boolean NeighbourInfoRequestItem::is_bound() const { return (field_hnb__RNL__Identity.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean NeighbourInfoRequestItem::is_value() const { return field_hnb__RNL__Identity.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int NeighbourInfoRequestItem::size_of() const { int ret_val = 1; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void NeighbourInfoRequestItem::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ hnb_RNL_Identity := "); field_hnb__RNL__Identity.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void NeighbourInfoRequestItem::set_implicit_omit() { if (hnb__RNL__Identity().is_bound()) hnb__RNL__Identity().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void NeighbourInfoRequestItem::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hnb__RNL__Identity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "hnb_RNL_Identity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__RNL__Identity().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 @HNBAP-IEs.NeighbourInfoRequestItem: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.NeighbourInfoRequestItem"); } } void NeighbourInfoRequestItem::encode_text(Text_Buf& text_buf) const { field_hnb__RNL__Identity.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void NeighbourInfoRequestItem::decode_text(Text_Buf& text_buf) { field_hnb__RNL__Identity.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void NeighbourInfoRequestItem::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 NeighbourInfoRequestItem::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* NeighbourInfoRequestItem::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("hnb_RNL_Identity': "); new_tlv->add_TLV(field_hnb__RNL__Identity.BER_encode_TLV(NeighbourInfoRequestItem_hnb__RNL__Identity_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(NeighbourInfoRequestItem_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean NeighbourInfoRequestItem::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 '@HNBAP-IEs.NeighbourInfoRequestItem' 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("hnb_RNL_Identity': "); 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_hnb__RNL__Identity.BER_decode_TLV(NeighbourInfoRequestItem_hnb__RNL__Identity_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(NeighbourInfoRequestItem_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 NeighbourInfoRequestItem::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 @HNBAP-IEs.NeighbourInfoRequestItem."); 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, "hnb_RNL_Identity"); enc_len += field_hnb__RNL__Identity.JSON_encode(NeighbourInfoRequestItem_hnb__RNL__Identity_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(NeighbourInfoRequestItem_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int NeighbourInfoRequestItem::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 hnb__RNL__Identity_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 (16 == name_len && 0 == strncmp(fld_name, "hnb_RNL_Identity", name_len)) { hnb__RNL__Identity_found = TRUE; int ret_val = field_hnb__RNL__Identity.JSON_decode(NeighbourInfoRequestItem_hnb__RNL__Identity_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, "hnb_RNL_Identity"); } 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(NeighbourInfoRequestItem_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 (!hnb__RNL__Identity_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "hnb_RNL_Identity"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int NeighbourInfoRequestItem::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_hnb__RNL__Identity.OER_encode(NeighbourInfoRequestItem_hnb__RNL__Identity_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(NeighbourInfoRequestItem_iE__Extensions_descr_, p_buf); return 0; } int NeighbourInfoRequestItem::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_hnb__RNL__Identity.OER_decode(NeighbourInfoRequestItem_hnb__RNL__Identity_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(NeighbourInfoRequestItem_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 NeighbourInfoRequestItem::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_hnb__RNL__Identity.PER_encode(NeighbourInfoRequestItem_hnb__RNL__Identity_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(NeighbourInfoRequestItem_iE__Extensions_descr_, p_buf, p_options); } void NeighbourInfoRequestItem::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_hnb__RNL__Identity.PER_decode(NeighbourInfoRequestItem_hnb__RNL__Identity_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(NeighbourInfoRequestItem_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 NeighbourInfoRequestItem_template::single_value_struct { HNB__RNL__Identity_template field_hnb__RNL__Identity; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template field_iE__Extensions; }; void NeighbourInfoRequestItem_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_hnb__RNL__Identity = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void NeighbourInfoRequestItem_template::copy_value(const NeighbourInfoRequestItem& other_value) { single_value = new single_value_struct; if (other_value.hnb__RNL__Identity().is_bound()) { single_value->field_hnb__RNL__Identity = other_value.hnb__RNL__Identity(); } else { single_value->field_hnb__RNL__Identity.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 NeighbourInfoRequestItem_template::copy_template(const NeighbourInfoRequestItem_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.hnb__RNL__Identity().get_selection()) { single_value->field_hnb__RNL__Identity = other_value.hnb__RNL__Identity(); } else { single_value->field_hnb__RNL__Identity.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 NeighbourInfoRequestItem_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 NeighbourInfoRequestItem_template(*other_value.implication_.precondition); implication_.implied_template = new NeighbourInfoRequestItem_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 @HNBAP-IEs.NeighbourInfoRequestItem."); break; } set_selection(other_value); } NeighbourInfoRequestItem_template::NeighbourInfoRequestItem_template() { } NeighbourInfoRequestItem_template::NeighbourInfoRequestItem_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } NeighbourInfoRequestItem_template::NeighbourInfoRequestItem_template(const NeighbourInfoRequestItem& other_value) { copy_value(other_value); } NeighbourInfoRequestItem_template::NeighbourInfoRequestItem_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const NeighbourInfoRequestItem&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.NeighbourInfoRequestItem from an unbound optional field."); } } NeighbourInfoRequestItem_template::NeighbourInfoRequestItem_template(NeighbourInfoRequestItem_template* p_precondition, NeighbourInfoRequestItem_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } NeighbourInfoRequestItem_template::NeighbourInfoRequestItem_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; } NeighbourInfoRequestItem_template::NeighbourInfoRequestItem_template(const NeighbourInfoRequestItem_template& other_value) : Base_Template() { copy_template(other_value); } NeighbourInfoRequestItem_template::~NeighbourInfoRequestItem_template() { clean_up(); } NeighbourInfoRequestItem_template& NeighbourInfoRequestItem_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } NeighbourInfoRequestItem_template& NeighbourInfoRequestItem_template::operator=(const NeighbourInfoRequestItem& other_value) { clean_up(); copy_value(other_value); return *this; } NeighbourInfoRequestItem_template& NeighbourInfoRequestItem_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const NeighbourInfoRequestItem&)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 @HNBAP-IEs.NeighbourInfoRequestItem."); } return *this; } NeighbourInfoRequestItem_template& NeighbourInfoRequestItem_template::operator=(const NeighbourInfoRequestItem_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean NeighbourInfoRequestItem_template::match(const NeighbourInfoRequestItem& 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.hnb__RNL__Identity().is_bound()) return FALSE; if(!single_value->field_hnb__RNL__Identity.match(other_value.hnb__RNL__Identity(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15&)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 @HNBAP-IEs.NeighbourInfoRequestItem."); } return FALSE; } boolean NeighbourInfoRequestItem_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_hnb__RNL__Identity.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean NeighbourInfoRequestItem_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_hnb__RNL__Identity.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void NeighbourInfoRequestItem_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; } NeighbourInfoRequestItem NeighbourInfoRequestItem_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 @HNBAP-IEs.NeighbourInfoRequestItem."); NeighbourInfoRequestItem ret_val; if (single_value->field_hnb__RNL__Identity.is_bound()) { ret_val.hnb__RNL__Identity() = single_value->field_hnb__RNL__Identity.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 NeighbourInfoRequestItem_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 @HNBAP-IEs.NeighbourInfoRequestItem."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new NeighbourInfoRequestItem_template[list_length]; } NeighbourInfoRequestItem_template& NeighbourInfoRequestItem_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 @HNBAP-IEs.NeighbourInfoRequestItem."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.NeighbourInfoRequestItem."); return value_list.list_value[list_index]; } HNB__RNL__Identity_template& NeighbourInfoRequestItem_template::hnb__RNL__Identity() { set_specific(); return single_value->field_hnb__RNL__Identity; } const HNB__RNL__Identity_template& NeighbourInfoRequestItem_template::hnb__RNL__Identity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hnb_RNL_Identity of a non-specific template of type @HNBAP-IEs.NeighbourInfoRequestItem."); return single_value->field_hnb__RNL__Identity; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& NeighbourInfoRequestItem_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& NeighbourInfoRequestItem_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.NeighbourInfoRequestItem."); return single_value->field_iE__Extensions; } int NeighbourInfoRequestItem_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.NeighbourInfoRequestItem which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; 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 @HNBAP-IEs.NeighbourInfoRequestItem 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 @HNBAP-IEs.NeighbourInfoRequestItem containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.NeighbourInfoRequestItem containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.NeighbourInfoRequestItem containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.NeighbourInfoRequestItem containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.NeighbourInfoRequestItem containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.NeighbourInfoRequestItem containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.NeighbourInfoRequestItem containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.NeighbourInfoRequestItem."); } return 0; } void NeighbourInfoRequestItem_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ hnb_RNL_Identity := "); single_value->field_hnb__RNL__Identity.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 NeighbourInfoRequestItem_template::log_match(const NeighbourInfoRequestItem& 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_hnb__RNL__Identity.match(match_value.hnb__RNL__Identity(), legacy)){ TTCN_Logger::log_logmatch_info(".hnb_RNL_Identity"); single_value->field_hnb__RNL__Identity.log_match(match_value.hnb__RNL__Identity(), 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("{ hnb_RNL_Identity := "); single_value->field_hnb__RNL__Identity.log_match(match_value.hnb__RNL__Identity(), 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 NeighbourInfoRequestItem_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (hnb__RNL__Identity().is_bound()) hnb__RNL__Identity().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void NeighbourInfoRequestItem_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_hnb__RNL__Identity.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 @HNBAP-IEs.NeighbourInfoRequestItem."); } } void NeighbourInfoRequestItem_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_hnb__RNL__Identity.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 NeighbourInfoRequestItem_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 @HNBAP-IEs.NeighbourInfoRequestItem."); } } void NeighbourInfoRequestItem_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: { NeighbourInfoRequestItem_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) hnb__RNL__Identity().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "hnb_RNL_Identity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hnb__RNL__Identity().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 @HNBAP-IEs.NeighbourInfoRequestItem: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { NeighbourInfoRequestItem_template* precondition = new NeighbourInfoRequestItem_template; precondition->set_param(*param.get_elem(0)); NeighbourInfoRequestItem_template* implied_template = new NeighbourInfoRequestItem_template; implied_template->set_param(*param.get_elem(1)); *this = NeighbourInfoRequestItem_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.NeighbourInfoRequestItem"); } is_ifpresent = param.get_ifpresent(); } void NeighbourInfoRequestItem_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_hnb__RNL__Identity.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.NeighbourInfoRequestItem"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.NeighbourInfoRequestItem"); 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 : "@HNBAP-IEs.NeighbourInfoRequestItem"); } boolean NeighbourInfoRequestItem_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean NeighbourInfoRequestItem_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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) lAI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rAC().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(), "lAI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.RAI: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.RAI"); } } void RAI::encode_text(Text_Buf& text_buf) const { field_lAI.encode_text(text_buf); field_rAC.encode_text(text_buf); } void RAI::decode_text(Text_Buf& text_buf) { field_lAI.decode_text(text_buf); field_rAC.decode_text(text_buf); } void RAI::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 RAI::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* RAI::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("lAI': "); new_tlv->add_TLV(field_lAI.BER_encode_TLV(RAI_lAI_descr_, p_coding)); ec_1.set_msg("rAC': "); new_tlv->add_TLV(field_rAC.BER_encode_TLV(RAI_rAC_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean RAI::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 '@HNBAP-IEs.RAI' 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("lAI': "); 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_lAI.BER_decode_TLV(RAI_lAI_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("rAC': "); 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_rAC.BER_decode_TLV(RAI_rAC_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 RAI::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 @HNBAP-IEs.RAI."); 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, "lAI"); enc_len += field_lAI.JSON_encode(RAI_lAI_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "rAC"); enc_len += field_rAC.JSON_encode(RAI_rAC_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int RAI::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 lAI_found = FALSE; boolean rAC_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 (3 == name_len && 0 == strncmp(fld_name, "lAI", name_len)) { lAI_found = TRUE; int ret_val = field_lAI.JSON_decode(RAI_lAI_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, 3, "lAI"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (3 == name_len && 0 == strncmp(fld_name, "rAC", name_len)) { rAC_found = TRUE; int ret_val = field_rAC.JSON_decode(RAI_rAC_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, 3, "rAC"); } 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 (!lAI_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "lAI"); return JSON_ERROR_FATAL; } if (!rAC_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "rAC"); return JSON_ERROR_FATAL; } return (int)dec_len; } int RAI::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; p_buf.put_c(c); field_lAI.OER_encode(RAI_lAI_descr_, p_buf); field_rAC.OER_encode(RAI_rAC_descr_, p_buf); return 0; } int RAI::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_lAI.OER_decode(RAI_lAI_descr_, p_buf, p_oer); field_rAC.OER_decode(RAI_rAC_descr_, p_buf, p_oer); 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 RAI::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); field_lAI.PER_encode(RAI_lAI_descr_, p_buf, p_options); field_rAC.PER_encode(RAI_rAC_descr_, p_buf, p_options); } void RAI::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(); field_lAI.PER_decode(RAI_lAI_descr_, p_buf, p_options); field_rAC.PER_decode(RAI_rAC_descr_, p_buf, p_options); 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 RAI_template::single_value_struct { LAI_template field_lAI; OCTETSTRING_template field_rAC; }; void RAI_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_lAI = ANY_VALUE; single_value->field_rAC = ANY_VALUE; } } } void RAI_template::copy_value(const RAI& other_value) { single_value = new single_value_struct; if (other_value.lAI().is_bound()) { single_value->field_lAI = other_value.lAI(); } else { single_value->field_lAI.clean_up(); } if (other_value.rAC().is_bound()) { single_value->field_rAC = other_value.rAC(); } else { single_value->field_rAC.clean_up(); } set_selection(SPECIFIC_VALUE); } void RAI_template::copy_template(const RAI_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.lAI().get_selection()) { single_value->field_lAI = other_value.lAI(); } else { single_value->field_lAI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rAC().get_selection()) { single_value->field_rAC = other_value.rAC(); } else { single_value->field_rAC.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 RAI_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 RAI_template(*other_value.implication_.precondition); implication_.implied_template = new RAI_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 @HNBAP-IEs.RAI."); break; } set_selection(other_value); } RAI_template::RAI_template() { } RAI_template::RAI_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RAI_template::RAI_template(const RAI& other_value) { copy_value(other_value); } RAI_template::RAI_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RAI&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.RAI from an unbound optional field."); } } RAI_template::RAI_template(RAI_template* p_precondition, RAI_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RAI_template::RAI_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; } RAI_template::RAI_template(const RAI_template& other_value) : Base_Template() { copy_template(other_value); } RAI_template::~RAI_template() { clean_up(); } RAI_template& RAI_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RAI_template& RAI_template::operator=(const RAI& other_value) { clean_up(); copy_value(other_value); return *this; } RAI_template& RAI_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RAI&)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 @HNBAP-IEs.RAI."); } return *this; } RAI_template& RAI_template::operator=(const RAI_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RAI_template::match(const RAI& 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.lAI().is_bound()) return FALSE; if(!single_value->field_lAI.match(other_value.lAI(), legacy))return FALSE; if(!other_value.rAC().is_bound()) return FALSE; if(!single_value->field_rAC.match(other_value.rAC(), 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 @HNBAP-IEs.RAI."); } return FALSE; } boolean RAI_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_lAI.is_bound() || single_value->field_rAC.is_bound(); } boolean RAI_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_lAI.is_value() && single_value->field_rAC.is_value(); } void RAI_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; } RAI RAI_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 @HNBAP-IEs.RAI."); RAI ret_val; if (single_value->field_lAI.is_bound()) { ret_val.lAI() = single_value->field_lAI.valueof(); } if (single_value->field_rAC.is_bound()) { ret_val.rAC() = single_value->field_rAC.valueof(); } return ret_val; } void RAI_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 @HNBAP-IEs.RAI."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RAI_template[list_length]; } RAI_template& RAI_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 @HNBAP-IEs.RAI."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.RAI."); return value_list.list_value[list_index]; } LAI_template& RAI_template::lAI() { set_specific(); return single_value->field_lAI; } const LAI_template& RAI_template::lAI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lAI of a non-specific template of type @HNBAP-IEs.RAI."); return single_value->field_lAI; } OCTETSTRING_template& RAI_template::rAC() { set_specific(); return single_value->field_rAC; } const OCTETSTRING_template& RAI_template::rAC() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAC of a non-specific template of type @HNBAP-IEs.RAI."); return single_value->field_rAC; } int RAI_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RAI 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 @HNBAP-IEs.RAI 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 @HNBAP-IEs.RAI containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RAI containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RAI containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RAI containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RAI containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RAI containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RAI containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.RAI."); } return 0; } void RAI_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ lAI := "); single_value->field_lAI.log(); TTCN_Logger::log_event_str(", rAC := "); single_value->field_rAC.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 RAI_template::log_match(const RAI& 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_lAI.match(match_value.lAI(), legacy)){ TTCN_Logger::log_logmatch_info(".lAI"); single_value->field_lAI.log_match(match_value.lAI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_rAC.match(match_value.rAC(), legacy)){ TTCN_Logger::log_logmatch_info(".rAC"); single_value->field_rAC.log_match(match_value.rAC(), 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("{ lAI := "); single_value->field_lAI.log_match(match_value.lAI(), legacy); TTCN_Logger::log_event_str(", rAC := "); single_value->field_rAC.log_match(match_value.rAC(), 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 RAI_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (lAI().is_bound()) lAI().set_implicit_omit(); if (rAC().is_bound()) rAC().set_implicit_omit(); } void RAI_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_lAI.encode_text(text_buf); single_value->field_rAC.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 @HNBAP-IEs.RAI."); } } void RAI_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_lAI.decode_text(text_buf); single_value->field_rAC.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 RAI_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 @HNBAP-IEs.RAI."); } } void RAI_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: { RAI_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) lAI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rAC().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(), "lAI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rAC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rAC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.RAI: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RAI_template* precondition = new RAI_template; precondition->set_param(*param.get_elem(0)); RAI_template* implied_template = new RAI_template; implied_template->set_param(*param.get_elem(1)); *this = RAI_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.RAI"); } is_ifpresent = param.get_ifpresent(); } void RAI_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_lAI.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.RAI"); single_value->field_rAC.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.RAI"); 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 : "@HNBAP-IEs.RAI"); } boolean RAI_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RAI_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) pTMSI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rAI().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(), "pTMSI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pTMSI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rAI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rAI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.PTMSIRAI: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.PTMSIRAI"); } } void PTMSIRAI::encode_text(Text_Buf& text_buf) const { field_pTMSI.encode_text(text_buf); field_rAI.encode_text(text_buf); } void PTMSIRAI::decode_text(Text_Buf& text_buf) { field_pTMSI.decode_text(text_buf); field_rAI.decode_text(text_buf); } void PTMSIRAI::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 PTMSIRAI::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* PTMSIRAI::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("pTMSI': "); new_tlv->add_TLV(field_pTMSI.BER_encode_TLV(PTMSIRAI_pTMSI_descr_, p_coding)); ec_1.set_msg("rAI': "); new_tlv->add_TLV(field_rAI.BER_encode_TLV(PTMSIRAI_rAI_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean PTMSIRAI::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 '@HNBAP-IEs.PTMSIRAI' 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("pTMSI': "); 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_pTMSI.BER_decode_TLV(PTMSIRAI_pTMSI_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("rAI': "); 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_rAI.BER_decode_TLV(PTMSIRAI_rAI_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 PTMSIRAI::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 @HNBAP-IEs.PTMSIRAI."); 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, "pTMSI"); enc_len += field_pTMSI.JSON_encode(PTMSIRAI_pTMSI_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "rAI"); enc_len += field_rAI.JSON_encode(PTMSIRAI_rAI_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int PTMSIRAI::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 pTMSI_found = FALSE; boolean rAI_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 (5 == name_len && 0 == strncmp(fld_name, "pTMSI", name_len)) { pTMSI_found = TRUE; int ret_val = field_pTMSI.JSON_decode(PTMSIRAI_pTMSI_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, "pTMSI"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (3 == name_len && 0 == strncmp(fld_name, "rAI", name_len)) { rAI_found = TRUE; int ret_val = field_rAI.JSON_decode(PTMSIRAI_rAI_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, 3, "rAI"); } 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 (!pTMSI_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "pTMSI"); return JSON_ERROR_FATAL; } if (!rAI_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "rAI"); return JSON_ERROR_FATAL; } return (int)dec_len; } int PTMSIRAI::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; p_buf.put_c(c); field_pTMSI.OER_encode(PTMSIRAI_pTMSI_descr_, p_buf); field_rAI.OER_encode(PTMSIRAI_rAI_descr_, p_buf); return 0; } int PTMSIRAI::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_pTMSI.OER_decode(PTMSIRAI_pTMSI_descr_, p_buf, p_oer); field_rAI.OER_decode(PTMSIRAI_rAI_descr_, p_buf, p_oer); 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 PTMSIRAI::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); field_pTMSI.PER_encode(PTMSIRAI_pTMSI_descr_, p_buf, p_options); field_rAI.PER_encode(PTMSIRAI_rAI_descr_, p_buf, p_options); } void PTMSIRAI::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(); field_pTMSI.PER_decode(PTMSIRAI_pTMSI_descr_, p_buf, p_options); field_rAI.PER_decode(PTMSIRAI_rAI_descr_, p_buf, p_options); 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 PTMSIRAI_template::single_value_struct { BITSTRING_template field_pTMSI; RAI_template field_rAI; }; void PTMSIRAI_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_pTMSI = ANY_VALUE; single_value->field_rAI = ANY_VALUE; } } } void PTMSIRAI_template::copy_value(const PTMSIRAI& other_value) { single_value = new single_value_struct; if (other_value.pTMSI().is_bound()) { single_value->field_pTMSI = other_value.pTMSI(); } else { single_value->field_pTMSI.clean_up(); } if (other_value.rAI().is_bound()) { single_value->field_rAI = other_value.rAI(); } else { single_value->field_rAI.clean_up(); } set_selection(SPECIFIC_VALUE); } void PTMSIRAI_template::copy_template(const PTMSIRAI_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.pTMSI().get_selection()) { single_value->field_pTMSI = other_value.pTMSI(); } else { single_value->field_pTMSI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rAI().get_selection()) { single_value->field_rAI = other_value.rAI(); } else { single_value->field_rAI.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 PTMSIRAI_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 PTMSIRAI_template(*other_value.implication_.precondition); implication_.implied_template = new PTMSIRAI_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 @HNBAP-IEs.PTMSIRAI."); break; } set_selection(other_value); } PTMSIRAI_template::PTMSIRAI_template() { } PTMSIRAI_template::PTMSIRAI_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } PTMSIRAI_template::PTMSIRAI_template(const PTMSIRAI& other_value) { copy_value(other_value); } PTMSIRAI_template::PTMSIRAI_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PTMSIRAI&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.PTMSIRAI from an unbound optional field."); } } PTMSIRAI_template::PTMSIRAI_template(PTMSIRAI_template* p_precondition, PTMSIRAI_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PTMSIRAI_template::PTMSIRAI_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; } PTMSIRAI_template::PTMSIRAI_template(const PTMSIRAI_template& other_value) : Base_Template() { copy_template(other_value); } PTMSIRAI_template::~PTMSIRAI_template() { clean_up(); } PTMSIRAI_template& PTMSIRAI_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PTMSIRAI_template& PTMSIRAI_template::operator=(const PTMSIRAI& other_value) { clean_up(); copy_value(other_value); return *this; } PTMSIRAI_template& PTMSIRAI_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PTMSIRAI&)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 @HNBAP-IEs.PTMSIRAI."); } return *this; } PTMSIRAI_template& PTMSIRAI_template::operator=(const PTMSIRAI_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean PTMSIRAI_template::match(const PTMSIRAI& 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.pTMSI().is_bound()) return FALSE; if(!single_value->field_pTMSI.match(other_value.pTMSI(), legacy))return FALSE; if(!other_value.rAI().is_bound()) return FALSE; if(!single_value->field_rAI.match(other_value.rAI(), 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 @HNBAP-IEs.PTMSIRAI."); } return FALSE; } boolean PTMSIRAI_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_pTMSI.is_bound() || single_value->field_rAI.is_bound(); } boolean PTMSIRAI_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_pTMSI.is_value() && single_value->field_rAI.is_value(); } void PTMSIRAI_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; } PTMSIRAI PTMSIRAI_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 @HNBAP-IEs.PTMSIRAI."); PTMSIRAI ret_val; if (single_value->field_pTMSI.is_bound()) { ret_val.pTMSI() = single_value->field_pTMSI.valueof(); } if (single_value->field_rAI.is_bound()) { ret_val.rAI() = single_value->field_rAI.valueof(); } return ret_val; } void PTMSIRAI_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 @HNBAP-IEs.PTMSIRAI."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new PTMSIRAI_template[list_length]; } PTMSIRAI_template& PTMSIRAI_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 @HNBAP-IEs.PTMSIRAI."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.PTMSIRAI."); return value_list.list_value[list_index]; } BITSTRING_template& PTMSIRAI_template::pTMSI() { set_specific(); return single_value->field_pTMSI; } const BITSTRING_template& PTMSIRAI_template::pTMSI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pTMSI of a non-specific template of type @HNBAP-IEs.PTMSIRAI."); return single_value->field_pTMSI; } RAI_template& PTMSIRAI_template::rAI() { set_specific(); return single_value->field_rAI; } const RAI_template& PTMSIRAI_template::rAI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAI of a non-specific template of type @HNBAP-IEs.PTMSIRAI."); return single_value->field_rAI; } int PTMSIRAI_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.PTMSIRAI 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 @HNBAP-IEs.PTMSIRAI 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 @HNBAP-IEs.PTMSIRAI containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.PTMSIRAI containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.PTMSIRAI containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.PTMSIRAI containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.PTMSIRAI containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.PTMSIRAI containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.PTMSIRAI containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.PTMSIRAI."); } return 0; } void PTMSIRAI_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ pTMSI := "); single_value->field_pTMSI.log(); TTCN_Logger::log_event_str(", rAI := "); single_value->field_rAI.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 PTMSIRAI_template::log_match(const PTMSIRAI& 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_pTMSI.match(match_value.pTMSI(), legacy)){ TTCN_Logger::log_logmatch_info(".pTMSI"); single_value->field_pTMSI.log_match(match_value.pTMSI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_rAI.match(match_value.rAI(), legacy)){ TTCN_Logger::log_logmatch_info(".rAI"); single_value->field_rAI.log_match(match_value.rAI(), 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("{ pTMSI := "); single_value->field_pTMSI.log_match(match_value.pTMSI(), legacy); TTCN_Logger::log_event_str(", rAI := "); single_value->field_rAI.log_match(match_value.rAI(), 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 PTMSIRAI_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (pTMSI().is_bound()) pTMSI().set_implicit_omit(); if (rAI().is_bound()) rAI().set_implicit_omit(); } void PTMSIRAI_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_pTMSI.encode_text(text_buf); single_value->field_rAI.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 @HNBAP-IEs.PTMSIRAI."); } } void PTMSIRAI_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_pTMSI.decode_text(text_buf); single_value->field_rAI.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 PTMSIRAI_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 @HNBAP-IEs.PTMSIRAI."); } } void PTMSIRAI_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: { PTMSIRAI_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) pTMSI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rAI().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(), "pTMSI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pTMSI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rAI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rAI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.PTMSIRAI: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { PTMSIRAI_template* precondition = new PTMSIRAI_template; precondition->set_param(*param.get_elem(0)); PTMSIRAI_template* implied_template = new PTMSIRAI_template; implied_template->set_param(*param.get_elem(1)); *this = PTMSIRAI_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.PTMSIRAI"); } is_ifpresent = param.get_ifpresent(); } void PTMSIRAI_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_pTMSI.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.PTMSIRAI"); single_value->field_rAI.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.PTMSIRAI"); 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 : "@HNBAP-IEs.PTMSIRAI"); } boolean PTMSIRAI_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PTMSIRAI_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; } RABList::RABList(const RABList& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.RABList."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } RABList::~RABList() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void RABList::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."); } } RABList& RABList::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; } RABList& RABList::operator=(const RABList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.RABList."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean RABList::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.RABList."); return val_ptr->n_elements == 0 ; } boolean RABList::operator==(const RABList& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.RABList."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.RABList."); 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; } RABListItem& RABList::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.RABList 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 = (RABListItem**)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 RABListItem(*(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 RABListItem; } return *val_ptr->value_elements[index_value]; } RABListItem& RABList::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.RABList."); return (*this)[(int)index_value]; } const RABListItem& RABList::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.RABList."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.RABList using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.RABList: 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 RABListItem& RABList::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.RABList."); return (*this)[(int)index_value]; } RABList RABList::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } RABList RABList::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } RABList RABList::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } RABList RABList::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.RABList."); 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; RABList 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 RABListItem(*val_ptr->value_elements[i]); } } return ret_val; } RABList RABList::operator+(const RABList& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.RABList concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; RABList 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 RABListItem(*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 RABListItem(*other_value.val_ptr->value_elements[i]); } } return ret_val; } RABList RABList::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.RABList."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.RABList","element"); RABList ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new RABListItem(*val_ptr->value_elements[i+index]); } } return ret_val; } RABList RABList::replace(int index, int len, const RABList& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.RABList."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.RABList."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.RABList","element"); RABList 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 RABListItem(*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 RABListItem(*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 RABListItem(*val_ptr->value_elements[index+i+len]); } } return ret_val; } RABList RABList::replace(int index, int len, const RABList_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 RABList::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.RABList."); 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 = (RABListItem**)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 RABListItem(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (RABListItem**)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 @HNBAP-IEs.RABList: %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 = (RABListItem**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean RABList::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 RABList::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.RABList."); return val_ptr->n_elements; } int RABList::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.RABList."); 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 RABList::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 RABList::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 RABList::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", "@HNBAP-IEs.RABList"); } 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", "@HNBAP-IEs.RABList"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void RABList::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.RABList."); 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 RABList::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 @HNBAP-IEs.RABList."); val_ptr->value_elements = (RABListItem**)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 RABListItem; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void RABList::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 RABList::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* RABList::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 RABList::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 = (RABListItem**)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 RABListItem; 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 RABList::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 @HNBAP-IEs.RABList."); 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 RABList::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); } RABListItem* val = new RABListItem; 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 = (RABListItem**)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 RABList::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 @HNBAP-IEs.RABList."); 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 RABList::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 RABList::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 RABList::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 RABList_template::copy_value(const RABList& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.RABList with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (RABListItem_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 RABListItem_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new RABListItem_template; } } set_selection(SPECIFIC_VALUE); } void RABList_template::copy_template(const RABList_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 = (RABListItem_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 RABListItem_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new RABListItem_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 RABList_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 RABList_template(*other_value.implication_.precondition); implication_.implied_template = new RABList_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 @HNBAP-IEs.RABList."); break; } set_selection(other_value); } boolean RABList_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 RABList_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const RABList*)value_ptr)[value_index], legacy); else return ((const RABList_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } RABList_template::RABList_template() { } RABList_template::RABList_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } RABList_template::RABList_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } RABList_template::RABList_template(const RABList& other_value) { copy_value(other_value); } RABList_template::RABList_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RABList&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.RABList from an unbound optional field."); } } RABList_template::RABList_template(RABList_template* p_precondition, RABList_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RABList_template::RABList_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; } RABList_template::RABList_template(const RABList_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } RABList_template::~RABList_template() { clean_up(); } void RABList_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; } RABList_template& RABList_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RABList_template& RABList_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } RABList_template& RABList_template::operator=(const RABList& other_value) { clean_up(); copy_value(other_value); return *this; } RABList_template& RABList_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RABList&)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 @HNBAP-IEs.RABList."); } return *this; } RABList_template& RABList_template::operator=(const RABList_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } RABListItem_template& RABList_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.RABList 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 @HNBAP-IEs.RABList."); break; } return *single_value.value_elements[index_value]; } RABListItem_template& RABList_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.RABList."); return (*this)[(int)index_value]; } const RABListItem_template& RABList_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.RABList using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.RABList."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.RABList: 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 RABListItem_template& RABList_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.RABList."); return (*this)[(int)index_value]; } void RABList_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.RABList."); 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 = (RABListItem_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 RABListItem_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 RABListItem_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 = (RABListItem_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int RABList_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 RABList_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 @HNBAP-IEs.RABList 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 @HNBAP-IEs.RABList 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 @HNBAP-IEs.RABList 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 @HNBAP-IEs.RABList 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 @HNBAP-IEs.RABList 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 @HNBAP-IEs.RABList containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.RABList.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.RABList"); } boolean RABList_template::match(const RABList& 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 @HNBAP-IEs.RABList."); } return FALSE; } boolean RABList_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; } RABList RABList_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 @HNBAP-IEs.RABList."); RABList 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; } RABList RABList_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); } RABList RABList_template::replace(int index, int len, const RABList_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()); } RABList RABList_template::replace(int index, int len, const RABList& 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 RABList_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 RABList_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.RABList."); } set_selection(template_type); } RABList_template& RABList_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 @HNBAP-IEs.RABList."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.RABList."); return value_list.list_value[list_index]; } void RABList_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 RABList_template::log_match(const RABList& 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 RABList_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 @HNBAP-IEs.RABList."); } } void RABList_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 @HNBAP-IEs.RABList."); single_value.value_elements = (RABListItem_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 RABListItem_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 RABList_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 @HNBAP-IEs.RABList."); } } boolean RABList_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RABList_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 RABList_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: { RABList_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: { RABList_template* precondition = new RABList_template; precondition->set_param(*param.get_elem(0)); RABList_template* implied_template = new RABList_template; implied_template->set_param(*param.get_elem(1)); *this = RABList_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.RABList"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void RABList_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 : "@HNBAP-IEs.RABList"); 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 : "@HNBAP-IEs.RABList"); } boolean RABList_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 TransportInfo_transportAssociation::copy_value(const TransportInfo_transportAssociation& other_value) { switch (other_value.union_selection) { case ALT_gtp__TEI: field_gtp__TEI = new OCTETSTRING(*other_value.field_gtp__TEI); break; case ALT_bindingID: field_bindingID = new OCTETSTRING(*other_value.field_bindingID); break; default: TTCN_error("Assignment of an unbound union value of type @HNBAP-IEs.TransportInfo.transportAssociation."); } union_selection = other_value.union_selection; } TransportInfo_transportAssociation::TransportInfo_transportAssociation() { union_selection = UNBOUND_VALUE; } TransportInfo_transportAssociation::TransportInfo_transportAssociation(const TransportInfo_transportAssociation& other_value) : Base_Type(){ copy_value(other_value); } TransportInfo_transportAssociation::~TransportInfo_transportAssociation() { clean_up(); } TransportInfo_transportAssociation& TransportInfo_transportAssociation::operator=(const TransportInfo_transportAssociation& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean TransportInfo_transportAssociation::operator==(const TransportInfo_transportAssociation& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-IEs.TransportInfo.transportAssociation."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-IEs.TransportInfo.transportAssociation."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { case ALT_gtp__TEI: return *field_gtp__TEI == *other_value.field_gtp__TEI; case ALT_bindingID: return *field_bindingID == *other_value.field_bindingID; default: return FALSE; } } OCTETSTRING& TransportInfo_transportAssociation::gtp__TEI() { if (union_selection != ALT_gtp__TEI) { clean_up(); field_gtp__TEI = new OCTETSTRING; union_selection = ALT_gtp__TEI; } return *field_gtp__TEI; } const OCTETSTRING& TransportInfo_transportAssociation::gtp__TEI() const { if (union_selection != ALT_gtp__TEI) TTCN_error("Using non-selected field gtp_TEI in a value of union type @HNBAP-IEs.TransportInfo.transportAssociation."); return *field_gtp__TEI; } OCTETSTRING& TransportInfo_transportAssociation::bindingID() { if (union_selection != ALT_bindingID) { clean_up(); field_bindingID = new OCTETSTRING; union_selection = ALT_bindingID; } return *field_bindingID; } const OCTETSTRING& TransportInfo_transportAssociation::bindingID() const { if (union_selection != ALT_bindingID) TTCN_error("Using non-selected field bindingID in a value of union type @HNBAP-IEs.TransportInfo.transportAssociation."); return *field_bindingID; } boolean TransportInfo_transportAssociation::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 @HNBAP-IEs.TransportInfo.transportAssociation."); return union_selection == checked_selection; } boolean TransportInfo_transportAssociation::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean TransportInfo_transportAssociation::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; case ALT_gtp__TEI: return field_gtp__TEI->is_value(); case ALT_bindingID: return field_bindingID->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void TransportInfo_transportAssociation::clean_up() { switch (union_selection) { case ALT_gtp__TEI: delete field_gtp__TEI; break; case ALT_bindingID: delete field_bindingID; break; default: break; } union_selection = UNBOUND_VALUE; } void TransportInfo_transportAssociation::log() const { switch (union_selection) { case ALT_gtp__TEI: TTCN_Logger::log_event_str("{ gtp_TEI := "); field_gtp__TEI->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_bindingID: TTCN_Logger::log_event_str("{ bindingID := "); field_bindingID->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void TransportInfo_transportAssociation::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, "gtp_TEI")) { gtp__TEI().set_param(*mp_last); if (!gtp__TEI().is_bound()) clean_up(); return; } if (!strcmp(last_name, "bindingID")) { bindingID().set_param(*mp_last); if (!bindingID().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.TransportInfo.transportAssociation.", last_name); } void TransportInfo_transportAssociation::set_implicit_omit() { switch (union_selection) { case ALT_gtp__TEI: field_gtp__TEI->set_implicit_omit(); break; case ALT_bindingID: field_bindingID->set_implicit_omit(); break; default: break; } } void TransportInfo_transportAssociation::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_gtp__TEI: field_gtp__TEI->encode_text(text_buf); break; case ALT_bindingID: field_bindingID->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @HNBAP-IEs.TransportInfo.transportAssociation."); } } void TransportInfo_transportAssociation::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_gtp__TEI: gtp__TEI().decode_text(text_buf); break; case ALT_bindingID: bindingID().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @HNBAP-IEs.TransportInfo.transportAssociation."); } } void TransportInfo_transportAssociation::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 TransportInfo_transportAssociation::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 *TransportInfo_transportAssociation::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_gtp__TEI: ec_1.set_msg("gtp_TEI': "); new_tlv = field_gtp__TEI->BER_encode_TLV(TransportInfo_transportAssociation_gtp__TEI_descr_, p_coding); break; case ALT_bindingID: ec_1.set_msg("bindingID': "); new_tlv = field_bindingID->BER_encode_TLV(TransportInfo_transportAssociation_bindingID_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 TransportInfo_transportAssociation::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_gtp__TEI = new OCTETSTRING; union_selection = ALT_gtp__TEI; if (field_gtp__TEI->BER_decode_isMyMsg(TransportInfo_transportAssociation_gtp__TEI_descr_, p_tlv)) return TRUE; delete field_gtp__TEI; field_bindingID = new OCTETSTRING; union_selection = ALT_bindingID; if (field_bindingID->BER_decode_isMyMsg(TransportInfo_transportAssociation_bindingID_descr_, p_tlv)) return TRUE; delete field_bindingID; union_selection = UNBOUND_VALUE; return FALSE; } boolean TransportInfo_transportAssociation::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { TransportInfo_transportAssociation tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean TransportInfo_transportAssociation::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 '@HNBAP-IEs.TransportInfo.transportAssociation' 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_gtp__TEI: ec_2.set_msg("gtp_TEI': "); field_gtp__TEI->BER_decode_TLV(TransportInfo_transportAssociation_gtp__TEI_descr_, tmp_tlv, L_form); break; case ALT_bindingID: ec_2.set_msg("bindingID': "); field_bindingID->BER_decode_TLV(TransportInfo_transportAssociation_bindingID_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int TransportInfo_transportAssociation::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_gtp__TEI: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "gtp_TEI"); } enc_len += field_gtp__TEI->JSON_encode(TransportInfo_transportAssociation_gtp__TEI_descr_, p_tok, FALSE); break; case ALT_bindingID: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "bindingID"); } enc_len += field_bindingID->JSON_encode(TransportInfo_transportAssociation_bindingID_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.TransportInfo.transportAssociation."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int TransportInfo_transportAssociation::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 gtp__TEI().JSON_decode(TransportInfo_transportAssociation_gtp__TEI_descr_, p_tok, TRUE, FALSE); case 1: return bindingID().JSON_decode(TransportInfo_transportAssociation_bindingID_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 '@HNBAP-IEs.TransportInfo.transportAssociation'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { p_tok.set_buf_pos(buf_pos); ret_val = gtp__TEI().JSON_decode(TransportInfo_transportAssociation_gtp__TEI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = bindingID().JSON_decode(TransportInfo_transportAssociation_bindingID_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 '@HNBAP-IEs.TransportInfo.transportAssociation'"); 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 '@HNBAP-IEs.TransportInfo.transportAssociation'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_AS_VALUE_ERROR, "object '@HNBAP-IEs.TransportInfo.transportAssociation'"); 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 (7 == name_len && 0 == strncmp(fld_name, "gtp_TEI", name_len)) { int ret_val = gtp__TEI().JSON_decode(TransportInfo_transportAssociation_gtp__TEI_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, "gtp_TEI"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (9 == name_len && 0 == strncmp(fld_name, "bindingID", name_len)) { int ret_val = bindingID().JSON_decode(TransportInfo_transportAssociation_bindingID_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, "bindingID"); } 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 TransportInfo_transportAssociation::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_gtp__TEI: {TTCN_Buffer buf; encode_oer_tag(*TransportInfo_transportAssociation_gtp__TEI_descr_.ber, p_buf); field_gtp__TEI->OER_encode(TransportInfo_transportAssociation_gtp__TEI_descr_, buf); p_buf.put_buf(buf); break; } case ALT_bindingID: {TTCN_Buffer buf; encode_oer_tag(*TransportInfo_transportAssociation_bindingID_descr_.ber, p_buf); field_bindingID->OER_encode(TransportInfo_transportAssociation_bindingID_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.TransportInfo.transportAssociation."); return -1; } return 0; } int TransportInfo_transportAssociation::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 (TransportInfo_transportAssociation_gtp__TEI_descr_.ber->tags[TransportInfo_transportAssociation_gtp__TEI_descr_.ber->n_tags-1].tagclass == descr.tagclass && TransportInfo_transportAssociation_gtp__TEI_descr_.ber->tags[TransportInfo_transportAssociation_gtp__TEI_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { gtp__TEI().OER_decode(TransportInfo_transportAssociation_gtp__TEI_descr_, p_buf, p_oer); } else if (TransportInfo_transportAssociation_bindingID_descr_.ber->tags[TransportInfo_transportAssociation_bindingID_descr_.ber->n_tags-1].tagclass == descr.tagclass && TransportInfo_transportAssociation_bindingID_descr_.ber->tags[TransportInfo_transportAssociation_bindingID_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { bindingID().OER_decode(TransportInfo_transportAssociation_bindingID_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type TransportInfo_transportAssociation"); } return 0; } void TransportInfo_transportAssociation::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_gtp__TEI: { INTEGER::PER_encode_int(p_buf, 0, 1); field_gtp__TEI->PER_encode(TransportInfo_transportAssociation_gtp__TEI_descr_, p_buf, p_options); break; } case ALT_bindingID: { INTEGER::PER_encode_int(p_buf, 1, 1); field_bindingID->PER_encode(TransportInfo_transportAssociation_bindingID_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 TransportInfo_transportAssociation::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, 1, FALSE, sel_int); switch (sel_int) { case 0: gtp__TEI().PER_decode(TransportInfo_transportAssociation_gtp__TEI_descr_, p_buf, p_options); break; case 1: bindingID().PER_decode(TransportInfo_transportAssociation_bindingID_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 TransportInfo_transportAssociation_template::copy_value(const TransportInfo_transportAssociation& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case TransportInfo_transportAssociation::ALT_gtp__TEI: single_value.field_gtp__TEI = new OCTETSTRING_template(other_value.gtp__TEI()); break; case TransportInfo_transportAssociation::ALT_bindingID: single_value.field_bindingID = new OCTETSTRING_template(other_value.bindingID()); break; default: TTCN_error("Initializing a template with an unbound value of type @HNBAP-IEs.TransportInfo.transportAssociation."); } set_selection(SPECIFIC_VALUE); } void TransportInfo_transportAssociation_template::copy_template(const TransportInfo_transportAssociation_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 TransportInfo_transportAssociation::ALT_gtp__TEI: single_value.field_gtp__TEI = new OCTETSTRING_template(*other_value.single_value.field_gtp__TEI); break; case TransportInfo_transportAssociation::ALT_bindingID: single_value.field_bindingID = new OCTETSTRING_template(*other_value.single_value.field_bindingID); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @HNBAP-IEs.TransportInfo.transportAssociation."); } 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 TransportInfo_transportAssociation_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 TransportInfo_transportAssociation_template(*other_value.implication_.precondition); implication_.implied_template = new TransportInfo_transportAssociation_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 @HNBAP-IEs.TransportInfo.transportAssociation."); } set_selection(other_value); } TransportInfo_transportAssociation_template::TransportInfo_transportAssociation_template() { } TransportInfo_transportAssociation_template::TransportInfo_transportAssociation_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TransportInfo_transportAssociation_template::TransportInfo_transportAssociation_template(const TransportInfo_transportAssociation& other_value) { copy_value(other_value); } TransportInfo_transportAssociation_template::TransportInfo_transportAssociation_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TransportInfo_transportAssociation&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-IEs.TransportInfo.transportAssociation from an unbound optional field."); } } TransportInfo_transportAssociation_template::TransportInfo_transportAssociation_template(TransportInfo_transportAssociation_template* p_precondition, TransportInfo_transportAssociation_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TransportInfo_transportAssociation_template::TransportInfo_transportAssociation_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; } TransportInfo_transportAssociation_template::TransportInfo_transportAssociation_template(const TransportInfo_transportAssociation_template& other_value) : Base_Template(){ copy_template(other_value); } TransportInfo_transportAssociation_template::~TransportInfo_transportAssociation_template() { clean_up(); } void TransportInfo_transportAssociation_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case TransportInfo_transportAssociation::ALT_gtp__TEI: delete single_value.field_gtp__TEI; break; case TransportInfo_transportAssociation::ALT_bindingID: delete single_value.field_bindingID; 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; } TransportInfo_transportAssociation_template& TransportInfo_transportAssociation_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TransportInfo_transportAssociation_template& TransportInfo_transportAssociation_template::operator=(const TransportInfo_transportAssociation& other_value) { clean_up(); copy_value(other_value); return *this; } TransportInfo_transportAssociation_template& TransportInfo_transportAssociation_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TransportInfo_transportAssociation&)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 @HNBAP-IEs.TransportInfo.transportAssociation."); } return *this; } TransportInfo_transportAssociation_template& TransportInfo_transportAssociation_template::operator=(const TransportInfo_transportAssociation_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TransportInfo_transportAssociation_template::match(const TransportInfo_transportAssociation& 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: { TransportInfo_transportAssociation::union_selection_type value_selection = other_value.get_selection(); if (value_selection == TransportInfo_transportAssociation::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case TransportInfo_transportAssociation::ALT_gtp__TEI: return single_value.field_gtp__TEI->match(other_value.gtp__TEI(), legacy); case TransportInfo_transportAssociation::ALT_bindingID: return single_value.field_bindingID->match(other_value.bindingID(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); } } 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 @HNBAP-IEs.TransportInfo.transportAssociation."); } return FALSE; } boolean TransportInfo_transportAssociation_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case TransportInfo_transportAssociation::ALT_gtp__TEI: return single_value.field_gtp__TEI->is_value(); case TransportInfo_transportAssociation::ALT_bindingID: return single_value.field_bindingID->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); } } TransportInfo_transportAssociation TransportInfo_transportAssociation_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 @HNBAP-IEs.TransportInfo.transportAssociation."); TransportInfo_transportAssociation ret_val; switch (single_value.union_selection) { case TransportInfo_transportAssociation::ALT_gtp__TEI: ret_val.gtp__TEI() = single_value.field_gtp__TEI->valueof(); break; case TransportInfo_transportAssociation::ALT_bindingID: ret_val.bindingID() = single_value.field_bindingID->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); } return ret_val; } TransportInfo_transportAssociation_template& TransportInfo_transportAssociation_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 @HNBAP-IEs.TransportInfo.transportAssociation."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); return value_list.list_value[list_index]; } void TransportInfo_transportAssociation_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 @HNBAP-IEs.TransportInfo.transportAssociation."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TransportInfo_transportAssociation_template[list_length]; } OCTETSTRING_template& TransportInfo_transportAssociation_template::gtp__TEI() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TransportInfo_transportAssociation::ALT_gtp__TEI) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_gtp__TEI = new OCTETSTRING_template(ANY_VALUE); else single_value.field_gtp__TEI = new OCTETSTRING_template; single_value.union_selection = TransportInfo_transportAssociation::ALT_gtp__TEI; set_selection(SPECIFIC_VALUE); } return *single_value.field_gtp__TEI; } const OCTETSTRING_template& TransportInfo_transportAssociation_template::gtp__TEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gtp_TEI in a non-specific template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); if (single_value.union_selection != TransportInfo_transportAssociation::ALT_gtp__TEI) TTCN_error("Accessing non-selected field gtp_TEI in a template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); return *single_value.field_gtp__TEI; } OCTETSTRING_template& TransportInfo_transportAssociation_template::bindingID() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TransportInfo_transportAssociation::ALT_bindingID) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_bindingID = new OCTETSTRING_template(ANY_VALUE); else single_value.field_bindingID = new OCTETSTRING_template; single_value.union_selection = TransportInfo_transportAssociation::ALT_bindingID; set_selection(SPECIFIC_VALUE); } return *single_value.field_bindingID; } const OCTETSTRING_template& TransportInfo_transportAssociation_template::bindingID() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bindingID in a non-specific template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); if (single_value.union_selection != TransportInfo_transportAssociation::ALT_bindingID) TTCN_error("Accessing non-selected field bindingID in a template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); return *single_value.field_bindingID; } boolean TransportInfo_transportAssociation_template::ischosen(TransportInfo_transportAssociation::union_selection_type checked_selection) const { if (checked_selection == TransportInfo_transportAssociation::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-IEs.TransportInfo.transportAssociation."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == TransportInfo_transportAssociation::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); 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 @HNBAP-IEs.TransportInfo.transportAssociation 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 TransportInfo_transportAssociation_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case TransportInfo_transportAssociation::ALT_gtp__TEI: TTCN_Logger::log_event_str("{ gtp_TEI := "); single_value.field_gtp__TEI->log(); TTCN_Logger::log_event_str(" }"); break; case TransportInfo_transportAssociation::ALT_bindingID: TTCN_Logger::log_event_str("{ bindingID := "); single_value.field_bindingID->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 TransportInfo_transportAssociation_template::log_match(const TransportInfo_transportAssociation& 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 TransportInfo_transportAssociation::ALT_gtp__TEI: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".gtp_TEI"); single_value.field_gtp__TEI->log_match(match_value.gtp__TEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ gtp_TEI := "); single_value.field_gtp__TEI->log_match(match_value.gtp__TEI(), legacy); TTCN_Logger::log_event_str(" }"); } break; case TransportInfo_transportAssociation::ALT_bindingID: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".bindingID"); single_value.field_bindingID->log_match(match_value.bindingID(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ bindingID := "); single_value.field_bindingID->log_match(match_value.bindingID(), 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 TransportInfo_transportAssociation_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case TransportInfo_transportAssociation::ALT_gtp__TEI: single_value.field_gtp__TEI->set_implicit_omit(); break; case TransportInfo_transportAssociation::ALT_bindingID: single_value.field_bindingID->set_implicit_omit(); break; default: break; } } void TransportInfo_transportAssociation_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 TransportInfo_transportAssociation::ALT_gtp__TEI: single_value.field_gtp__TEI->encode_text(text_buf); break; case TransportInfo_transportAssociation::ALT_bindingID: single_value.field_bindingID->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); } 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 @HNBAP-IEs.TransportInfo.transportAssociation."); } } void TransportInfo_transportAssociation_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = TransportInfo_transportAssociation::UNBOUND_VALUE; TransportInfo_transportAssociation::union_selection_type new_selection = (TransportInfo_transportAssociation::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case TransportInfo_transportAssociation::ALT_gtp__TEI: single_value.field_gtp__TEI = new OCTETSTRING_template; single_value.field_gtp__TEI->decode_text(text_buf); break; case TransportInfo_transportAssociation::ALT_bindingID: single_value.field_bindingID = new OCTETSTRING_template; single_value.field_bindingID->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @HNBAP-IEs.TransportInfo.transportAssociation."); } 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 TransportInfo_transportAssociation_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 @HNBAP-IEs.TransportInfo.transportAssociation."); } } boolean TransportInfo_transportAssociation_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TransportInfo_transportAssociation_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 `@HNBAP-IEs.TransportInfo.transportAssociation'"); } if (strcmp("gtp_TEI", param_field) == 0) { gtp__TEI().set_param(param); return; } else if (strcmp("bindingID", param_field) == 0) { bindingID().set_param(param); return; } else param.error("Field `%s' not found in union template type `@HNBAP-IEs.TransportInfo.transportAssociation'", 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: { TransportInfo_transportAssociation_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", "@HNBAP-IEs.TransportInfo.transportAssociation"); 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, "gtp_TEI")) { gtp__TEI().set_param(*mp_last); break; } if (!strcmp(last_name, "bindingID")) { bindingID().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.TransportInfo.transportAssociation.", last_name); } break; case Module_Param::MP_Implication_Template: { TransportInfo_transportAssociation_template* precondition = new TransportInfo_transportAssociation_template; precondition->set_param(*m_p->get_elem(0)); TransportInfo_transportAssociation_template* implied_template = new TransportInfo_transportAssociation_template; implied_template->set_param(*m_p->get_elem(1)); *this = TransportInfo_transportAssociation_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-IEs.TransportInfo.transportAssociation"); } is_ifpresent = param.get_ifpresent(); } void TransportInfo_transportAssociation_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 TransportInfo_transportAssociation::ALT_gtp__TEI: single_value.field_gtp__TEI->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.TransportInfo.transportAssociation"); return; case TransportInfo_transportAssociation::ALT_bindingID: single_value.field_bindingID->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.TransportInfo.transportAssociation"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @HNBAP-IEs.TransportInfo.transportAssociation."); } 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 : "@HNBAP-IEs.TransportInfo.transportAssociation"); } TransportInfo::TransportInfo() { } TransportInfo::TransportInfo(const BITSTRING& par_transportLayerAddress, const TransportInfo_transportAssociation& par_transportAssociation, const OPTIONAL< _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 >& par_iE__Extensions) : field_transportLayerAddress(par_transportLayerAddress), field_transportAssociation(par_transportAssociation), field_iE__Extensions(par_iE__Extensions) { } TransportInfo::TransportInfo(const TransportInfo& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.TransportInfo."); if (other_value.transportLayerAddress().is_bound()) field_transportLayerAddress = other_value.transportLayerAddress(); else field_transportLayerAddress.clean_up(); if (other_value.transportAssociation().is_bound()) field_transportAssociation = other_value.transportAssociation(); else field_transportAssociation.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void TransportInfo::clean_up() { field_transportLayerAddress.clean_up(); field_transportAssociation.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* TransportInfo::get_descriptor() const { return &TransportInfo_descr_; } TransportInfo& TransportInfo::operator=(const TransportInfo& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.TransportInfo."); if (other_value.transportLayerAddress().is_bound()) field_transportLayerAddress = other_value.transportLayerAddress(); else field_transportLayerAddress.clean_up(); if (other_value.transportAssociation().is_bound()) field_transportAssociation = other_value.transportAssociation(); else field_transportAssociation.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 TransportInfo::operator==(const TransportInfo& other_value) const { return field_transportLayerAddress==other_value.field_transportLayerAddress && field_transportAssociation==other_value.field_transportAssociation && field_iE__Extensions==other_value.field_iE__Extensions; } boolean TransportInfo::is_bound() const { return (field_transportLayerAddress.is_bound()) || (field_transportAssociation.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean TransportInfo::is_value() const { return field_transportLayerAddress.is_value() && field_transportAssociation.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int TransportInfo::size_of() const { int ret_val = 2; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void TransportInfo::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ transportLayerAddress := "); field_transportLayerAddress.log(); TTCN_Logger::log_event_str(", transportAssociation := "); field_transportAssociation.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void TransportInfo::set_implicit_omit() { if (transportLayerAddress().is_bound()) transportLayerAddress().set_implicit_omit(); if (transportAssociation().is_bound()) transportAssociation().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void TransportInfo::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) transportLayerAddress().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) transportAssociation().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "transportLayerAddress")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { transportLayerAddress().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "transportAssociation")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { transportAssociation().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 @HNBAP-IEs.TransportInfo: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.TransportInfo"); } } void TransportInfo::encode_text(Text_Buf& text_buf) const { field_transportLayerAddress.encode_text(text_buf); field_transportAssociation.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void TransportInfo::decode_text(Text_Buf& text_buf) { field_transportLayerAddress.decode_text(text_buf); field_transportAssociation.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void TransportInfo::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 TransportInfo::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* TransportInfo::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("transportLayerAddress': "); new_tlv->add_TLV(field_transportLayerAddress.BER_encode_TLV(TransportInfo_transportLayerAddress_descr_, p_coding)); ec_1.set_msg("transportAssociation': "); new_tlv->add_TLV(field_transportAssociation.BER_encode_TLV(TransportInfo_transportAssociation_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(TransportInfo_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean TransportInfo::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 '@HNBAP-IEs.TransportInfo' 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("transportLayerAddress': "); 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_transportLayerAddress.BER_decode_TLV(TransportInfo_transportLayerAddress_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("transportAssociation': "); 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_transportAssociation.BER_decode_TLV(TransportInfo_transportAssociation_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(TransportInfo_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 TransportInfo::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 @HNBAP-IEs.TransportInfo."); 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, "transportLayerAddress"); enc_len += field_transportLayerAddress.JSON_encode(TransportInfo_transportLayerAddress_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "transportAssociation"); enc_len += field_transportAssociation.JSON_encode(TransportInfo_transportAssociation_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(TransportInfo_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int TransportInfo::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 transportLayerAddress_found = FALSE; boolean transportAssociation_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 (21 == name_len && 0 == strncmp(fld_name, "transportLayerAddress", name_len)) { transportLayerAddress_found = TRUE; int ret_val = field_transportLayerAddress.JSON_decode(TransportInfo_transportLayerAddress_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, 21, "transportLayerAddress"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (20 == name_len && 0 == strncmp(fld_name, "transportAssociation", name_len)) { transportAssociation_found = TRUE; int ret_val = field_transportAssociation.JSON_decode(TransportInfo_transportAssociation_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, "transportAssociation"); } 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(TransportInfo_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 (!transportLayerAddress_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "transportLayerAddress"); return JSON_ERROR_FATAL; } if (!transportAssociation_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "transportAssociation"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int TransportInfo::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_transportLayerAddress.OER_encode(TransportInfo_transportLayerAddress_descr_, p_buf); field_transportAssociation.OER_encode(TransportInfo_transportAssociation_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(TransportInfo_iE__Extensions_descr_, p_buf); return 0; } int TransportInfo::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_transportLayerAddress.OER_decode(TransportInfo_transportLayerAddress_descr_, p_buf, p_oer); field_transportAssociation.OER_decode(TransportInfo_transportAssociation_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(TransportInfo_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 TransportInfo::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_transportLayerAddress.PER_encode(TransportInfo_transportLayerAddress_descr_, p_buf, p_options); field_transportAssociation.PER_encode(TransportInfo_transportAssociation_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(TransportInfo_iE__Extensions_descr_, p_buf, p_options); } void TransportInfo::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_transportLayerAddress.PER_decode(TransportInfo_transportLayerAddress_descr_, p_buf, p_options); field_transportAssociation.PER_decode(TransportInfo_transportAssociation_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(TransportInfo_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 TransportInfo_template::single_value_struct { BITSTRING_template field_transportLayerAddress; TransportInfo_transportAssociation_template field_transportAssociation; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template field_iE__Extensions; }; void TransportInfo_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_transportLayerAddress = ANY_VALUE; single_value->field_transportAssociation = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void TransportInfo_template::copy_value(const TransportInfo& other_value) { single_value = new single_value_struct; if (other_value.transportLayerAddress().is_bound()) { single_value->field_transportLayerAddress = other_value.transportLayerAddress(); } else { single_value->field_transportLayerAddress.clean_up(); } if (other_value.transportAssociation().is_bound()) { single_value->field_transportAssociation = other_value.transportAssociation(); } else { single_value->field_transportAssociation.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 TransportInfo_template::copy_template(const TransportInfo_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.transportLayerAddress().get_selection()) { single_value->field_transportLayerAddress = other_value.transportLayerAddress(); } else { single_value->field_transportLayerAddress.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.transportAssociation().get_selection()) { single_value->field_transportAssociation = other_value.transportAssociation(); } else { single_value->field_transportAssociation.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 TransportInfo_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 TransportInfo_template(*other_value.implication_.precondition); implication_.implied_template = new TransportInfo_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 @HNBAP-IEs.TransportInfo."); break; } set_selection(other_value); } TransportInfo_template::TransportInfo_template() { } TransportInfo_template::TransportInfo_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TransportInfo_template::TransportInfo_template(const TransportInfo& other_value) { copy_value(other_value); } TransportInfo_template::TransportInfo_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TransportInfo&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.TransportInfo from an unbound optional field."); } } TransportInfo_template::TransportInfo_template(TransportInfo_template* p_precondition, TransportInfo_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TransportInfo_template::TransportInfo_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; } TransportInfo_template::TransportInfo_template(const TransportInfo_template& other_value) : Base_Template() { copy_template(other_value); } TransportInfo_template::~TransportInfo_template() { clean_up(); } TransportInfo_template& TransportInfo_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TransportInfo_template& TransportInfo_template::operator=(const TransportInfo& other_value) { clean_up(); copy_value(other_value); return *this; } TransportInfo_template& TransportInfo_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TransportInfo&)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 @HNBAP-IEs.TransportInfo."); } return *this; } TransportInfo_template& TransportInfo_template::operator=(const TransportInfo_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TransportInfo_template::match(const TransportInfo& 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.transportLayerAddress().is_bound()) return FALSE; if(!single_value->field_transportLayerAddress.match(other_value.transportLayerAddress(), legacy))return FALSE; if(!other_value.transportAssociation().is_bound()) return FALSE; if(!single_value->field_transportAssociation.match(other_value.transportAssociation(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16&)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 @HNBAP-IEs.TransportInfo."); } return FALSE; } boolean TransportInfo_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_transportLayerAddress.is_bound() || single_value->field_transportAssociation.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean TransportInfo_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_transportLayerAddress.is_value() && single_value->field_transportAssociation.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void TransportInfo_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; } TransportInfo TransportInfo_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 @HNBAP-IEs.TransportInfo."); TransportInfo ret_val; if (single_value->field_transportLayerAddress.is_bound()) { ret_val.transportLayerAddress() = single_value->field_transportLayerAddress.valueof(); } if (single_value->field_transportAssociation.is_bound()) { ret_val.transportAssociation() = single_value->field_transportAssociation.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 TransportInfo_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 @HNBAP-IEs.TransportInfo."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TransportInfo_template[list_length]; } TransportInfo_template& TransportInfo_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 @HNBAP-IEs.TransportInfo."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.TransportInfo."); return value_list.list_value[list_index]; } BITSTRING_template& TransportInfo_template::transportLayerAddress() { set_specific(); return single_value->field_transportLayerAddress; } const BITSTRING_template& TransportInfo_template::transportLayerAddress() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field transportLayerAddress of a non-specific template of type @HNBAP-IEs.TransportInfo."); return single_value->field_transportLayerAddress; } TransportInfo_transportAssociation_template& TransportInfo_template::transportAssociation() { set_specific(); return single_value->field_transportAssociation; } const TransportInfo_transportAssociation_template& TransportInfo_template::transportAssociation() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field transportAssociation of a non-specific template of type @HNBAP-IEs.TransportInfo."); return single_value->field_transportAssociation; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& TransportInfo_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& TransportInfo_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.TransportInfo."); return single_value->field_iE__Extensions; } int TransportInfo_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TransportInfo which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 2; 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 @HNBAP-IEs.TransportInfo 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 @HNBAP-IEs.TransportInfo containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TransportInfo containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TransportInfo containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TransportInfo containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TransportInfo containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TransportInfo containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TransportInfo containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.TransportInfo."); } return 0; } void TransportInfo_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ transportLayerAddress := "); single_value->field_transportLayerAddress.log(); TTCN_Logger::log_event_str(", transportAssociation := "); single_value->field_transportAssociation.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 TransportInfo_template::log_match(const TransportInfo& 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_transportLayerAddress.match(match_value.transportLayerAddress(), legacy)){ TTCN_Logger::log_logmatch_info(".transportLayerAddress"); single_value->field_transportLayerAddress.log_match(match_value.transportLayerAddress(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_transportAssociation.match(match_value.transportAssociation(), legacy)){ TTCN_Logger::log_logmatch_info(".transportAssociation"); single_value->field_transportAssociation.log_match(match_value.transportAssociation(), 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("{ transportLayerAddress := "); single_value->field_transportLayerAddress.log_match(match_value.transportLayerAddress(), legacy); TTCN_Logger::log_event_str(", transportAssociation := "); single_value->field_transportAssociation.log_match(match_value.transportAssociation(), 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 TransportInfo_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (transportLayerAddress().is_bound()) transportLayerAddress().set_implicit_omit(); if (transportAssociation().is_bound()) transportAssociation().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void TransportInfo_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_transportLayerAddress.encode_text(text_buf); single_value->field_transportAssociation.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 @HNBAP-IEs.TransportInfo."); } } void TransportInfo_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_transportLayerAddress.decode_text(text_buf); single_value->field_transportAssociation.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 TransportInfo_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 @HNBAP-IEs.TransportInfo."); } } void TransportInfo_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: { TransportInfo_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) transportLayerAddress().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) transportAssociation().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "transportLayerAddress")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { transportLayerAddress().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "transportAssociation")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { transportAssociation().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 @HNBAP-IEs.TransportInfo: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TransportInfo_template* precondition = new TransportInfo_template; precondition->set_param(*param.get_elem(0)); TransportInfo_template* implied_template = new TransportInfo_template; implied_template->set_param(*param.get_elem(1)); *this = TransportInfo_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.TransportInfo"); } is_ifpresent = param.get_ifpresent(); } void TransportInfo_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_transportLayerAddress.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.TransportInfo"); single_value->field_transportAssociation.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.TransportInfo"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.TransportInfo"); 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 : "@HNBAP-IEs.TransportInfo"); } boolean TransportInfo_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TransportInfo_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_iE__Extensions) : field_rAB__ID(par_rAB__ID), field_old__transport__Info(par_old__transport__Info), field_new__transport__Info(par_new__transport__Info), field_cn__domain__indicator(par_cn__domain__indicator), field_iE__Extensions(par_iE__Extensions) { } RABListItem::RABListItem(const RABListItem& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.RABListItem."); if (other_value.rAB__ID().is_bound()) field_rAB__ID = other_value.rAB__ID(); else field_rAB__ID.clean_up(); if (other_value.old__transport__Info().is_bound()) field_old__transport__Info = other_value.old__transport__Info(); else field_old__transport__Info.clean_up(); if (other_value.new__transport__Info().is_bound()) field_new__transport__Info = other_value.new__transport__Info(); else field_new__transport__Info.clean_up(); if (other_value.cn__domain__indicator().is_bound()) field_cn__domain__indicator = other_value.cn__domain__indicator(); else field_cn__domain__indicator.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void RABListItem::clean_up() { field_rAB__ID.clean_up(); field_old__transport__Info.clean_up(); field_new__transport__Info.clean_up(); field_cn__domain__indicator.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* RABListItem::get_descriptor() const { return &RABListItem_descr_; } RABListItem& RABListItem::operator=(const RABListItem& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.RABListItem."); if (other_value.rAB__ID().is_bound()) field_rAB__ID = other_value.rAB__ID(); else field_rAB__ID.clean_up(); if (other_value.old__transport__Info().is_bound()) field_old__transport__Info = other_value.old__transport__Info(); else field_old__transport__Info.clean_up(); if (other_value.new__transport__Info().is_bound()) field_new__transport__Info = other_value.new__transport__Info(); else field_new__transport__Info.clean_up(); if (other_value.cn__domain__indicator().is_bound()) field_cn__domain__indicator = other_value.cn__domain__indicator(); else field_cn__domain__indicator.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 RABListItem::operator==(const RABListItem& other_value) const { return field_rAB__ID==other_value.field_rAB__ID && field_old__transport__Info==other_value.field_old__transport__Info && field_new__transport__Info==other_value.field_new__transport__Info && field_cn__domain__indicator==other_value.field_cn__domain__indicator && field_iE__Extensions==other_value.field_iE__Extensions; } boolean RABListItem::is_bound() const { return (field_rAB__ID.is_bound()) || (field_old__transport__Info.is_bound()) || (field_new__transport__Info.is_bound()) || (field_cn__domain__indicator.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean RABListItem::is_value() const { return field_rAB__ID.is_value() && field_old__transport__Info.is_value() && field_new__transport__Info.is_value() && field_cn__domain__indicator.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int RABListItem::size_of() const { int ret_val = 4; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void RABListItem::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ rAB_ID := "); field_rAB__ID.log(); TTCN_Logger::log_event_str(", old_transport_Info := "); field_old__transport__Info.log(); TTCN_Logger::log_event_str(", new_transport_Info := "); field_new__transport__Info.log(); TTCN_Logger::log_event_str(", cn_domain_indicator := "); field_cn__domain__indicator.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void RABListItem::set_implicit_omit() { if (rAB__ID().is_bound()) rAB__ID().set_implicit_omit(); if (old__transport__Info().is_bound()) old__transport__Info().set_implicit_omit(); if (new__transport__Info().is_bound()) new__transport__Info().set_implicit_omit(); if (cn__domain__indicator().is_bound()) cn__domain__indicator().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void RABListItem::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) rAB__ID().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) old__transport__Info().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) new__transport__Info().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cn__domain__indicator().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(), "rAB_ID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rAB__ID().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "old_transport_Info")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { old__transport__Info().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "new_transport_Info")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { new__transport__Info().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_domain_indicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__domain__indicator().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 @HNBAP-IEs.RABListItem: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.RABListItem"); } } void RABListItem::encode_text(Text_Buf& text_buf) const { field_rAB__ID.encode_text(text_buf); field_old__transport__Info.encode_text(text_buf); field_new__transport__Info.encode_text(text_buf); field_cn__domain__indicator.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void RABListItem::decode_text(Text_Buf& text_buf) { field_rAB__ID.decode_text(text_buf); field_old__transport__Info.decode_text(text_buf); field_new__transport__Info.decode_text(text_buf); field_cn__domain__indicator.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void RABListItem::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 RABListItem::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* RABListItem::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("rAB_ID': "); new_tlv->add_TLV(field_rAB__ID.BER_encode_TLV(RABListItem_rAB__ID_descr_, p_coding)); ec_1.set_msg("old_transport_Info': "); new_tlv->add_TLV(field_old__transport__Info.BER_encode_TLV(RABListItem_old__transport__Info_descr_, p_coding)); ec_1.set_msg("new_transport_Info': "); new_tlv->add_TLV(field_new__transport__Info.BER_encode_TLV(RABListItem_new__transport__Info_descr_, p_coding)); ec_1.set_msg("cn_domain_indicator': "); new_tlv->add_TLV(field_cn__domain__indicator.BER_encode_TLV(RABListItem_cn__domain__indicator_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(RABListItem_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean RABListItem::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 '@HNBAP-IEs.RABListItem' 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("rAB_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_rAB__ID.BER_decode_TLV(RABListItem_rAB__ID_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("old_transport_Info': "); 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_old__transport__Info.BER_decode_TLV(RABListItem_old__transport__Info_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("new_transport_Info': "); 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_new__transport__Info.BER_decode_TLV(RABListItem_new__transport__Info_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("cn_domain_indicator': "); 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__domain__indicator.BER_decode_TLV(RABListItem_cn__domain__indicator_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(RABListItem_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 RABListItem::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 @HNBAP-IEs.RABListItem."); 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, "rAB_ID"); enc_len += field_rAB__ID.JSON_encode(RABListItem_rAB__ID_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "old_transport_Info"); enc_len += field_old__transport__Info.JSON_encode(RABListItem_old__transport__Info_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "new_transport_Info"); enc_len += field_new__transport__Info.JSON_encode(RABListItem_new__transport__Info_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "cn_domain_indicator"); enc_len += field_cn__domain__indicator.JSON_encode(RABListItem_cn__domain__indicator_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(RABListItem_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int RABListItem::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 rAB__ID_found = FALSE; boolean old__transport__Info_found = FALSE; boolean new__transport__Info_found = FALSE; boolean cn__domain__indicator_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 (6 == name_len && 0 == strncmp(fld_name, "rAB_ID", name_len)) { rAB__ID_found = TRUE; int ret_val = field_rAB__ID.JSON_decode(RABListItem_rAB__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, 6, "rAB_ID"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (18 == name_len && 0 == strncmp(fld_name, "old_transport_Info", name_len)) { old__transport__Info_found = TRUE; int ret_val = field_old__transport__Info.JSON_decode(RABListItem_old__transport__Info_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, 18, "old_transport_Info"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (18 == name_len && 0 == strncmp(fld_name, "new_transport_Info", name_len)) { new__transport__Info_found = TRUE; int ret_val = field_new__transport__Info.JSON_decode(RABListItem_new__transport__Info_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, 18, "new_transport_Info"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (19 == name_len && 0 == strncmp(fld_name, "cn_domain_indicator", name_len)) { cn__domain__indicator_found = TRUE; int ret_val = field_cn__domain__indicator.JSON_decode(RABListItem_cn__domain__indicator_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, "cn_domain_indicator"); } 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(RABListItem_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 (!rAB__ID_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "rAB_ID"); return JSON_ERROR_FATAL; } if (!old__transport__Info_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "old_transport_Info"); return JSON_ERROR_FATAL; } if (!new__transport__Info_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "new_transport_Info"); return JSON_ERROR_FATAL; } if (!cn__domain__indicator_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "cn_domain_indicator"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int RABListItem::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_rAB__ID.OER_encode(RABListItem_rAB__ID_descr_, p_buf); field_old__transport__Info.OER_encode(RABListItem_old__transport__Info_descr_, p_buf); field_new__transport__Info.OER_encode(RABListItem_new__transport__Info_descr_, p_buf); field_cn__domain__indicator.OER_encode(RABListItem_cn__domain__indicator_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(RABListItem_iE__Extensions_descr_, p_buf); return 0; } int RABListItem::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_rAB__ID.OER_decode(RABListItem_rAB__ID_descr_, p_buf, p_oer); field_old__transport__Info.OER_decode(RABListItem_old__transport__Info_descr_, p_buf, p_oer); field_new__transport__Info.OER_decode(RABListItem_new__transport__Info_descr_, p_buf, p_oer); field_cn__domain__indicator.OER_decode(RABListItem_cn__domain__indicator_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(RABListItem_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 RABListItem::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_rAB__ID.PER_encode(RABListItem_rAB__ID_descr_, p_buf, p_options); field_old__transport__Info.PER_encode(RABListItem_old__transport__Info_descr_, p_buf, p_options); field_new__transport__Info.PER_encode(RABListItem_new__transport__Info_descr_, p_buf, p_options); field_cn__domain__indicator.PER_encode(RABListItem_cn__domain__indicator_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(RABListItem_iE__Extensions_descr_, p_buf, p_options); } void RABListItem::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_rAB__ID.PER_decode(RABListItem_rAB__ID_descr_, p_buf, p_options); field_old__transport__Info.PER_decode(RABListItem_old__transport__Info_descr_, p_buf, p_options); field_new__transport__Info.PER_decode(RABListItem_new__transport__Info_descr_, p_buf, p_options); field_cn__domain__indicator.PER_decode(RABListItem_cn__domain__indicator_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(RABListItem_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 RABListItem_template::single_value_struct { BITSTRING_template field_rAB__ID; TransportInfo_template field_old__transport__Info; TransportInfo_template field_new__transport__Info; CN__DomainIndicator_template field_cn__domain__indicator; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template field_iE__Extensions; }; void RABListItem_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_rAB__ID = ANY_VALUE; single_value->field_old__transport__Info = ANY_VALUE; single_value->field_new__transport__Info = ANY_VALUE; single_value->field_cn__domain__indicator = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void RABListItem_template::copy_value(const RABListItem& other_value) { single_value = new single_value_struct; if (other_value.rAB__ID().is_bound()) { single_value->field_rAB__ID = other_value.rAB__ID(); } else { single_value->field_rAB__ID.clean_up(); } if (other_value.old__transport__Info().is_bound()) { single_value->field_old__transport__Info = other_value.old__transport__Info(); } else { single_value->field_old__transport__Info.clean_up(); } if (other_value.new__transport__Info().is_bound()) { single_value->field_new__transport__Info = other_value.new__transport__Info(); } else { single_value->field_new__transport__Info.clean_up(); } if (other_value.cn__domain__indicator().is_bound()) { single_value->field_cn__domain__indicator = other_value.cn__domain__indicator(); } else { single_value->field_cn__domain__indicator.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 RABListItem_template::copy_template(const RABListItem_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.rAB__ID().get_selection()) { single_value->field_rAB__ID = other_value.rAB__ID(); } else { single_value->field_rAB__ID.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.old__transport__Info().get_selection()) { single_value->field_old__transport__Info = other_value.old__transport__Info(); } else { single_value->field_old__transport__Info.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.new__transport__Info().get_selection()) { single_value->field_new__transport__Info = other_value.new__transport__Info(); } else { single_value->field_new__transport__Info.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cn__domain__indicator().get_selection()) { single_value->field_cn__domain__indicator = other_value.cn__domain__indicator(); } else { single_value->field_cn__domain__indicator.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 RABListItem_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 RABListItem_template(*other_value.implication_.precondition); implication_.implied_template = new RABListItem_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 @HNBAP-IEs.RABListItem."); break; } set_selection(other_value); } RABListItem_template::RABListItem_template() { } RABListItem_template::RABListItem_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } RABListItem_template::RABListItem_template(const RABListItem& other_value) { copy_value(other_value); } RABListItem_template::RABListItem_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RABListItem&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.RABListItem from an unbound optional field."); } } RABListItem_template::RABListItem_template(RABListItem_template* p_precondition, RABListItem_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } RABListItem_template::RABListItem_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; } RABListItem_template::RABListItem_template(const RABListItem_template& other_value) : Base_Template() { copy_template(other_value); } RABListItem_template::~RABListItem_template() { clean_up(); } RABListItem_template& RABListItem_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } RABListItem_template& RABListItem_template::operator=(const RABListItem& other_value) { clean_up(); copy_value(other_value); return *this; } RABListItem_template& RABListItem_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const RABListItem&)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 @HNBAP-IEs.RABListItem."); } return *this; } RABListItem_template& RABListItem_template::operator=(const RABListItem_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean RABListItem_template::match(const RABListItem& 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.rAB__ID().is_bound()) return FALSE; if(!single_value->field_rAB__ID.match(other_value.rAB__ID(), legacy))return FALSE; if(!other_value.old__transport__Info().is_bound()) return FALSE; if(!single_value->field_old__transport__Info.match(other_value.old__transport__Info(), legacy))return FALSE; if(!other_value.new__transport__Info().is_bound()) return FALSE; if(!single_value->field_new__transport__Info.match(other_value.new__transport__Info(), legacy))return FALSE; if(!other_value.cn__domain__indicator().is_bound()) return FALSE; if(!single_value->field_cn__domain__indicator.match(other_value.cn__domain__indicator(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17&)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 @HNBAP-IEs.RABListItem."); } return FALSE; } boolean RABListItem_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_rAB__ID.is_bound() || single_value->field_old__transport__Info.is_bound() || single_value->field_new__transport__Info.is_bound() || single_value->field_cn__domain__indicator.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean RABListItem_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_rAB__ID.is_value() && single_value->field_old__transport__Info.is_value() && single_value->field_new__transport__Info.is_value() && single_value->field_cn__domain__indicator.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void RABListItem_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; } RABListItem RABListItem_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 @HNBAP-IEs.RABListItem."); RABListItem ret_val; if (single_value->field_rAB__ID.is_bound()) { ret_val.rAB__ID() = single_value->field_rAB__ID.valueof(); } if (single_value->field_old__transport__Info.is_bound()) { ret_val.old__transport__Info() = single_value->field_old__transport__Info.valueof(); } if (single_value->field_new__transport__Info.is_bound()) { ret_val.new__transport__Info() = single_value->field_new__transport__Info.valueof(); } if (single_value->field_cn__domain__indicator.is_bound()) { ret_val.cn__domain__indicator() = single_value->field_cn__domain__indicator.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 RABListItem_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 @HNBAP-IEs.RABListItem."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new RABListItem_template[list_length]; } RABListItem_template& RABListItem_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 @HNBAP-IEs.RABListItem."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.RABListItem."); return value_list.list_value[list_index]; } BITSTRING_template& RABListItem_template::rAB__ID() { set_specific(); return single_value->field_rAB__ID; } const BITSTRING_template& RABListItem_template::rAB__ID() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rAB_ID of a non-specific template of type @HNBAP-IEs.RABListItem."); return single_value->field_rAB__ID; } TransportInfo_template& RABListItem_template::old__transport__Info() { set_specific(); return single_value->field_old__transport__Info; } const TransportInfo_template& RABListItem_template::old__transport__Info() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field old_transport_Info of a non-specific template of type @HNBAP-IEs.RABListItem."); return single_value->field_old__transport__Info; } TransportInfo_template& RABListItem_template::new__transport__Info() { set_specific(); return single_value->field_new__transport__Info; } const TransportInfo_template& RABListItem_template::new__transport__Info() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field new_transport_Info of a non-specific template of type @HNBAP-IEs.RABListItem."); return single_value->field_new__transport__Info; } CN__DomainIndicator_template& RABListItem_template::cn__domain__indicator() { set_specific(); return single_value->field_cn__domain__indicator; } const CN__DomainIndicator_template& RABListItem_template::cn__domain__indicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cn_domain_indicator of a non-specific template of type @HNBAP-IEs.RABListItem."); return single_value->field_cn__domain__indicator; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& RABListItem_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& RABListItem_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.RABListItem."); return single_value->field_iE__Extensions; } int RABListItem_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RABListItem which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; 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 @HNBAP-IEs.RABListItem 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 @HNBAP-IEs.RABListItem containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RABListItem containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RABListItem containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RABListItem containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RABListItem containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RABListItem containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.RABListItem containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.RABListItem."); } return 0; } void RABListItem_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ rAB_ID := "); single_value->field_rAB__ID.log(); TTCN_Logger::log_event_str(", old_transport_Info := "); single_value->field_old__transport__Info.log(); TTCN_Logger::log_event_str(", new_transport_Info := "); single_value->field_new__transport__Info.log(); TTCN_Logger::log_event_str(", cn_domain_indicator := "); single_value->field_cn__domain__indicator.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 RABListItem_template::log_match(const RABListItem& 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_rAB__ID.match(match_value.rAB__ID(), legacy)){ TTCN_Logger::log_logmatch_info(".rAB_ID"); single_value->field_rAB__ID.log_match(match_value.rAB__ID(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_old__transport__Info.match(match_value.old__transport__Info(), legacy)){ TTCN_Logger::log_logmatch_info(".old_transport_Info"); single_value->field_old__transport__Info.log_match(match_value.old__transport__Info(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_new__transport__Info.match(match_value.new__transport__Info(), legacy)){ TTCN_Logger::log_logmatch_info(".new_transport_Info"); single_value->field_new__transport__Info.log_match(match_value.new__transport__Info(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cn__domain__indicator.match(match_value.cn__domain__indicator(), legacy)){ TTCN_Logger::log_logmatch_info(".cn_domain_indicator"); single_value->field_cn__domain__indicator.log_match(match_value.cn__domain__indicator(), 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("{ rAB_ID := "); single_value->field_rAB__ID.log_match(match_value.rAB__ID(), legacy); TTCN_Logger::log_event_str(", old_transport_Info := "); single_value->field_old__transport__Info.log_match(match_value.old__transport__Info(), legacy); TTCN_Logger::log_event_str(", new_transport_Info := "); single_value->field_new__transport__Info.log_match(match_value.new__transport__Info(), legacy); TTCN_Logger::log_event_str(", cn_domain_indicator := "); single_value->field_cn__domain__indicator.log_match(match_value.cn__domain__indicator(), 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 RABListItem_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (rAB__ID().is_bound()) rAB__ID().set_implicit_omit(); if (old__transport__Info().is_bound()) old__transport__Info().set_implicit_omit(); if (new__transport__Info().is_bound()) new__transport__Info().set_implicit_omit(); if (cn__domain__indicator().is_bound()) cn__domain__indicator().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void RABListItem_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_rAB__ID.encode_text(text_buf); single_value->field_old__transport__Info.encode_text(text_buf); single_value->field_new__transport__Info.encode_text(text_buf); single_value->field_cn__domain__indicator.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 @HNBAP-IEs.RABListItem."); } } void RABListItem_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_rAB__ID.decode_text(text_buf); single_value->field_old__transport__Info.decode_text(text_buf); single_value->field_new__transport__Info.decode_text(text_buf); single_value->field_cn__domain__indicator.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 RABListItem_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 @HNBAP-IEs.RABListItem."); } } void RABListItem_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: { RABListItem_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) rAB__ID().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) old__transport__Info().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) new__transport__Info().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) cn__domain__indicator().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(), "rAB_ID")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rAB__ID().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "old_transport_Info")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { old__transport__Info().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "new_transport_Info")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { new__transport__Info().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cn_domain_indicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cn__domain__indicator().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 @HNBAP-IEs.RABListItem: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { RABListItem_template* precondition = new RABListItem_template; precondition->set_param(*param.get_elem(0)); RABListItem_template* implied_template = new RABListItem_template; implied_template->set_param(*param.get_elem(1)); *this = RABListItem_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.RABListItem"); } is_ifpresent = param.get_ifpresent(); } void RABListItem_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_rAB__ID.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.RABListItem"); single_value->field_old__transport__Info.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.RABListItem"); single_value->field_new__transport__Info.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.RABListItem"); single_value->field_cn__domain__indicator.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.RABListItem"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.RABListItem"); 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 : "@HNBAP-IEs.RABListItem"); } boolean RABListItem_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean RABListItem_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx(int other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Registration-Cause."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.Registration-Cause comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean Registration__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 @HNBAP-IEs.Registration-Cause."); return enum_value > other_value; } boolean Registration__Cause::operator>(const Registration__Cause& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Registration-Cause."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Registration-Cause."); return enum_value > other_value.enum_value; } const char *Registration__Cause::enum_to_str(enum_type enum_par) { switch (enum_par) { case emergency__call: return "emergency_call"; case normal: return "normal"; case ue__relocation: return "ue_relocation"; default: return ""; } } Registration__Cause::enum_type Registration__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")) return normal; if (!strcmp(str_par, "ue_relocation")) return ue__relocation; } return UNKNOWN_VALUE; } boolean Registration__Cause::is_valid_enum(int int_par) { switch (int_par) { case 0: case 1: case 2: return TRUE; default: return FALSE; } } int Registration__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 @HNBAP-IEs.Registration-Cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int Registration__Cause::enum2int(const Registration__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 @HNBAP-IEs.Registration-Cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void Registration__Cause::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HNBAP-IEs.Registration-Cause.", int_val); enum_value = (enum_type)int_val; } Registration__Cause::operator Registration__Cause::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HNBAP-IEs.Registration-Cause."); return enum_value; } void Registration__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 Registration__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", "@HNBAP-IEs.Registration-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 @HNBAP-IEs.Registration-Cause."); } } void Registration__Cause::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HNBAP-IEs.Registration-Cause."); text_buf.push_int(enum_value); } void Registration__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 @HNBAP-IEs.Registration-Cause.", enum_value); } void Registration__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 Registration__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* Registration__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 Registration__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 @HNBAP-IEs.Registration-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 Registration__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 @HNBAP-IEs.Registration-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 Registration__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 Registration__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 @HNBAP-IEs.Registration-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 Registration__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 Registration__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: enc_val = 1; ext_bit = FALSE; break; case ue__relocation: enc_val = 0; ext_bit = TRUE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @HNBAP-IEs.Registration-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 Registration__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) { case 0: enum_value = ue__relocation; break; default: enum_value = UNBOUND_VALUE; break; } else switch (dec_int) { case 0: enum_value = emergency__call; break; case 1: enum_value = normal; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_INVAL_MSG, "Decoded invalid number (%d) for enumerated type @HNBAP-IEs.Registration-Cause.", dec_int); break; } } void Registration__Cause_template::copy_template(const Registration__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 Registration__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 Registration__Cause_template(*other_value.implication_.precondition); implication_.implied_template = new Registration__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 @HNBAP-IEs.Registration-Cause."); } } Registration__Cause_template::Registration__Cause_template() { } Registration__Cause_template::Registration__Cause_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Registration__Cause_template::Registration__Cause_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!Registration__Cause::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HNBAP-IEs.Registration-Cause with unknown numeric value %d.", other_value); single_value = (Registration__Cause::enum_type)other_value; } Registration__Cause_template::Registration__Cause_template(Registration__Cause::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } Registration__Cause_template::Registration__Cause_template(const Registration__Cause& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == Registration__Cause::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HNBAP-IEs.Registration-Cause."); single_value = other_value.enum_value; } Registration__Cause_template::Registration__Cause_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (Registration__Cause::enum_type)(const Registration__Cause&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @HNBAP-IEs.Registration-Cause from an unbound optional field."); } } Registration__Cause_template::Registration__Cause_template(Registration__Cause_template* p_precondition, Registration__Cause_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Registration__Cause_template::Registration__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; } Registration__Cause_template::Registration__Cause_template(const Registration__Cause_template& other_value) : Base_Template() { copy_template(other_value); } Registration__Cause_template::~Registration__Cause_template() { clean_up(); } boolean Registration__Cause_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean Registration__Cause_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != Registration__Cause::UNBOUND_VALUE; } void Registration__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; } Registration__Cause_template& Registration__Cause_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Registration__Cause_template& Registration__Cause_template::operator=(int other_value) { if (!Registration__Cause::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HNBAP-IEs.Registration-Cause.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (Registration__Cause::enum_type)other_value; return *this; } Registration__Cause_template& Registration__Cause_template::operator=(Registration__Cause::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } Registration__Cause_template& Registration__Cause_template::operator=(const Registration__Cause& other_value) { if (other_value.enum_value == Registration__Cause::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.Registration-Cause to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } Registration__Cause_template& Registration__Cause_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (Registration__Cause::enum_type)(const Registration__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 @HNBAP-IEs.Registration-Cause."); } return *this; } Registration__Cause_template& Registration__Cause_template::operator=(const Registration__Cause_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Registration__Cause_template::match(Registration__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 @HNBAP-IEs.Registration-Cause."); } return FALSE; } boolean Registration__Cause_template::match(const Registration__Cause& other_value, boolean) const { if (other_value.enum_value == Registration__Cause::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HNBAP-IEs.Registration-Cause with an unbound value."); return match(other_value.enum_value); } Registration__Cause::enum_type Registration__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 @HNBAP-IEs.Registration-Cause."); return single_value; } void Registration__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 Registration__Cause_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @HNBAP-IEs.Registration-Cause."); } } Registration__Cause_template& Registration__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 @HNBAP-IEs.Registration-Cause."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-IEs.Registration-Cause."); return value_list.list_value[list_index]; } void Registration__Cause_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(Registration__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 Registration__Cause_template::log_match(const Registration__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 Registration__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 @HNBAP-IEs.Registration-Cause."); } } void Registration__Cause_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (Registration__Cause::enum_type)text_buf.pull_int().get_val(); if (!Registration__Cause::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HNBAP-IEs.Registration-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 Registration__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 @HNBAP-IEs.Registration-Cause."); } } boolean Registration__Cause_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Registration__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: { Registration__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: { Registration__Cause::enum_type enum_val = Registration__Cause::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!Registration__Cause::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @HNBAP-IEs.Registration-Cause."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { Registration__Cause_template* precondition = new Registration__Cause_template; precondition->set_param(*m_p->get_elem(0)); Registration__Cause_template* implied_template = new Registration__Cause_template; implied_template->set_param(*m_p->get_elem(1)); *this = Registration__Cause_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@HNBAP-IEs.Registration-Cause"); } is_ifpresent = param.get_ifpresent(); } void Registration__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 : "@HNBAP-IEs.Registration-Cause"); } TMSILAI::TMSILAI() { } TMSILAI::TMSILAI(const BITSTRING& par_tMSI, const LAI& par_lAI) : field_tMSI(par_tMSI), field_lAI(par_lAI) { } TMSILAI::TMSILAI(const TMSILAI& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.TMSILAI."); if (other_value.tMSI().is_bound()) field_tMSI = other_value.tMSI(); else field_tMSI.clean_up(); if (other_value.lAI().is_bound()) field_lAI = other_value.lAI(); else field_lAI.clean_up(); } void TMSILAI::clean_up() { field_tMSI.clean_up(); field_lAI.clean_up(); } const TTCN_Typedescriptor_t* TMSILAI::get_descriptor() const { return &TMSILAI_descr_; } TMSILAI& TMSILAI::operator=(const TMSILAI& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.TMSILAI."); if (other_value.tMSI().is_bound()) field_tMSI = other_value.tMSI(); else field_tMSI.clean_up(); if (other_value.lAI().is_bound()) field_lAI = other_value.lAI(); else field_lAI.clean_up(); } return *this; } boolean TMSILAI::operator==(const TMSILAI& other_value) const { return field_tMSI==other_value.field_tMSI && field_lAI==other_value.field_lAI; } boolean TMSILAI::is_bound() const { return (field_tMSI.is_bound()) || (field_lAI.is_bound()); } boolean TMSILAI::is_value() const { return field_tMSI.is_value() && field_lAI.is_value(); } void TMSILAI::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ tMSI := "); field_tMSI.log(); TTCN_Logger::log_event_str(", lAI := "); field_lAI.log(); TTCN_Logger::log_event_str(" }"); } void TMSILAI::set_implicit_omit() { if (tMSI().is_bound()) tMSI().set_implicit_omit(); if (lAI().is_bound()) lAI().set_implicit_omit(); } void TMSILAI::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 (20 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) tMSI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lAI().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(), "tMSI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tMSI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lAI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.TMSILAI: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.TMSILAI"); } } void TMSILAI::encode_text(Text_Buf& text_buf) const { field_tMSI.encode_text(text_buf); field_lAI.encode_text(text_buf); } void TMSILAI::decode_text(Text_Buf& text_buf) { field_tMSI.decode_text(text_buf); field_lAI.decode_text(text_buf); } void TMSILAI::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 TMSILAI::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* TMSILAI::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("tMSI': "); new_tlv->add_TLV(field_tMSI.BER_encode_TLV(TMSILAI_tMSI_descr_, p_coding)); ec_1.set_msg("lAI': "); new_tlv->add_TLV(field_lAI.BER_encode_TLV(TMSILAI_lAI_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean TMSILAI::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 '@HNBAP-IEs.TMSILAI' 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("tMSI': "); 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_tMSI.BER_decode_TLV(TMSILAI_tMSI_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("lAI': "); 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_lAI.BER_decode_TLV(TMSILAI_lAI_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 TMSILAI::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 @HNBAP-IEs.TMSILAI."); 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, "tMSI"); enc_len += field_tMSI.JSON_encode(TMSILAI_tMSI_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "lAI"); enc_len += field_lAI.JSON_encode(TMSILAI_lAI_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int TMSILAI::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 tMSI_found = FALSE; boolean lAI_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 (4 == name_len && 0 == strncmp(fld_name, "tMSI", name_len)) { tMSI_found = TRUE; int ret_val = field_tMSI.JSON_decode(TMSILAI_tMSI_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, "tMSI"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (3 == name_len && 0 == strncmp(fld_name, "lAI", name_len)) { lAI_found = TRUE; int ret_val = field_lAI.JSON_decode(TMSILAI_lAI_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, 3, "lAI"); } 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 (!tMSI_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "tMSI"); return JSON_ERROR_FATAL; } if (!lAI_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "lAI"); return JSON_ERROR_FATAL; } return (int)dec_len; } int TMSILAI::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_tMSI.OER_encode(TMSILAI_tMSI_descr_, p_buf); field_lAI.OER_encode(TMSILAI_lAI_descr_, p_buf); return 0; } int TMSILAI::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_tMSI.OER_decode(TMSILAI_tMSI_descr_, p_buf, p_oer); field_lAI.OER_decode(TMSILAI_lAI_descr_, p_buf, p_oer); return 0; } void TMSILAI::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_tMSI.PER_encode(TMSILAI_tMSI_descr_, p_buf, p_options); field_lAI.PER_encode(TMSILAI_lAI_descr_, p_buf, p_options); } void TMSILAI::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_tMSI.PER_decode(TMSILAI_tMSI_descr_, p_buf, p_options); field_lAI.PER_decode(TMSILAI_lAI_descr_, p_buf, p_options); } struct TMSILAI_template::single_value_struct { BITSTRING_template field_tMSI; LAI_template field_lAI; }; void TMSILAI_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_tMSI = ANY_VALUE; single_value->field_lAI = ANY_VALUE; } } } void TMSILAI_template::copy_value(const TMSILAI& other_value) { single_value = new single_value_struct; if (other_value.tMSI().is_bound()) { single_value->field_tMSI = other_value.tMSI(); } else { single_value->field_tMSI.clean_up(); } if (other_value.lAI().is_bound()) { single_value->field_lAI = other_value.lAI(); } else { single_value->field_lAI.clean_up(); } set_selection(SPECIFIC_VALUE); } void TMSILAI_template::copy_template(const TMSILAI_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.tMSI().get_selection()) { single_value->field_tMSI = other_value.tMSI(); } else { single_value->field_tMSI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lAI().get_selection()) { single_value->field_lAI = other_value.lAI(); } else { single_value->field_lAI.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 TMSILAI_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 TMSILAI_template(*other_value.implication_.precondition); implication_.implied_template = new TMSILAI_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 @HNBAP-IEs.TMSILAI."); break; } set_selection(other_value); } TMSILAI_template::TMSILAI_template() { } TMSILAI_template::TMSILAI_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } TMSILAI_template::TMSILAI_template(const TMSILAI& other_value) { copy_value(other_value); } TMSILAI_template::TMSILAI_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TMSILAI&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.TMSILAI from an unbound optional field."); } } TMSILAI_template::TMSILAI_template(TMSILAI_template* p_precondition, TMSILAI_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } TMSILAI_template::TMSILAI_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; } TMSILAI_template::TMSILAI_template(const TMSILAI_template& other_value) : Base_Template() { copy_template(other_value); } TMSILAI_template::~TMSILAI_template() { clean_up(); } TMSILAI_template& TMSILAI_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } TMSILAI_template& TMSILAI_template::operator=(const TMSILAI& other_value) { clean_up(); copy_value(other_value); return *this; } TMSILAI_template& TMSILAI_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const TMSILAI&)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 @HNBAP-IEs.TMSILAI."); } return *this; } TMSILAI_template& TMSILAI_template::operator=(const TMSILAI_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean TMSILAI_template::match(const TMSILAI& 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.tMSI().is_bound()) return FALSE; if(!single_value->field_tMSI.match(other_value.tMSI(), legacy))return FALSE; if(!other_value.lAI().is_bound()) return FALSE; if(!single_value->field_lAI.match(other_value.lAI(), 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 @HNBAP-IEs.TMSILAI."); } return FALSE; } boolean TMSILAI_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_tMSI.is_bound() || single_value->field_lAI.is_bound(); } boolean TMSILAI_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_tMSI.is_value() && single_value->field_lAI.is_value(); } void TMSILAI_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; } TMSILAI TMSILAI_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 @HNBAP-IEs.TMSILAI."); TMSILAI ret_val; if (single_value->field_tMSI.is_bound()) { ret_val.tMSI() = single_value->field_tMSI.valueof(); } if (single_value->field_lAI.is_bound()) { ret_val.lAI() = single_value->field_lAI.valueof(); } return ret_val; } void TMSILAI_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 @HNBAP-IEs.TMSILAI."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new TMSILAI_template[list_length]; } TMSILAI_template& TMSILAI_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 @HNBAP-IEs.TMSILAI."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.TMSILAI."); return value_list.list_value[list_index]; } BITSTRING_template& TMSILAI_template::tMSI() { set_specific(); return single_value->field_tMSI; } const BITSTRING_template& TMSILAI_template::tMSI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tMSI of a non-specific template of type @HNBAP-IEs.TMSILAI."); return single_value->field_tMSI; } LAI_template& TMSILAI_template::lAI() { set_specific(); return single_value->field_lAI; } const LAI_template& TMSILAI_template::lAI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lAI of a non-specific template of type @HNBAP-IEs.TMSILAI."); return single_value->field_lAI; } int TMSILAI_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TMSILAI 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 @HNBAP-IEs.TMSILAI 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 @HNBAP-IEs.TMSILAI containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TMSILAI containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TMSILAI containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TMSILAI containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TMSILAI containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TMSILAI containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.TMSILAI containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.TMSILAI."); } return 0; } void TMSILAI_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ tMSI := "); single_value->field_tMSI.log(); TTCN_Logger::log_event_str(", lAI := "); single_value->field_lAI.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 TMSILAI_template::log_match(const TMSILAI& 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_tMSI.match(match_value.tMSI(), legacy)){ TTCN_Logger::log_logmatch_info(".tMSI"); single_value->field_tMSI.log_match(match_value.tMSI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lAI.match(match_value.lAI(), legacy)){ TTCN_Logger::log_logmatch_info(".lAI"); single_value->field_lAI.log_match(match_value.lAI(), 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("{ tMSI := "); single_value->field_tMSI.log_match(match_value.tMSI(), legacy); TTCN_Logger::log_event_str(", lAI := "); single_value->field_lAI.log_match(match_value.lAI(), 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 TMSILAI_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (tMSI().is_bound()) tMSI().set_implicit_omit(); if (lAI().is_bound()) lAI().set_implicit_omit(); } void TMSILAI_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_tMSI.encode_text(text_buf); single_value->field_lAI.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 @HNBAP-IEs.TMSILAI."); } } void TMSILAI_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_tMSI.decode_text(text_buf); single_value->field_lAI.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 TMSILAI_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 @HNBAP-IEs.TMSILAI."); } } void TMSILAI_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: { TMSILAI_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) tMSI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lAI().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(), "tMSI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tMSI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lAI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lAI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @HNBAP-IEs.TMSILAI: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { TMSILAI_template* precondition = new TMSILAI_template; precondition->set_param(*param.get_elem(0)); TMSILAI_template* implied_template = new TMSILAI_template; implied_template->set_param(*param.get_elem(1)); *this = TMSILAI_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.TMSILAI"); } is_ifpresent = param.get_ifpresent(); } void TMSILAI_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_tMSI.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.TMSILAI"); single_value->field_lAI.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.TMSILAI"); 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 : "@HNBAP-IEs.TMSILAI"); } boolean TMSILAI_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean TMSILAI_template::match_omit(boolean legacy) const { if (is_ifpresent) return TRUE; switch (template_selection) { case OMIT_VALUE: case ANY_OR_OMIT: return TRUE; case IMPLICATION_MATCH: return !implication_.precondition->match_omit() || implication_.implied_template->match_omit(); case VALUE_LIST: case COMPLEMENTED_LIST: if (legacy) { for (unsigned int l_idx=0; l_idx& par_iE__Extensions) : field_access__stratum__release__indicator(par_access__stratum__release__indicator), field_csg__capability(par_csg__capability), field_iE__Extensions(par_iE__Extensions) { } UE__Capabilities::UE__Capabilities(const UE__Capabilities& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.UE-Capabilities."); if (other_value.access__stratum__release__indicator().is_bound()) field_access__stratum__release__indicator = other_value.access__stratum__release__indicator(); else field_access__stratum__release__indicator.clean_up(); if (other_value.csg__capability().is_bound()) field_csg__capability = other_value.csg__capability(); else field_csg__capability.clean_up(); if (other_value.iE__Extensions().is_bound()) field_iE__Extensions = other_value.iE__Extensions(); else field_iE__Extensions.clean_up(); } void UE__Capabilities::clean_up() { field_access__stratum__release__indicator.clean_up(); field_csg__capability.clean_up(); field_iE__Extensions.clean_up(); } const TTCN_Typedescriptor_t* UE__Capabilities::get_descriptor() const { return &UE__Capabilities_descr_; } UE__Capabilities& UE__Capabilities::operator=(const UE__Capabilities& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-IEs.UE-Capabilities."); if (other_value.access__stratum__release__indicator().is_bound()) field_access__stratum__release__indicator = other_value.access__stratum__release__indicator(); else field_access__stratum__release__indicator.clean_up(); if (other_value.csg__capability().is_bound()) field_csg__capability = other_value.csg__capability(); else field_csg__capability.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 UE__Capabilities::operator==(const UE__Capabilities& other_value) const { return field_access__stratum__release__indicator==other_value.field_access__stratum__release__indicator && field_csg__capability==other_value.field_csg__capability && field_iE__Extensions==other_value.field_iE__Extensions; } boolean UE__Capabilities::is_bound() const { return (field_access__stratum__release__indicator.is_bound()) || (field_csg__capability.is_bound()) || (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_bound()); } boolean UE__Capabilities::is_value() const { return field_access__stratum__release__indicator.is_value() && field_csg__capability.is_value() && (OPTIONAL_OMIT == field_iE__Extensions.get_selection() || field_iE__Extensions.is_value()); } int UE__Capabilities::size_of() const { int ret_val = 2; if (field_iE__Extensions.ispresent()) ret_val++; return ret_val; } void UE__Capabilities::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ access_stratum_release_indicator := "); field_access__stratum__release__indicator.log(); TTCN_Logger::log_event_str(", csg_capability := "); field_csg__capability.log(); TTCN_Logger::log_event_str(", iE_Extensions := "); field_iE__Extensions.log(); TTCN_Logger::log_event_str(" }"); } void UE__Capabilities::set_implicit_omit() { if (access__stratum__release__indicator().is_bound()) access__stratum__release__indicator().set_implicit_omit(); if (csg__capability().is_bound()) csg__capability().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void UE__Capabilities::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) access__stratum__release__indicator().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) csg__capability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "access_stratum_release_indicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { access__stratum__release__indicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "csg_capability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { csg__capability().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 @HNBAP-IEs.UE-Capabilities: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-IEs.UE-Capabilities"); } } void UE__Capabilities::encode_text(Text_Buf& text_buf) const { field_access__stratum__release__indicator.encode_text(text_buf); field_csg__capability.encode_text(text_buf); field_iE__Extensions.encode_text(text_buf); } void UE__Capabilities::decode_text(Text_Buf& text_buf) { field_access__stratum__release__indicator.decode_text(text_buf); field_csg__capability.decode_text(text_buf); field_iE__Extensions.decode_text(text_buf); } void UE__Capabilities::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 UE__Capabilities::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* UE__Capabilities::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("access_stratum_release_indicator': "); new_tlv->add_TLV(field_access__stratum__release__indicator.BER_encode_TLV(UE__Capabilities_access__stratum__release__indicator_descr_, p_coding)); ec_1.set_msg("csg_capability': "); new_tlv->add_TLV(field_csg__capability.BER_encode_TLV(UE__Capabilities_csg__capability_descr_, p_coding)); ec_1.set_msg("iE_Extensions': "); new_tlv->add_TLV(field_iE__Extensions.BER_encode_TLV(UE__Capabilities_iE__Extensions_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean UE__Capabilities::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 '@HNBAP-IEs.UE-Capabilities' 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("access_stratum_release_indicator': "); 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_access__stratum__release__indicator.BER_decode_TLV(UE__Capabilities_access__stratum__release__indicator_descr_, tmp_tlv, L_form); tlv_present=FALSE; ec_2.set_msg("csg_capability': "); 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_csg__capability.BER_decode_TLV(UE__Capabilities_csg__capability_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(UE__Capabilities_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 UE__Capabilities::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 @HNBAP-IEs.UE-Capabilities."); 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, "access_stratum_release_indicator"); enc_len += field_access__stratum__release__indicator.JSON_encode(UE__Capabilities_access__stratum__release__indicator_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "csg_capability"); enc_len += field_csg__capability.JSON_encode(UE__Capabilities_csg__capability_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(UE__Capabilities_iE__Extensions_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int UE__Capabilities::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 access__stratum__release__indicator_found = FALSE; boolean csg__capability_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 (32 == name_len && 0 == strncmp(fld_name, "access_stratum_release_indicator", name_len)) { access__stratum__release__indicator_found = TRUE; int ret_val = field_access__stratum__release__indicator.JSON_decode(UE__Capabilities_access__stratum__release__indicator_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, 32, "access_stratum_release_indicator"); } return JSON_ERROR_FATAL; } dec_len += (size_t)ret_val; } else if (14 == name_len && 0 == strncmp(fld_name, "csg_capability", name_len)) { csg__capability_found = TRUE; int ret_val = field_csg__capability.JSON_decode(UE__Capabilities_csg__capability_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, "csg_capability"); } 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(UE__Capabilities_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 (!access__stratum__release__indicator_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "access_stratum_release_indicator"); return JSON_ERROR_FATAL; } if (!csg__capability_found) { JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, JSON_DEC_MISSING_FIELD_ERROR, "csg_capability"); return JSON_ERROR_FATAL; } if (!iE__Extensions_found) { field_iE__Extensions = OMIT_VALUE; } return (int)dec_len; } int UE__Capabilities::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_access__stratum__release__indicator.OER_encode(UE__Capabilities_access__stratum__release__indicator_descr_, p_buf); field_csg__capability.OER_encode(UE__Capabilities_csg__capability_descr_, p_buf); if (field_iE__Extensions.is_present()) field_iE__Extensions.OER_encode(UE__Capabilities_iE__Extensions_descr_, p_buf); return 0; } int UE__Capabilities::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_access__stratum__release__indicator.OER_decode(UE__Capabilities_access__stratum__release__indicator_descr_, p_buf, p_oer); field_csg__capability.OER_decode(UE__Capabilities_csg__capability_descr_, p_buf, p_oer); if (uc[0] & 64) field_iE__Extensions.OER_decode(UE__Capabilities_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 UE__Capabilities::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_access__stratum__release__indicator.PER_encode(UE__Capabilities_access__stratum__release__indicator_descr_, p_buf, p_options); field_csg__capability.PER_encode(UE__Capabilities_csg__capability_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_encode(UE__Capabilities_iE__Extensions_descr_, p_buf, p_options); } void UE__Capabilities::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_access__stratum__release__indicator.PER_decode(UE__Capabilities_access__stratum__release__indicator_descr_, p_buf, p_options); field_csg__capability.PER_decode(UE__Capabilities_csg__capability_descr_, p_buf, p_options); if (field_iE__Extensions_present) field_iE__Extensions.PER_decode(UE__Capabilities_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 UE__Capabilities_template::single_value_struct { Access__stratum__release__indicator_template field_access__stratum__release__indicator; CSG__Capability_template field_csg__capability; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template field_iE__Extensions; }; void UE__Capabilities_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_access__stratum__release__indicator = ANY_VALUE; single_value->field_csg__capability = ANY_VALUE; single_value->field_iE__Extensions = ANY_OR_OMIT; } } } void UE__Capabilities_template::copy_value(const UE__Capabilities& other_value) { single_value = new single_value_struct; if (other_value.access__stratum__release__indicator().is_bound()) { single_value->field_access__stratum__release__indicator = other_value.access__stratum__release__indicator(); } else { single_value->field_access__stratum__release__indicator.clean_up(); } if (other_value.csg__capability().is_bound()) { single_value->field_csg__capability = other_value.csg__capability(); } else { single_value->field_csg__capability.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 UE__Capabilities_template::copy_template(const UE__Capabilities_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.access__stratum__release__indicator().get_selection()) { single_value->field_access__stratum__release__indicator = other_value.access__stratum__release__indicator(); } else { single_value->field_access__stratum__release__indicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.csg__capability().get_selection()) { single_value->field_csg__capability = other_value.csg__capability(); } else { single_value->field_csg__capability.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 UE__Capabilities_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 UE__Capabilities_template(*other_value.implication_.precondition); implication_.implied_template = new UE__Capabilities_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 @HNBAP-IEs.UE-Capabilities."); break; } set_selection(other_value); } UE__Capabilities_template::UE__Capabilities_template() { } UE__Capabilities_template::UE__Capabilities_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } UE__Capabilities_template::UE__Capabilities_template(const UE__Capabilities& other_value) { copy_value(other_value); } UE__Capabilities_template::UE__Capabilities_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const UE__Capabilities&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.UE-Capabilities from an unbound optional field."); } } UE__Capabilities_template::UE__Capabilities_template(UE__Capabilities_template* p_precondition, UE__Capabilities_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } UE__Capabilities_template::UE__Capabilities_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; } UE__Capabilities_template::UE__Capabilities_template(const UE__Capabilities_template& other_value) : Base_Template() { copy_template(other_value); } UE__Capabilities_template::~UE__Capabilities_template() { clean_up(); } UE__Capabilities_template& UE__Capabilities_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } UE__Capabilities_template& UE__Capabilities_template::operator=(const UE__Capabilities& other_value) { clean_up(); copy_value(other_value); return *this; } UE__Capabilities_template& UE__Capabilities_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const UE__Capabilities&)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 @HNBAP-IEs.UE-Capabilities."); } return *this; } UE__Capabilities_template& UE__Capabilities_template::operator=(const UE__Capabilities_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean UE__Capabilities_template::match(const UE__Capabilities& 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.access__stratum__release__indicator().is_bound()) return FALSE; if(!single_value->field_access__stratum__release__indicator.match(other_value.access__stratum__release__indicator(), legacy))return FALSE; if(!other_value.csg__capability().is_bound()) return FALSE; if(!single_value->field_csg__capability.match(other_value.csg__capability(), 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18&)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 @HNBAP-IEs.UE-Capabilities."); } return FALSE; } boolean UE__Capabilities_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_access__stratum__release__indicator.is_bound() || single_value->field_csg__capability.is_bound() || (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_bound()); } boolean UE__Capabilities_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_access__stratum__release__indicator.is_value() && single_value->field_csg__capability.is_value() && (single_value->field_iE__Extensions.is_omit() || single_value->field_iE__Extensions.is_value()); } void UE__Capabilities_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; } UE__Capabilities UE__Capabilities_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 @HNBAP-IEs.UE-Capabilities."); UE__Capabilities ret_val; if (single_value->field_access__stratum__release__indicator.is_bound()) { ret_val.access__stratum__release__indicator() = single_value->field_access__stratum__release__indicator.valueof(); } if (single_value->field_csg__capability.is_bound()) { ret_val.csg__capability() = single_value->field_csg__capability.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 UE__Capabilities_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 @HNBAP-IEs.UE-Capabilities."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new UE__Capabilities_template[list_length]; } UE__Capabilities_template& UE__Capabilities_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 @HNBAP-IEs.UE-Capabilities."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-IEs.UE-Capabilities."); return value_list.list_value[list_index]; } Access__stratum__release__indicator_template& UE__Capabilities_template::access__stratum__release__indicator() { set_specific(); return single_value->field_access__stratum__release__indicator; } const Access__stratum__release__indicator_template& UE__Capabilities_template::access__stratum__release__indicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field access_stratum_release_indicator of a non-specific template of type @HNBAP-IEs.UE-Capabilities."); return single_value->field_access__stratum__release__indicator; } CSG__Capability_template& UE__Capabilities_template::csg__capability() { set_specific(); return single_value->field_csg__capability; } const CSG__Capability_template& UE__Capabilities_template::csg__capability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field csg_capability of a non-specific template of type @HNBAP-IEs.UE-Capabilities."); return single_value->field_csg__capability; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& UE__Capabilities_template::iE__Extensions() { set_specific(); return single_value->field_iE__Extensions; } const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& UE__Capabilities_template::iE__Extensions() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iE_Extensions of a non-specific template of type @HNBAP-IEs.UE-Capabilities."); return single_value->field_iE__Extensions; } int UE__Capabilities_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UE-Capabilities which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 2; 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 @HNBAP-IEs.UE-Capabilities 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 @HNBAP-IEs.UE-Capabilities containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UE-Capabilities containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UE-Capabilities containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UE-Capabilities containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UE-Capabilities containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UE-Capabilities containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-IEs.UE-Capabilities containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.UE-Capabilities."); } return 0; } void UE__Capabilities_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ access_stratum_release_indicator := "); single_value->field_access__stratum__release__indicator.log(); TTCN_Logger::log_event_str(", csg_capability := "); single_value->field_csg__capability.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 UE__Capabilities_template::log_match(const UE__Capabilities& 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_access__stratum__release__indicator.match(match_value.access__stratum__release__indicator(), legacy)){ TTCN_Logger::log_logmatch_info(".access_stratum_release_indicator"); single_value->field_access__stratum__release__indicator.log_match(match_value.access__stratum__release__indicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_csg__capability.match(match_value.csg__capability(), legacy)){ TTCN_Logger::log_logmatch_info(".csg_capability"); single_value->field_csg__capability.log_match(match_value.csg__capability(), 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("{ access_stratum_release_indicator := "); single_value->field_access__stratum__release__indicator.log_match(match_value.access__stratum__release__indicator(), legacy); TTCN_Logger::log_event_str(", csg_capability := "); single_value->field_csg__capability.log_match(match_value.csg__capability(), 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 UE__Capabilities_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; if (access__stratum__release__indicator().is_bound()) access__stratum__release__indicator().set_implicit_omit(); if (csg__capability().is_bound()) csg__capability().set_implicit_omit(); if (!iE__Extensions().is_bound()) iE__Extensions() = OMIT_VALUE; else iE__Extensions().set_implicit_omit(); } void UE__Capabilities_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_access__stratum__release__indicator.encode_text(text_buf); single_value->field_csg__capability.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 @HNBAP-IEs.UE-Capabilities."); } } void UE__Capabilities_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_access__stratum__release__indicator.decode_text(text_buf); single_value->field_csg__capability.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 UE__Capabilities_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 @HNBAP-IEs.UE-Capabilities."); } } void UE__Capabilities_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: { UE__Capabilities_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) access__stratum__release__indicator().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) csg__capability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) iE__Extensions().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(), "access_stratum_release_indicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { access__stratum__release__indicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "csg_capability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { csg__capability().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 @HNBAP-IEs.UE-Capabilities: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { UE__Capabilities_template* precondition = new UE__Capabilities_template; precondition->set_param(*param.get_elem(0)); UE__Capabilities_template* implied_template = new UE__Capabilities_template; implied_template->set_param(*param.get_elem(1)); *this = UE__Capabilities_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-IEs.UE-Capabilities"); } is_ifpresent = param.get_ifpresent(); } void UE__Capabilities_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_access__stratum__release__indicator.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Capabilities"); single_value->field_csg__capability.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Capabilities"); single_value->field_iE__Extensions.check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Capabilities"); 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 : "@HNBAP-IEs.UE-Capabilities"); } boolean UE__Capabilities_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean UE__Capabilities_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); return val_ptr->n_elements == 0 ; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator==(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18; } return *val_ptr->value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); if (index_value < 0) TTCN_error("Accessing an element of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); return (*this)[(int)index_value]; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::operator+(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*other_value.val_ptr->value_elements[i]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*val_ptr->value_elements[i+index]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); check_replace_arguments(val_ptr->n_elements, index, len, "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18","element"); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*val_ptr->value_elements[index+i+len]); } } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(*(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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18**)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18: %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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); return val_ptr->n_elements; } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18"); } 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", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); val_ptr->value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18**)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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18; 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18* val = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18; 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18**)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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template; } } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); break; } set_selection(other_value); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18*)value_ptr)[value_index], legacy); else return ((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template() { } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18>* p_dyn_match) : Base_Record_Of_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::~_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18&)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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); break; } return *single_value.value_elements[index_value]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); return (*this)[(int)index_value]; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18: 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); return (*this)[(int)index_value]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18 containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& 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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::replace(int index, int len, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); } set_selection(template_type); } _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& 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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); } } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); single_value.value_elements = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); } } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_template(precondition, implied_template); } break; default: param.type_error("record of template", "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18"); 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 : "@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18"); } boolean _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type& other_value) { switch (other_value.union_selection) { default: TTCN_error("Assignment of an unbound union value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } union_selection = other_value.union_selection; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type() { union_selection = UNBOUND_VALUE; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type& other_value) : Base_Type(){ copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { default: return FALSE; } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); return union_selection == checked_selection; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; default: TTCN_error("Invalid selection in union is_bound");} } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::clean_up() { switch (union_selection) { default: break; } union_selection = UNBOUND_VALUE; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::log() const { switch (union_selection) { default: TTCN_Logger::log_event_unbound(); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type.", last_name); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::set_implicit_omit() { switch (union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); union_selection = UNBOUND_VALUE; return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type, because it has zero alternatives."); return -1; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type, because it has zero alternatives."); return JSON_ERROR_FATAL; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); return -1; } return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type': "); ec_0.error(TTCN_EncDec::ET_DEC_OPENTYPE, "Cannot decode open type: the constraining object set is empty."); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } set_selection(SPECIFIC_VALUE); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& other_value) : Base_Template(){ copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template() { clean_up(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::union_selection_type value_selection = other_value.get_selection(); if (value_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } return ret_val; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); return value_list.list_value[list_index]; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template[list_length]; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::ischosen(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::union_selection_type checked_selection) const { if (checked_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { default: break; } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::UNBOUND_VALUE; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type::union_selection_type new_selection = (_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type."); } } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type'"); } param.error("Field `%s' not found in union template type `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type.", last_name); } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template; precondition->set_param(*m_p->get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template; implied_template->set_param(*m_p->get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18.extensionValue.type"); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(const INTEGER& par_id, const HNBAP__CommonDataTypes::Criticality& par_criticality, const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type& par_extensionValue) : field_id(par_id), field_criticality(par_criticality), field_extensionValue(par_extensionValue) { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::clean_up() { field_id.clean_up(); field_criticality.clean_up(); field_extensionValue.clean_up(); } const TTCN_Typedescriptor_t* _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::get_descriptor() const { return &_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_descr_; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::operator==(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& other_value) const { return field_id==other_value.field_id && field_criticality==other_value.field_criticality && field_extensionValue==other_value.field_extensionValue; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::is_bound() const { return (field_id.is_bound()) || (field_criticality.is_bound()) || (field_extensionValue.is_bound()); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::is_value() const { return field_id.is_value() && field_criticality.is_value() && field_extensionValue.is_value(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18"); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_descr_, p_coding)); ec_1.set_msg("criticality': "); new_tlv->add_TLV(field_criticality.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_descr_, p_coding)); ec_1.set_msg("extensionValue': "); new_tlv->add_TLV(field_extensionValue.BER_encode_TLV(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_descr_, p_coding)); new_tlv=ASN_BER_V2TLV(new_tlv, p_td, p_coding); return new_tlv; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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 '@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18' 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "criticality"); enc_len += field_criticality.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_descr_, p_tok, FALSE); } { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "extensionValue"); enc_len += field_extensionValue.JSON_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_descr_, p_tok, FALSE); } enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); return enc_len; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_descr_, p_buf); field_criticality.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_descr_, p_buf); field_extensionValue.OER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_descr_, p_buf); return 0; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::OER_decode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf, OER_struct& p_oer) { field_id.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_descr_, p_buf, p_oer); field_criticality.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_descr_, p_buf, p_oer); field_extensionValue.OER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_descr_, p_buf, p_options); field_criticality.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_descr_, p_buf, p_options); field_extensionValue.PER_encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_descr_, p_buf, p_options); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::PER_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_options) { clean_up(); field_id.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_descr_, p_buf, p_options); field_criticality.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_descr_, p_buf, p_options); field_extensionValue.PER_decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18::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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::single_value_struct { INTEGER_template field_id; HNBAP__CommonDataTypes::Criticality_template field_criticality; _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template field_extensionValue; }; void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::copy_value(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::copy_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(*other_value.implication_.precondition); implication_.implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); break; } set_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template() { } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& other_value) { copy_value(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18>& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 from an unbound optional field."); } } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template* p_precondition, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(Dynamic_Match_Interface<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18>* p_dyn_match) : Base_Template(DYNAMIC_MATCH) { dyn_match = new dynmatch_struct<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18>; dyn_match->ptr = p_dyn_match; dyn_match->ref_count = 1; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& other_value) : Base_Template() { copy_template(other_value); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::~_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template() { clean_up(); } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& other_value) { clean_up(); copy_value(other_value); return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::operator=(const OPTIONAL<_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18>& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18&)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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); } return *this; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::operator=(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); } return FALSE; } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18 _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template[list_length]; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); return value_list.list_value[list_index]; } INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::id() { set_specific(); return single_value->field_id; } const INTEGER_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::id() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field id of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); return single_value->field_id; } HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::criticality() { set_specific(); return single_value->field_criticality; } const HNBAP__CommonDataTypes::Criticality_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::criticality() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field criticality of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); return single_value->field_criticality; } _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::extensionValue() { set_specific(); return single_value->field_extensionValue; } const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_type_template& _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::extensionValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionValue of a non-specific template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); return single_value->field_extensionValue; } int _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18 containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); } return 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::log_match(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& 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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18."); } } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 @HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template* precondition = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template; precondition->set_param(*param.get_elem(0)); _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template* implied_template = new _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template; implied_template->set_param(*param.get_elem(1)); *this = _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template(precondition, implied_template); } break; default: param.type_error("record template", "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18"); } is_ifpresent = param.get_ifpresent(); } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18"); single_value->field_criticality.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18"); single_value->field_extensionValue.check_restriction(t_res, t_name ? t_name : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18"); 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 : "@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18"); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_tMSILAI: return field_tMSILAI->is_value(); case ALT_pTMSIRAI: return field_pTMSIRAI->is_value(); case ALT_iMEI: return field_iMEI->is_value(); case ALT_eSN: return field_eSN->is_value(); case ALT_iMSIDS41: return field_iMSIDS41->is_value(); case ALT_iMSIESN: return field_iMSIESN->is_value(); case ALT_tMSIDS41: return field_tMSIDS41->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void UE__Identity::clean_up() { switch (union_selection) { case ALT_iMSI: delete field_iMSI; break; case ALT_tMSILAI: delete field_tMSILAI; break; case ALT_pTMSIRAI: delete field_pTMSIRAI; break; case ALT_iMEI: delete field_iMEI; break; case ALT_eSN: delete field_eSN; break; case ALT_iMSIDS41: delete field_iMSIDS41; break; case ALT_iMSIESN: delete field_iMSIESN; break; case ALT_tMSIDS41: delete field_tMSIDS41; break; default: break; } union_selection = UNBOUND_VALUE; } void UE__Identity::log() const { switch (union_selection) { case ALT_iMSI: TTCN_Logger::log_event_str("{ iMSI := "); field_iMSI->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_tMSILAI: TTCN_Logger::log_event_str("{ tMSILAI := "); field_tMSILAI->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_pTMSIRAI: TTCN_Logger::log_event_str("{ pTMSIRAI := "); field_pTMSIRAI->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_eSN: TTCN_Logger::log_event_str("{ eSN := "); field_eSN->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_iMSIDS41: TTCN_Logger::log_event_str("{ iMSIDS41 := "); field_iMSIDS41->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_iMSIESN: TTCN_Logger::log_event_str("{ iMSIESN := "); field_iMSIESN->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_tMSIDS41: TTCN_Logger::log_event_str("{ tMSIDS41 := "); field_tMSIDS41->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void UE__Identity::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, "iMSI")) { iMSI().set_param(*mp_last); if (!iMSI().is_bound()) clean_up(); return; } if (!strcmp(last_name, "tMSILAI")) { tMSILAI().set_param(*mp_last); if (!tMSILAI().is_bound()) clean_up(); return; } if (!strcmp(last_name, "pTMSIRAI")) { pTMSIRAI().set_param(*mp_last); if (!pTMSIRAI().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, "eSN")) { eSN().set_param(*mp_last); if (!eSN().is_bound()) clean_up(); return; } if (!strcmp(last_name, "iMSIDS41")) { iMSIDS41().set_param(*mp_last); if (!iMSIDS41().is_bound()) clean_up(); return; } if (!strcmp(last_name, "iMSIESN")) { iMSIESN().set_param(*mp_last); if (!iMSIESN().is_bound()) clean_up(); return; } if (!strcmp(last_name, "tMSIDS41")) { tMSIDS41().set_param(*mp_last); if (!tMSIDS41().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.UE-Identity.", last_name); } void UE__Identity::set_implicit_omit() { switch (union_selection) { case ALT_iMSI: field_iMSI->set_implicit_omit(); break; case ALT_tMSILAI: field_tMSILAI->set_implicit_omit(); break; case ALT_pTMSIRAI: field_pTMSIRAI->set_implicit_omit(); break; case ALT_iMEI: field_iMEI->set_implicit_omit(); break; case ALT_eSN: field_eSN->set_implicit_omit(); break; case ALT_iMSIDS41: field_iMSIDS41->set_implicit_omit(); break; case ALT_iMSIESN: field_iMSIESN->set_implicit_omit(); break; case ALT_tMSIDS41: field_tMSIDS41->set_implicit_omit(); break; default: break; } } void UE__Identity::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_iMSI: field_iMSI->encode_text(text_buf); break; case ALT_tMSILAI: field_tMSILAI->encode_text(text_buf); break; case ALT_pTMSIRAI: field_pTMSIRAI->encode_text(text_buf); break; case ALT_iMEI: field_iMEI->encode_text(text_buf); break; case ALT_eSN: field_eSN->encode_text(text_buf); break; case ALT_iMSIDS41: field_iMSIDS41->encode_text(text_buf); break; case ALT_iMSIESN: field_iMSIESN->encode_text(text_buf); break; case ALT_tMSIDS41: field_tMSIDS41->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @HNBAP-IEs.UE-Identity."); } } void UE__Identity::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_iMSI: iMSI().decode_text(text_buf); break; case ALT_tMSILAI: tMSILAI().decode_text(text_buf); break; case ALT_pTMSIRAI: pTMSIRAI().decode_text(text_buf); break; case ALT_iMEI: iMEI().decode_text(text_buf); break; case ALT_eSN: eSN().decode_text(text_buf); break; case ALT_iMSIDS41: iMSIDS41().decode_text(text_buf); break; case ALT_iMSIESN: iMSIESN().decode_text(text_buf); break; case ALT_tMSIDS41: tMSIDS41().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @HNBAP-IEs.UE-Identity."); } } void UE__Identity::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 UE__Identity::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 *UE__Identity::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_iMSI: ec_1.set_msg("iMSI': "); new_tlv = field_iMSI->BER_encode_TLV(UE__Identity_iMSI_descr_, p_coding); break; case ALT_tMSILAI: ec_1.set_msg("tMSILAI': "); new_tlv = field_tMSILAI->BER_encode_TLV(UE__Identity_tMSILAI_descr_, p_coding); break; case ALT_pTMSIRAI: ec_1.set_msg("pTMSIRAI': "); new_tlv = field_pTMSIRAI->BER_encode_TLV(UE__Identity_pTMSIRAI_descr_, p_coding); break; case ALT_iMEI: ec_1.set_msg("iMEI': "); new_tlv = field_iMEI->BER_encode_TLV(UE__Identity_iMEI_descr_, p_coding); break; case ALT_eSN: ec_1.set_msg("eSN': "); new_tlv = field_eSN->BER_encode_TLV(UE__Identity_eSN_descr_, p_coding); break; case ALT_iMSIDS41: ec_1.set_msg("iMSIDS41': "); new_tlv = field_iMSIDS41->BER_encode_TLV(UE__Identity_iMSIDS41_descr_, p_coding); break; case ALT_iMSIESN: ec_1.set_msg("iMSIESN': "); new_tlv = field_iMSIESN->BER_encode_TLV(UE__Identity_iMSIESN_descr_, p_coding); break; case ALT_tMSIDS41: ec_1.set_msg("tMSIDS41': "); new_tlv = field_tMSIDS41->BER_encode_TLV(UE__Identity_tMSIDS41_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 UE__Identity::BER_decode_set_selection(const ASN_BER_TLV_t& p_tlv) { clean_up(); field_iMSI = new OCTETSTRING; union_selection = ALT_iMSI; if (field_iMSI->BER_decode_isMyMsg(UE__Identity_iMSI_descr_, p_tlv)) return TRUE; delete field_iMSI; field_tMSILAI = new TMSILAI; union_selection = ALT_tMSILAI; if (field_tMSILAI->BER_decode_isMyMsg(UE__Identity_tMSILAI_descr_, p_tlv)) return TRUE; delete field_tMSILAI; field_pTMSIRAI = new PTMSIRAI; union_selection = ALT_pTMSIRAI; if (field_pTMSIRAI->BER_decode_isMyMsg(UE__Identity_pTMSIRAI_descr_, p_tlv)) return TRUE; delete field_pTMSIRAI; field_iMEI = new BITSTRING; union_selection = ALT_iMEI; if (field_iMEI->BER_decode_isMyMsg(UE__Identity_iMEI_descr_, p_tlv)) return TRUE; delete field_iMEI; field_eSN = new BITSTRING; union_selection = ALT_eSN; if (field_eSN->BER_decode_isMyMsg(UE__Identity_eSN_descr_, p_tlv)) return TRUE; delete field_eSN; field_iMSIDS41 = new OCTETSTRING; union_selection = ALT_iMSIDS41; if (field_iMSIDS41->BER_decode_isMyMsg(UE__Identity_iMSIDS41_descr_, p_tlv)) return TRUE; delete field_iMSIDS41; field_iMSIESN = new IMSIESN; union_selection = ALT_iMSIESN; if (field_iMSIESN->BER_decode_isMyMsg(UE__Identity_iMSIESN_descr_, p_tlv)) return TRUE; delete field_iMSIESN; field_tMSIDS41 = new OCTETSTRING; union_selection = ALT_tMSIDS41; if (field_tMSIDS41->BER_decode_isMyMsg(UE__Identity_tMSIDS41_descr_, p_tlv)) return TRUE; delete field_tMSIDS41; union_selection = UNBOUND_VALUE; return FALSE; } boolean UE__Identity::BER_decode_isMyMsg(const TTCN_Typedescriptor_t& p_td, const ASN_BER_TLV_t& p_tlv) { if (p_td.ber->n_tags == 0) { UE__Identity tmp_type; return tmp_type.BER_decode_set_selection(p_tlv); } else return Base_Type::BER_decode_isMyMsg(p_td, p_tlv); } boolean UE__Identity::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 '@HNBAP-IEs.UE-Identity' 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_iMSI: ec_2.set_msg("iMSI': "); field_iMSI->BER_decode_TLV(UE__Identity_iMSI_descr_, tmp_tlv, L_form); break; case ALT_tMSILAI: ec_2.set_msg("tMSILAI': "); field_tMSILAI->BER_decode_TLV(UE__Identity_tMSILAI_descr_, tmp_tlv, L_form); break; case ALT_pTMSIRAI: ec_2.set_msg("pTMSIRAI': "); field_pTMSIRAI->BER_decode_TLV(UE__Identity_pTMSIRAI_descr_, tmp_tlv, L_form); break; case ALT_iMEI: ec_2.set_msg("iMEI': "); field_iMEI->BER_decode_TLV(UE__Identity_iMEI_descr_, tmp_tlv, L_form); break; case ALT_eSN: ec_2.set_msg("eSN': "); field_eSN->BER_decode_TLV(UE__Identity_eSN_descr_, tmp_tlv, L_form); break; case ALT_iMSIDS41: ec_2.set_msg("iMSIDS41': "); field_iMSIDS41->BER_decode_TLV(UE__Identity_iMSIDS41_descr_, tmp_tlv, L_form); break; case ALT_iMSIESN: ec_2.set_msg("iMSIESN': "); field_iMSIESN->BER_decode_TLV(UE__Identity_iMSIESN_descr_, tmp_tlv, L_form); break; case ALT_tMSIDS41: ec_2.set_msg("tMSIDS41': "); field_tMSIDS41->BER_decode_TLV(UE__Identity_tMSIDS41_descr_, tmp_tlv, L_form); break; default: return FALSE; } return TRUE; } int UE__Identity::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_iMSI: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iMSI"); } enc_len += field_iMSI->JSON_encode(UE__Identity_iMSI_descr_, p_tok, FALSE); break; case ALT_tMSILAI: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "tMSILAI"); } enc_len += field_tMSILAI->JSON_encode(UE__Identity_tMSILAI_descr_, p_tok, FALSE); break; case ALT_pTMSIRAI: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "pTMSIRAI"); } enc_len += field_pTMSIRAI->JSON_encode(UE__Identity_pTMSIRAI_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(UE__Identity_iMEI_descr_, p_tok, FALSE); break; case ALT_eSN: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "eSN"); } enc_len += field_eSN->JSON_encode(UE__Identity_eSN_descr_, p_tok, FALSE); break; case ALT_iMSIDS41: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iMSIDS41"); } enc_len += field_iMSIDS41->JSON_encode(UE__Identity_iMSIDS41_descr_, p_tok, FALSE); break; case ALT_iMSIESN: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "iMSIESN"); } enc_len += field_iMSIESN->JSON_encode(UE__Identity_iMSIESN_descr_, p_tok, FALSE); break; case ALT_tMSIDS41: if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_NAME, "tMSIDS41"); } enc_len += field_tMSIDS41->JSON_encode(UE__Identity_tMSIDS41_descr_, p_tok, FALSE); break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.UE-Identity."); return -1; } if (!as_value) { enc_len += p_tok.put_next_token(JSON_TOKEN_OBJECT_END, NULL); } return enc_len; } int UE__Identity::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 iMSI().JSON_decode(UE__Identity_iMSI_descr_, p_tok, TRUE, FALSE); case 1: return tMSILAI().JSON_decode(UE__Identity_tMSILAI_descr_, p_tok, TRUE, FALSE); case 2: return pTMSIRAI().JSON_decode(UE__Identity_pTMSIRAI_descr_, p_tok, TRUE, FALSE); case 3: return iMEI().JSON_decode(UE__Identity_iMEI_descr_, p_tok, TRUE, FALSE); case 4: return eSN().JSON_decode(UE__Identity_eSN_descr_, p_tok, TRUE, FALSE); case 5: return iMSIDS41().JSON_decode(UE__Identity_iMSIDS41_descr_, p_tok, TRUE, FALSE); case 6: return iMSIESN().JSON_decode(UE__Identity_iMSIESN_descr_, p_tok, TRUE, FALSE); case 7: return tMSIDS41().JSON_decode(UE__Identity_tMSIDS41_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 '@HNBAP-IEs.UE-Identity'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_STRING: { p_tok.set_buf_pos(buf_pos); ret_val = iMSI().JSON_decode(UE__Identity_iMSI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMEI().JSON_decode(UE__Identity_iMEI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = eSN().JSON_decode(UE__Identity_eSN_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIDS41().JSON_decode(UE__Identity_iMSIDS41_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = tMSIDS41().JSON_decode(UE__Identity_tMSIDS41_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 '@HNBAP-IEs.UE-Identity'"); 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 '@HNBAP-IEs.UE-Identity'"); clean_up(); return JSON_ERROR_FATAL; } case JSON_TOKEN_OBJECT_START: { p_tok.set_buf_pos(buf_pos); ret_val = tMSILAI().JSON_decode(UE__Identity_tMSILAI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = pTMSIRAI().JSON_decode(UE__Identity_pTMSIRAI_descr_, p_tok, TRUE, FALSE); if (0 <= ret_val) { return ret_val; } p_tok.set_buf_pos(buf_pos); ret_val = iMSIESN().JSON_decode(UE__Identity_iMSIESN_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 '@HNBAP-IEs.UE-Identity'"); 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 (4 == name_len && 0 == strncmp(fld_name, "iMSI", name_len)) { int ret_val = iMSI().JSON_decode(UE__Identity_iMSI_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, "iMSI"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (7 == name_len && 0 == strncmp(fld_name, "tMSILAI", name_len)) { int ret_val = tMSILAI().JSON_decode(UE__Identity_tMSILAI_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, "tMSILAI"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (8 == name_len && 0 == strncmp(fld_name, "pTMSIRAI", name_len)) { int ret_val = pTMSIRAI().JSON_decode(UE__Identity_pTMSIRAI_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, "pTMSIRAI"); } 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(UE__Identity_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 (3 == name_len && 0 == strncmp(fld_name, "eSN", name_len)) { int ret_val = eSN().JSON_decode(UE__Identity_eSN_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, 3, "eSN"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (8 == name_len && 0 == strncmp(fld_name, "iMSIDS41", name_len)) { int ret_val = iMSIDS41().JSON_decode(UE__Identity_iMSIDS41_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, "iMSIDS41"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (7 == name_len && 0 == strncmp(fld_name, "iMSIESN", name_len)) { int ret_val = iMSIESN().JSON_decode(UE__Identity_iMSIESN_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, "iMSIESN"); } return JSON_ERROR_FATAL; } else { dec_len += (size_t)ret_val; } } else if (8 == name_len && 0 == strncmp(fld_name, "tMSIDS41", name_len)) { int ret_val = tMSIDS41().JSON_decode(UE__Identity_tMSIDS41_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, "tMSIDS41"); } 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 UE__Identity::OER_encode(const TTCN_Typedescriptor_t&, TTCN_Buffer& p_buf) const { switch(union_selection) { case ALT_iMSI: {TTCN_Buffer buf; encode_oer_tag(*UE__Identity_iMSI_descr_.ber, p_buf); field_iMSI->OER_encode(UE__Identity_iMSI_descr_, buf); p_buf.put_buf(buf); break; } case ALT_tMSILAI: {TTCN_Buffer buf; encode_oer_tag(*UE__Identity_tMSILAI_descr_.ber, p_buf); field_tMSILAI->OER_encode(UE__Identity_tMSILAI_descr_, buf); p_buf.put_buf(buf); break; } case ALT_pTMSIRAI: {TTCN_Buffer buf; encode_oer_tag(*UE__Identity_pTMSIRAI_descr_.ber, p_buf); field_pTMSIRAI->OER_encode(UE__Identity_pTMSIRAI_descr_, buf); p_buf.put_buf(buf); break; } case ALT_iMEI: {TTCN_Buffer buf; encode_oer_tag(*UE__Identity_iMEI_descr_.ber, p_buf); field_iMEI->OER_encode(UE__Identity_iMEI_descr_, buf); p_buf.put_buf(buf); break; } case ALT_eSN: {TTCN_Buffer buf; encode_oer_tag(*UE__Identity_eSN_descr_.ber, p_buf); field_eSN->OER_encode(UE__Identity_eSN_descr_, buf); p_buf.put_buf(buf); break; } case ALT_iMSIDS41: {TTCN_Buffer buf; encode_oer_tag(*UE__Identity_iMSIDS41_descr_.ber, p_buf); field_iMSIDS41->OER_encode(UE__Identity_iMSIDS41_descr_, buf); p_buf.put_buf(buf); break; } case ALT_iMSIESN: {TTCN_Buffer buf; encode_oer_tag(*UE__Identity_iMSIESN_descr_.ber, p_buf); field_iMSIESN->OER_encode(UE__Identity_iMSIESN_descr_, buf); p_buf.put_buf(buf); break; } case ALT_tMSIDS41: {TTCN_Buffer buf; encode_oer_tag(*UE__Identity_tMSIDS41_descr_.ber, p_buf); field_tMSIDS41->OER_encode(UE__Identity_tMSIDS41_descr_, buf); p_buf.put_buf(buf); break; } default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value of type @HNBAP-IEs.UE-Identity."); return -1; } return 0; } int UE__Identity::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 (UE__Identity_iMSI_descr_.ber->tags[UE__Identity_iMSI_descr_.ber->n_tags-1].tagclass == descr.tagclass && UE__Identity_iMSI_descr_.ber->tags[UE__Identity_iMSI_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { iMSI().OER_decode(UE__Identity_iMSI_descr_, p_buf, p_oer); } else if (UE__Identity_tMSILAI_descr_.ber->tags[UE__Identity_tMSILAI_descr_.ber->n_tags-1].tagclass == descr.tagclass && UE__Identity_tMSILAI_descr_.ber->tags[UE__Identity_tMSILAI_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { tMSILAI().OER_decode(UE__Identity_tMSILAI_descr_, p_buf, p_oer); } else if (UE__Identity_pTMSIRAI_descr_.ber->tags[UE__Identity_pTMSIRAI_descr_.ber->n_tags-1].tagclass == descr.tagclass && UE__Identity_pTMSIRAI_descr_.ber->tags[UE__Identity_pTMSIRAI_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { pTMSIRAI().OER_decode(UE__Identity_pTMSIRAI_descr_, p_buf, p_oer); } else if (UE__Identity_iMEI_descr_.ber->tags[UE__Identity_iMEI_descr_.ber->n_tags-1].tagclass == descr.tagclass && UE__Identity_iMEI_descr_.ber->tags[UE__Identity_iMEI_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { iMEI().OER_decode(UE__Identity_iMEI_descr_, p_buf, p_oer); } else if (UE__Identity_eSN_descr_.ber->tags[UE__Identity_eSN_descr_.ber->n_tags-1].tagclass == descr.tagclass && UE__Identity_eSN_descr_.ber->tags[UE__Identity_eSN_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { eSN().OER_decode(UE__Identity_eSN_descr_, p_buf, p_oer); } else if (UE__Identity_iMSIDS41_descr_.ber->tags[UE__Identity_iMSIDS41_descr_.ber->n_tags-1].tagclass == descr.tagclass && UE__Identity_iMSIDS41_descr_.ber->tags[UE__Identity_iMSIDS41_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { iMSIDS41().OER_decode(UE__Identity_iMSIDS41_descr_, p_buf, p_oer); } else if (UE__Identity_iMSIESN_descr_.ber->tags[UE__Identity_iMSIESN_descr_.ber->n_tags-1].tagclass == descr.tagclass && UE__Identity_iMSIESN_descr_.ber->tags[UE__Identity_iMSIESN_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { iMSIESN().OER_decode(UE__Identity_iMSIESN_descr_, p_buf, p_oer); } else if (UE__Identity_tMSIDS41_descr_.ber->tags[UE__Identity_tMSIDS41_descr_.ber->n_tags-1].tagclass == descr.tagclass && UE__Identity_tMSIDS41_descr_.ber->tags[UE__Identity_tMSIDS41_descr_.ber->n_tags-1].tagnumber == descr.tagnumber) { tMSIDS41().OER_decode(UE__Identity_tMSIDS41_descr_, p_buf, p_oer); } else { TTCN_error("Cannot find matching tag for type UE__Identity"); } return 0; } void UE__Identity::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_iMSI: { INTEGER::PER_encode_int(p_buf, 0, 3); field_iMSI->PER_encode(UE__Identity_iMSI_descr_, p_buf, p_options); break; } case ALT_tMSILAI: { INTEGER::PER_encode_int(p_buf, 1, 3); field_tMSILAI->PER_encode(UE__Identity_tMSILAI_descr_, p_buf, p_options); break; } case ALT_pTMSIRAI: { INTEGER::PER_encode_int(p_buf, 2, 3); field_pTMSIRAI->PER_encode(UE__Identity_pTMSIRAI_descr_, p_buf, p_options); break; } case ALT_iMEI: { INTEGER::PER_encode_int(p_buf, 3, 3); field_iMEI->PER_encode(UE__Identity_iMEI_descr_, p_buf, p_options); break; } case ALT_eSN: { INTEGER::PER_encode_int(p_buf, 4, 3); field_eSN->PER_encode(UE__Identity_eSN_descr_, p_buf, p_options); break; } case ALT_iMSIDS41: { INTEGER::PER_encode_int(p_buf, 5, 3); field_iMSIDS41->PER_encode(UE__Identity_iMSIDS41_descr_, p_buf, p_options); break; } case ALT_iMSIESN: { INTEGER::PER_encode_int(p_buf, 6, 3); field_iMSIESN->PER_encode(UE__Identity_iMSIESN_descr_, p_buf, p_options); break; } case ALT_tMSIDS41: { INTEGER::PER_encode_int(p_buf, 7, 3); field_tMSIDS41->PER_encode(UE__Identity_tMSIDS41_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 UE__Identity::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, 3, FALSE, sel_int); switch (sel_int) { case 0: iMSI().PER_decode(UE__Identity_iMSI_descr_, p_buf, p_options); break; case 1: tMSILAI().PER_decode(UE__Identity_tMSILAI_descr_, p_buf, p_options); break; case 2: pTMSIRAI().PER_decode(UE__Identity_pTMSIRAI_descr_, p_buf, p_options); break; case 3: iMEI().PER_decode(UE__Identity_iMEI_descr_, p_buf, p_options); break; case 4: eSN().PER_decode(UE__Identity_eSN_descr_, p_buf, p_options); break; case 5: iMSIDS41().PER_decode(UE__Identity_iMSIDS41_descr_, p_buf, p_options); break; case 6: iMSIESN().PER_decode(UE__Identity_iMSIESN_descr_, p_buf, p_options); break; case 7: tMSIDS41().PER_decode(UE__Identity_tMSIDS41_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 UE__Identity_template::copy_value(const UE__Identity& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case UE__Identity::ALT_iMSI: single_value.field_iMSI = new OCTETSTRING_template(other_value.iMSI()); break; case UE__Identity::ALT_tMSILAI: single_value.field_tMSILAI = new TMSILAI_template(other_value.tMSILAI()); break; case UE__Identity::ALT_pTMSIRAI: single_value.field_pTMSIRAI = new PTMSIRAI_template(other_value.pTMSIRAI()); break; case UE__Identity::ALT_iMEI: single_value.field_iMEI = new BITSTRING_template(other_value.iMEI()); break; case UE__Identity::ALT_eSN: single_value.field_eSN = new BITSTRING_template(other_value.eSN()); break; case UE__Identity::ALT_iMSIDS41: single_value.field_iMSIDS41 = new OCTETSTRING_template(other_value.iMSIDS41()); break; case UE__Identity::ALT_iMSIESN: single_value.field_iMSIESN = new IMSIESN_template(other_value.iMSIESN()); break; case UE__Identity::ALT_tMSIDS41: single_value.field_tMSIDS41 = new OCTETSTRING_template(other_value.tMSIDS41()); break; default: TTCN_error("Initializing a template with an unbound value of type @HNBAP-IEs.UE-Identity."); } set_selection(SPECIFIC_VALUE); } void UE__Identity_template::copy_template(const UE__Identity_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 UE__Identity::ALT_iMSI: single_value.field_iMSI = new OCTETSTRING_template(*other_value.single_value.field_iMSI); break; case UE__Identity::ALT_tMSILAI: single_value.field_tMSILAI = new TMSILAI_template(*other_value.single_value.field_tMSILAI); break; case UE__Identity::ALT_pTMSIRAI: single_value.field_pTMSIRAI = new PTMSIRAI_template(*other_value.single_value.field_pTMSIRAI); break; case UE__Identity::ALT_iMEI: single_value.field_iMEI = new BITSTRING_template(*other_value.single_value.field_iMEI); break; case UE__Identity::ALT_eSN: single_value.field_eSN = new BITSTRING_template(*other_value.single_value.field_eSN); break; case UE__Identity::ALT_iMSIDS41: single_value.field_iMSIDS41 = new OCTETSTRING_template(*other_value.single_value.field_iMSIDS41); break; case UE__Identity::ALT_iMSIESN: single_value.field_iMSIESN = new IMSIESN_template(*other_value.single_value.field_iMSIESN); break; case UE__Identity::ALT_tMSIDS41: single_value.field_tMSIDS41 = new OCTETSTRING_template(*other_value.single_value.field_tMSIDS41); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @HNBAP-IEs.UE-Identity."); } 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 UE__Identity_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 UE__Identity_template(*other_value.implication_.precondition); implication_.implied_template = new UE__Identity_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 @HNBAP-IEs.UE-Identity."); } set_selection(other_value); } UE__Identity_template::UE__Identity_template() { } UE__Identity_template::UE__Identity_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } UE__Identity_template::UE__Identity_template(const UE__Identity& other_value) { copy_value(other_value); } UE__Identity_template::UE__Identity_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const UE__Identity&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @HNBAP-IEs.UE-Identity from an unbound optional field."); } } UE__Identity_template::UE__Identity_template(UE__Identity_template* p_precondition, UE__Identity_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } UE__Identity_template::UE__Identity_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; } UE__Identity_template::UE__Identity_template(const UE__Identity_template& other_value) : Base_Template(){ copy_template(other_value); } UE__Identity_template::~UE__Identity_template() { clean_up(); } void UE__Identity_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case UE__Identity::ALT_iMSI: delete single_value.field_iMSI; break; case UE__Identity::ALT_tMSILAI: delete single_value.field_tMSILAI; break; case UE__Identity::ALT_pTMSIRAI: delete single_value.field_pTMSIRAI; break; case UE__Identity::ALT_iMEI: delete single_value.field_iMEI; break; case UE__Identity::ALT_eSN: delete single_value.field_eSN; break; case UE__Identity::ALT_iMSIDS41: delete single_value.field_iMSIDS41; break; case UE__Identity::ALT_iMSIESN: delete single_value.field_iMSIESN; break; case UE__Identity::ALT_tMSIDS41: delete single_value.field_tMSIDS41; 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; } UE__Identity_template& UE__Identity_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } UE__Identity_template& UE__Identity_template::operator=(const UE__Identity& other_value) { clean_up(); copy_value(other_value); return *this; } UE__Identity_template& UE__Identity_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const UE__Identity&)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 @HNBAP-IEs.UE-Identity."); } return *this; } UE__Identity_template& UE__Identity_template::operator=(const UE__Identity_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean UE__Identity_template::match(const UE__Identity& 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: { UE__Identity::union_selection_type value_selection = other_value.get_selection(); if (value_selection == UE__Identity::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case UE__Identity::ALT_iMSI: return single_value.field_iMSI->match(other_value.iMSI(), legacy); case UE__Identity::ALT_tMSILAI: return single_value.field_tMSILAI->match(other_value.tMSILAI(), legacy); case UE__Identity::ALT_pTMSIRAI: return single_value.field_pTMSIRAI->match(other_value.pTMSIRAI(), legacy); case UE__Identity::ALT_iMEI: return single_value.field_iMEI->match(other_value.iMEI(), legacy); case UE__Identity::ALT_eSN: return single_value.field_eSN->match(other_value.eSN(), legacy); case UE__Identity::ALT_iMSIDS41: return single_value.field_iMSIDS41->match(other_value.iMSIDS41(), legacy); case UE__Identity::ALT_iMSIESN: return single_value.field_iMSIESN->match(other_value.iMSIESN(), legacy); case UE__Identity::ALT_tMSIDS41: return single_value.field_tMSIDS41->match(other_value.tMSIDS41(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @HNBAP-IEs.UE-Identity."); } } 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 @HNBAP-IEs.UE-Identity."); } return FALSE; } boolean UE__Identity_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case UE__Identity::ALT_iMSI: return single_value.field_iMSI->is_value(); case UE__Identity::ALT_tMSILAI: return single_value.field_tMSILAI->is_value(); case UE__Identity::ALT_pTMSIRAI: return single_value.field_pTMSIRAI->is_value(); case UE__Identity::ALT_iMEI: return single_value.field_iMEI->is_value(); case UE__Identity::ALT_eSN: return single_value.field_eSN->is_value(); case UE__Identity::ALT_iMSIDS41: return single_value.field_iMSIDS41->is_value(); case UE__Identity::ALT_iMSIESN: return single_value.field_iMSIESN->is_value(); case UE__Identity::ALT_tMSIDS41: return single_value.field_tMSIDS41->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @HNBAP-IEs.UE-Identity."); } } UE__Identity UE__Identity_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 @HNBAP-IEs.UE-Identity."); UE__Identity ret_val; switch (single_value.union_selection) { case UE__Identity::ALT_iMSI: ret_val.iMSI() = single_value.field_iMSI->valueof(); break; case UE__Identity::ALT_tMSILAI: ret_val.tMSILAI() = single_value.field_tMSILAI->valueof(); break; case UE__Identity::ALT_pTMSIRAI: ret_val.pTMSIRAI() = single_value.field_pTMSIRAI->valueof(); break; case UE__Identity::ALT_iMEI: ret_val.iMEI() = single_value.field_iMEI->valueof(); break; case UE__Identity::ALT_eSN: ret_val.eSN() = single_value.field_eSN->valueof(); break; case UE__Identity::ALT_iMSIDS41: ret_val.iMSIDS41() = single_value.field_iMSIDS41->valueof(); break; case UE__Identity::ALT_iMSIESN: ret_val.iMSIESN() = single_value.field_iMSIESN->valueof(); break; case UE__Identity::ALT_tMSIDS41: ret_val.tMSIDS41() = single_value.field_tMSIDS41->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @HNBAP-IEs.UE-Identity."); } return ret_val; } UE__Identity_template& UE__Identity_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 @HNBAP-IEs.UE-Identity."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @HNBAP-IEs.UE-Identity."); return value_list.list_value[list_index]; } void UE__Identity_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 @HNBAP-IEs.UE-Identity."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new UE__Identity_template[list_length]; } OCTETSTRING_template& UE__Identity_template::iMSI() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != UE__Identity::ALT_iMSI) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_iMSI = new OCTETSTRING_template(ANY_VALUE); else single_value.field_iMSI = new OCTETSTRING_template; single_value.union_selection = UE__Identity::ALT_iMSI; set_selection(SPECIFIC_VALUE); } return *single_value.field_iMSI; } const OCTETSTRING_template& UE__Identity_template::iMSI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iMSI in a non-specific template of union type @HNBAP-IEs.UE-Identity."); if (single_value.union_selection != UE__Identity::ALT_iMSI) TTCN_error("Accessing non-selected field iMSI in a template of union type @HNBAP-IEs.UE-Identity."); return *single_value.field_iMSI; } TMSILAI_template& UE__Identity_template::tMSILAI() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != UE__Identity::ALT_tMSILAI) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tMSILAI = new TMSILAI_template(ANY_VALUE); else single_value.field_tMSILAI = new TMSILAI_template; single_value.union_selection = UE__Identity::ALT_tMSILAI; set_selection(SPECIFIC_VALUE); } return *single_value.field_tMSILAI; } const TMSILAI_template& UE__Identity_template::tMSILAI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tMSILAI in a non-specific template of union type @HNBAP-IEs.UE-Identity."); if (single_value.union_selection != UE__Identity::ALT_tMSILAI) TTCN_error("Accessing non-selected field tMSILAI in a template of union type @HNBAP-IEs.UE-Identity."); return *single_value.field_tMSILAI; } PTMSIRAI_template& UE__Identity_template::pTMSIRAI() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != UE__Identity::ALT_pTMSIRAI) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_pTMSIRAI = new PTMSIRAI_template(ANY_VALUE); else single_value.field_pTMSIRAI = new PTMSIRAI_template; single_value.union_selection = UE__Identity::ALT_pTMSIRAI; set_selection(SPECIFIC_VALUE); } return *single_value.field_pTMSIRAI; } const PTMSIRAI_template& UE__Identity_template::pTMSIRAI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pTMSIRAI in a non-specific template of union type @HNBAP-IEs.UE-Identity."); if (single_value.union_selection != UE__Identity::ALT_pTMSIRAI) TTCN_error("Accessing non-selected field pTMSIRAI in a template of union type @HNBAP-IEs.UE-Identity."); return *single_value.field_pTMSIRAI; } BITSTRING_template& UE__Identity_template::iMEI() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != UE__Identity::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 BITSTRING_template(ANY_VALUE); else single_value.field_iMEI = new BITSTRING_template; single_value.union_selection = UE__Identity::ALT_iMEI; set_selection(SPECIFIC_VALUE); } return *single_value.field_iMEI; } const BITSTRING_template& UE__Identity_template::iMEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iMEI in a non-specific template of union type @HNBAP-IEs.UE-Identity."); if (single_value.union_selection != UE__Identity::ALT_iMEI) TTCN_error("Accessing non-selected field iMEI in a template of union type @HNBAP-IEs.UE-Identity."); return *single_value.field_iMEI; } BITSTRING_template& UE__Identity_template::eSN() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != UE__Identity::ALT_eSN) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_eSN = new BITSTRING_template(ANY_VALUE); else single_value.field_eSN = new BITSTRING_template; single_value.union_selection = UE__Identity::ALT_eSN; set_selection(SPECIFIC_VALUE); } return *single_value.field_eSN; } const BITSTRING_template& UE__Identity_template::eSN() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eSN in a non-specific template of union type @HNBAP-IEs.UE-Identity."); if (single_value.union_selection != UE__Identity::ALT_eSN) TTCN_error("Accessing non-selected field eSN in a template of union type @HNBAP-IEs.UE-Identity."); return *single_value.field_eSN; } OCTETSTRING_template& UE__Identity_template::iMSIDS41() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != UE__Identity::ALT_iMSIDS41) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_iMSIDS41 = new OCTETSTRING_template(ANY_VALUE); else single_value.field_iMSIDS41 = new OCTETSTRING_template; single_value.union_selection = UE__Identity::ALT_iMSIDS41; set_selection(SPECIFIC_VALUE); } return *single_value.field_iMSIDS41; } const OCTETSTRING_template& UE__Identity_template::iMSIDS41() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iMSIDS41 in a non-specific template of union type @HNBAP-IEs.UE-Identity."); if (single_value.union_selection != UE__Identity::ALT_iMSIDS41) TTCN_error("Accessing non-selected field iMSIDS41 in a template of union type @HNBAP-IEs.UE-Identity."); return *single_value.field_iMSIDS41; } IMSIESN_template& UE__Identity_template::iMSIESN() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != UE__Identity::ALT_iMSIESN) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_iMSIESN = new IMSIESN_template(ANY_VALUE); else single_value.field_iMSIESN = new IMSIESN_template; single_value.union_selection = UE__Identity::ALT_iMSIESN; set_selection(SPECIFIC_VALUE); } return *single_value.field_iMSIESN; } const IMSIESN_template& UE__Identity_template::iMSIESN() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iMSIESN in a non-specific template of union type @HNBAP-IEs.UE-Identity."); if (single_value.union_selection != UE__Identity::ALT_iMSIESN) TTCN_error("Accessing non-selected field iMSIESN in a template of union type @HNBAP-IEs.UE-Identity."); return *single_value.field_iMSIESN; } OCTETSTRING_template& UE__Identity_template::tMSIDS41() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != UE__Identity::ALT_tMSIDS41) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_tMSIDS41 = new OCTETSTRING_template(ANY_VALUE); else single_value.field_tMSIDS41 = new OCTETSTRING_template; single_value.union_selection = UE__Identity::ALT_tMSIDS41; set_selection(SPECIFIC_VALUE); } return *single_value.field_tMSIDS41; } const OCTETSTRING_template& UE__Identity_template::tMSIDS41() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tMSIDS41 in a non-specific template of union type @HNBAP-IEs.UE-Identity."); if (single_value.union_selection != UE__Identity::ALT_tMSIDS41) TTCN_error("Accessing non-selected field tMSIDS41 in a template of union type @HNBAP-IEs.UE-Identity."); return *single_value.field_tMSIDS41; } boolean UE__Identity_template::ischosen(UE__Identity::union_selection_type checked_selection) const { if (checked_selection == UE__Identity::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @HNBAP-IEs.UE-Identity."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == UE__Identity::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @HNBAP-IEs.UE-Identity."); 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 @HNBAP-IEs.UE-Identity 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 UE__Identity_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case UE__Identity::ALT_iMSI: TTCN_Logger::log_event_str("{ iMSI := "); single_value.field_iMSI->log(); TTCN_Logger::log_event_str(" }"); break; case UE__Identity::ALT_tMSILAI: TTCN_Logger::log_event_str("{ tMSILAI := "); single_value.field_tMSILAI->log(); TTCN_Logger::log_event_str(" }"); break; case UE__Identity::ALT_pTMSIRAI: TTCN_Logger::log_event_str("{ pTMSIRAI := "); single_value.field_pTMSIRAI->log(); TTCN_Logger::log_event_str(" }"); break; case UE__Identity::ALT_iMEI: TTCN_Logger::log_event_str("{ iMEI := "); single_value.field_iMEI->log(); TTCN_Logger::log_event_str(" }"); break; case UE__Identity::ALT_eSN: TTCN_Logger::log_event_str("{ eSN := "); single_value.field_eSN->log(); TTCN_Logger::log_event_str(" }"); break; case UE__Identity::ALT_iMSIDS41: TTCN_Logger::log_event_str("{ iMSIDS41 := "); single_value.field_iMSIDS41->log(); TTCN_Logger::log_event_str(" }"); break; case UE__Identity::ALT_iMSIESN: TTCN_Logger::log_event_str("{ iMSIESN := "); single_value.field_iMSIESN->log(); TTCN_Logger::log_event_str(" }"); break; case UE__Identity::ALT_tMSIDS41: TTCN_Logger::log_event_str("{ tMSIDS41 := "); single_value.field_tMSIDS41->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 UE__Identity_template::log_match(const UE__Identity& 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 UE__Identity::ALT_iMSI: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".iMSI"); single_value.field_iMSI->log_match(match_value.iMSI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ iMSI := "); single_value.field_iMSI->log_match(match_value.iMSI(), legacy); TTCN_Logger::log_event_str(" }"); } break; case UE__Identity::ALT_tMSILAI: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".tMSILAI"); single_value.field_tMSILAI->log_match(match_value.tMSILAI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ tMSILAI := "); single_value.field_tMSILAI->log_match(match_value.tMSILAI(), legacy); TTCN_Logger::log_event_str(" }"); } break; case UE__Identity::ALT_pTMSIRAI: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".pTMSIRAI"); single_value.field_pTMSIRAI->log_match(match_value.pTMSIRAI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ pTMSIRAI := "); single_value.field_pTMSIRAI->log_match(match_value.pTMSIRAI(), legacy); TTCN_Logger::log_event_str(" }"); } break; case UE__Identity::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 UE__Identity::ALT_eSN: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".eSN"); single_value.field_eSN->log_match(match_value.eSN(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ eSN := "); single_value.field_eSN->log_match(match_value.eSN(), legacy); TTCN_Logger::log_event_str(" }"); } break; case UE__Identity::ALT_iMSIDS41: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".iMSIDS41"); single_value.field_iMSIDS41->log_match(match_value.iMSIDS41(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ iMSIDS41 := "); single_value.field_iMSIDS41->log_match(match_value.iMSIDS41(), legacy); TTCN_Logger::log_event_str(" }"); } break; case UE__Identity::ALT_iMSIESN: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".iMSIESN"); single_value.field_iMSIESN->log_match(match_value.iMSIESN(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ iMSIESN := "); single_value.field_iMSIESN->log_match(match_value.iMSIESN(), legacy); TTCN_Logger::log_event_str(" }"); } break; case UE__Identity::ALT_tMSIDS41: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".tMSIDS41"); single_value.field_tMSIDS41->log_match(match_value.tMSIDS41(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ tMSIDS41 := "); single_value.field_tMSIDS41->log_match(match_value.tMSIDS41(), 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 UE__Identity_template::set_implicit_omit() { if (template_selection != SPECIFIC_VALUE) return; switch (single_value.union_selection) { case UE__Identity::ALT_iMSI: single_value.field_iMSI->set_implicit_omit(); break; case UE__Identity::ALT_tMSILAI: single_value.field_tMSILAI->set_implicit_omit(); break; case UE__Identity::ALT_pTMSIRAI: single_value.field_pTMSIRAI->set_implicit_omit(); break; case UE__Identity::ALT_iMEI: single_value.field_iMEI->set_implicit_omit(); break; case UE__Identity::ALT_eSN: single_value.field_eSN->set_implicit_omit(); break; case UE__Identity::ALT_iMSIDS41: single_value.field_iMSIDS41->set_implicit_omit(); break; case UE__Identity::ALT_iMSIESN: single_value.field_iMSIESN->set_implicit_omit(); break; case UE__Identity::ALT_tMSIDS41: single_value.field_tMSIDS41->set_implicit_omit(); break; default: break; } } void UE__Identity_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 UE__Identity::ALT_iMSI: single_value.field_iMSI->encode_text(text_buf); break; case UE__Identity::ALT_tMSILAI: single_value.field_tMSILAI->encode_text(text_buf); break; case UE__Identity::ALT_pTMSIRAI: single_value.field_pTMSIRAI->encode_text(text_buf); break; case UE__Identity::ALT_iMEI: single_value.field_iMEI->encode_text(text_buf); break; case UE__Identity::ALT_eSN: single_value.field_eSN->encode_text(text_buf); break; case UE__Identity::ALT_iMSIDS41: single_value.field_iMSIDS41->encode_text(text_buf); break; case UE__Identity::ALT_iMSIESN: single_value.field_iMSIESN->encode_text(text_buf); break; case UE__Identity::ALT_tMSIDS41: single_value.field_tMSIDS41->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @HNBAP-IEs.UE-Identity."); } 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 @HNBAP-IEs.UE-Identity."); } } void UE__Identity_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = UE__Identity::UNBOUND_VALUE; UE__Identity::union_selection_type new_selection = (UE__Identity::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case UE__Identity::ALT_iMSI: single_value.field_iMSI = new OCTETSTRING_template; single_value.field_iMSI->decode_text(text_buf); break; case UE__Identity::ALT_tMSILAI: single_value.field_tMSILAI = new TMSILAI_template; single_value.field_tMSILAI->decode_text(text_buf); break; case UE__Identity::ALT_pTMSIRAI: single_value.field_pTMSIRAI = new PTMSIRAI_template; single_value.field_pTMSIRAI->decode_text(text_buf); break; case UE__Identity::ALT_iMEI: single_value.field_iMEI = new BITSTRING_template; single_value.field_iMEI->decode_text(text_buf); break; case UE__Identity::ALT_eSN: single_value.field_eSN = new BITSTRING_template; single_value.field_eSN->decode_text(text_buf); break; case UE__Identity::ALT_iMSIDS41: single_value.field_iMSIDS41 = new OCTETSTRING_template; single_value.field_iMSIDS41->decode_text(text_buf); break; case UE__Identity::ALT_iMSIESN: single_value.field_iMSIESN = new IMSIESN_template; single_value.field_iMSIESN->decode_text(text_buf); break; case UE__Identity::ALT_tMSIDS41: single_value.field_tMSIDS41 = new OCTETSTRING_template; single_value.field_tMSIDS41->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @HNBAP-IEs.UE-Identity."); } 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 UE__Identity_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 @HNBAP-IEs.UE-Identity."); } } boolean UE__Identity_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean UE__Identity_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 `@HNBAP-IEs.UE-Identity'"); } if (strcmp("iMSI", param_field) == 0) { iMSI().set_param(param); return; } else if (strcmp("tMSILAI", param_field) == 0) { tMSILAI().set_param(param); return; } else if (strcmp("pTMSIRAI", param_field) == 0) { pTMSIRAI().set_param(param); return; } else if (strcmp("iMEI", param_field) == 0) { iMEI().set_param(param); return; } else if (strcmp("eSN", param_field) == 0) { eSN().set_param(param); return; } else if (strcmp("iMSIDS41", param_field) == 0) { iMSIDS41().set_param(param); return; } else if (strcmp("iMSIESN", param_field) == 0) { iMSIESN().set_param(param); return; } else if (strcmp("tMSIDS41", param_field) == 0) { tMSIDS41().set_param(param); return; } else param.error("Field `%s' not found in union template type `@HNBAP-IEs.UE-Identity'", 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: { UE__Identity_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", "@HNBAP-IEs.UE-Identity"); 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, "iMSI")) { iMSI().set_param(*mp_last); break; } if (!strcmp(last_name, "tMSILAI")) { tMSILAI().set_param(*mp_last); break; } if (!strcmp(last_name, "pTMSIRAI")) { pTMSIRAI().set_param(*mp_last); break; } if (!strcmp(last_name, "iMEI")) { iMEI().set_param(*mp_last); break; } if (!strcmp(last_name, "eSN")) { eSN().set_param(*mp_last); break; } if (!strcmp(last_name, "iMSIDS41")) { iMSIDS41().set_param(*mp_last); break; } if (!strcmp(last_name, "iMSIESN")) { iMSIESN().set_param(*mp_last); break; } if (!strcmp(last_name, "tMSIDS41")) { tMSIDS41().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @HNBAP-IEs.UE-Identity.", last_name); } break; case Module_Param::MP_Implication_Template: { UE__Identity_template* precondition = new UE__Identity_template; precondition->set_param(*m_p->get_elem(0)); UE__Identity_template* implied_template = new UE__Identity_template; implied_template->set_param(*m_p->get_elem(1)); *this = UE__Identity_template(precondition, implied_template); } break; default: param.type_error("union template", "@HNBAP-IEs.UE-Identity"); } is_ifpresent = param.get_ifpresent(); } void UE__Identity_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 UE__Identity::ALT_iMSI: single_value.field_iMSI->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Identity"); return; case UE__Identity::ALT_tMSILAI: single_value.field_tMSILAI->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Identity"); return; case UE__Identity::ALT_pTMSIRAI: single_value.field_pTMSIRAI->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Identity"); return; case UE__Identity::ALT_iMEI: single_value.field_iMEI->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Identity"); return; case UE__Identity::ALT_eSN: single_value.field_eSN->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Identity"); return; case UE__Identity::ALT_iMSIDS41: single_value.field_iMSIDS41->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Identity"); return; case UE__Identity::ALT_iMSIESN: single_value.field_iMSIESN->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Identity"); return; case UE__Identity::ALT_tMSIDS41: single_value.field_tMSIDS41->check_restriction(t_res, t_name ? t_name : "@HNBAP-IEs.UE-Identity"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @HNBAP-IEs.UE-Identity."); } 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 : "@HNBAP-IEs.UE-Identity"); } Update__cause::Update__cause() { enum_value = UNBOUND_VALUE; } Update__cause::Update__cause(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @HNBAP-IEs.Update-cause with invalid numeric value %d.", other_value); enum_value = (enum_type)other_value; } Update__cause::Update__cause(enum_type other_value) { enum_value = other_value; } Update__cause::Update__cause(const Update__cause& other_value) : Base_Type() { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @HNBAP-IEs.Update-cause."); enum_value = other_value.enum_value; } Update__cause& Update__cause::operator=(int other_value) { if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @HNBAP-IEs.Update-cause.", other_value); enum_value = (enum_type)other_value; return *this; } Update__cause& Update__cause::operator=(enum_type other_value) { enum_value = other_value; return *this; } Update__cause& Update__cause::operator=(const Update__cause& other_value) { if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.Update-cause."); enum_value = other_value.enum_value; return *this; } boolean Update__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 @HNBAP-IEs.Update-cause."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.Update-cause comparison is an unknown numeric value %d", other_value); return enum_value == other_value; } boolean Update__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 @HNBAP-IEs.Update-cause."); return enum_value == other_value; } boolean Update__cause::operator==(const Update__cause& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Update-cause."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Update-cause."); return enum_value == other_value.enum_value; } boolean Update__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 @HNBAP-IEs.Update-cause."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.Update-cause comparison is an unknown numeric value %d", other_value); return enum_value < other_value; } boolean Update__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 @HNBAP-IEs.Update-cause."); return enum_value < other_value; } boolean Update__cause::operator<(const Update__cause& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Update-cause."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Update-cause."); return enum_value < other_value.enum_value; } boolean Update__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 @HNBAP-IEs.Update-cause."); if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @HNBAP-IEs.Update-cause comparison is an unknown numeric value %d", other_value); return enum_value > other_value; } boolean Update__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 @HNBAP-IEs.Update-cause."); return enum_value > other_value; } boolean Update__cause::operator>(const Update__cause& other_value) const { if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Update-cause."); if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @HNBAP-IEs.Update-cause."); return enum_value > other_value.enum_value; } const char *Update__cause::enum_to_str(enum_type enum_par) { switch (enum_par) { case relocation__preparation: return "relocation_preparation"; default: return ""; } } Update__cause::enum_type Update__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, "relocation_preparation")) return relocation__preparation; } return UNKNOWN_VALUE; } boolean Update__cause::is_valid_enum(int int_par) { switch (int_par) { case 0: return TRUE; default: return FALSE; } } int Update__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 @HNBAP-IEs.Update-cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par; } int Update__cause::enum2int(const Update__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 @HNBAP-IEs.Update-cause.", enum_par==UNBOUND_VALUE?"unbound":"invalid"); return enum_par.enum_value; } void Update__cause::int2enum(int int_val) { if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @HNBAP-IEs.Update-cause.", int_val); enum_value = (enum_type)int_val; } Update__cause::operator Update__cause::enum_type() const { if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @HNBAP-IEs.Update-cause."); return enum_value; } void Update__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 Update__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", "@HNBAP-IEs.Update-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 @HNBAP-IEs.Update-cause."); } } void Update__cause::encode_text(Text_Buf& text_buf) const { if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @HNBAP-IEs.Update-cause."); text_buf.push_int(enum_value); } void Update__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 @HNBAP-IEs.Update-cause.", enum_value); } void Update__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 Update__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* Update__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 Update__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 @HNBAP-IEs.Update-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 Update__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 @HNBAP-IEs.Update-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 Update__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 = relocation__preparation; } 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 Update__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 @HNBAP-IEs.Update-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 Update__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 Update__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 relocation__preparation: enc_val = 0; ext_bit = FALSE; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound or unknown value of enumerated type @HNBAP-IEs.Update-cause."); } p_buf.PER_put_bit(ext_bit); if (ext_bit) enc_val.PER_encode_normally_small(p_buf, p_options); } void Update__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 enum_value = relocation__preparation; int dec_int = ext_bit ? (int)dec_val : 0; if (ext_bit) switch (dec_int) { default: enum_value = UNBOUND_VALUE; break; } } void Update__cause_template::copy_template(const Update__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 Update__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 Update__cause_template(*other_value.implication_.precondition); implication_.implied_template = new Update__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 @HNBAP-IEs.Update-cause."); } } Update__cause_template::Update__cause_template() { } Update__cause_template::Update__cause_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Update__cause_template::Update__cause_template(int other_value) : Base_Template(SPECIFIC_VALUE) { if (!Update__cause::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @HNBAP-IEs.Update-cause with unknown numeric value %d.", other_value); single_value = (Update__cause::enum_type)other_value; } Update__cause_template::Update__cause_template(Update__cause::enum_type other_value) : Base_Template(SPECIFIC_VALUE) { single_value = other_value; } Update__cause_template::Update__cause_template(const Update__cause& other_value) : Base_Template(SPECIFIC_VALUE) { if (other_value.enum_value == Update__cause::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @HNBAP-IEs.Update-cause."); single_value = other_value.enum_value; } Update__cause_template::Update__cause_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (Update__cause::enum_type)(const Update__cause&)other_value; break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of enumerated type @HNBAP-IEs.Update-cause from an unbound optional field."); } } Update__cause_template::Update__cause_template(Update__cause_template* p_precondition, Update__cause_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Update__cause_template::Update__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; } Update__cause_template::Update__cause_template(const Update__cause_template& other_value) : Base_Template() { copy_template(other_value); } Update__cause_template::~Update__cause_template() { clean_up(); } boolean Update__cause_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; return TRUE; } boolean Update__cause_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value != Update__cause::UNBOUND_VALUE; } void Update__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; } Update__cause_template& Update__cause_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Update__cause_template& Update__cause_template::operator=(int other_value) { if (!Update__cause::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @HNBAP-IEs.Update-cause.", other_value); clean_up(); set_selection(SPECIFIC_VALUE); single_value = (Update__cause::enum_type)other_value; return *this; } Update__cause_template& Update__cause_template::operator=(Update__cause::enum_type other_value) { clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value; return *this; } Update__cause_template& Update__cause_template::operator=(const Update__cause& other_value) { if (other_value.enum_value == Update__cause::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @HNBAP-IEs.Update-cause to a template."); clean_up(); set_selection(SPECIFIC_VALUE); single_value = other_value.enum_value; return *this; } Update__cause_template& Update__cause_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: set_selection(SPECIFIC_VALUE); single_value = (Update__cause::enum_type)(const Update__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 @HNBAP-IEs.Update-cause."); } return *this; } Update__cause_template& Update__cause_template::operator=(const Update__cause_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Update__cause_template::match(Update__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 @HNBAP-IEs.Update-cause."); } return FALSE; } boolean Update__cause_template::match(const Update__cause& other_value, boolean) const { if (other_value.enum_value == Update__cause::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @HNBAP-IEs.Update-cause with an unbound value."); return match(other_value.enum_value); } Update__cause::enum_type Update__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 @HNBAP-IEs.Update-cause."); return single_value; } void Update__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 Update__cause_template[list_length]; break; default: TTCN_error("Setting an invalid type for a template of enumerated type @HNBAP-IEs.Update-cause."); } } Update__cause_template& Update__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 @HNBAP-IEs.Update-cause."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of enumerated type @HNBAP-IEs.Update-cause."); return value_list.list_value[list_index]; } void Update__cause_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_enum(Update__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 Update__cause_template::log_match(const Update__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 Update__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 @HNBAP-IEs.Update-cause."); } } void Update__cause_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value = (Update__cause::enum_type)text_buf.pull_int().get_val(); if (!Update__cause::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @HNBAP-IEs.Update-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 Update__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 @HNBAP-IEs.Update-cause."); } } boolean Update__cause_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Update__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: { Update__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: { Update__cause::enum_type enum_val = Update__cause::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value()); if (!Update__cause::is_valid_enum(enum_val)) { param.error("Invalid enumerated value for type @HNBAP-IEs.Update-cause."); } *this = enum_val; } break; case Module_Param::MP_Implication_Template: { Update__cause_template* precondition = new Update__cause_template; precondition->set_param(*m_p->get_elem(0)); Update__cause_template* implied_template = new Update__cause_template; implied_template->set_param(*m_p->get_elem(1)); *this = Update__cause_template(precondition, implied_template); } break; default: param.type_error("enumerated template", "@HNBAP-IEs.Update-cause"); } is_ifpresent = param.get_ifpresent(); } void Update__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 : "@HNBAP-IEs.Update-cause"); } /* Bodies of functions, altsteps and testcases */ void Access__stratum__release__indicator_encoder(const Access__stratum__release__indicator& 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 `@HNBAP-IEs.Access-stratum-release-indicator' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Access__stratum__release__indicator_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Access__stratum__release__indicator_decoder(OCTETSTRING& input_stream, Access__stratum__release__indicator& 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 `@HNBAP-IEs.Access-stratum-release-indicator' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Access__stratum__release__indicator_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 AccessResult_encoder(const AccessResult& 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 `@HNBAP-IEs.AccessResult' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(AccessResult_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER AccessResult_decoder(OCTETSTRING& input_stream, AccessResult& 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 `@HNBAP-IEs.AccessResult' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(AccessResult_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 AltitudeAndDirection_directionOfAltitude_encoder(const AltitudeAndDirection_directionOfAltitude& 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 `@HNBAP-IEs.AltitudeAndDirection.directionOfAltitude' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(AltitudeAndDirection_directionOfAltitude_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER AltitudeAndDirection_directionOfAltitude_decoder(OCTETSTRING& input_stream, AltitudeAndDirection_directionOfAltitude& 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 `@HNBAP-IEs.AltitudeAndDirection.directionOfAltitude' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(AltitudeAndDirection_directionOfAltitude_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 AltitudeAndDirection_altitude_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(AltitudeAndDirection_altitude_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER AltitudeAndDirection_altitude_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(AltitudeAndDirection_altitude_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 AltitudeAndDirection_encoder(const AltitudeAndDirection& 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 `@HNBAP-IEs.AltitudeAndDirection' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(AltitudeAndDirection_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER AltitudeAndDirection_decoder(OCTETSTRING& input_stream, AltitudeAndDirection& 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 `@HNBAP-IEs.AltitudeAndDirection' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(AltitudeAndDirection_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 BackoffTimer_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(BackoffTimer_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER BackoffTimer_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(BackoffTimer_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 BindingID_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(BindingID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER BindingID_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(BindingID_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 CauseRadioNetwork_encoder(const CauseRadioNetwork& 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 `@HNBAP-IEs.CauseRadioNetwork' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CauseRadioNetwork_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CauseRadioNetwork_decoder(OCTETSTRING& input_stream, CauseRadioNetwork& 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 `@HNBAP-IEs.CauseRadioNetwork' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CauseRadioNetwork_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 Cause_radioNetwork_encoder(const CauseRadioNetwork& 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 `@HNBAP-IEs.CauseRadioNetwork' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Cause_radioNetwork_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Cause_radioNetwork_decoder(OCTETSTRING& input_stream, CauseRadioNetwork& 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 `@HNBAP-IEs.CauseRadioNetwork' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Cause_radioNetwork_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 CauseTransport_encoder(const CauseTransport& 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 `@HNBAP-IEs.CauseTransport' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CauseTransport_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CauseTransport_decoder(OCTETSTRING& input_stream, CauseTransport& 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 `@HNBAP-IEs.CauseTransport' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CauseTransport_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 Cause_transport_encoder(const CauseTransport& 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 `@HNBAP-IEs.CauseTransport' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Cause_transport_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Cause_transport_decoder(OCTETSTRING& input_stream, CauseTransport& 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 `@HNBAP-IEs.CauseTransport' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Cause_transport_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 CauseProtocol_encoder(const CauseProtocol& 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 `@HNBAP-IEs.CauseProtocol' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CauseProtocol_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CauseProtocol_decoder(OCTETSTRING& input_stream, CauseProtocol& 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 `@HNBAP-IEs.CauseProtocol' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CauseProtocol_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 Cause_protocol_encoder(const CauseProtocol& 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 `@HNBAP-IEs.CauseProtocol' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Cause_protocol_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Cause_protocol_decoder(OCTETSTRING& input_stream, CauseProtocol& 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 `@HNBAP-IEs.CauseProtocol' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Cause_protocol_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 CauseMisc_encoder(const CauseMisc& 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 `@HNBAP-IEs.CauseMisc' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CauseMisc_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CauseMisc_decoder(OCTETSTRING& input_stream, CauseMisc& 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 `@HNBAP-IEs.CauseMisc' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CauseMisc_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 Cause_misc_encoder(const CauseMisc& 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 `@HNBAP-IEs.CauseMisc' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Cause_misc_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Cause_misc_decoder(OCTETSTRING& input_stream, CauseMisc& 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 `@HNBAP-IEs.CauseMisc' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Cause_misc_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 Cause_encoder(const Cause& 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 `@HNBAP-IEs.Cause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Cause_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Cause_decoder(OCTETSTRING& input_stream, Cause& 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 `@HNBAP-IEs.Cause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Cause_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 CellIdentity_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CellIdentity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CellIdentity_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CellIdentity_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 Context__ID_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Context__ID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Context__ID_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Context__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 CriticalityDiagnostics_procedureCode_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_procedureCode_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics_procedureCode_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_procedureCode_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_triggeringMessage_encoder(const HNBAP__CommonDataTypes::TriggeringMessage& 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 `@HNBAP-CommonDataTypes.TriggeringMessage' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics_triggeringMessage_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics_triggeringMessage_decoder(OCTETSTRING& input_stream, HNBAP__CommonDataTypes::TriggeringMessage& 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 `@HNBAP-CommonDataTypes.TriggeringMessage' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics_triggeringMessage_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_procedureCriticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CriticalityDiagnostics_procedureCriticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CriticalityDiagnostics_procedureCriticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CriticalityDiagnostics_procedureCriticality_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 CriticalityDiagnostics__IE__List& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.CriticalityDiagnostics-IE-List."); return other_value.val_ptr->n_elements == 0; } void CriticalityDiagnostics__IE__List_0_iECriticality_encoder(const HNBAP__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 `@HNBAP-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, HNBAP__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 `@HNBAP-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 `@HNBAP-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 `@HNBAP-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 `@HNBAP-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 `@HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst1_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst1_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst1' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 `@HNBAP-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 `@HNBAP-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 `@HNBAP-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 `@HNBAP-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 `@HNBAP-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 `@HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst2_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst2_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst2' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-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 `@HNBAP-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 `@HNBAP-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; } } void CSG__ID_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CSG__ID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CSG__ID_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CSG__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 CSG__Capability_encoder(const CSG__Capability& 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 `@HNBAP-IEs.CSG-Capability' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CSG__Capability_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CSG__Capability_decoder(OCTETSTRING& input_stream, CSG__Capability& 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 `@HNBAP-IEs.CSG-Capability' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CSG__Capability_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 CSGMembershipStatus_encoder(const CSGMembershipStatus& 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 `@HNBAP-IEs.CSGMembershipStatus' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CSGMembershipStatus_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CSGMembershipStatus_decoder(OCTETSTRING& input_stream, CSGMembershipStatus& 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 `@HNBAP-IEs.CSGMembershipStatus' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CSGMembershipStatus_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 PLMNidentity_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(PLMNidentity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER PLMNidentity_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(PLMNidentity_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 CGI_pLMNidentity_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CGI_pLMNidentity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CGI_pLMNidentity_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CGI_pLMNidentity_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 LAC_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(LAC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER LAC_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(LAC_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 CGI_lAC_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CGI_lAC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CGI_lAC_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CGI_lAC_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 CI_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CI_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CI_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 CGI_cI_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CGI_cI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CGI_cI_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CGI_cI_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst3_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3_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 CGI_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CGI_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CGI_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst3& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst3' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CGI_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 CGI_encoder(const CGI& 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 `@HNBAP-IEs.CGI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CGI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CGI_decoder(OCTETSTRING& input_stream, CGI& 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 `@HNBAP-IEs.CGI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CGI_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 CN__DomainIndicator_encoder(const CN__DomainIndicator& 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 `@HNBAP-IEs.CN-DomainIndicator' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(CN__DomainIndicator_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER CN__DomainIndicator_decoder(OCTETSTRING& input_stream, CN__DomainIndicator& 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 `@HNBAP-IEs.CN-DomainIndicator' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(CN__DomainIndicator_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 ESN_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(ESN_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER ESN_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(ESN_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 GeographicalCoordinates_latitudeSign_encoder(const GeographicalCoordinates_latitudeSign& 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 `@HNBAP-IEs.GeographicalCoordinates.latitudeSign' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(GeographicalCoordinates_latitudeSign_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalCoordinates_latitudeSign_decoder(OCTETSTRING& input_stream, GeographicalCoordinates_latitudeSign& 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 `@HNBAP-IEs.GeographicalCoordinates.latitudeSign' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(GeographicalCoordinates_latitudeSign_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 GeographicalCoordinates_latitude_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(GeographicalCoordinates_latitude_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalCoordinates_latitude_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(GeographicalCoordinates_latitude_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 GeographicalCoordinates_longitude_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(GeographicalCoordinates_longitude_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalCoordinates_longitude_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(GeographicalCoordinates_longitude_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst4_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4_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 GeographicalCoordinates_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(GeographicalCoordinates_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalCoordinates_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst4& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst4' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(GeographicalCoordinates_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 GeographicalCoordinates_encoder(const GeographicalCoordinates& 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 `@HNBAP-IEs.GeographicalCoordinates' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(GeographicalCoordinates_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalCoordinates_decoder(OCTETSTRING& input_stream, GeographicalCoordinates& 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 `@HNBAP-IEs.GeographicalCoordinates' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(GeographicalCoordinates_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 GeographicalLocation_geographicalCoordinates_encoder(const GeographicalCoordinates& 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 `@HNBAP-IEs.GeographicalCoordinates' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(GeographicalLocation_geographicalCoordinates_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalLocation_geographicalCoordinates_decoder(OCTETSTRING& input_stream, GeographicalCoordinates& 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 `@HNBAP-IEs.GeographicalCoordinates' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(GeographicalLocation_geographicalCoordinates_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 GeographicalLocation_altitudeAndDirection_encoder(const AltitudeAndDirection& 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 `@HNBAP-IEs.AltitudeAndDirection' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(GeographicalLocation_altitudeAndDirection_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalLocation_altitudeAndDirection_decoder(OCTETSTRING& input_stream, AltitudeAndDirection& 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 `@HNBAP-IEs.AltitudeAndDirection' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(GeographicalLocation_altitudeAndDirection_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst5_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5_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 GeographicalLocation_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(GeographicalLocation_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalLocation_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst5& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst5' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(GeographicalLocation_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 GeographicalLocation_encoder(const GeographicalLocation& 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 `@HNBAP-IEs.GeographicalLocation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(GeographicalLocation_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GeographicalLocation_decoder(OCTETSTRING& input_stream, GeographicalLocation& 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 `@HNBAP-IEs.GeographicalLocation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(GeographicalLocation_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 GTP__TEI_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(GTP__TEI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER GTP__TEI_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(GTP__TEI_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 HNB__Cell__Access__Mode_encoder(const HNB__Cell__Access__Mode& 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 `@HNBAP-IEs.HNB-Cell-Access-Mode' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Cell__Access__Mode_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Cell__Access__Mode_decoder(OCTETSTRING& input_stream, HNB__Cell__Access__Mode& 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 `@HNBAP-IEs.HNB-Cell-Access-Mode' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Cell__Access__Mode_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 HNB__Cell__Identifier_pLMNidentity_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Cell__Identifier_pLMNidentity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Cell__Identifier_pLMNidentity_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Cell__Identifier_pLMNidentity_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 HNB__Cell__Identifier_cellIdentity_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Cell__Identifier_cellIdentity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Cell__Identifier_cellIdentity_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Cell__Identifier_cellIdentity_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst6_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6_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 HNB__Cell__Identifier_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Cell__Identifier_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Cell__Identifier_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst6& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst6' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Cell__Identifier_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 HNB__Cell__Identifier_encoder(const HNB__Cell__Identifier& 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 `@HNBAP-IEs.HNB-Cell-Identifier' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Cell__Identifier_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Cell__Identifier_decoder(OCTETSTRING& input_stream, HNB__Cell__Identifier& 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 `@HNBAP-IEs.HNB-Cell-Identifier' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Cell__Identifier_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 HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_encoder(const HNB__Cell__Identifier& 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 `@HNBAP-IEs.HNB-Cell-Identifier' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_decoder(OCTETSTRING& input_stream, HNB__Cell__Identifier& 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 `@HNBAP-IEs.HNB-Cell-Identifier' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__RNL__Identity_hNB__Identity__as__Cell__Identifier_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 HNB__RNL__Identity_encoder(const HNB__RNL__Identity& 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 `@HNBAP-IEs.HNB-RNL-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__RNL__Identity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__RNL__Identity_decoder(OCTETSTRING& input_stream, HNB__RNL__Identity& 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 `@HNBAP-IEs.HNB-RNL-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__RNL__Identity_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 HNBConfigInfo_hnb__RNL__Identity_encoder(const HNB__RNL__Identity& 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 `@HNBAP-IEs.HNB-RNL-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigInfo_hnb__RNL__Identity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigInfo_hnb__RNL__Identity_decoder(OCTETSTRING& input_stream, HNB__RNL__Identity& 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 `@HNBAP-IEs.HNB-RNL-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigInfo_hnb__RNL__Identity_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 HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_encoder(const HNB__Cell__Access__Mode& 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 `@HNBAP-IEs.HNB-Cell-Access-Mode' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_decoder(OCTETSTRING& input_stream, HNB__Cell__Access__Mode& 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 `@HNBAP-IEs.HNB-Cell-Access-Mode' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationProvided_hNB__Cell__Access__Mode_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 Iurh__Signalling__TNL__AddressList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.Iurh-Signalling-TNL-AddressList."); return other_value.val_ptr->n_elements == 0; } void Ipv4Address_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Ipv4Address_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Ipv4Address_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Ipv4Address_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 IP__Address_ipaddress_ipv4info_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IP__Address_ipaddress_ipv4info_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IP__Address_ipaddress_ipv4info_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IP__Address_ipaddress_ipv4info_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 Ipv6Address_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Ipv6Address_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Ipv6Address_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Ipv6Address_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 IP__Address_ipaddress_ipv6info_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IP__Address_ipaddress_ipv6info_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IP__Address_ipaddress_ipv6info_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IP__Address_ipaddress_ipv6info_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 IP__Address_ipaddress_encoder(const IP__Address_ipaddress& 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 `@HNBAP-IEs.IP-Address.ipaddress' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IP__Address_ipaddress_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IP__Address_ipaddress_decoder(OCTETSTRING& input_stream, IP__Address_ipaddress& 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 `@HNBAP-IEs.IP-Address.ipaddress' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IP__Address_ipaddress_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst7' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst7_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7_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 IP__Address_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IP__Address_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IP__Address_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst7& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst7' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IP__Address_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 IP__Address_encoder(const IP__Address& 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 `@HNBAP-IEs.IP-Address' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IP__Address_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IP__Address_decoder(OCTETSTRING& input_stream, IP__Address& 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 `@HNBAP-IEs.IP-Address' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IP__Address_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 Iurh__Signalling__TNL__AddressList_0_encoder(const IP__Address& 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 `@HNBAP-IEs.IP-Address' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Iurh__Signalling__TNL__AddressList_0_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Iurh__Signalling__TNL__AddressList_0_decoder(OCTETSTRING& input_stream, IP__Address& 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 `@HNBAP-IEs.IP-Address' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Iurh__Signalling__TNL__AddressList_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 Iurh__Signalling__TNL__AddressList_encoder(const Iurh__Signalling__TNL__AddressList& 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 `@HNBAP-IEs.Iurh-Signalling-TNL-AddressList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Iurh__Signalling__TNL__AddressList_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Iurh__Signalling__TNL__AddressList_decoder(OCTETSTRING& input_stream, Iurh__Signalling__TNL__AddressList& 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 `@HNBAP-IEs.Iurh-Signalling-TNL-AddressList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Iurh__Signalling__TNL__AddressList_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 HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_encoder(const Iurh__Signalling__TNL__AddressList& 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 `@HNBAP-IEs.Iurh-Signalling-TNL-AddressList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_decoder(OCTETSTRING& input_stream, Iurh__Signalling__TNL__AddressList& 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 `@HNBAP-IEs.Iurh-Signalling-TNL-AddressList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationProvided_iurh__Signalling__TNL__AddressList_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 PSC_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(PSC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER PSC_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(PSC_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 HNBConfigurationInformationProvided_psc_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationProvided_psc_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationProvided_psc_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationProvided_psc_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 HNBConfigurationInformationProvided_cSG__ID_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationProvided_cSG__ID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationProvided_cSG__ID_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationProvided_cSG__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; } } boolean operator==(null_type, const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst8' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst8_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8_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 HNBConfigurationInformationProvided_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationProvided_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationProvided_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst8& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst8' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationProvided_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 HNBConfigurationInformationProvided_encoder(const HNBConfigurationInformationProvided& 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 `@HNBAP-IEs.HNBConfigurationInformationProvided' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationProvided_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationProvided_decoder(OCTETSTRING& input_stream, HNBConfigurationInformationProvided& 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 `@HNBAP-IEs.HNBConfigurationInformationProvided' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationProvided_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 ConfigurationInformation_provided_encoder(const HNBConfigurationInformationProvided& 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 `@HNBAP-IEs.HNBConfigurationInformationProvided' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(ConfigurationInformation_provided_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER ConfigurationInformation_provided_decoder(OCTETSTRING& input_stream, HNBConfigurationInformationProvided& 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 `@HNBAP-IEs.HNBConfigurationInformationProvided' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(ConfigurationInformation_provided_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 HNBConfigurationInformationMissing_cause_encoder(const Cause& 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 `@HNBAP-IEs.Cause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationMissing_cause_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationMissing_cause_decoder(OCTETSTRING& input_stream, Cause& 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 `@HNBAP-IEs.Cause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationMissing_cause_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst9' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst9_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9_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 HNBConfigurationInformationMissing_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationMissing_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationMissing_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst9& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst9' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationMissing_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 HNBConfigurationInformationMissing_encoder(const HNBConfigurationInformationMissing& 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 `@HNBAP-IEs.HNBConfigurationInformationMissing' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigurationInformationMissing_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigurationInformationMissing_decoder(OCTETSTRING& input_stream, HNBConfigurationInformationMissing& 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 `@HNBAP-IEs.HNBConfigurationInformationMissing' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigurationInformationMissing_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 ConfigurationInformation_missing_encoder(const HNBConfigurationInformationMissing& 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 `@HNBAP-IEs.HNBConfigurationInformationMissing' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(ConfigurationInformation_missing_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER ConfigurationInformation_missing_decoder(OCTETSTRING& input_stream, HNBConfigurationInformationMissing& 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 `@HNBAP-IEs.HNBConfigurationInformationMissing' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(ConfigurationInformation_missing_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 ConfigurationInformation_encoder(const ConfigurationInformation& 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 `@HNBAP-IEs.ConfigurationInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(ConfigurationInformation_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER ConfigurationInformation_decoder(OCTETSTRING& input_stream, ConfigurationInformation& 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 `@HNBAP-IEs.ConfigurationInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(ConfigurationInformation_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 HNBConfigInfo_configurationInformation_encoder(const ConfigurationInformation& 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 `@HNBAP-IEs.ConfigurationInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigInfo_configurationInformation_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigInfo_configurationInformation_decoder(OCTETSTRING& input_stream, ConfigurationInformation& 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 `@HNBAP-IEs.ConfigurationInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigInfo_configurationInformation_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst10' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst10_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10_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 HNBConfigInfo_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigInfo_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigInfo_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst10& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst10' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigInfo_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 HNBConfigInfo_encoder(const HNBConfigInfo& 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 `@HNBAP-IEs.HNBConfigInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNBConfigInfo_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNBConfigInfo_decoder(OCTETSTRING& input_stream, HNBConfigInfo& 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 `@HNBAP-IEs.HNBConfigInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNBConfigInfo_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 UTRANCellID_lAC_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UTRANCellID_lAC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UTRANCellID_lAC_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UTRANCellID_lAC_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 RAC_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RAC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RAC_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RAC_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 UTRANCellID_rAC_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UTRANCellID_rAC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UTRANCellID_rAC_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UTRANCellID_rAC_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 UTRANCellID_pLMNidentity_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UTRANCellID_pLMNidentity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UTRANCellID_pLMNidentity_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UTRANCellID_pLMNidentity_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 UTRANCellID_uTRANcellID_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UTRANCellID_uTRANcellID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UTRANCellID_uTRANcellID_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UTRANCellID_uTRANcellID_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst11' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst11_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11_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 UTRANCellID_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UTRANCellID_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UTRANCellID_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst11& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst11' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UTRANCellID_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 UTRANCellID_encoder(const UTRANCellID& 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 `@HNBAP-IEs.UTRANCellID' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UTRANCellID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UTRANCellID_decoder(OCTETSTRING& input_stream, UTRANCellID& 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 `@HNBAP-IEs.UTRANCellID' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UTRANCellID_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 MacroCellID_uTRANCellID_encoder(const UTRANCellID& 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 `@HNBAP-IEs.UTRANCellID' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(MacroCellID_uTRANCellID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER MacroCellID_uTRANCellID_decoder(OCTETSTRING& input_stream, UTRANCellID& 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 `@HNBAP-IEs.UTRANCellID' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(MacroCellID_uTRANCellID_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 MacroCellID_gERANCellID_encoder(const CGI& 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 `@HNBAP-IEs.CGI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(MacroCellID_gERANCellID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER MacroCellID_gERANCellID_decoder(OCTETSTRING& input_stream, CGI& 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 `@HNBAP-IEs.CGI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(MacroCellID_gERANCellID_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 MacroCellID_encoder(const MacroCellID& 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 `@HNBAP-IEs.MacroCellID' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(MacroCellID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER MacroCellID_decoder(OCTETSTRING& input_stream, MacroCellID& 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 `@HNBAP-IEs.MacroCellID' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(MacroCellID_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 MacroCoverageInformation_cellIdentity_encoder(const MacroCellID& 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 `@HNBAP-IEs.MacroCellID' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(MacroCoverageInformation_cellIdentity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER MacroCoverageInformation_cellIdentity_decoder(OCTETSTRING& input_stream, MacroCellID& 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 `@HNBAP-IEs.MacroCellID' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(MacroCoverageInformation_cellIdentity_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst12' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst12_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12_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 MacroCoverageInformation_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(MacroCoverageInformation_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER MacroCoverageInformation_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst12& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst12' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(MacroCoverageInformation_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 MacroCoverageInformation_encoder(const MacroCoverageInformation& 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 `@HNBAP-IEs.MacroCoverageInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(MacroCoverageInformation_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER MacroCoverageInformation_decoder(OCTETSTRING& input_stream, MacroCoverageInformation& 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 `@HNBAP-IEs.MacroCoverageInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(MacroCoverageInformation_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 HNB__Location__Information_macroCoverageInfo_encoder(const MacroCoverageInformation& 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 `@HNBAP-IEs.MacroCoverageInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Location__Information_macroCoverageInfo_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Location__Information_macroCoverageInfo_decoder(OCTETSTRING& input_stream, MacroCoverageInformation& 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 `@HNBAP-IEs.MacroCoverageInformation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Location__Information_macroCoverageInfo_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 HNB__Location__Information_geographicalCoordinates_encoder(const GeographicalLocation& 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 `@HNBAP-IEs.GeographicalLocation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Location__Information_geographicalCoordinates_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Location__Information_geographicalCoordinates_decoder(OCTETSTRING& input_stream, GeographicalLocation& 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 `@HNBAP-IEs.GeographicalLocation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Location__Information_geographicalCoordinates_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst13_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13_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 HNB__Location__Information_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Location__Information_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Location__Information_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst13& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst13' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Location__Information_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 HNB__Location__Information_encoder(const HNB__Location__Information& 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 `@HNBAP-IEs.HNB-Location-Information' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Location__Information_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Location__Information_decoder(OCTETSTRING& input_stream, HNB__Location__Information& 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 `@HNBAP-IEs.HNB-Location-Information' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Location__Information_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 HNB__Identity__Info_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Identity__Info_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Identity__Info_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Identity__Info_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 HNB__Identity_hNB__Identity__Info_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Identity_hNB__Identity__Info_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Identity_hNB__Identity__Info_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Identity_hNB__Identity__Info_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst14' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst14_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14_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 HNB__Identity_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Identity_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Identity_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst14& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst14' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Identity_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 HNB__Identity_encoder(const HNB__Identity& 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 `@HNBAP-IEs.HNB-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(HNB__Identity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER HNB__Identity_decoder(OCTETSTRING& input_stream, HNB__Identity& 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 `@HNBAP-IEs.HNB-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(HNB__Identity_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 IMEI_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IMEI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IMEI_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IMEI_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 IMSI_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IMSI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IMSI_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IMSI_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 IMSIDS41_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IMSIDS41_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IMSIDS41_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IMSIDS41_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 IMSIESN_iMSIDS41_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IMSIESN_iMSIDS41_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IMSIESN_iMSIDS41_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IMSIESN_iMSIDS41_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 IMSIESN_eSN_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IMSIESN_eSN_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IMSIESN_eSN_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IMSIESN_eSN_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 IMSIESN_encoder(const IMSIESN& 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 `@HNBAP-IEs.IMSIESN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(IMSIESN_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER IMSIESN_decoder(OCTETSTRING& input_stream, IMSIESN& 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 `@HNBAP-IEs.IMSIESN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(IMSIESN_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 LAI_pLMNID_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(LAI_pLMNID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER LAI_pLMNID_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(LAI_pLMNID_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 LAI_lAC_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(LAI_lAC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER LAI_lAC_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(LAI_lAC_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 LAI_encoder(const LAI& 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 `@HNBAP-IEs.LAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(LAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER LAI_decoder(OCTETSTRING& input_stream, LAI& 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 `@HNBAP-IEs.LAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(LAI_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 MuxPortNumber_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(MuxPortNumber_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER MuxPortNumber_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(MuxPortNumber_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 NeighbourInfoList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.NeighbourInfoList."); return other_value.val_ptr->n_elements == 0; } void NeighbourInfoList_0_encoder(const HNBConfigInfo& 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 `@HNBAP-IEs.HNBConfigInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(NeighbourInfoList_0_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER NeighbourInfoList_0_decoder(OCTETSTRING& input_stream, HNBConfigInfo& 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 `@HNBAP-IEs.HNBConfigInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(NeighbourInfoList_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 NeighbourInfoList_encoder(const NeighbourInfoList& 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 `@HNBAP-IEs.NeighbourInfoList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(NeighbourInfoList_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER NeighbourInfoList_decoder(OCTETSTRING& input_stream, NeighbourInfoList& 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 `@HNBAP-IEs.NeighbourInfoList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(NeighbourInfoList_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 NeighbourInfoRequestList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.NeighbourInfoRequestList."); return other_value.val_ptr->n_elements == 0; } void NeighbourInfoRequestItem_hnb__RNL__Identity_encoder(const HNB__RNL__Identity& 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 `@HNBAP-IEs.HNB-RNL-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(NeighbourInfoRequestItem_hnb__RNL__Identity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER NeighbourInfoRequestItem_hnb__RNL__Identity_decoder(OCTETSTRING& input_stream, HNB__RNL__Identity& 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 `@HNBAP-IEs.HNB-RNL-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(NeighbourInfoRequestItem_hnb__RNL__Identity_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst15' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst15_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15_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 NeighbourInfoRequestItem_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(NeighbourInfoRequestItem_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER NeighbourInfoRequestItem_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst15& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst15' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(NeighbourInfoRequestItem_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 NeighbourInfoRequestItem_encoder(const NeighbourInfoRequestItem& 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 `@HNBAP-IEs.NeighbourInfoRequestItem' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(NeighbourInfoRequestItem_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER NeighbourInfoRequestItem_decoder(OCTETSTRING& input_stream, NeighbourInfoRequestItem& 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 `@HNBAP-IEs.NeighbourInfoRequestItem' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(NeighbourInfoRequestItem_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 NeighbourInfoRequestList_0_encoder(const NeighbourInfoRequestItem& 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 `@HNBAP-IEs.NeighbourInfoRequestItem' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(NeighbourInfoRequestList_0_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER NeighbourInfoRequestList_0_decoder(OCTETSTRING& input_stream, NeighbourInfoRequestItem& 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 `@HNBAP-IEs.NeighbourInfoRequestItem' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(NeighbourInfoRequestList_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 NeighbourInfoRequestList_encoder(const NeighbourInfoRequestList& 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 `@HNBAP-IEs.NeighbourInfoRequestList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(NeighbourInfoRequestList_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER NeighbourInfoRequestList_decoder(OCTETSTRING& input_stream, NeighbourInfoRequestList& 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 `@HNBAP-IEs.NeighbourInfoRequestList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(NeighbourInfoRequestList_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 PTMSI_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(PTMSI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER PTMSI_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(PTMSI_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 PTMSIRAI_pTMSI_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(PTMSIRAI_pTMSI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER PTMSIRAI_pTMSI_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(PTMSIRAI_pTMSI_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 RAI_lAI_encoder(const LAI& 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 `@HNBAP-IEs.LAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RAI_lAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RAI_lAI_decoder(OCTETSTRING& input_stream, LAI& 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 `@HNBAP-IEs.LAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RAI_lAI_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 RAI_rAC_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RAI_rAC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RAI_rAC_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RAI_rAC_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 RAI_encoder(const RAI& 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 `@HNBAP-IEs.RAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RAI_decoder(OCTETSTRING& input_stream, RAI& 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 `@HNBAP-IEs.RAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RAI_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 PTMSIRAI_rAI_encoder(const RAI& 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 `@HNBAP-IEs.RAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(PTMSIRAI_rAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER PTMSIRAI_rAI_decoder(OCTETSTRING& input_stream, RAI& 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 `@HNBAP-IEs.RAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(PTMSIRAI_rAI_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 PTMSIRAI_encoder(const PTMSIRAI& 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 `@HNBAP-IEs.PTMSIRAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(PTMSIRAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER PTMSIRAI_decoder(OCTETSTRING& input_stream, PTMSIRAI& 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 `@HNBAP-IEs.PTMSIRAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(PTMSIRAI_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 RAB__ID_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RAB__ID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RAB__ID_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RAB__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; } } boolean operator==(null_type, const RABList& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.RABList."); return other_value.val_ptr->n_elements == 0; } void RABListItem_rAB__ID_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RABListItem_rAB__ID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RABListItem_rAB__ID_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RABListItem_rAB__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 TransportLayerAddress_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TransportLayerAddress_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TransportLayerAddress_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TransportLayerAddress_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 TransportInfo_transportLayerAddress_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TransportInfo_transportLayerAddress_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TransportInfo_transportLayerAddress_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TransportInfo_transportLayerAddress_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 TransportInfo_transportAssociation_gtp__TEI_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TransportInfo_transportAssociation_gtp__TEI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TransportInfo_transportAssociation_gtp__TEI_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TransportInfo_transportAssociation_gtp__TEI_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 TransportInfo_transportAssociation_bindingID_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TransportInfo_transportAssociation_bindingID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TransportInfo_transportAssociation_bindingID_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TransportInfo_transportAssociation_bindingID_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 TransportInfo_transportAssociation_encoder(const TransportInfo_transportAssociation& 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 `@HNBAP-IEs.TransportInfo.transportAssociation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TransportInfo_transportAssociation_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TransportInfo_transportAssociation_decoder(OCTETSTRING& input_stream, TransportInfo_transportAssociation& 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 `@HNBAP-IEs.TransportInfo.transportAssociation' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TransportInfo_transportAssociation_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst16' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst16_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16_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 TransportInfo_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TransportInfo_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TransportInfo_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst16& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst16' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TransportInfo_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 TransportInfo_encoder(const TransportInfo& 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 `@HNBAP-IEs.TransportInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TransportInfo_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TransportInfo_decoder(OCTETSTRING& input_stream, TransportInfo& 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 `@HNBAP-IEs.TransportInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TransportInfo_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 RABListItem_old__transport__Info_encoder(const TransportInfo& 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 `@HNBAP-IEs.TransportInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RABListItem_old__transport__Info_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RABListItem_old__transport__Info_decoder(OCTETSTRING& input_stream, TransportInfo& 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 `@HNBAP-IEs.TransportInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RABListItem_old__transport__Info_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 RABListItem_new__transport__Info_encoder(const TransportInfo& 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 `@HNBAP-IEs.TransportInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RABListItem_new__transport__Info_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RABListItem_new__transport__Info_decoder(OCTETSTRING& input_stream, TransportInfo& 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 `@HNBAP-IEs.TransportInfo' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RABListItem_new__transport__Info_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 RABListItem_cn__domain__indicator_encoder(const CN__DomainIndicator& 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 `@HNBAP-IEs.CN-DomainIndicator' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RABListItem_cn__domain__indicator_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RABListItem_cn__domain__indicator_decoder(OCTETSTRING& input_stream, CN__DomainIndicator& 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 `@HNBAP-IEs.CN-DomainIndicator' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RABListItem_cn__domain__indicator_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst17' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst17_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17_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 RABListItem_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RABListItem_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RABListItem_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst17& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst17' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RABListItem_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 RABListItem_encoder(const RABListItem& 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 `@HNBAP-IEs.RABListItem' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RABListItem_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RABListItem_decoder(OCTETSTRING& input_stream, RABListItem& 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 `@HNBAP-IEs.RABListItem' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RABListItem_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 RABList_0_encoder(const RABListItem& 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 `@HNBAP-IEs.RABListItem' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RABList_0_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RABList_0_decoder(OCTETSTRING& input_stream, RABListItem& 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 `@HNBAP-IEs.RABListItem' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RABList_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 RABList_encoder(const RABList& 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 `@HNBAP-IEs.RABList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(RABList_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RABList_decoder(OCTETSTRING& input_stream, RABList& 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 `@HNBAP-IEs.RABList' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(RABList_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 Registration__Cause_encoder(const Registration__Cause& 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 `@HNBAP-IEs.Registration-Cause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Registration__Cause_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Registration__Cause_decoder(OCTETSTRING& input_stream, Registration__Cause& 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 `@HNBAP-IEs.Registration-Cause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Registration__Cause_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 RNC__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(RNC__ID_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER RNC__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(RNC__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 SAC_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(SAC_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER SAC_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(SAC_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 TMSILAI_tMSI_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TMSILAI_tMSI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TMSILAI_tMSI_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TMSILAI_tMSI_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 TMSILAI_lAI_encoder(const LAI& 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 `@HNBAP-IEs.LAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TMSILAI_lAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TMSILAI_lAI_decoder(OCTETSTRING& input_stream, LAI& 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 `@HNBAP-IEs.LAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TMSILAI_lAI_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 TMSILAI_encoder(const TMSILAI& 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 `@HNBAP-IEs.TMSILAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TMSILAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TMSILAI_decoder(OCTETSTRING& input_stream, TMSILAI& 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 `@HNBAP-IEs.TMSILAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TMSILAI_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 TMSIDS41_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(TMSIDS41_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER TMSIDS41_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(TMSIDS41_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 UE__Capabilities_access__stratum__release__indicator_encoder(const Access__stratum__release__indicator& 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 `@HNBAP-IEs.Access-stratum-release-indicator' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Capabilities_access__stratum__release__indicator_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Capabilities_access__stratum__release__indicator_decoder(OCTETSTRING& input_stream, Access__stratum__release__indicator& 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 `@HNBAP-IEs.Access-stratum-release-indicator' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Capabilities_access__stratum__release__indicator_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 UE__Capabilities_csg__capability_encoder(const CSG__Capability& 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 `@HNBAP-IEs.CSG-Capability' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Capabilities_csg__capability_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Capabilities_csg__capability_decoder(OCTETSTRING& input_stream, CSG__Capability& 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 `@HNBAP-IEs.CSG-Capability' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Capabilities_csg__capability_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& other_value) { if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18."); return other_value.val_ptr->n_elements == 0; } void _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_id_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_encoder(const HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_criticality_decoder(OCTETSTRING& input_stream, HNBAP__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 `@HNBAP-CommonDataTypes.Criticality' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_extensionValue_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_encoder(const _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18& 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 `@HNBAP-Containers.ProtocolExtensionField.HNBAP-IEs.inst18' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionField_HNBAP__IEs_inst18_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_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(_root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18_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 UE__Capabilities_iE__Extensions_encoder(const _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Capabilities_iE__Extensions_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Capabilities_iE__Extensions_decoder(OCTETSTRING& input_stream, _root_HNBAP__Containers_ProtocolExtensionContainer_HNBAP__IEs_inst18& 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 `@HNBAP-IEs.ProtocolExtensionContainer.HNBAP-IEs.inst18' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Capabilities_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 UE__Capabilities_encoder(const UE__Capabilities& 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 `@HNBAP-IEs.UE-Capabilities' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Capabilities_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Capabilities_decoder(OCTETSTRING& input_stream, UE__Capabilities& 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 `@HNBAP-IEs.UE-Capabilities' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Capabilities_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 UE__Identity_iMSI_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_iMSI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_iMSI_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_iMSI_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 UE__Identity_tMSILAI_encoder(const TMSILAI& 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 `@HNBAP-IEs.TMSILAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_tMSILAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_tMSILAI_decoder(OCTETSTRING& input_stream, TMSILAI& 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 `@HNBAP-IEs.TMSILAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_tMSILAI_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 UE__Identity_pTMSIRAI_encoder(const PTMSIRAI& 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 `@HNBAP-IEs.PTMSIRAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_pTMSIRAI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_pTMSIRAI_decoder(OCTETSTRING& input_stream, PTMSIRAI& 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 `@HNBAP-IEs.PTMSIRAI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_pTMSIRAI_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 UE__Identity_iMEI_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_iMEI_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_iMEI_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_iMEI_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 UE__Identity_eSN_encoder(const BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_eSN_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_eSN_decoder(OCTETSTRING& input_stream, BITSTRING& 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 `bitstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_eSN_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 UE__Identity_iMSIDS41_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_iMSIDS41_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_iMSIDS41_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_iMSIDS41_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 UE__Identity_iMSIESN_encoder(const IMSIESN& 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 `@HNBAP-IEs.IMSIESN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_iMSIESN_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_iMSIESN_decoder(OCTETSTRING& input_stream, IMSIESN& 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 `@HNBAP-IEs.IMSIESN' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_iMSIESN_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 UE__Identity_tMSIDS41_encoder(const OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_tMSIDS41_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_tMSIDS41_decoder(OCTETSTRING& input_stream, OCTETSTRING& 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 `octetstring' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_tMSIDS41_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 UE__Identity_encoder(const UE__Identity& 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 `@HNBAP-IEs.UE-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(UE__Identity_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER UE__Identity_decoder(OCTETSTRING& input_stream, UE__Identity& 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 `@HNBAP-IEs.UE-Identity' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(UE__Identity_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 Update__cause_encoder(const Update__cause& 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 `@HNBAP-IEs.Update-cause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf; input_value.encode(Update__cause_descr_, ttcn_buf, coding_type, extra_options); ttcn_buf.get_string(output_stream); } INTEGER Update__cause_decoder(OCTETSTRING& input_stream, Update__cause& 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 `@HNBAP-IEs.Update-cause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str()); } TTCN_Buffer ttcn_buf(input_stream); output_value.decode(Update__cause_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("HNBAP_IEs.asn", 0, TTCN_Location::LOCATION_UNKNOWN, "HNBAP-IEs"); HNBAP__Constants::module_object.pre_init_module(); HNBAP__Containers::module_object.pre_init_module(); const_HNB__Location__Information__ExtIEs_1_criticality = HNBAP__CommonDataTypes::Criticality::reject; const_HNB__Location__Information__ExtIEs_1_id = HNBAP__Constants::id__HNB__Internet__Information; const_HNB__Location__Information__ExtIEs_1_presence = HNBAP__CommonDataTypes::Presence::optional__; } } /* end of namespace */