// This C++ source file was generated by the TTCN-3 compiler // of the TTCN-3 Test Executor version 9.0.0 // for (build@3978f7fbee0c) on Mon Jun 24 02:37:33 2024 // Copyright (c) 2000-2023 Ericsson Telecom AB // Do not edit this file unless you know what you are doing. /* Including header files */ #include "BSSGP_Types.hh" namespace BSSGP__Types { /* Member functions of C++ classes */ Mobile__Id__BSSGP::Mobile__Id__BSSGP() { } Mobile__Id__BSSGP::Mobile__Id__BSSGP(const OCTETSTRING& par_iEI, const BITSTRING& par_ext, const LIN2__2a& par_lengthIndicator, const MobileIdentityV__BSSGP& par_mobile__Identity) : field_iEI(par_iEI), field_ext(par_ext), field_lengthIndicator(par_lengthIndicator), field_mobile__Identity(par_mobile__Identity) { } Mobile__Id__BSSGP::Mobile__Id__BSSGP(const Mobile__Id__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.Mobile_Id_BSSGP."); if (other_value.iEI().is_bound()) field_iEI = other_value.iEI(); else field_iEI.clean_up(); if (other_value.ext().is_bound()) field_ext = other_value.ext(); else field_ext.clean_up(); if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator(); else field_lengthIndicator.clean_up(); if (other_value.mobile__Identity().is_bound()) field_mobile__Identity = other_value.mobile__Identity(); else field_mobile__Identity.clean_up(); } void Mobile__Id__BSSGP::clean_up() { field_iEI.clean_up(); field_ext.clean_up(); field_lengthIndicator.clean_up(); field_mobile__Identity.clean_up(); } const TTCN_Typedescriptor_t* Mobile__Id__BSSGP::get_descriptor() const { return &Mobile__Id__BSSGP_descr_; } Mobile__Id__BSSGP& Mobile__Id__BSSGP::operator=(const Mobile__Id__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.Mobile_Id_BSSGP."); if (other_value.iEI().is_bound()) field_iEI = other_value.iEI(); else field_iEI.clean_up(); if (other_value.ext().is_bound()) field_ext = other_value.ext(); else field_ext.clean_up(); if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator(); else field_lengthIndicator.clean_up(); if (other_value.mobile__Identity().is_bound()) field_mobile__Identity = other_value.mobile__Identity(); else field_mobile__Identity.clean_up(); } return *this; } boolean Mobile__Id__BSSGP::operator==(const Mobile__Id__BSSGP& other_value) const { return field_iEI==other_value.field_iEI && field_ext==other_value.field_ext && field_lengthIndicator==other_value.field_lengthIndicator && field_mobile__Identity==other_value.field_mobile__Identity; } boolean Mobile__Id__BSSGP::is_bound() const { return (field_iEI.is_bound()) || (field_ext.is_bound()) || (field_lengthIndicator.is_bound()) || (field_mobile__Identity.is_bound()); } boolean Mobile__Id__BSSGP::is_value() const { return field_iEI.is_value() && field_ext.is_value() && field_lengthIndicator.is_value() && field_mobile__Identity.is_value(); } void Mobile__Id__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ iEI := "); field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); field_lengthIndicator.log(); TTCN_Logger::log_event_str(", mobile_Identity := "); field_mobile__Identity.log(); TTCN_Logger::log_event_str(" }"); } void Mobile__Id__BSSGP::set_implicit_omit() { if (iEI().is_bound()) iEI().set_implicit_omit(); if (ext().is_bound()) ext().set_implicit_omit(); if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit(); if (mobile__Identity().is_bound()) mobile__Identity().set_implicit_omit(); } void Mobile__Id__BSSGP::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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobile__Identity().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mobile_Identity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mobile__Identity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.Mobile_Id_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.Mobile_Id_BSSGP"); } } void Mobile__Id__BSSGP::encode_text(Text_Buf& text_buf) const { field_iEI.encode_text(text_buf); field_ext.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_mobile__Identity.encode_text(text_buf); } void Mobile__Id__BSSGP::decode_text(Text_Buf& text_buf) { field_iEI.decode_text(text_buf); field_ext.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_mobile__Identity.decode_text(text_buf); } void Mobile__Id__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Mobile__Id__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int Mobile__Id__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; int selected_field = -1; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field2 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit); decoded_field_length = field_iEI.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, Mobile__Id__BSSGP_ext_descr_.raw->forceomit); decoded_field_length = field_ext.RAW_decode(Mobile__Id__BSSGP_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_ext == bs_0) selected_field = 0; else if (field_ext == bs_1) selected_field = 1; else selected_field = -1; RAW_Force_Omit field_2_force_omit(2, force_omit, Mobile__Id__BSSGP_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(Mobile__Id__BSSGP_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: { INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_); field_lengthIndicator.length1() = tmp1; value_of_length_field2 += tmp1.get_long_long_val() * 8; break; } case LIN2__2a::ALT_length2: { INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_); field_lengthIndicator.length2() = tmp2; value_of_length_field2 += tmp2.get_long_long_val() * 8; break; } default: value_of_length_field2 = 0; } RAW_Force_Omit field_3_force_omit(3, force_omit, MobileIdentityV__BSSGP_descr_.raw->forceomit); decoded_field_length = field_mobile__Identity.RAW_decode(MobileIdentityV__BSSGP_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; if (field_iEI != os_49) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int Mobile__Id__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Mobile__Id__BSSGP_ext_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Mobile__Id__BSSGP_lengthIndicator_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileIdentityV__BSSGP_descr_.raw); encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ext.RAW_encode(Mobile__Id__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_lengthIndicator.RAW_encode(Mobile__Id__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_mobile__Identity.RAW_encode(MobileIdentityV__BSSGP_descr_, *myleaf.body.node.nodes[3]); { int sel_field = 0; while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; } const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr; int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length; delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field]; myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos; } switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: if (field_ext != bs_0) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_0.RAW_encode(Mobile__Id__BSSGP_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; case LIN2__2a::ALT_length2: if (field_ext != bs_1) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_1.RAW_encode(Mobile__Id__BSSGP_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; default:; } if (field_iEI != os_49) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ os_49.RAW_encode(General__Types::OCT1_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct Mobile__Id__BSSGP_template::single_value_struct { OCTETSTRING_template field_iEI; BITSTRING_template field_ext; LIN2__2a_template field_lengthIndicator; MobileIdentityV__BSSGP_template field_mobile__Identity; }; void Mobile__Id__BSSGP_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_iEI = ANY_VALUE; single_value->field_ext = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_mobile__Identity = ANY_VALUE; } } } void Mobile__Id__BSSGP_template::copy_value(const Mobile__Id__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.iEI().is_bound()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (other_value.ext().is_bound()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.mobile__Identity().is_bound()) { single_value->field_mobile__Identity = other_value.mobile__Identity(); } else { single_value->field_mobile__Identity.clean_up(); } set_selection(SPECIFIC_VALUE); } void Mobile__Id__BSSGP_template::copy_template(const Mobile__Id__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mobile__Identity().get_selection()) { single_value->field_mobile__Identity = other_value.mobile__Identity(); } else { single_value->field_mobile__Identity.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 Mobile__Id__BSSGP_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 Mobile__Id__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new Mobile__Id__BSSGP_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 @BSSGP_Types.Mobile_Id_BSSGP."); break; } set_selection(other_value); } Mobile__Id__BSSGP_template::Mobile__Id__BSSGP_template() { } Mobile__Id__BSSGP_template::Mobile__Id__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Mobile__Id__BSSGP_template::Mobile__Id__BSSGP_template(const Mobile__Id__BSSGP& other_value) { copy_value(other_value); } Mobile__Id__BSSGP_template::Mobile__Id__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Mobile__Id__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.Mobile_Id_BSSGP from an unbound optional field."); } } Mobile__Id__BSSGP_template::Mobile__Id__BSSGP_template(Mobile__Id__BSSGP_template* p_precondition, Mobile__Id__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Mobile__Id__BSSGP_template::Mobile__Id__BSSGP_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; } Mobile__Id__BSSGP_template::Mobile__Id__BSSGP_template(const Mobile__Id__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } Mobile__Id__BSSGP_template::~Mobile__Id__BSSGP_template() { clean_up(); } Mobile__Id__BSSGP_template& Mobile__Id__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Mobile__Id__BSSGP_template& Mobile__Id__BSSGP_template::operator=(const Mobile__Id__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } Mobile__Id__BSSGP_template& Mobile__Id__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Mobile__Id__BSSGP&)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 @BSSGP_Types.Mobile_Id_BSSGP."); } return *this; } Mobile__Id__BSSGP_template& Mobile__Id__BSSGP_template::operator=(const Mobile__Id__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Mobile__Id__BSSGP_template::match(const Mobile__Id__BSSGP& 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.iEI().is_bound()) return FALSE; if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE; if(!other_value.ext().is_bound()) return FALSE; if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.mobile__Identity().is_bound()) return FALSE; if(!single_value->field_mobile__Identity.match(other_value.mobile__Identity(), 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 @BSSGP_Types.Mobile_Id_BSSGP."); } return FALSE; } boolean Mobile__Id__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iEI.is_bound() || single_value->field_ext.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_mobile__Identity.is_bound(); } boolean Mobile__Id__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iEI.is_value() && single_value->field_ext.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_mobile__Identity.is_value(); } void Mobile__Id__BSSGP_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; } Mobile__Id__BSSGP Mobile__Id__BSSGP_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 @BSSGP_Types.Mobile_Id_BSSGP."); Mobile__Id__BSSGP ret_val; if (single_value->field_iEI.is_bound()) { ret_val.iEI() = single_value->field_iEI.valueof(); } if (single_value->field_ext.is_bound()) { ret_val.ext() = single_value->field_ext.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_mobile__Identity.is_bound()) { ret_val.mobile__Identity() = single_value->field_mobile__Identity.valueof(); } return ret_val; } void Mobile__Id__BSSGP_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 @BSSGP_Types.Mobile_Id_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Mobile__Id__BSSGP_template[list_length]; } Mobile__Id__BSSGP_template& Mobile__Id__BSSGP_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 @BSSGP_Types.Mobile_Id_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Mobile_Id_BSSGP."); return value_list.list_value[list_index]; } OCTETSTRING_template& Mobile__Id__BSSGP_template::iEI() { set_specific(); return single_value->field_iEI; } const OCTETSTRING_template& Mobile__Id__BSSGP_template::iEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Mobile_Id_BSSGP."); return single_value->field_iEI; } BITSTRING_template& Mobile__Id__BSSGP_template::ext() { set_specific(); return single_value->field_ext; } const BITSTRING_template& Mobile__Id__BSSGP_template::ext() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Mobile_Id_BSSGP."); return single_value->field_ext; } LIN2__2a_template& Mobile__Id__BSSGP_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const LIN2__2a_template& Mobile__Id__BSSGP_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Mobile_Id_BSSGP."); return single_value->field_lengthIndicator; } MobileIdentityV__BSSGP_template& Mobile__Id__BSSGP_template::mobile__Identity() { set_specific(); return single_value->field_mobile__Identity; } const MobileIdentityV__BSSGP_template& Mobile__Id__BSSGP_template::mobile__Identity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mobile_Identity of a non-specific template of type @BSSGP_Types.Mobile_Id_BSSGP."); return single_value->field_mobile__Identity; } int Mobile__Id__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Mobile_Id_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.Mobile_Id_BSSGP 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 @BSSGP_Types.Mobile_Id_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Mobile_Id_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Mobile_Id_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Mobile_Id_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Mobile_Id_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Mobile_Id_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Mobile_Id_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Mobile_Id_BSSGP."); } return 0; } void Mobile__Id__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iEI := "); single_value->field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", mobile_Identity := "); single_value->field_mobile__Identity.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 Mobile__Id__BSSGP_template::log_match(const Mobile__Id__BSSGP& 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_iEI.match(match_value.iEI(), legacy)){ TTCN_Logger::log_logmatch_info(".iEI"); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ext.match(match_value.ext(), legacy)){ TTCN_Logger::log_logmatch_info(".ext"); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_mobile__Identity.match(match_value.mobile__Identity(), legacy)){ TTCN_Logger::log_logmatch_info(".mobile_Identity"); single_value->field_mobile__Identity.log_match(match_value.mobile__Identity(), 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("{ iEI := "); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", mobile_Identity := "); single_value->field_mobile__Identity.log_match(match_value.mobile__Identity(), 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 Mobile__Id__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iEI.encode_text(text_buf); single_value->field_ext.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_mobile__Identity.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 @BSSGP_Types.Mobile_Id_BSSGP."); } } void Mobile__Id__BSSGP_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_iEI.decode_text(text_buf); single_value->field_ext.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_mobile__Identity.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 Mobile__Id__BSSGP_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 @BSSGP_Types.Mobile_Id_BSSGP."); } } void Mobile__Id__BSSGP_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: { Mobile__Id__BSSGP_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mobile__Identity().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mobile_Identity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mobile__Identity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.Mobile_Id_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Mobile__Id__BSSGP_template* precondition = new Mobile__Id__BSSGP_template; precondition->set_param(*param.get_elem(0)); Mobile__Id__BSSGP_template* implied_template = new Mobile__Id__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = Mobile__Id__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.Mobile_Id_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void Mobile__Id__BSSGP_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Mobile_Id_BSSGP"); single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Mobile_Id_BSSGP"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Mobile_Id_BSSGP"); single_value->field_mobile__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Mobile_Id_BSSGP"); 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 : "@BSSGP_Types.Mobile_Id_BSSGP"); } boolean Mobile__Id__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Mobile__Id__BSSGP_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bmax().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "bmax")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { bmax().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MS_Bucket_Size: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MS_Bucket_Size"); } } void MS__Bucket__Size::encode_text(Text_Buf& text_buf) const { field_iEI.encode_text(text_buf); field_ext.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_bmax.encode_text(text_buf); } void MS__Bucket__Size::decode_text(Text_Buf& text_buf) { field_iEI.decode_text(text_buf); field_ext.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_bmax.decode_text(text_buf); } void MS__Bucket__Size::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MS__Bucket__Size::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MS__Bucket__Size::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; int selected_field = -1; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field2 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit); decoded_field_length = field_iEI.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MS__Bucket__Size_ext_descr_.raw->forceomit); decoded_field_length = field_ext.RAW_decode(MS__Bucket__Size_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_ext == bs_0) selected_field = 0; else if (field_ext == bs_1) selected_field = 1; else selected_field = -1; RAW_Force_Omit field_2_force_omit(2, force_omit, MS__Bucket__Size_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(MS__Bucket__Size_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: { INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_); field_lengthIndicator.length1() = tmp1; value_of_length_field2 += tmp1.get_long_long_val() * 8; break; } case LIN2__2a::ALT_length2: { INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_); field_lengthIndicator.length2() = tmp2; value_of_length_field2 += tmp2.get_long_long_val() * 8; break; } default: value_of_length_field2 = 0; } RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT2_descr_.raw->forceomit); decoded_field_length = field_bmax.RAW_decode(General__Types::OCT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; if (field_iEI != os_50) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MS__Bucket__Size::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MS__Bucket__Size_ext_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MS__Bucket__Size_lengthIndicator_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT2_descr_.raw); encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ext.RAW_encode(MS__Bucket__Size_ext_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_lengthIndicator.RAW_encode(MS__Bucket__Size_lengthIndicator_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_bmax.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[3]); { int sel_field = 0; while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; } const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr; int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length; delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field]; myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos; } switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: if (field_ext != bs_0) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_0.RAW_encode(MS__Bucket__Size_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; case LIN2__2a::ALT_length2: if (field_ext != bs_1) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_1.RAW_encode(MS__Bucket__Size_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; default:; } if (field_iEI != os_50) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ os_50.RAW_encode(General__Types::OCT1_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct MS__Bucket__Size_template::single_value_struct { OCTETSTRING_template field_iEI; BITSTRING_template field_ext; LIN2__2a_template field_lengthIndicator; OCTETSTRING_template field_bmax; }; void MS__Bucket__Size_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_iEI = ANY_VALUE; single_value->field_ext = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_bmax = ANY_VALUE; } } } void MS__Bucket__Size_template::copy_value(const MS__Bucket__Size& other_value) { single_value = new single_value_struct; if (other_value.iEI().is_bound()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (other_value.ext().is_bound()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.bmax().is_bound()) { single_value->field_bmax = other_value.bmax(); } else { single_value->field_bmax.clean_up(); } set_selection(SPECIFIC_VALUE); } void MS__Bucket__Size_template::copy_template(const MS__Bucket__Size_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.bmax().get_selection()) { single_value->field_bmax = other_value.bmax(); } else { single_value->field_bmax.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 MS__Bucket__Size_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 MS__Bucket__Size_template(*other_value.implication_.precondition); implication_.implied_template = new MS__Bucket__Size_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 @BSSGP_Types.MS_Bucket_Size."); break; } set_selection(other_value); } MS__Bucket__Size_template::MS__Bucket__Size_template() { } MS__Bucket__Size_template::MS__Bucket__Size_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MS__Bucket__Size_template::MS__Bucket__Size_template(const MS__Bucket__Size& other_value) { copy_value(other_value); } MS__Bucket__Size_template::MS__Bucket__Size_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MS__Bucket__Size&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MS_Bucket_Size from an unbound optional field."); } } MS__Bucket__Size_template::MS__Bucket__Size_template(MS__Bucket__Size_template* p_precondition, MS__Bucket__Size_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MS__Bucket__Size_template::MS__Bucket__Size_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; } MS__Bucket__Size_template::MS__Bucket__Size_template(const MS__Bucket__Size_template& other_value) : Base_Template() { copy_template(other_value); } MS__Bucket__Size_template::~MS__Bucket__Size_template() { clean_up(); } MS__Bucket__Size_template& MS__Bucket__Size_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MS__Bucket__Size_template& MS__Bucket__Size_template::operator=(const MS__Bucket__Size& other_value) { clean_up(); copy_value(other_value); return *this; } MS__Bucket__Size_template& MS__Bucket__Size_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MS__Bucket__Size&)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 @BSSGP_Types.MS_Bucket_Size."); } return *this; } MS__Bucket__Size_template& MS__Bucket__Size_template::operator=(const MS__Bucket__Size_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MS__Bucket__Size_template::match(const MS__Bucket__Size& 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.iEI().is_bound()) return FALSE; if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE; if(!other_value.ext().is_bound()) return FALSE; if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.bmax().is_bound()) return FALSE; if(!single_value->field_bmax.match(other_value.bmax(), 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 @BSSGP_Types.MS_Bucket_Size."); } return FALSE; } boolean MS__Bucket__Size_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iEI.is_bound() || single_value->field_ext.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_bmax.is_bound(); } boolean MS__Bucket__Size_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iEI.is_value() && single_value->field_ext.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_bmax.is_value(); } void MS__Bucket__Size_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; } MS__Bucket__Size MS__Bucket__Size_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 @BSSGP_Types.MS_Bucket_Size."); MS__Bucket__Size ret_val; if (single_value->field_iEI.is_bound()) { ret_val.iEI() = single_value->field_iEI.valueof(); } if (single_value->field_ext.is_bound()) { ret_val.ext() = single_value->field_ext.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_bmax.is_bound()) { ret_val.bmax() = single_value->field_bmax.valueof(); } return ret_val; } void MS__Bucket__Size_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 @BSSGP_Types.MS_Bucket_Size."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MS__Bucket__Size_template[list_length]; } MS__Bucket__Size_template& MS__Bucket__Size_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 @BSSGP_Types.MS_Bucket_Size."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MS_Bucket_Size."); return value_list.list_value[list_index]; } OCTETSTRING_template& MS__Bucket__Size_template::iEI() { set_specific(); return single_value->field_iEI; } const OCTETSTRING_template& MS__Bucket__Size_template::iEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.MS_Bucket_Size."); return single_value->field_iEI; } BITSTRING_template& MS__Bucket__Size_template::ext() { set_specific(); return single_value->field_ext; } const BITSTRING_template& MS__Bucket__Size_template::ext() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.MS_Bucket_Size."); return single_value->field_ext; } LIN2__2a_template& MS__Bucket__Size_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const LIN2__2a_template& MS__Bucket__Size_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.MS_Bucket_Size."); return single_value->field_lengthIndicator; } OCTETSTRING_template& MS__Bucket__Size_template::bmax() { set_specific(); return single_value->field_bmax; } const OCTETSTRING_template& MS__Bucket__Size_template::bmax() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field bmax of a non-specific template of type @BSSGP_Types.MS_Bucket_Size."); return single_value->field_bmax; } int MS__Bucket__Size_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Bucket_Size which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.MS_Bucket_Size 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 @BSSGP_Types.MS_Bucket_Size containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Bucket_Size containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Bucket_Size containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Bucket_Size containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Bucket_Size containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Bucket_Size containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Bucket_Size containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MS_Bucket_Size."); } return 0; } void MS__Bucket__Size_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iEI := "); single_value->field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", bmax := "); single_value->field_bmax.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 MS__Bucket__Size_template::log_match(const MS__Bucket__Size& 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_iEI.match(match_value.iEI(), legacy)){ TTCN_Logger::log_logmatch_info(".iEI"); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ext.match(match_value.ext(), legacy)){ TTCN_Logger::log_logmatch_info(".ext"); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_bmax.match(match_value.bmax(), legacy)){ TTCN_Logger::log_logmatch_info(".bmax"); single_value->field_bmax.log_match(match_value.bmax(), 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("{ iEI := "); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", bmax := "); single_value->field_bmax.log_match(match_value.bmax(), 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 MS__Bucket__Size_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iEI.encode_text(text_buf); single_value->field_ext.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_bmax.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 @BSSGP_Types.MS_Bucket_Size."); } } void MS__Bucket__Size_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_iEI.decode_text(text_buf); single_value->field_ext.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_bmax.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 MS__Bucket__Size_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 @BSSGP_Types.MS_Bucket_Size."); } } void MS__Bucket__Size_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: { MS__Bucket__Size_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) bmax().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "bmax")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { bmax().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MS_Bucket_Size: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MS__Bucket__Size_template* precondition = new MS__Bucket__Size_template; precondition->set_param(*param.get_elem(0)); MS__Bucket__Size_template* implied_template = new MS__Bucket__Size_template; implied_template->set_param(*param.get_elem(1)); *this = MS__Bucket__Size_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MS_Bucket_Size"); } is_ifpresent = param.get_ifpresent(); } void MS__Bucket__Size_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MS_Bucket_Size"); single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MS_Bucket_Size"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MS_Bucket_Size"); single_value->field_bmax.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MS_Bucket_Size"); 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 : "@BSSGP_Types.MS_Bucket_Size"); } boolean MS__Bucket__Size_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MS__Bucket__Size_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; } MSRadioAccessCapabilityV__BSSGP::MSRadioAccessCapabilityV__BSSGP(const MSRadioAccessCapabilityV__BSSGP& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } MSRadioAccessCapabilityV__BSSGP::~MSRadioAccessCapabilityV__BSSGP() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void MSRadioAccessCapabilityV__BSSGP::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."); } } MSRadioAccessCapabilityV__BSSGP& MSRadioAccessCapabilityV__BSSGP::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; } MSRadioAccessCapabilityV__BSSGP& MSRadioAccessCapabilityV__BSSGP::operator=(const MSRadioAccessCapabilityV__BSSGP& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean MSRadioAccessCapabilityV__BSSGP::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); return val_ptr->n_elements == 0 ; } boolean MSRadioAccessCapabilityV__BSSGP::operator==(const MSRadioAccessCapabilityV__BSSGP& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); 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; } MSRACapabilityValuesRecord__BSSGP& MSRadioAccessCapabilityV__BSSGP::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP 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 = (MSRACapabilityValuesRecord__BSSGP**)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 MSRACapabilityValuesRecord__BSSGP(*(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 MSRACapabilityValuesRecord__BSSGP; } return *val_ptr->value_elements[index_value]; } MSRACapabilityValuesRecord__BSSGP& MSRadioAccessCapabilityV__BSSGP::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); return (*this)[(int)index_value]; } const MSRACapabilityValuesRecord__BSSGP& MSRadioAccessCapabilityV__BSSGP::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP: 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 MSRACapabilityValuesRecord__BSSGP& MSRadioAccessCapabilityV__BSSGP::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); return (*this)[(int)index_value]; } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); 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; MSRadioAccessCapabilityV__BSSGP 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 MSRACapabilityValuesRecord__BSSGP(*val_ptr->value_elements[i]); } } return ret_val; } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP::operator+(const MSRadioAccessCapabilityV__BSSGP& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; MSRadioAccessCapabilityV__BSSGP 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 MSRACapabilityValuesRecord__BSSGP(*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 MSRACapabilityValuesRecord__BSSGP(*other_value.val_ptr->value_elements[i]); } } return ret_val; } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Types.MSRadioAccessCapabilityV_BSSGP","element"); MSRadioAccessCapabilityV__BSSGP ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new MSRACapabilityValuesRecord__BSSGP(*val_ptr->value_elements[i+index]); } } return ret_val; } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP::replace(int index, int len, const MSRadioAccessCapabilityV__BSSGP& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); check_replace_arguments(val_ptr->n_elements, index, len, "@BSSGP_Types.MSRadioAccessCapabilityV_BSSGP","element"); MSRadioAccessCapabilityV__BSSGP 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 MSRACapabilityValuesRecord__BSSGP(*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 MSRACapabilityValuesRecord__BSSGP(*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 MSRACapabilityValuesRecord__BSSGP(*val_ptr->value_elements[index+i+len]); } } return ret_val; } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP::replace(int index, int len, const MSRadioAccessCapabilityV__BSSGP_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 MSRadioAccessCapabilityV__BSSGP::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); 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 = (MSRACapabilityValuesRecord__BSSGP**)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 MSRACapabilityValuesRecord__BSSGP(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (MSRACapabilityValuesRecord__BSSGP**)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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP: %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 = (MSRACapabilityValuesRecord__BSSGP**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean MSRadioAccessCapabilityV__BSSGP::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 MSRadioAccessCapabilityV__BSSGP::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); return val_ptr->n_elements; } int MSRadioAccessCapabilityV__BSSGP::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); 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 MSRadioAccessCapabilityV__BSSGP::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 MSRadioAccessCapabilityV__BSSGP::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 MSRadioAccessCapabilityV__BSSGP::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", "@BSSGP_Types.MSRadioAccessCapabilityV_BSSGP"); } 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", "@BSSGP_Types.MSRadioAccessCapabilityV_BSSGP"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void MSRadioAccessCapabilityV__BSSGP::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); 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 MSRadioAccessCapabilityV__BSSGP::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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); val_ptr->value_elements = (MSRACapabilityValuesRecord__BSSGP**)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 MSRACapabilityValuesRecord__BSSGP; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void MSRadioAccessCapabilityV__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MSRadioAccessCapabilityV__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MSRadioAccessCapabilityV__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean /*no_err*/, int sel_field, boolean first_call, const RAW_Force_Omit*){ int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; int decoded_length=0; int decoded_field_length=0; size_t start_of_field=0; if(first_call) { clean_up(); val_ptr=new recordof_setof_struct; val_ptr->ref_count=1; val_ptr->n_elements=0; val_ptr->value_elements=NULL; } int start_field=val_ptr->n_elements; if(p_td.raw->fieldlength || sel_field!=-1){ int a=0; if(sel_field==-1) sel_field=p_td.raw->fieldlength; start_of_field=p_buf.get_pos_bit(); for(a=0;a=0){ delete &(*this)[a+start_field]; a--; val_ptr->n_elements--; } p_buf.set_pos_bit(start_of_field); return decoded_field_length; } decoded_length+=decoded_field_length; limit-=decoded_field_length; } if(a==0) val_ptr->n_elements=0; } else { if(limit==0){ if(!first_call) return -1; val_ptr->n_elements=0; return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength; } int a=start_field; while(limit>0){ start_of_field=p_buf.get_pos_bit(); decoded_field_length=(*this)[a].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE); if(decoded_field_length < 0){ delete &(*this)[a]; val_ptr->n_elements--; p_buf.set_pos_bit(start_of_field); if(a>start_field){ return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength; } else return -1; } decoded_length+=decoded_field_length; limit-=decoded_field_length; a++; if (!p_buf.get_last_bit()) return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength; } } return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength; } int MSRadioAccessCapabilityV__BSSGP::RAW_encode(const TTCN_Typedescriptor_t& p_td,RAW_enc_tree& myleaf) const{ int encoded_length=0; int encoded_num_of_records=p_td.raw->fieldlength?smaller(val_ptr->n_elements, p_td.raw->fieldlength):val_ptr->n_elements; myleaf.isleaf=FALSE; myleaf.rec_of=TRUE; myleaf.body.node.num_of_nodes=encoded_num_of_records; myleaf.body.node.nodes=init_nodes_of_enc_tree(encoded_num_of_records); for(int a=0;araw); encoded_length+=(*this)[a].RAW_encode(*p_td.oftype_descr,*myleaf.body.node.nodes[a]); } return myleaf.length=encoded_length; } void MSRadioAccessCapabilityV__BSSGP_template::copy_value(const MSRadioAccessCapabilityV__BSSGP& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (MSRACapabilityValuesRecord__BSSGP_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 MSRACapabilityValuesRecord__BSSGP_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord__BSSGP_template; } } set_selection(SPECIFIC_VALUE); } void MSRadioAccessCapabilityV__BSSGP_template::copy_template(const MSRadioAccessCapabilityV__BSSGP_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 = (MSRACapabilityValuesRecord__BSSGP_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 MSRACapabilityValuesRecord__BSSGP_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new MSRACapabilityValuesRecord__BSSGP_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 MSRadioAccessCapabilityV__BSSGP_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 MSRadioAccessCapabilityV__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MSRadioAccessCapabilityV__BSSGP_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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); break; } set_selection(other_value); } boolean MSRadioAccessCapabilityV__BSSGP_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 MSRadioAccessCapabilityV__BSSGP_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const MSRadioAccessCapabilityV__BSSGP*)value_ptr)[value_index], legacy); else return ((const MSRadioAccessCapabilityV__BSSGP_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } MSRadioAccessCapabilityV__BSSGP_template::MSRadioAccessCapabilityV__BSSGP_template() { } MSRadioAccessCapabilityV__BSSGP_template::MSRadioAccessCapabilityV__BSSGP_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } MSRadioAccessCapabilityV__BSSGP_template::MSRadioAccessCapabilityV__BSSGP_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } MSRadioAccessCapabilityV__BSSGP_template::MSRadioAccessCapabilityV__BSSGP_template(const MSRadioAccessCapabilityV__BSSGP& other_value) { copy_value(other_value); } MSRadioAccessCapabilityV__BSSGP_template::MSRadioAccessCapabilityV__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRadioAccessCapabilityV__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP from an unbound optional field."); } } MSRadioAccessCapabilityV__BSSGP_template::MSRadioAccessCapabilityV__BSSGP_template(MSRadioAccessCapabilityV__BSSGP_template* p_precondition, MSRadioAccessCapabilityV__BSSGP_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MSRadioAccessCapabilityV__BSSGP_template::MSRadioAccessCapabilityV__BSSGP_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; } MSRadioAccessCapabilityV__BSSGP_template::MSRadioAccessCapabilityV__BSSGP_template(const MSRadioAccessCapabilityV__BSSGP_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } MSRadioAccessCapabilityV__BSSGP_template::~MSRadioAccessCapabilityV__BSSGP_template() { clean_up(); } void MSRadioAccessCapabilityV__BSSGP_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; } MSRadioAccessCapabilityV__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MSRadioAccessCapabilityV__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } MSRadioAccessCapabilityV__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator=(const MSRadioAccessCapabilityV__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MSRadioAccessCapabilityV__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRadioAccessCapabilityV__BSSGP&)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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); } return *this; } MSRadioAccessCapabilityV__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator=(const MSRadioAccessCapabilityV__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } MSRACapabilityValuesRecord__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP 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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); break; } return *single_value.value_elements[index_value]; } MSRACapabilityValuesRecord__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); return (*this)[(int)index_value]; } const MSRACapabilityValuesRecord__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP: 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 MSRACapabilityValuesRecord__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); return (*this)[(int)index_value]; } void MSRadioAccessCapabilityV__BSSGP_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); 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 = (MSRACapabilityValuesRecord__BSSGP_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 MSRACapabilityValuesRecord__BSSGP_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 MSRACapabilityValuesRecord__BSSGP_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 = (MSRACapabilityValuesRecord__BSSGP_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int MSRadioAccessCapabilityV__BSSGP_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 MSRadioAccessCapabilityV__BSSGP_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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP 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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP 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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP 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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP 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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP 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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP"); } boolean MSRadioAccessCapabilityV__BSSGP_template::match(const MSRadioAccessCapabilityV__BSSGP& 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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); } return FALSE; } boolean MSRadioAccessCapabilityV__BSSGP_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; } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP_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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); MSRadioAccessCapabilityV__BSSGP 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; } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP_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); } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP_template::replace(int index, int len, const MSRadioAccessCapabilityV__BSSGP_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()); } MSRadioAccessCapabilityV__BSSGP MSRadioAccessCapabilityV__BSSGP_template::replace(int index, int len, const MSRadioAccessCapabilityV__BSSGP& 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 MSRadioAccessCapabilityV__BSSGP_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 MSRadioAccessCapabilityV__BSSGP_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); } set_selection(template_type); } MSRadioAccessCapabilityV__BSSGP_template& MSRadioAccessCapabilityV__BSSGP_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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); return value_list.list_value[list_index]; } void MSRadioAccessCapabilityV__BSSGP_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 MSRadioAccessCapabilityV__BSSGP_template::log_match(const MSRadioAccessCapabilityV__BSSGP& 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 MSRadioAccessCapabilityV__BSSGP_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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); } } void MSRadioAccessCapabilityV__BSSGP_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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); single_value.value_elements = (MSRACapabilityValuesRecord__BSSGP_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 MSRACapabilityValuesRecord__BSSGP_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 MSRadioAccessCapabilityV__BSSGP_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 @BSSGP_Types.MSRadioAccessCapabilityV_BSSGP."); } } boolean MSRadioAccessCapabilityV__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MSRadioAccessCapabilityV__BSSGP_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_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: { MSRadioAccessCapabilityV__BSSGP_template* precondition = new MSRadioAccessCapabilityV__BSSGP_template; precondition->set_param(*param.get_elem(0)); MSRadioAccessCapabilityV__BSSGP_template* implied_template = new MSRadioAccessCapabilityV__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MSRadioAccessCapabilityV__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record of template", "@BSSGP_Types.MSRadioAccessCapabilityV_BSSGP"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void MSRadioAccessCapabilityV__BSSGP_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 : "@BSSGP_Types.MSRadioAccessCapabilityV_BSSGP"); 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 : "@BSSGP_Types.MSRadioAccessCapabilityV_BSSGP"); } boolean MSRadioAccessCapabilityV__BSSGP_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 MSRACapabilityValues__BSSGP::copy_value(const MSRACapabilityValues__BSSGP& other_value) { switch (other_value.union_selection) { case ALT_mSRACapabilityValuesExclude1111: field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111__BSSGP(*other_value.field_mSRACapabilityValuesExclude1111); break; case ALT_mSRACapabilityValues1111: field_mSRACapabilityValues1111 = new MSRACapabilityValues1111__BSSGP(*other_value.field_mSRACapabilityValues1111); break; default: TTCN_error("Assignment of an unbound union value of type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } union_selection = other_value.union_selection; } MSRACapabilityValues__BSSGP::MSRACapabilityValues__BSSGP() { union_selection = UNBOUND_VALUE; } MSRACapabilityValues__BSSGP::MSRACapabilityValues__BSSGP(const MSRACapabilityValues__BSSGP& other_value) : Base_Type(){ copy_value(other_value); } MSRACapabilityValues__BSSGP::~MSRACapabilityValues__BSSGP() { clean_up(); } MSRACapabilityValues__BSSGP& MSRACapabilityValues__BSSGP::operator=(const MSRACapabilityValues__BSSGP& other_value) { if (this != &other_value) { clean_up(); copy_value(other_value); } return *this; } boolean MSRACapabilityValues__BSSGP::operator==(const MSRACapabilityValues__BSSGP& other_value) const { if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); if (union_selection != other_value.union_selection) return FALSE; switch (union_selection) { case ALT_mSRACapabilityValuesExclude1111: return *field_mSRACapabilityValuesExclude1111 == *other_value.field_mSRACapabilityValuesExclude1111; case ALT_mSRACapabilityValues1111: return *field_mSRACapabilityValues1111 == *other_value.field_mSRACapabilityValues1111; default: return FALSE; } } MSRACapabilityValuesExclude1111__BSSGP& MSRACapabilityValues__BSSGP::mSRACapabilityValuesExclude1111() { if (union_selection != ALT_mSRACapabilityValuesExclude1111) { clean_up(); field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111__BSSGP; union_selection = ALT_mSRACapabilityValuesExclude1111; } return *field_mSRACapabilityValuesExclude1111; } const MSRACapabilityValuesExclude1111__BSSGP& MSRACapabilityValues__BSSGP::mSRACapabilityValuesExclude1111() const { if (union_selection != ALT_mSRACapabilityValuesExclude1111) TTCN_error("Using non-selected field mSRACapabilityValuesExclude1111 in a value of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); return *field_mSRACapabilityValuesExclude1111; } MSRACapabilityValues1111__BSSGP& MSRACapabilityValues__BSSGP::mSRACapabilityValues1111() { if (union_selection != ALT_mSRACapabilityValues1111) { clean_up(); field_mSRACapabilityValues1111 = new MSRACapabilityValues1111__BSSGP; union_selection = ALT_mSRACapabilityValues1111; } return *field_mSRACapabilityValues1111; } const MSRACapabilityValues1111__BSSGP& MSRACapabilityValues__BSSGP::mSRACapabilityValues1111() const { if (union_selection != ALT_mSRACapabilityValues1111) TTCN_error("Using non-selected field mSRACapabilityValues1111 in a value of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); return *field_mSRACapabilityValues1111; } boolean MSRACapabilityValues__BSSGP::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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); return union_selection == checked_selection; } boolean MSRACapabilityValues__BSSGP::is_bound() const { return union_selection != UNBOUND_VALUE; } boolean MSRACapabilityValues__BSSGP::is_value() const { switch (union_selection) { case UNBOUND_VALUE: return FALSE; case ALT_mSRACapabilityValuesExclude1111: return field_mSRACapabilityValuesExclude1111->is_value(); case ALT_mSRACapabilityValues1111: return field_mSRACapabilityValues1111->is_value(); default: TTCN_error("Invalid selection in union is_bound");} } void MSRACapabilityValues__BSSGP::clean_up() { switch (union_selection) { case ALT_mSRACapabilityValuesExclude1111: delete field_mSRACapabilityValuesExclude1111; break; case ALT_mSRACapabilityValues1111: delete field_mSRACapabilityValues1111; break; default: break; } union_selection = UNBOUND_VALUE; } void MSRACapabilityValues__BSSGP::log() const { switch (union_selection) { case ALT_mSRACapabilityValuesExclude1111: TTCN_Logger::log_event_str("{ mSRACapabilityValuesExclude1111 := "); field_mSRACapabilityValuesExclude1111->log(); TTCN_Logger::log_event_str(" }"); break; case ALT_mSRACapabilityValues1111: TTCN_Logger::log_event_str("{ mSRACapabilityValues1111 := "); field_mSRACapabilityValues1111->log(); TTCN_Logger::log_event_str(" }"); break; default: TTCN_Logger::log_event_unbound(); } } void MSRACapabilityValues__BSSGP::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, "mSRACapabilityValuesExclude1111")) { mSRACapabilityValuesExclude1111().set_param(*mp_last); if (!mSRACapabilityValuesExclude1111().is_bound()) clean_up(); return; } if (!strcmp(last_name, "mSRACapabilityValues1111")) { mSRACapabilityValues1111().set_param(*mp_last); if (!mSRACapabilityValues1111().is_bound()) clean_up(); return; } mp_last->error("Field %s does not exist in type @BSSGP_Types.MSRACapabilityValues_BSSGP.", last_name); } void MSRACapabilityValues__BSSGP::set_implicit_omit() { switch (union_selection) { case ALT_mSRACapabilityValuesExclude1111: field_mSRACapabilityValuesExclude1111->set_implicit_omit(); break; case ALT_mSRACapabilityValues1111: field_mSRACapabilityValues1111->set_implicit_omit(); break; default: break; } } void MSRACapabilityValues__BSSGP::encode_text(Text_Buf& text_buf) const { text_buf.push_int(union_selection); switch (union_selection) { case ALT_mSRACapabilityValuesExclude1111: field_mSRACapabilityValuesExclude1111->encode_text(text_buf); break; case ALT_mSRACapabilityValues1111: field_mSRACapabilityValues1111->encode_text(text_buf); break; default: TTCN_error("Text encoder: Encoding an unbound value of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } } void MSRACapabilityValues__BSSGP::decode_text(Text_Buf& text_buf) { switch ((union_selection_type)text_buf.pull_int().get_val()) { case ALT_mSRACapabilityValuesExclude1111: mSRACapabilityValuesExclude1111().decode_text(text_buf); break; case ALT_mSRACapabilityValues1111: mSRACapabilityValues1111().decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } } void MSRACapabilityValues__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MSRACapabilityValues__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MSRACapabilityValues__BSSGP::RAW_decode( const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int sel_field, boolean, const RAW_Force_Omit* force_omit) { int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; int decoded_length=0; int starting_pos=p_buf.get_pos_bit(); if(sel_field!=-1){ switch(sel_field){ case 0: { RAW_Force_Omit field_force_omit(0, force_omit, MSRACapabilityValuesExclude1111__BSSGP_descr_.raw->forceomit); decoded_length = mSRACapabilityValuesExclude1111().RAW_decode(MSRACapabilityValuesExclude1111__BSSGP_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit); break; } case 1: { RAW_Force_Omit field_force_omit(1, force_omit, MSRACapabilityValues1111__BSSGP_descr_.raw->forceomit); decoded_length = mSRACapabilityValues1111().RAW_decode(MSRACapabilityValues1111__BSSGP_descr_, p_buf, limit, top_bit_ord, no_err, -1, TRUE, &field_force_omit); break; } default: break; } return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength; } else { p_buf.set_pos_bit(starting_pos); RAW_Force_Omit field_0_force_omit(0, force_omit, MSRACapabilityValuesExclude1111__BSSGP_descr_.raw->forceomit); decoded_length = mSRACapabilityValuesExclude1111().RAW_decode(MSRACapabilityValuesExclude1111__BSSGP_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_0_force_omit); if (decoded_length >= 0) { return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength; } p_buf.set_pos_bit(starting_pos); RAW_Force_Omit field_1_force_omit(1, force_omit, MSRACapabilityValues1111__BSSGP_descr_.raw->forceomit); decoded_length = mSRACapabilityValues1111().RAW_decode(MSRACapabilityValues1111__BSSGP_descr_, p_buf, limit, top_bit_ord, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_length >= 0) { return decoded_length + p_buf.increase_pos_padd(p_td.raw->padding) + prepaddlength; } } clean_up(); return -1; } int MSRACapabilityValues__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); memset(myleaf.body.node.nodes, 0, 2 * sizeof(RAW_enc_tree *)); switch (union_selection) { case ALT_mSRACapabilityValuesExclude1111: myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 0, MSRACapabilityValuesExclude1111__BSSGP_descr_.raw); encoded_length = field_mSRACapabilityValuesExclude1111->RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_descr_, *myleaf.body.node.nodes[0]); myleaf.body.node.nodes[0]->coding_descr = &MSRACapabilityValuesExclude1111__BSSGP_descr_; break; case ALT_mSRACapabilityValues1111: myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &myleaf.curr_pos, 1, MSRACapabilityValues1111__BSSGP_descr_.raw); encoded_length = field_mSRACapabilityValues1111->RAW_encode(MSRACapabilityValues1111__BSSGP_descr_, *myleaf.body.node.nodes[1]); myleaf.body.node.nodes[1]->coding_descr = &MSRACapabilityValues1111__BSSGP_descr_; break; default: TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); } return encoded_length; } void MSRACapabilityValues__BSSGP_template::copy_value(const MSRACapabilityValues__BSSGP& other_value) { single_value.union_selection = other_value.get_selection(); switch (single_value.union_selection) { case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111__BSSGP_template(other_value.mSRACapabilityValuesExclude1111()); break; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111__BSSGP_template(other_value.mSRACapabilityValues1111()); break; default: TTCN_error("Initializing a template with an unbound value of type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } set_selection(SPECIFIC_VALUE); } void MSRACapabilityValues__BSSGP_template::copy_template(const MSRACapabilityValues__BSSGP_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 MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111__BSSGP_template(*other_value.single_value.field_mSRACapabilityValuesExclude1111); break; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111__BSSGP_template(*other_value.single_value.field_mSRACapabilityValues1111); break; default: TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } 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 MSRACapabilityValues__BSSGP_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 MSRACapabilityValues__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MSRACapabilityValues__BSSGP_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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); } set_selection(other_value); } MSRACapabilityValues__BSSGP_template::MSRACapabilityValues__BSSGP_template() { } MSRACapabilityValues__BSSGP_template::MSRACapabilityValues__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MSRACapabilityValues__BSSGP_template::MSRACapabilityValues__BSSGP_template(const MSRACapabilityValues__BSSGP& other_value) { copy_value(other_value); } MSRACapabilityValues__BSSGP_template::MSRACapabilityValues__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRACapabilityValues__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP from an unbound optional field."); } } MSRACapabilityValues__BSSGP_template::MSRACapabilityValues__BSSGP_template(MSRACapabilityValues__BSSGP_template* p_precondition, MSRACapabilityValues__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MSRACapabilityValues__BSSGP_template::MSRACapabilityValues__BSSGP_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; } MSRACapabilityValues__BSSGP_template::MSRACapabilityValues__BSSGP_template(const MSRACapabilityValues__BSSGP_template& other_value) : Base_Template(){ copy_template(other_value); } MSRACapabilityValues__BSSGP_template::~MSRACapabilityValues__BSSGP_template() { clean_up(); } void MSRACapabilityValues__BSSGP_template::clean_up() { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: delete single_value.field_mSRACapabilityValuesExclude1111; break; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: delete single_value.field_mSRACapabilityValues1111; 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; } MSRACapabilityValues__BSSGP_template& MSRACapabilityValues__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MSRACapabilityValues__BSSGP_template& MSRACapabilityValues__BSSGP_template::operator=(const MSRACapabilityValues__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MSRACapabilityValues__BSSGP_template& MSRACapabilityValues__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRACapabilityValues__BSSGP&)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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); } return *this; } MSRACapabilityValues__BSSGP_template& MSRACapabilityValues__BSSGP_template::operator=(const MSRACapabilityValues__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MSRACapabilityValues__BSSGP_template::match(const MSRACapabilityValues__BSSGP& 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: { MSRACapabilityValues__BSSGP::union_selection_type value_selection = other_value.get_selection(); if (value_selection == MSRACapabilityValues__BSSGP::UNBOUND_VALUE) return FALSE; if (value_selection != single_value.union_selection) return FALSE; switch (value_selection) { case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: return single_value.field_mSRACapabilityValuesExclude1111->match(other_value.mSRACapabilityValuesExclude1111(), legacy); case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: return single_value.field_mSRACapabilityValues1111->match(other_value.mSRACapabilityValues1111(), legacy); default: TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } } 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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); } return FALSE; } boolean MSRACapabilityValues__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; switch (single_value.union_selection) { case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: return single_value.field_mSRACapabilityValuesExclude1111->is_value(); case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: return single_value.field_mSRACapabilityValues1111->is_value(); default: TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } } MSRACapabilityValues__BSSGP MSRACapabilityValues__BSSGP_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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); MSRACapabilityValues__BSSGP ret_val; switch (single_value.union_selection) { case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: ret_val.mSRACapabilityValuesExclude1111() = single_value.field_mSRACapabilityValuesExclude1111->valueof(); break; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: ret_val.mSRACapabilityValues1111() = single_value.field_mSRACapabilityValues1111->valueof(); break; default: TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } return ret_val; } MSRACapabilityValues__BSSGP_template& MSRACapabilityValues__BSSGP_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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); return value_list.list_value[list_index]; } void MSRACapabilityValues__BSSGP_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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MSRACapabilityValues__BSSGP_template[list_length]; } MSRACapabilityValuesExclude1111__BSSGP_template& MSRACapabilityValues__BSSGP_template::mSRACapabilityValuesExclude1111() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111__BSSGP_template(ANY_VALUE); else single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111__BSSGP_template; single_value.union_selection = MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111; set_selection(SPECIFIC_VALUE); } return *single_value.field_mSRACapabilityValuesExclude1111; } const MSRACapabilityValuesExclude1111__BSSGP_template& MSRACapabilityValues__BSSGP_template::mSRACapabilityValuesExclude1111() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mSRACapabilityValuesExclude1111 in a non-specific template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); if (single_value.union_selection != MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111) TTCN_error("Accessing non-selected field mSRACapabilityValuesExclude1111 in a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); return *single_value.field_mSRACapabilityValuesExclude1111; } MSRACapabilityValues1111__BSSGP_template& MSRACapabilityValues__BSSGP_template::mSRACapabilityValues1111() { if (template_selection != SPECIFIC_VALUE || single_value.union_selection != MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111) { template_sel old_selection = template_selection; clean_up(); if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111__BSSGP_template(ANY_VALUE); else single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111__BSSGP_template; single_value.union_selection = MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111; set_selection(SPECIFIC_VALUE); } return *single_value.field_mSRACapabilityValues1111; } const MSRACapabilityValues1111__BSSGP_template& MSRACapabilityValues__BSSGP_template::mSRACapabilityValues1111() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mSRACapabilityValues1111 in a non-specific template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); if (single_value.union_selection != MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111) TTCN_error("Accessing non-selected field mSRACapabilityValues1111 in a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); return *single_value.field_mSRACapabilityValues1111; } boolean MSRACapabilityValues__BSSGP_template::ischosen(MSRACapabilityValues__BSSGP::union_selection_type checked_selection) const { if (checked_selection == MSRACapabilityValues__BSSGP::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); switch (template_selection) { case SPECIFIC_VALUE: if (single_value.union_selection == MSRACapabilityValues__BSSGP::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); 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 @BSSGP_Types.MSRACapabilityValues_BSSGP 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 MSRACapabilityValues__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: switch (single_value.union_selection) { case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: TTCN_Logger::log_event_str("{ mSRACapabilityValuesExclude1111 := "); single_value.field_mSRACapabilityValuesExclude1111->log(); TTCN_Logger::log_event_str(" }"); break; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: TTCN_Logger::log_event_str("{ mSRACapabilityValues1111 := "); single_value.field_mSRACapabilityValues1111->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 MSRACapabilityValues__BSSGP_template::log_match(const MSRACapabilityValues__BSSGP& 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 MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".mSRACapabilityValuesExclude1111"); single_value.field_mSRACapabilityValuesExclude1111->log_match(match_value.mSRACapabilityValuesExclude1111(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ mSRACapabilityValuesExclude1111 := "); single_value.field_mSRACapabilityValuesExclude1111->log_match(match_value.mSRACapabilityValuesExclude1111(), legacy); TTCN_Logger::log_event_str(" }"); } break; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){ TTCN_Logger::log_logmatch_info(".mSRACapabilityValues1111"); single_value.field_mSRACapabilityValues1111->log_match(match_value.mSRACapabilityValues1111(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } else { TTCN_Logger::log_event_str("{ mSRACapabilityValues1111 := "); single_value.field_mSRACapabilityValues1111->log_match(match_value.mSRACapabilityValues1111(), 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 MSRACapabilityValues__BSSGP_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 MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: single_value.field_mSRACapabilityValuesExclude1111->encode_text(text_buf); break; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: single_value.field_mSRACapabilityValues1111->encode_text(text_buf); break; default: TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } 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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); } } void MSRACapabilityValues__BSSGP_template::decode_text(Text_Buf& text_buf) { clean_up(); decode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: { single_value.union_selection = MSRACapabilityValues__BSSGP::UNBOUND_VALUE; MSRACapabilityValues__BSSGP::union_selection_type new_selection = (MSRACapabilityValues__BSSGP::union_selection_type)text_buf.pull_int().get_val(); switch (new_selection) { case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: single_value.field_mSRACapabilityValuesExclude1111 = new MSRACapabilityValuesExclude1111__BSSGP_template; single_value.field_mSRACapabilityValuesExclude1111->decode_text(text_buf); break; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: single_value.field_mSRACapabilityValues1111 = new MSRACapabilityValues1111__BSSGP_template; single_value.field_mSRACapabilityValues1111->decode_text(text_buf); break; default: TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } 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 MSRACapabilityValues__BSSGP_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 @BSSGP_Types.MSRACapabilityValues_BSSGP."); } } boolean MSRACapabilityValues__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MSRACapabilityValues__BSSGP_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 `@BSSGP_Types.MSRACapabilityValues_BSSGP'"); } if (strcmp("mSRACapabilityValuesExclude1111", param_field) == 0) { mSRACapabilityValuesExclude1111().set_param(param); return; } else if (strcmp("mSRACapabilityValues1111", param_field) == 0) { mSRACapabilityValues1111().set_param(param); return; } else param.error("Field `%s' not found in union template type `@BSSGP_Types.MSRACapabilityValues_BSSGP'", 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: { MSRACapabilityValues__BSSGP_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", "@BSSGP_Types.MSRACapabilityValues_BSSGP"); 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, "mSRACapabilityValuesExclude1111")) { mSRACapabilityValuesExclude1111().set_param(*mp_last); break; } if (!strcmp(last_name, "mSRACapabilityValues1111")) { mSRACapabilityValues1111().set_param(*mp_last); break; } mp_last->error("Field %s does not exist in type @BSSGP_Types.MSRACapabilityValues_BSSGP.", last_name); } break; case Module_Param::MP_Implication_Template: { MSRACapabilityValues__BSSGP_template* precondition = new MSRACapabilityValues__BSSGP_template; precondition->set_param(*m_p->get_elem(0)); MSRACapabilityValues__BSSGP_template* implied_template = new MSRACapabilityValues__BSSGP_template; implied_template->set_param(*m_p->get_elem(1)); *this = MSRACapabilityValues__BSSGP_template(precondition, implied_template); } break; default: param.type_error("union template", "@BSSGP_Types.MSRACapabilityValues_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MSRACapabilityValues__BSSGP_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 MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValuesExclude1111: single_value.field_mSRACapabilityValuesExclude1111->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValues_BSSGP"); return; case MSRACapabilityValues__BSSGP::ALT_mSRACapabilityValues1111: single_value.field_mSRACapabilityValues1111->check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValues_BSSGP"); return; default: TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @BSSGP_Types.MSRACapabilityValues_BSSGP."); } 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 : "@BSSGP_Types.MSRACapabilityValues_BSSGP"); } AccessCapabilities__BSSGP::AccessCapabilities__BSSGP() { } AccessCapabilities__BSSGP::AccessCapabilities__BSSGP(const BITSTRING& par_rfPowerCapability, const BITSTRING& par_presenceBitA5, const OPTIONAL< A5BITS__BSSGP >& par_a5bits, const BITSTRING& par_esind, const BITSTRING& par_psbit, const BITSTRING& par_vgcs, const BITSTRING& par_vbs, const BITSTRING& par_presenceBitMultislot, const OPTIONAL< MultislotCap__BSSGP >& par_multislotcap, const OPTIONAL< AccessCapAdditionsAfterRel97__BSSGP >& par_accessCapAdditionsAfterRel97) : field_rfPowerCapability(par_rfPowerCapability), field_presenceBitA5(par_presenceBitA5), field_a5bits(par_a5bits), field_esind(par_esind), field_psbit(par_psbit), field_vgcs(par_vgcs), field_vbs(par_vbs), field_presenceBitMultislot(par_presenceBitMultislot), field_multislotcap(par_multislotcap), field_accessCapAdditionsAfterRel97(par_accessCapAdditionsAfterRel97) { } AccessCapabilities__BSSGP::AccessCapabilities__BSSGP(const AccessCapabilities__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapabilities_BSSGP."); if (other_value.rfPowerCapability().is_bound()) field_rfPowerCapability = other_value.rfPowerCapability(); else field_rfPowerCapability.clean_up(); if (other_value.presenceBitA5().is_bound()) field_presenceBitA5 = other_value.presenceBitA5(); else field_presenceBitA5.clean_up(); if (other_value.a5bits().is_bound()) field_a5bits = other_value.a5bits(); else field_a5bits.clean_up(); if (other_value.esind().is_bound()) field_esind = other_value.esind(); else field_esind.clean_up(); if (other_value.psbit().is_bound()) field_psbit = other_value.psbit(); else field_psbit.clean_up(); if (other_value.vgcs().is_bound()) field_vgcs = other_value.vgcs(); else field_vgcs.clean_up(); if (other_value.vbs().is_bound()) field_vbs = other_value.vbs(); else field_vbs.clean_up(); if (other_value.presenceBitMultislot().is_bound()) field_presenceBitMultislot = other_value.presenceBitMultislot(); else field_presenceBitMultislot.clean_up(); if (other_value.multislotcap().is_bound()) field_multislotcap = other_value.multislotcap(); else field_multislotcap.clean_up(); if (other_value.accessCapAdditionsAfterRel97().is_bound()) field_accessCapAdditionsAfterRel97 = other_value.accessCapAdditionsAfterRel97(); else field_accessCapAdditionsAfterRel97.clean_up(); } void AccessCapabilities__BSSGP::clean_up() { field_rfPowerCapability.clean_up(); field_presenceBitA5.clean_up(); field_a5bits.clean_up(); field_esind.clean_up(); field_psbit.clean_up(); field_vgcs.clean_up(); field_vbs.clean_up(); field_presenceBitMultislot.clean_up(); field_multislotcap.clean_up(); field_accessCapAdditionsAfterRel97.clean_up(); } const TTCN_Typedescriptor_t* AccessCapabilities__BSSGP::get_descriptor() const { return &AccessCapabilities__BSSGP_descr_; } AccessCapabilities__BSSGP& AccessCapabilities__BSSGP::operator=(const AccessCapabilities__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapabilities_BSSGP."); if (other_value.rfPowerCapability().is_bound()) field_rfPowerCapability = other_value.rfPowerCapability(); else field_rfPowerCapability.clean_up(); if (other_value.presenceBitA5().is_bound()) field_presenceBitA5 = other_value.presenceBitA5(); else field_presenceBitA5.clean_up(); if (other_value.a5bits().is_bound()) field_a5bits = other_value.a5bits(); else field_a5bits.clean_up(); if (other_value.esind().is_bound()) field_esind = other_value.esind(); else field_esind.clean_up(); if (other_value.psbit().is_bound()) field_psbit = other_value.psbit(); else field_psbit.clean_up(); if (other_value.vgcs().is_bound()) field_vgcs = other_value.vgcs(); else field_vgcs.clean_up(); if (other_value.vbs().is_bound()) field_vbs = other_value.vbs(); else field_vbs.clean_up(); if (other_value.presenceBitMultislot().is_bound()) field_presenceBitMultislot = other_value.presenceBitMultislot(); else field_presenceBitMultislot.clean_up(); if (other_value.multislotcap().is_bound()) field_multislotcap = other_value.multislotcap(); else field_multislotcap.clean_up(); if (other_value.accessCapAdditionsAfterRel97().is_bound()) field_accessCapAdditionsAfterRel97 = other_value.accessCapAdditionsAfterRel97(); else field_accessCapAdditionsAfterRel97.clean_up(); } return *this; } boolean AccessCapabilities__BSSGP::operator==(const AccessCapabilities__BSSGP& other_value) const { return field_rfPowerCapability==other_value.field_rfPowerCapability && field_presenceBitA5==other_value.field_presenceBitA5 && field_a5bits==other_value.field_a5bits && field_esind==other_value.field_esind && field_psbit==other_value.field_psbit && field_vgcs==other_value.field_vgcs && field_vbs==other_value.field_vbs && field_presenceBitMultislot==other_value.field_presenceBitMultislot && field_multislotcap==other_value.field_multislotcap && field_accessCapAdditionsAfterRel97==other_value.field_accessCapAdditionsAfterRel97; } boolean AccessCapabilities__BSSGP::is_bound() const { return (field_rfPowerCapability.is_bound()) || (field_presenceBitA5.is_bound()) || (OPTIONAL_OMIT == field_a5bits.get_selection() || field_a5bits.is_bound()) || (field_esind.is_bound()) || (field_psbit.is_bound()) || (field_vgcs.is_bound()) || (field_vbs.is_bound()) || (field_presenceBitMultislot.is_bound()) || (OPTIONAL_OMIT == field_multislotcap.get_selection() || field_multislotcap.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel97.get_selection() || field_accessCapAdditionsAfterRel97.is_bound()); } boolean AccessCapabilities__BSSGP::is_value() const { return field_rfPowerCapability.is_value() && field_presenceBitA5.is_value() && (OPTIONAL_OMIT == field_a5bits.get_selection() || field_a5bits.is_value()) && field_esind.is_value() && field_psbit.is_value() && field_vgcs.is_value() && field_vbs.is_value() && field_presenceBitMultislot.is_value() && (OPTIONAL_OMIT == field_multislotcap.get_selection() || field_multislotcap.is_value()) && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel97.get_selection() || field_accessCapAdditionsAfterRel97.is_value()); } int AccessCapabilities__BSSGP::size_of() const { int ret_val = 7; if (field_a5bits.ispresent()) ret_val++; if (field_multislotcap.ispresent()) ret_val++; if (field_accessCapAdditionsAfterRel97.ispresent()) ret_val++; return ret_val; } void AccessCapabilities__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ rfPowerCapability := "); field_rfPowerCapability.log(); TTCN_Logger::log_event_str(", presenceBitA5 := "); field_presenceBitA5.log(); TTCN_Logger::log_event_str(", a5bits := "); field_a5bits.log(); TTCN_Logger::log_event_str(", esind := "); field_esind.log(); TTCN_Logger::log_event_str(", psbit := "); field_psbit.log(); TTCN_Logger::log_event_str(", vgcs := "); field_vgcs.log(); TTCN_Logger::log_event_str(", vbs := "); field_vbs.log(); TTCN_Logger::log_event_str(", presenceBitMultislot := "); field_presenceBitMultislot.log(); TTCN_Logger::log_event_str(", multislotcap := "); field_multislotcap.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel97 := "); field_accessCapAdditionsAfterRel97.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapabilities__BSSGP::set_implicit_omit() { if (rfPowerCapability().is_bound()) rfPowerCapability().set_implicit_omit(); if (presenceBitA5().is_bound()) presenceBitA5().set_implicit_omit(); if (!a5bits().is_bound()) a5bits() = OMIT_VALUE; else a5bits().set_implicit_omit(); if (esind().is_bound()) esind().set_implicit_omit(); if (psbit().is_bound()) psbit().set_implicit_omit(); if (vgcs().is_bound()) vgcs().set_implicit_omit(); if (vbs().is_bound()) vbs().set_implicit_omit(); if (presenceBitMultislot().is_bound()) presenceBitMultislot().set_implicit_omit(); if (!multislotcap().is_bound()) multislotcap() = OMIT_VALUE; else multislotcap().set_implicit_omit(); if (!accessCapAdditionsAfterRel97().is_bound()) accessCapAdditionsAfterRel97() = OMIT_VALUE; else accessCapAdditionsAfterRel97().set_implicit_omit(); } void AccessCapabilities__BSSGP::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 (100 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) rfPowerCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitA5().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a5bits().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) psbit().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) vgcs().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) vbs().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) presenceBitMultislot().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) multislotcap().set_param(*param.get_elem(8)); if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel97().set_param(*param.get_elem(9)); 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(), "rfPowerCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rfPowerCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitA5")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitA5().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a5bits")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a5bits().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "esind")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { esind().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "psbit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { psbit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "vgcs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { vgcs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "vbs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { vbs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitMultislot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitMultislot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotcap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotcap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel97")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel97().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapabilities_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapabilities_BSSGP"); } } void AccessCapabilities__BSSGP::encode_text(Text_Buf& text_buf) const { field_rfPowerCapability.encode_text(text_buf); field_presenceBitA5.encode_text(text_buf); field_a5bits.encode_text(text_buf); field_esind.encode_text(text_buf); field_psbit.encode_text(text_buf); field_vgcs.encode_text(text_buf); field_vbs.encode_text(text_buf); field_presenceBitMultislot.encode_text(text_buf); field_multislotcap.encode_text(text_buf); field_accessCapAdditionsAfterRel97.encode_text(text_buf); } void AccessCapabilities__BSSGP::decode_text(Text_Buf& text_buf) { field_rfPowerCapability.decode_text(text_buf); field_presenceBitA5.decode_text(text_buf); field_a5bits.decode_text(text_buf); field_esind.decode_text(text_buf); field_psbit.decode_text(text_buf); field_vgcs.decode_text(text_buf); field_vbs.decode_text(text_buf); field_presenceBitMultislot.decode_text(text_buf); field_multislotcap.decode_text(text_buf); field_accessCapAdditionsAfterRel97.decode_text(text_buf); } void AccessCapabilities__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapabilities__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapabilities__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapabilities__BSSGP_rfPowerCapability_descr_.raw->forceomit); decoded_field_length = field_rfPowerCapability.RAW_decode(AccessCapabilities__BSSGP_rfPowerCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapabilities__BSSGP_presenceBitA5_descr_.raw->forceomit); decoded_field_length = field_presenceBitA5.RAW_decode(AccessCapabilities__BSSGP_presenceBitA5_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitA5 == bs_0){ if (force_omit != NULL && (*force_omit)(2)) { field_a5bits = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapabilities__BSSGP_a5bits_descr_.raw->forceomit); decoded_field_length = field_a5bits().RAW_decode(AccessCapabilities__BSSGP_a5bits_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 1) { field_a5bits = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_a5bits=OMIT_VALUE; RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapabilities__BSSGP_esind_descr_.raw->forceomit); decoded_field_length = field_esind.RAW_decode(AccessCapabilities__BSSGP_esind_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapabilities__BSSGP_psbit_descr_.raw->forceomit); decoded_field_length = field_psbit.RAW_decode(AccessCapabilities__BSSGP_psbit_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapabilities__BSSGP_vgcs_descr_.raw->forceomit); decoded_field_length = field_vgcs.RAW_decode(AccessCapabilities__BSSGP_vgcs_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_6_force_omit(6, force_omit, AccessCapabilities__BSSGP_vbs_descr_.raw->forceomit); decoded_field_length = field_vbs.RAW_decode(AccessCapabilities__BSSGP_vbs_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_7_force_omit(7, force_omit, AccessCapabilities__BSSGP_presenceBitMultislot_descr_.raw->forceomit); decoded_field_length = field_presenceBitMultislot.RAW_decode(AccessCapabilities__BSSGP_presenceBitMultislot_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitMultislot == bs_0){ if (force_omit != NULL && (*force_omit)(8)) { field_multislotcap = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_8_force_omit(8, force_omit, AccessCapabilities__BSSGP_multislotcap_descr_.raw->forceomit); decoded_field_length = field_multislotcap().RAW_decode(AccessCapabilities__BSSGP_multislotcap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit); if (decoded_field_length < 1) { field_multislotcap = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_multislotcap=OMIT_VALUE; if (limit > 0){ if (force_omit != NULL && (*force_omit)(9)) { field_accessCapAdditionsAfterRel97 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_9_force_omit(9, force_omit, AccessCapabilities__BSSGP_accessCapAdditionsAfterRel97_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel97().RAW_decode(AccessCapabilities__BSSGP_accessCapAdditionsAfterRel97_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel97 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel97=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapabilities__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 10; myleaf.body.node.nodes = init_nodes_of_enc_tree(10); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapabilities__BSSGP_rfPowerCapability_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapabilities__BSSGP_presenceBitA5_descr_.raw); if (field_a5bits.ispresent()) { myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapabilities__BSSGP_a5bits_descr_.raw); } else myleaf.body.node.nodes[2] = NULL; myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapabilities__BSSGP_esind_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapabilities__BSSGP_psbit_descr_.raw); myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapabilities__BSSGP_vgcs_descr_.raw); myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapabilities__BSSGP_vbs_descr_.raw); myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, AccessCapabilities__BSSGP_presenceBitMultislot_descr_.raw); if (field_multislotcap.ispresent()) { myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, AccessCapabilities__BSSGP_multislotcap_descr_.raw); } else myleaf.body.node.nodes[8] = NULL; if (field_accessCapAdditionsAfterRel97.ispresent()) { myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, AccessCapabilities__BSSGP_accessCapAdditionsAfterRel97_descr_.raw); } else myleaf.body.node.nodes[9] = NULL; encoded_length += field_rfPowerCapability.RAW_encode(AccessCapabilities__BSSGP_rfPowerCapability_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_presenceBitA5.RAW_encode(AccessCapabilities__BSSGP_presenceBitA5_descr_, *myleaf.body.node.nodes[1]); if (field_a5bits.ispresent()) { encoded_length += field_a5bits().RAW_encode(AccessCapabilities__BSSGP_a5bits_descr_, *myleaf.body.node.nodes[2]); } encoded_length += field_esind.RAW_encode(AccessCapabilities__BSSGP_esind_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_psbit.RAW_encode(AccessCapabilities__BSSGP_psbit_descr_, *myleaf.body.node.nodes[4]); encoded_length += field_vgcs.RAW_encode(AccessCapabilities__BSSGP_vgcs_descr_, *myleaf.body.node.nodes[5]); encoded_length += field_vbs.RAW_encode(AccessCapabilities__BSSGP_vbs_descr_, *myleaf.body.node.nodes[6]); encoded_length += field_presenceBitMultislot.RAW_encode(AccessCapabilities__BSSGP_presenceBitMultislot_descr_, *myleaf.body.node.nodes[7]); if (field_multislotcap.ispresent()) { encoded_length += field_multislotcap().RAW_encode(AccessCapabilities__BSSGP_multislotcap_descr_, *myleaf.body.node.nodes[8]); } if (field_accessCapAdditionsAfterRel97.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel97().RAW_encode(AccessCapabilities__BSSGP_accessCapAdditionsAfterRel97_descr_, *myleaf.body.node.nodes[9]); } if (field_a5bits.ispresent() && (field_presenceBitA5 != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={1}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapabilities__BSSGP_presenceBitA5_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } if (field_multislotcap.ispresent() && (field_presenceBitMultislot != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={7}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapabilities__BSSGP_presenceBitMultislot_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct AccessCapabilities__BSSGP_template::single_value_struct { BITSTRING_template field_rfPowerCapability; BITSTRING_template field_presenceBitA5; A5BITS__BSSGP_template field_a5bits; BITSTRING_template field_esind; BITSTRING_template field_psbit; BITSTRING_template field_vgcs; BITSTRING_template field_vbs; BITSTRING_template field_presenceBitMultislot; MultislotCap__BSSGP_template field_multislotcap; AccessCapAdditionsAfterRel97__BSSGP_template field_accessCapAdditionsAfterRel97; }; void AccessCapabilities__BSSGP_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_rfPowerCapability = ANY_VALUE; single_value->field_presenceBitA5 = ANY_VALUE; single_value->field_a5bits = ANY_OR_OMIT; single_value->field_esind = ANY_VALUE; single_value->field_psbit = ANY_VALUE; single_value->field_vgcs = ANY_VALUE; single_value->field_vbs = ANY_VALUE; single_value->field_presenceBitMultislot = ANY_VALUE; single_value->field_multislotcap = ANY_OR_OMIT; single_value->field_accessCapAdditionsAfterRel97 = ANY_OR_OMIT; } } } void AccessCapabilities__BSSGP_template::copy_value(const AccessCapabilities__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.rfPowerCapability().is_bound()) { single_value->field_rfPowerCapability = other_value.rfPowerCapability(); } else { single_value->field_rfPowerCapability.clean_up(); } if (other_value.presenceBitA5().is_bound()) { single_value->field_presenceBitA5 = other_value.presenceBitA5(); } else { single_value->field_presenceBitA5.clean_up(); } if (other_value.a5bits().is_bound()) { if (other_value.a5bits().ispresent()) single_value->field_a5bits = other_value.a5bits()(); else single_value->field_a5bits = OMIT_VALUE; } else { single_value->field_a5bits.clean_up(); } if (other_value.esind().is_bound()) { single_value->field_esind = other_value.esind(); } else { single_value->field_esind.clean_up(); } if (other_value.psbit().is_bound()) { single_value->field_psbit = other_value.psbit(); } else { single_value->field_psbit.clean_up(); } if (other_value.vgcs().is_bound()) { single_value->field_vgcs = other_value.vgcs(); } else { single_value->field_vgcs.clean_up(); } if (other_value.vbs().is_bound()) { single_value->field_vbs = other_value.vbs(); } else { single_value->field_vbs.clean_up(); } if (other_value.presenceBitMultislot().is_bound()) { single_value->field_presenceBitMultislot = other_value.presenceBitMultislot(); } else { single_value->field_presenceBitMultislot.clean_up(); } if (other_value.multislotcap().is_bound()) { if (other_value.multislotcap().ispresent()) single_value->field_multislotcap = other_value.multislotcap()(); else single_value->field_multislotcap = OMIT_VALUE; } else { single_value->field_multislotcap.clean_up(); } if (other_value.accessCapAdditionsAfterRel97().is_bound()) { if (other_value.accessCapAdditionsAfterRel97().ispresent()) single_value->field_accessCapAdditionsAfterRel97 = other_value.accessCapAdditionsAfterRel97()(); else single_value->field_accessCapAdditionsAfterRel97 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel97.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapabilities__BSSGP_template::copy_template(const AccessCapabilities__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.rfPowerCapability().get_selection()) { single_value->field_rfPowerCapability = other_value.rfPowerCapability(); } else { single_value->field_rfPowerCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitA5().get_selection()) { single_value->field_presenceBitA5 = other_value.presenceBitA5(); } else { single_value->field_presenceBitA5.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.a5bits().get_selection()) { single_value->field_a5bits = other_value.a5bits(); } else { single_value->field_a5bits.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.esind().get_selection()) { single_value->field_esind = other_value.esind(); } else { single_value->field_esind.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.psbit().get_selection()) { single_value->field_psbit = other_value.psbit(); } else { single_value->field_psbit.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.vgcs().get_selection()) { single_value->field_vgcs = other_value.vgcs(); } else { single_value->field_vgcs.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.vbs().get_selection()) { single_value->field_vbs = other_value.vbs(); } else { single_value->field_vbs.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitMultislot().get_selection()) { single_value->field_presenceBitMultislot = other_value.presenceBitMultislot(); } else { single_value->field_presenceBitMultislot.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.multislotcap().get_selection()) { single_value->field_multislotcap = other_value.multislotcap(); } else { single_value->field_multislotcap.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel97().get_selection()) { single_value->field_accessCapAdditionsAfterRel97 = other_value.accessCapAdditionsAfterRel97(); } else { single_value->field_accessCapAdditionsAfterRel97.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 AccessCapabilities__BSSGP_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 AccessCapabilities__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapabilities__BSSGP_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 @BSSGP_Types.AccessCapabilities_BSSGP."); break; } set_selection(other_value); } AccessCapabilities__BSSGP_template::AccessCapabilities__BSSGP_template() { } AccessCapabilities__BSSGP_template::AccessCapabilities__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapabilities__BSSGP_template::AccessCapabilities__BSSGP_template(const AccessCapabilities__BSSGP& other_value) { copy_value(other_value); } AccessCapabilities__BSSGP_template::AccessCapabilities__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapabilities__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapabilities_BSSGP from an unbound optional field."); } } AccessCapabilities__BSSGP_template::AccessCapabilities__BSSGP_template(AccessCapabilities__BSSGP_template* p_precondition, AccessCapabilities__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapabilities__BSSGP_template::AccessCapabilities__BSSGP_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; } AccessCapabilities__BSSGP_template::AccessCapabilities__BSSGP_template(const AccessCapabilities__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapabilities__BSSGP_template::~AccessCapabilities__BSSGP_template() { clean_up(); } AccessCapabilities__BSSGP_template& AccessCapabilities__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapabilities__BSSGP_template& AccessCapabilities__BSSGP_template::operator=(const AccessCapabilities__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapabilities__BSSGP_template& AccessCapabilities__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapabilities__BSSGP&)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 @BSSGP_Types.AccessCapabilities_BSSGP."); } return *this; } AccessCapabilities__BSSGP_template& AccessCapabilities__BSSGP_template::operator=(const AccessCapabilities__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapabilities__BSSGP_template::match(const AccessCapabilities__BSSGP& 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.rfPowerCapability().is_bound()) return FALSE; if(!single_value->field_rfPowerCapability.match(other_value.rfPowerCapability(), legacy))return FALSE; if(!other_value.presenceBitA5().is_bound()) return FALSE; if(!single_value->field_presenceBitA5.match(other_value.presenceBitA5(), legacy))return FALSE; if(!other_value.a5bits().is_bound()) return FALSE; if((other_value.a5bits().ispresent() ? !single_value->field_a5bits.match((const A5BITS__BSSGP&)other_value.a5bits(), legacy) : !single_value->field_a5bits.match_omit(legacy)))return FALSE; if(!other_value.esind().is_bound()) return FALSE; if(!single_value->field_esind.match(other_value.esind(), legacy))return FALSE; if(!other_value.psbit().is_bound()) return FALSE; if(!single_value->field_psbit.match(other_value.psbit(), legacy))return FALSE; if(!other_value.vgcs().is_bound()) return FALSE; if(!single_value->field_vgcs.match(other_value.vgcs(), legacy))return FALSE; if(!other_value.vbs().is_bound()) return FALSE; if(!single_value->field_vbs.match(other_value.vbs(), legacy))return FALSE; if(!other_value.presenceBitMultislot().is_bound()) return FALSE; if(!single_value->field_presenceBitMultislot.match(other_value.presenceBitMultislot(), legacy))return FALSE; if(!other_value.multislotcap().is_bound()) return FALSE; if((other_value.multislotcap().ispresent() ? !single_value->field_multislotcap.match((const MultislotCap__BSSGP&)other_value.multislotcap(), legacy) : !single_value->field_multislotcap.match_omit(legacy)))return FALSE; if(!other_value.accessCapAdditionsAfterRel97().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel97().ispresent() ? !single_value->field_accessCapAdditionsAfterRel97.match((const AccessCapAdditionsAfterRel97__BSSGP&)other_value.accessCapAdditionsAfterRel97(), legacy) : !single_value->field_accessCapAdditionsAfterRel97.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 @BSSGP_Types.AccessCapabilities_BSSGP."); } return FALSE; } boolean AccessCapabilities__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_rfPowerCapability.is_bound() || single_value->field_presenceBitA5.is_bound() || (single_value->field_a5bits.is_omit() || single_value->field_a5bits.is_bound()) || single_value->field_esind.is_bound() || single_value->field_psbit.is_bound() || single_value->field_vgcs.is_bound() || single_value->field_vbs.is_bound() || single_value->field_presenceBitMultislot.is_bound() || (single_value->field_multislotcap.is_omit() || single_value->field_multislotcap.is_bound()) || (single_value->field_accessCapAdditionsAfterRel97.is_omit() || single_value->field_accessCapAdditionsAfterRel97.is_bound()); } boolean AccessCapabilities__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_rfPowerCapability.is_value() && single_value->field_presenceBitA5.is_value() && (single_value->field_a5bits.is_omit() || single_value->field_a5bits.is_value()) && single_value->field_esind.is_value() && single_value->field_psbit.is_value() && single_value->field_vgcs.is_value() && single_value->field_vbs.is_value() && single_value->field_presenceBitMultislot.is_value() && (single_value->field_multislotcap.is_omit() || single_value->field_multislotcap.is_value()) && (single_value->field_accessCapAdditionsAfterRel97.is_omit() || single_value->field_accessCapAdditionsAfterRel97.is_value()); } void AccessCapabilities__BSSGP_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; } AccessCapabilities__BSSGP AccessCapabilities__BSSGP_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 @BSSGP_Types.AccessCapabilities_BSSGP."); AccessCapabilities__BSSGP ret_val; if (single_value->field_rfPowerCapability.is_bound()) { ret_val.rfPowerCapability() = single_value->field_rfPowerCapability.valueof(); } if (single_value->field_presenceBitA5.is_bound()) { ret_val.presenceBitA5() = single_value->field_presenceBitA5.valueof(); } if (single_value->field_a5bits.is_omit()) ret_val.a5bits() = OMIT_VALUE; else if (single_value->field_a5bits.is_bound()) { ret_val.a5bits() = single_value->field_a5bits.valueof(); } if (single_value->field_esind.is_bound()) { ret_val.esind() = single_value->field_esind.valueof(); } if (single_value->field_psbit.is_bound()) { ret_val.psbit() = single_value->field_psbit.valueof(); } if (single_value->field_vgcs.is_bound()) { ret_val.vgcs() = single_value->field_vgcs.valueof(); } if (single_value->field_vbs.is_bound()) { ret_val.vbs() = single_value->field_vbs.valueof(); } if (single_value->field_presenceBitMultislot.is_bound()) { ret_val.presenceBitMultislot() = single_value->field_presenceBitMultislot.valueof(); } if (single_value->field_multislotcap.is_omit()) ret_val.multislotcap() = OMIT_VALUE; else if (single_value->field_multislotcap.is_bound()) { ret_val.multislotcap() = single_value->field_multislotcap.valueof(); } if (single_value->field_accessCapAdditionsAfterRel97.is_omit()) ret_val.accessCapAdditionsAfterRel97() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel97.is_bound()) { ret_val.accessCapAdditionsAfterRel97() = single_value->field_accessCapAdditionsAfterRel97.valueof(); } return ret_val; } void AccessCapabilities__BSSGP_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 @BSSGP_Types.AccessCapabilities_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapabilities__BSSGP_template[list_length]; } AccessCapabilities__BSSGP_template& AccessCapabilities__BSSGP_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 @BSSGP_Types.AccessCapabilities_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapabilities__BSSGP_template::rfPowerCapability() { set_specific(); return single_value->field_rfPowerCapability; } const BITSTRING_template& AccessCapabilities__BSSGP_template::rfPowerCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rfPowerCapability of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_rfPowerCapability; } BITSTRING_template& AccessCapabilities__BSSGP_template::presenceBitA5() { set_specific(); return single_value->field_presenceBitA5; } const BITSTRING_template& AccessCapabilities__BSSGP_template::presenceBitA5() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitA5 of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_presenceBitA5; } A5BITS__BSSGP_template& AccessCapabilities__BSSGP_template::a5bits() { set_specific(); return single_value->field_a5bits; } const A5BITS__BSSGP_template& AccessCapabilities__BSSGP_template::a5bits() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a5bits of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_a5bits; } BITSTRING_template& AccessCapabilities__BSSGP_template::esind() { set_specific(); return single_value->field_esind; } const BITSTRING_template& AccessCapabilities__BSSGP_template::esind() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field esind of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_esind; } BITSTRING_template& AccessCapabilities__BSSGP_template::psbit() { set_specific(); return single_value->field_psbit; } const BITSTRING_template& AccessCapabilities__BSSGP_template::psbit() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field psbit of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_psbit; } BITSTRING_template& AccessCapabilities__BSSGP_template::vgcs() { set_specific(); return single_value->field_vgcs; } const BITSTRING_template& AccessCapabilities__BSSGP_template::vgcs() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field vgcs of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_vgcs; } BITSTRING_template& AccessCapabilities__BSSGP_template::vbs() { set_specific(); return single_value->field_vbs; } const BITSTRING_template& AccessCapabilities__BSSGP_template::vbs() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field vbs of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_vbs; } BITSTRING_template& AccessCapabilities__BSSGP_template::presenceBitMultislot() { set_specific(); return single_value->field_presenceBitMultislot; } const BITSTRING_template& AccessCapabilities__BSSGP_template::presenceBitMultislot() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitMultislot of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_presenceBitMultislot; } MultislotCap__BSSGP_template& AccessCapabilities__BSSGP_template::multislotcap() { set_specific(); return single_value->field_multislotcap; } const MultislotCap__BSSGP_template& AccessCapabilities__BSSGP_template::multislotcap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field multislotcap of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_multislotcap; } AccessCapAdditionsAfterRel97__BSSGP_template& AccessCapabilities__BSSGP_template::accessCapAdditionsAfterRel97() { set_specific(); return single_value->field_accessCapAdditionsAfterRel97; } const AccessCapAdditionsAfterRel97__BSSGP_template& AccessCapabilities__BSSGP_template::accessCapAdditionsAfterRel97() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel97 of a non-specific template of type @BSSGP_Types.AccessCapabilities_BSSGP."); return single_value->field_accessCapAdditionsAfterRel97; } int AccessCapabilities__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilities_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 7; if (single_value->field_a5bits.is_present()) ret_val++; if (single_value->field_multislotcap.is_present()) ret_val++; if (single_value->field_accessCapAdditionsAfterRel97.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 @BSSGP_Types.AccessCapabilities_BSSGP 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 @BSSGP_Types.AccessCapabilities_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilities_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilities_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilities_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilities_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilities_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilities_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapabilities_BSSGP."); } return 0; } void AccessCapabilities__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ rfPowerCapability := "); single_value->field_rfPowerCapability.log(); TTCN_Logger::log_event_str(", presenceBitA5 := "); single_value->field_presenceBitA5.log(); TTCN_Logger::log_event_str(", a5bits := "); single_value->field_a5bits.log(); TTCN_Logger::log_event_str(", esind := "); single_value->field_esind.log(); TTCN_Logger::log_event_str(", psbit := "); single_value->field_psbit.log(); TTCN_Logger::log_event_str(", vgcs := "); single_value->field_vgcs.log(); TTCN_Logger::log_event_str(", vbs := "); single_value->field_vbs.log(); TTCN_Logger::log_event_str(", presenceBitMultislot := "); single_value->field_presenceBitMultislot.log(); TTCN_Logger::log_event_str(", multislotcap := "); single_value->field_multislotcap.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel97 := "); single_value->field_accessCapAdditionsAfterRel97.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 AccessCapabilities__BSSGP_template::log_match(const AccessCapabilities__BSSGP& 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_rfPowerCapability.match(match_value.rfPowerCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".rfPowerCapability"); single_value->field_rfPowerCapability.log_match(match_value.rfPowerCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitA5.match(match_value.presenceBitA5(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitA5"); single_value->field_presenceBitA5.log_match(match_value.presenceBitA5(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.a5bits().ispresent()){ if(!single_value->field_a5bits.match(match_value.a5bits(), legacy)){ TTCN_Logger::log_logmatch_info(".a5bits"); single_value->field_a5bits.log_match(match_value.a5bits(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_a5bits.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".a5bits := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_a5bits.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_esind.match(match_value.esind(), legacy)){ TTCN_Logger::log_logmatch_info(".esind"); single_value->field_esind.log_match(match_value.esind(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_psbit.match(match_value.psbit(), legacy)){ TTCN_Logger::log_logmatch_info(".psbit"); single_value->field_psbit.log_match(match_value.psbit(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_vgcs.match(match_value.vgcs(), legacy)){ TTCN_Logger::log_logmatch_info(".vgcs"); single_value->field_vgcs.log_match(match_value.vgcs(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_vbs.match(match_value.vbs(), legacy)){ TTCN_Logger::log_logmatch_info(".vbs"); single_value->field_vbs.log_match(match_value.vbs(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitMultislot.match(match_value.presenceBitMultislot(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitMultislot"); single_value->field_presenceBitMultislot.log_match(match_value.presenceBitMultislot(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.multislotcap().ispresent()){ if(!single_value->field_multislotcap.match(match_value.multislotcap(), legacy)){ TTCN_Logger::log_logmatch_info(".multislotcap"); single_value->field_multislotcap.log_match(match_value.multislotcap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_multislotcap.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".multislotcap := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_multislotcap.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.accessCapAdditionsAfterRel97().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel97.match(match_value.accessCapAdditionsAfterRel97(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel97"); single_value->field_accessCapAdditionsAfterRel97.log_match(match_value.accessCapAdditionsAfterRel97(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel97.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel97 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel97.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("{ rfPowerCapability := "); single_value->field_rfPowerCapability.log_match(match_value.rfPowerCapability(), legacy); TTCN_Logger::log_event_str(", presenceBitA5 := "); single_value->field_presenceBitA5.log_match(match_value.presenceBitA5(), legacy); TTCN_Logger::log_event_str(", a5bits := "); if (match_value.a5bits().ispresent()) { single_value->field_a5bits.log_match(match_value.a5bits(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_a5bits.log(); if (single_value->field_a5bits.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", esind := "); single_value->field_esind.log_match(match_value.esind(), legacy); TTCN_Logger::log_event_str(", psbit := "); single_value->field_psbit.log_match(match_value.psbit(), legacy); TTCN_Logger::log_event_str(", vgcs := "); single_value->field_vgcs.log_match(match_value.vgcs(), legacy); TTCN_Logger::log_event_str(", vbs := "); single_value->field_vbs.log_match(match_value.vbs(), legacy); TTCN_Logger::log_event_str(", presenceBitMultislot := "); single_value->field_presenceBitMultislot.log_match(match_value.presenceBitMultislot(), legacy); TTCN_Logger::log_event_str(", multislotcap := "); if (match_value.multislotcap().ispresent()) { single_value->field_multislotcap.log_match(match_value.multislotcap(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_multislotcap.log(); if (single_value->field_multislotcap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel97 := "); if (match_value.accessCapAdditionsAfterRel97().ispresent()) { single_value->field_accessCapAdditionsAfterRel97.log_match(match_value.accessCapAdditionsAfterRel97(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel97.log(); if (single_value->field_accessCapAdditionsAfterRel97.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 AccessCapabilities__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_rfPowerCapability.encode_text(text_buf); single_value->field_presenceBitA5.encode_text(text_buf); single_value->field_a5bits.encode_text(text_buf); single_value->field_esind.encode_text(text_buf); single_value->field_psbit.encode_text(text_buf); single_value->field_vgcs.encode_text(text_buf); single_value->field_vbs.encode_text(text_buf); single_value->field_presenceBitMultislot.encode_text(text_buf); single_value->field_multislotcap.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel97.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 @BSSGP_Types.AccessCapabilities_BSSGP."); } } void AccessCapabilities__BSSGP_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_rfPowerCapability.decode_text(text_buf); single_value->field_presenceBitA5.decode_text(text_buf); single_value->field_a5bits.decode_text(text_buf); single_value->field_esind.decode_text(text_buf); single_value->field_psbit.decode_text(text_buf); single_value->field_vgcs.decode_text(text_buf); single_value->field_vbs.decode_text(text_buf); single_value->field_presenceBitMultislot.decode_text(text_buf); single_value->field_multislotcap.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel97.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 AccessCapabilities__BSSGP_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 @BSSGP_Types.AccessCapabilities_BSSGP."); } } void AccessCapabilities__BSSGP_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: { AccessCapabilities__BSSGP_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) rfPowerCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitA5().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a5bits().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) esind().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) psbit().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) vgcs().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) vbs().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) presenceBitMultislot().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) multislotcap().set_param(*param.get_elem(8)); if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel97().set_param(*param.get_elem(9)); 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(), "rfPowerCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rfPowerCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitA5")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitA5().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a5bits")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a5bits().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "esind")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { esind().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "psbit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { psbit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "vgcs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { vgcs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "vbs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { vbs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitMultislot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitMultislot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotcap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotcap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel97")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel97().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapabilities_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapabilities__BSSGP_template* precondition = new AccessCapabilities__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapabilities__BSSGP_template* implied_template = new AccessCapabilities__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapabilities__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapabilities_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapabilities__BSSGP_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_rfPowerCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_presenceBitA5.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_a5bits.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_esind.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_psbit.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_vgcs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_vbs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_presenceBitMultislot.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_multislotcap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); single_value->field_accessCapAdditionsAfterRel97.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilities_BSSGP"); 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 : "@BSSGP_Types.AccessCapabilities_BSSGP"); } boolean AccessCapabilities__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapabilities__BSSGP_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) a51().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) a52().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a53().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) a54().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) a55().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) a56().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) a57().set_param(*param.get_elem(6)); 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(), "a51")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a51().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a52")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a52().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a53")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a53().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a54")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a54().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a55")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a55().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a56")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a56().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a57")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a57().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.A5BITS_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.A5BITS_BSSGP"); } } void A5BITS__BSSGP::encode_text(Text_Buf& text_buf) const { field_a51.encode_text(text_buf); field_a52.encode_text(text_buf); field_a53.encode_text(text_buf); field_a54.encode_text(text_buf); field_a55.encode_text(text_buf); field_a56.encode_text(text_buf); field_a57.encode_text(text_buf); } void A5BITS__BSSGP::decode_text(Text_Buf& text_buf) { field_a51.decode_text(text_buf); field_a52.decode_text(text_buf); field_a53.decode_text(text_buf); field_a54.decode_text(text_buf); field_a55.decode_text(text_buf); field_a56.decode_text(text_buf); field_a57.decode_text(text_buf); } void A5BITS__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void A5BITS__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int A5BITS__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, A5BITS__BSSGP_a51_descr_.raw->forceomit); decoded_field_length = field_a51.RAW_decode(A5BITS__BSSGP_a51_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, A5BITS__BSSGP_a52_descr_.raw->forceomit); decoded_field_length = field_a52.RAW_decode(A5BITS__BSSGP_a52_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, A5BITS__BSSGP_a53_descr_.raw->forceomit); decoded_field_length = field_a53.RAW_decode(A5BITS__BSSGP_a53_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_3_force_omit(3, force_omit, A5BITS__BSSGP_a54_descr_.raw->forceomit); decoded_field_length = field_a54.RAW_decode(A5BITS__BSSGP_a54_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_4_force_omit(4, force_omit, A5BITS__BSSGP_a55_descr_.raw->forceomit); decoded_field_length = field_a55.RAW_decode(A5BITS__BSSGP_a55_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_5_force_omit(5, force_omit, A5BITS__BSSGP_a56_descr_.raw->forceomit); decoded_field_length = field_a56.RAW_decode(A5BITS__BSSGP_a56_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_6_force_omit(6, force_omit, A5BITS__BSSGP_a57_descr_.raw->forceomit); decoded_field_length = field_a57.RAW_decode(A5BITS__BSSGP_a57_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int A5BITS__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 7; myleaf.body.node.nodes = init_nodes_of_enc_tree(7); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, A5BITS__BSSGP_a51_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, A5BITS__BSSGP_a52_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, A5BITS__BSSGP_a53_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, A5BITS__BSSGP_a54_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, A5BITS__BSSGP_a55_descr_.raw); myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, A5BITS__BSSGP_a56_descr_.raw); myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, A5BITS__BSSGP_a57_descr_.raw); encoded_length += field_a51.RAW_encode(A5BITS__BSSGP_a51_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_a52.RAW_encode(A5BITS__BSSGP_a52_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_a53.RAW_encode(A5BITS__BSSGP_a53_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_a54.RAW_encode(A5BITS__BSSGP_a54_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_a55.RAW_encode(A5BITS__BSSGP_a55_descr_, *myleaf.body.node.nodes[4]); encoded_length += field_a56.RAW_encode(A5BITS__BSSGP_a56_descr_, *myleaf.body.node.nodes[5]); encoded_length += field_a57.RAW_encode(A5BITS__BSSGP_a57_descr_, *myleaf.body.node.nodes[6]); return myleaf.length = encoded_length; } struct A5BITS__BSSGP_template::single_value_struct { BITSTRING_template field_a51; BITSTRING_template field_a52; BITSTRING_template field_a53; BITSTRING_template field_a54; BITSTRING_template field_a55; BITSTRING_template field_a56; BITSTRING_template field_a57; }; void A5BITS__BSSGP_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_a51 = ANY_VALUE; single_value->field_a52 = ANY_VALUE; single_value->field_a53 = ANY_VALUE; single_value->field_a54 = ANY_VALUE; single_value->field_a55 = ANY_VALUE; single_value->field_a56 = ANY_VALUE; single_value->field_a57 = ANY_VALUE; } } } void A5BITS__BSSGP_template::copy_value(const A5BITS__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.a51().is_bound()) { single_value->field_a51 = other_value.a51(); } else { single_value->field_a51.clean_up(); } if (other_value.a52().is_bound()) { single_value->field_a52 = other_value.a52(); } else { single_value->field_a52.clean_up(); } if (other_value.a53().is_bound()) { single_value->field_a53 = other_value.a53(); } else { single_value->field_a53.clean_up(); } if (other_value.a54().is_bound()) { single_value->field_a54 = other_value.a54(); } else { single_value->field_a54.clean_up(); } if (other_value.a55().is_bound()) { single_value->field_a55 = other_value.a55(); } else { single_value->field_a55.clean_up(); } if (other_value.a56().is_bound()) { single_value->field_a56 = other_value.a56(); } else { single_value->field_a56.clean_up(); } if (other_value.a57().is_bound()) { single_value->field_a57 = other_value.a57(); } else { single_value->field_a57.clean_up(); } set_selection(SPECIFIC_VALUE); } void A5BITS__BSSGP_template::copy_template(const A5BITS__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.a51().get_selection()) { single_value->field_a51 = other_value.a51(); } else { single_value->field_a51.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.a52().get_selection()) { single_value->field_a52 = other_value.a52(); } else { single_value->field_a52.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.a53().get_selection()) { single_value->field_a53 = other_value.a53(); } else { single_value->field_a53.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.a54().get_selection()) { single_value->field_a54 = other_value.a54(); } else { single_value->field_a54.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.a55().get_selection()) { single_value->field_a55 = other_value.a55(); } else { single_value->field_a55.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.a56().get_selection()) { single_value->field_a56 = other_value.a56(); } else { single_value->field_a56.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.a57().get_selection()) { single_value->field_a57 = other_value.a57(); } else { single_value->field_a57.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 A5BITS__BSSGP_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 A5BITS__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new A5BITS__BSSGP_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 @BSSGP_Types.A5BITS_BSSGP."); break; } set_selection(other_value); } A5BITS__BSSGP_template::A5BITS__BSSGP_template() { } A5BITS__BSSGP_template::A5BITS__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } A5BITS__BSSGP_template::A5BITS__BSSGP_template(const A5BITS__BSSGP& other_value) { copy_value(other_value); } A5BITS__BSSGP_template::A5BITS__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const A5BITS__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.A5BITS_BSSGP from an unbound optional field."); } } A5BITS__BSSGP_template::A5BITS__BSSGP_template(A5BITS__BSSGP_template* p_precondition, A5BITS__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } A5BITS__BSSGP_template::A5BITS__BSSGP_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; } A5BITS__BSSGP_template::A5BITS__BSSGP_template(const A5BITS__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } A5BITS__BSSGP_template::~A5BITS__BSSGP_template() { clean_up(); } A5BITS__BSSGP_template& A5BITS__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } A5BITS__BSSGP_template& A5BITS__BSSGP_template::operator=(const A5BITS__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } A5BITS__BSSGP_template& A5BITS__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const A5BITS__BSSGP&)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 @BSSGP_Types.A5BITS_BSSGP."); } return *this; } A5BITS__BSSGP_template& A5BITS__BSSGP_template::operator=(const A5BITS__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean A5BITS__BSSGP_template::match(const A5BITS__BSSGP& 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.a51().is_bound()) return FALSE; if(!single_value->field_a51.match(other_value.a51(), legacy))return FALSE; if(!other_value.a52().is_bound()) return FALSE; if(!single_value->field_a52.match(other_value.a52(), legacy))return FALSE; if(!other_value.a53().is_bound()) return FALSE; if(!single_value->field_a53.match(other_value.a53(), legacy))return FALSE; if(!other_value.a54().is_bound()) return FALSE; if(!single_value->field_a54.match(other_value.a54(), legacy))return FALSE; if(!other_value.a55().is_bound()) return FALSE; if(!single_value->field_a55.match(other_value.a55(), legacy))return FALSE; if(!other_value.a56().is_bound()) return FALSE; if(!single_value->field_a56.match(other_value.a56(), legacy))return FALSE; if(!other_value.a57().is_bound()) return FALSE; if(!single_value->field_a57.match(other_value.a57(), 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 @BSSGP_Types.A5BITS_BSSGP."); } return FALSE; } boolean A5BITS__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_a51.is_bound() || single_value->field_a52.is_bound() || single_value->field_a53.is_bound() || single_value->field_a54.is_bound() || single_value->field_a55.is_bound() || single_value->field_a56.is_bound() || single_value->field_a57.is_bound(); } boolean A5BITS__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_a51.is_value() && single_value->field_a52.is_value() && single_value->field_a53.is_value() && single_value->field_a54.is_value() && single_value->field_a55.is_value() && single_value->field_a56.is_value() && single_value->field_a57.is_value(); } void A5BITS__BSSGP_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; } A5BITS__BSSGP A5BITS__BSSGP_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 @BSSGP_Types.A5BITS_BSSGP."); A5BITS__BSSGP ret_val; if (single_value->field_a51.is_bound()) { ret_val.a51() = single_value->field_a51.valueof(); } if (single_value->field_a52.is_bound()) { ret_val.a52() = single_value->field_a52.valueof(); } if (single_value->field_a53.is_bound()) { ret_val.a53() = single_value->field_a53.valueof(); } if (single_value->field_a54.is_bound()) { ret_val.a54() = single_value->field_a54.valueof(); } if (single_value->field_a55.is_bound()) { ret_val.a55() = single_value->field_a55.valueof(); } if (single_value->field_a56.is_bound()) { ret_val.a56() = single_value->field_a56.valueof(); } if (single_value->field_a57.is_bound()) { ret_val.a57() = single_value->field_a57.valueof(); } return ret_val; } void A5BITS__BSSGP_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 @BSSGP_Types.A5BITS_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new A5BITS__BSSGP_template[list_length]; } A5BITS__BSSGP_template& A5BITS__BSSGP_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 @BSSGP_Types.A5BITS_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.A5BITS_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& A5BITS__BSSGP_template::a51() { set_specific(); return single_value->field_a51; } const BITSTRING_template& A5BITS__BSSGP_template::a51() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a51 of a non-specific template of type @BSSGP_Types.A5BITS_BSSGP."); return single_value->field_a51; } BITSTRING_template& A5BITS__BSSGP_template::a52() { set_specific(); return single_value->field_a52; } const BITSTRING_template& A5BITS__BSSGP_template::a52() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a52 of a non-specific template of type @BSSGP_Types.A5BITS_BSSGP."); return single_value->field_a52; } BITSTRING_template& A5BITS__BSSGP_template::a53() { set_specific(); return single_value->field_a53; } const BITSTRING_template& A5BITS__BSSGP_template::a53() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a53 of a non-specific template of type @BSSGP_Types.A5BITS_BSSGP."); return single_value->field_a53; } BITSTRING_template& A5BITS__BSSGP_template::a54() { set_specific(); return single_value->field_a54; } const BITSTRING_template& A5BITS__BSSGP_template::a54() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a54 of a non-specific template of type @BSSGP_Types.A5BITS_BSSGP."); return single_value->field_a54; } BITSTRING_template& A5BITS__BSSGP_template::a55() { set_specific(); return single_value->field_a55; } const BITSTRING_template& A5BITS__BSSGP_template::a55() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a55 of a non-specific template of type @BSSGP_Types.A5BITS_BSSGP."); return single_value->field_a55; } BITSTRING_template& A5BITS__BSSGP_template::a56() { set_specific(); return single_value->field_a56; } const BITSTRING_template& A5BITS__BSSGP_template::a56() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a56 of a non-specific template of type @BSSGP_Types.A5BITS_BSSGP."); return single_value->field_a56; } BITSTRING_template& A5BITS__BSSGP_template::a57() { set_specific(); return single_value->field_a57; } const BITSTRING_template& A5BITS__BSSGP_template::a57() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a57 of a non-specific template of type @BSSGP_Types.A5BITS_BSSGP."); return single_value->field_a57; } int A5BITS__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.A5BITS_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 7; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.A5BITS_BSSGP 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 @BSSGP_Types.A5BITS_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.A5BITS_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.A5BITS_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.A5BITS_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.A5BITS_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.A5BITS_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.A5BITS_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.A5BITS_BSSGP."); } return 0; } void A5BITS__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ a51 := "); single_value->field_a51.log(); TTCN_Logger::log_event_str(", a52 := "); single_value->field_a52.log(); TTCN_Logger::log_event_str(", a53 := "); single_value->field_a53.log(); TTCN_Logger::log_event_str(", a54 := "); single_value->field_a54.log(); TTCN_Logger::log_event_str(", a55 := "); single_value->field_a55.log(); TTCN_Logger::log_event_str(", a56 := "); single_value->field_a56.log(); TTCN_Logger::log_event_str(", a57 := "); single_value->field_a57.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 A5BITS__BSSGP_template::log_match(const A5BITS__BSSGP& 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_a51.match(match_value.a51(), legacy)){ TTCN_Logger::log_logmatch_info(".a51"); single_value->field_a51.log_match(match_value.a51(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_a52.match(match_value.a52(), legacy)){ TTCN_Logger::log_logmatch_info(".a52"); single_value->field_a52.log_match(match_value.a52(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_a53.match(match_value.a53(), legacy)){ TTCN_Logger::log_logmatch_info(".a53"); single_value->field_a53.log_match(match_value.a53(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_a54.match(match_value.a54(), legacy)){ TTCN_Logger::log_logmatch_info(".a54"); single_value->field_a54.log_match(match_value.a54(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_a55.match(match_value.a55(), legacy)){ TTCN_Logger::log_logmatch_info(".a55"); single_value->field_a55.log_match(match_value.a55(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_a56.match(match_value.a56(), legacy)){ TTCN_Logger::log_logmatch_info(".a56"); single_value->field_a56.log_match(match_value.a56(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_a57.match(match_value.a57(), legacy)){ TTCN_Logger::log_logmatch_info(".a57"); single_value->field_a57.log_match(match_value.a57(), 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("{ a51 := "); single_value->field_a51.log_match(match_value.a51(), legacy); TTCN_Logger::log_event_str(", a52 := "); single_value->field_a52.log_match(match_value.a52(), legacy); TTCN_Logger::log_event_str(", a53 := "); single_value->field_a53.log_match(match_value.a53(), legacy); TTCN_Logger::log_event_str(", a54 := "); single_value->field_a54.log_match(match_value.a54(), legacy); TTCN_Logger::log_event_str(", a55 := "); single_value->field_a55.log_match(match_value.a55(), legacy); TTCN_Logger::log_event_str(", a56 := "); single_value->field_a56.log_match(match_value.a56(), legacy); TTCN_Logger::log_event_str(", a57 := "); single_value->field_a57.log_match(match_value.a57(), 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 A5BITS__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_a51.encode_text(text_buf); single_value->field_a52.encode_text(text_buf); single_value->field_a53.encode_text(text_buf); single_value->field_a54.encode_text(text_buf); single_value->field_a55.encode_text(text_buf); single_value->field_a56.encode_text(text_buf); single_value->field_a57.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 @BSSGP_Types.A5BITS_BSSGP."); } } void A5BITS__BSSGP_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_a51.decode_text(text_buf); single_value->field_a52.decode_text(text_buf); single_value->field_a53.decode_text(text_buf); single_value->field_a54.decode_text(text_buf); single_value->field_a55.decode_text(text_buf); single_value->field_a56.decode_text(text_buf); single_value->field_a57.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 A5BITS__BSSGP_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 @BSSGP_Types.A5BITS_BSSGP."); } } void A5BITS__BSSGP_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: { A5BITS__BSSGP_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) a51().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) a52().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) a53().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) a54().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) a55().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) a56().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) a57().set_param(*param.get_elem(6)); 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(), "a51")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a51().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a52")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a52().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a53")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a53().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a54")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a54().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a55")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a55().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a56")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a56().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a57")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a57().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.A5BITS_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { A5BITS__BSSGP_template* precondition = new A5BITS__BSSGP_template; precondition->set_param(*param.get_elem(0)); A5BITS__BSSGP_template* implied_template = new A5BITS__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = A5BITS__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.A5BITS_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void A5BITS__BSSGP_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_a51.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.A5BITS_BSSGP"); single_value->field_a52.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.A5BITS_BSSGP"); single_value->field_a53.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.A5BITS_BSSGP"); single_value->field_a54.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.A5BITS_BSSGP"); single_value->field_a55.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.A5BITS_BSSGP"); single_value->field_a56.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.A5BITS_BSSGP"); single_value->field_a57.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.A5BITS_BSSGP"); 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 : "@BSSGP_Types.A5BITS_BSSGP"); } boolean A5BITS__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean A5BITS__BSSGP_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_hscsdmultislotclass, const BITSTRING& par_presenceBitGprs, const OPTIONAL< MultislotCap__GPRS__BSSGP >& par_gprsmultislot, const BITSTRING& par_presenceBitSms, const OPTIONAL< MultislotCap__SMS__BSSGP >& par_multislotCap__SMS, const OPTIONAL< MultislotCapAdditionsAfterRel97__BSSGP >& par_multislotCapAdditionsAfterRel97) : field_presenceBitHscsd(par_presenceBitHscsd), field_hscsdmultislotclass(par_hscsdmultislotclass), field_presenceBitGprs(par_presenceBitGprs), field_gprsmultislot(par_gprsmultislot), field_presenceBitSms(par_presenceBitSms), field_multislotCap__SMS(par_multislotCap__SMS), field_multislotCapAdditionsAfterRel97(par_multislotCapAdditionsAfterRel97) { } MultislotCap__BSSGP::MultislotCap__BSSGP(const MultislotCap__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MultislotCap_BSSGP."); if (other_value.presenceBitHscsd().is_bound()) field_presenceBitHscsd = other_value.presenceBitHscsd(); else field_presenceBitHscsd.clean_up(); if (other_value.hscsdmultislotclass().is_bound()) field_hscsdmultislotclass = other_value.hscsdmultislotclass(); else field_hscsdmultislotclass.clean_up(); if (other_value.presenceBitGprs().is_bound()) field_presenceBitGprs = other_value.presenceBitGprs(); else field_presenceBitGprs.clean_up(); if (other_value.gprsmultislot().is_bound()) field_gprsmultislot = other_value.gprsmultislot(); else field_gprsmultislot.clean_up(); if (other_value.presenceBitSms().is_bound()) field_presenceBitSms = other_value.presenceBitSms(); else field_presenceBitSms.clean_up(); if (other_value.multislotCap__SMS().is_bound()) field_multislotCap__SMS = other_value.multislotCap__SMS(); else field_multislotCap__SMS.clean_up(); if (other_value.multislotCapAdditionsAfterRel97().is_bound()) field_multislotCapAdditionsAfterRel97 = other_value.multislotCapAdditionsAfterRel97(); else field_multislotCapAdditionsAfterRel97.clean_up(); } void MultislotCap__BSSGP::clean_up() { field_presenceBitHscsd.clean_up(); field_hscsdmultislotclass.clean_up(); field_presenceBitGprs.clean_up(); field_gprsmultislot.clean_up(); field_presenceBitSms.clean_up(); field_multislotCap__SMS.clean_up(); field_multislotCapAdditionsAfterRel97.clean_up(); } const TTCN_Typedescriptor_t* MultislotCap__BSSGP::get_descriptor() const { return &MultislotCap__BSSGP_descr_; } MultislotCap__BSSGP& MultislotCap__BSSGP::operator=(const MultislotCap__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MultislotCap_BSSGP."); if (other_value.presenceBitHscsd().is_bound()) field_presenceBitHscsd = other_value.presenceBitHscsd(); else field_presenceBitHscsd.clean_up(); if (other_value.hscsdmultislotclass().is_bound()) field_hscsdmultislotclass = other_value.hscsdmultislotclass(); else field_hscsdmultislotclass.clean_up(); if (other_value.presenceBitGprs().is_bound()) field_presenceBitGprs = other_value.presenceBitGprs(); else field_presenceBitGprs.clean_up(); if (other_value.gprsmultislot().is_bound()) field_gprsmultislot = other_value.gprsmultislot(); else field_gprsmultislot.clean_up(); if (other_value.presenceBitSms().is_bound()) field_presenceBitSms = other_value.presenceBitSms(); else field_presenceBitSms.clean_up(); if (other_value.multislotCap__SMS().is_bound()) field_multislotCap__SMS = other_value.multislotCap__SMS(); else field_multislotCap__SMS.clean_up(); if (other_value.multislotCapAdditionsAfterRel97().is_bound()) field_multislotCapAdditionsAfterRel97 = other_value.multislotCapAdditionsAfterRel97(); else field_multislotCapAdditionsAfterRel97.clean_up(); } return *this; } boolean MultislotCap__BSSGP::operator==(const MultislotCap__BSSGP& other_value) const { return field_presenceBitHscsd==other_value.field_presenceBitHscsd && field_hscsdmultislotclass==other_value.field_hscsdmultislotclass && field_presenceBitGprs==other_value.field_presenceBitGprs && field_gprsmultislot==other_value.field_gprsmultislot && field_presenceBitSms==other_value.field_presenceBitSms && field_multislotCap__SMS==other_value.field_multislotCap__SMS && field_multislotCapAdditionsAfterRel97==other_value.field_multislotCapAdditionsAfterRel97; } boolean MultislotCap__BSSGP::is_bound() const { return (field_presenceBitHscsd.is_bound()) || (OPTIONAL_OMIT == field_hscsdmultislotclass.get_selection() || field_hscsdmultislotclass.is_bound()) || (field_presenceBitGprs.is_bound()) || (OPTIONAL_OMIT == field_gprsmultislot.get_selection() || field_gprsmultislot.is_bound()) || (field_presenceBitSms.is_bound()) || (OPTIONAL_OMIT == field_multislotCap__SMS.get_selection() || field_multislotCap__SMS.is_bound()) || (OPTIONAL_OMIT == field_multislotCapAdditionsAfterRel97.get_selection() || field_multislotCapAdditionsAfterRel97.is_bound()); } boolean MultislotCap__BSSGP::is_value() const { return field_presenceBitHscsd.is_value() && (OPTIONAL_OMIT == field_hscsdmultislotclass.get_selection() || field_hscsdmultislotclass.is_value()) && field_presenceBitGprs.is_value() && (OPTIONAL_OMIT == field_gprsmultislot.get_selection() || field_gprsmultislot.is_value()) && field_presenceBitSms.is_value() && (OPTIONAL_OMIT == field_multislotCap__SMS.get_selection() || field_multislotCap__SMS.is_value()) && (OPTIONAL_OMIT == field_multislotCapAdditionsAfterRel97.get_selection() || field_multislotCapAdditionsAfterRel97.is_value()); } int MultislotCap__BSSGP::size_of() const { int ret_val = 3; if (field_hscsdmultislotclass.ispresent()) ret_val++; if (field_gprsmultislot.ispresent()) ret_val++; if (field_multislotCap__SMS.ispresent()) ret_val++; if (field_multislotCapAdditionsAfterRel97.ispresent()) ret_val++; return ret_val; } void MultislotCap__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ presenceBitHscsd := "); field_presenceBitHscsd.log(); TTCN_Logger::log_event_str(", hscsdmultislotclass := "); field_hscsdmultislotclass.log(); TTCN_Logger::log_event_str(", presenceBitGprs := "); field_presenceBitGprs.log(); TTCN_Logger::log_event_str(", gprsmultislot := "); field_gprsmultislot.log(); TTCN_Logger::log_event_str(", presenceBitSms := "); field_presenceBitSms.log(); TTCN_Logger::log_event_str(", multislotCap_SMS := "); field_multislotCap__SMS.log(); TTCN_Logger::log_event_str(", multislotCapAdditionsAfterRel97 := "); field_multislotCapAdditionsAfterRel97.log(); TTCN_Logger::log_event_str(" }"); } void MultislotCap__BSSGP::set_implicit_omit() { if (presenceBitHscsd().is_bound()) presenceBitHscsd().set_implicit_omit(); if (!hscsdmultislotclass().is_bound()) hscsdmultislotclass() = OMIT_VALUE; else hscsdmultislotclass().set_implicit_omit(); if (presenceBitGprs().is_bound()) presenceBitGprs().set_implicit_omit(); if (!gprsmultislot().is_bound()) gprsmultislot() = OMIT_VALUE; else gprsmultislot().set_implicit_omit(); if (presenceBitSms().is_bound()) presenceBitSms().set_implicit_omit(); if (!multislotCap__SMS().is_bound()) multislotCap__SMS() = OMIT_VALUE; else multislotCap__SMS().set_implicit_omit(); if (!multislotCapAdditionsAfterRel97().is_bound()) multislotCapAdditionsAfterRel97() = OMIT_VALUE; else multislotCapAdditionsAfterRel97().set_implicit_omit(); } void MultislotCap__BSSGP::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 (70 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) presenceBitHscsd().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) hscsdmultislotclass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitGprs().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gprsmultislot().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitSms().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) multislotCap__SMS().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) multislotCapAdditionsAfterRel97().set_param(*param.get_elem(6)); 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(), "presenceBitHscsd")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitHscsd().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hscsdmultislotclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hscsdmultislotclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitGprs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitGprs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gprsmultislot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gprsmultislot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitSms")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitSms().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotCap_SMS")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCap__SMS().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotCapAdditionsAfterRel97")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCapAdditionsAfterRel97().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MultislotCap_BSSGP"); } } void MultislotCap__BSSGP::encode_text(Text_Buf& text_buf) const { field_presenceBitHscsd.encode_text(text_buf); field_hscsdmultislotclass.encode_text(text_buf); field_presenceBitGprs.encode_text(text_buf); field_gprsmultislot.encode_text(text_buf); field_presenceBitSms.encode_text(text_buf); field_multislotCap__SMS.encode_text(text_buf); field_multislotCapAdditionsAfterRel97.encode_text(text_buf); } void MultislotCap__BSSGP::decode_text(Text_Buf& text_buf) { field_presenceBitHscsd.decode_text(text_buf); field_hscsdmultislotclass.decode_text(text_buf); field_presenceBitGprs.decode_text(text_buf); field_gprsmultislot.decode_text(text_buf); field_presenceBitSms.decode_text(text_buf); field_multislotCap__SMS.decode_text(text_buf); field_multislotCapAdditionsAfterRel97.decode_text(text_buf); } void MultislotCap__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MultislotCap__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MultislotCap__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, MultislotCap__BSSGP_presenceBitHscsd_descr_.raw->forceomit); decoded_field_length = field_presenceBitHscsd.RAW_decode(MultislotCap__BSSGP_presenceBitHscsd_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitHscsd == bs_0){ if (force_omit != NULL && (*force_omit)(1)) { field_hscsdmultislotclass = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotCap__BSSGP_hscsdmultislotclass_descr_.raw->forceomit); decoded_field_length = field_hscsdmultislotclass().RAW_decode(MultislotCap__BSSGP_hscsdmultislotclass_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_hscsdmultislotclass = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_hscsdmultislotclass=OMIT_VALUE; RAW_Force_Omit field_2_force_omit(2, force_omit, MultislotCap__BSSGP_presenceBitGprs_descr_.raw->forceomit); decoded_field_length = field_presenceBitGprs.RAW_decode(MultislotCap__BSSGP_presenceBitGprs_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitGprs == bs_0){ if (force_omit != NULL && (*force_omit)(3)) { field_gprsmultislot = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_3_force_omit(3, force_omit, MultislotCap__BSSGP_gprsmultislot_descr_.raw->forceomit); decoded_field_length = field_gprsmultislot().RAW_decode(MultislotCap__BSSGP_gprsmultislot_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 1) { field_gprsmultislot = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_gprsmultislot=OMIT_VALUE; RAW_Force_Omit field_4_force_omit(4, force_omit, MultislotCap__BSSGP_presenceBitSms_descr_.raw->forceomit); decoded_field_length = field_presenceBitSms.RAW_decode(MultislotCap__BSSGP_presenceBitSms_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitSms == bs_0){ if (force_omit != NULL && (*force_omit)(5)) { field_multislotCap__SMS = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_5_force_omit(5, force_omit, MultislotCap__BSSGP_multislotCap__SMS_descr_.raw->forceomit); decoded_field_length = field_multislotCap__SMS().RAW_decode(MultislotCap__BSSGP_multislotCap__SMS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 1) { field_multislotCap__SMS = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_multislotCap__SMS=OMIT_VALUE; if (limit > 0){ if (force_omit != NULL && (*force_omit)(6)) { field_multislotCapAdditionsAfterRel97 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_6_force_omit(6, force_omit, MultislotCap__BSSGP_multislotCapAdditionsAfterRel97_descr_.raw->forceomit); decoded_field_length = field_multislotCapAdditionsAfterRel97().RAW_decode(MultislotCap__BSSGP_multislotCapAdditionsAfterRel97_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit); if (decoded_field_length < 1) { field_multislotCapAdditionsAfterRel97 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_multislotCapAdditionsAfterRel97=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MultislotCap__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 7; myleaf.body.node.nodes = init_nodes_of_enc_tree(7); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MultislotCap__BSSGP_presenceBitHscsd_descr_.raw); if (field_hscsdmultislotclass.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__BSSGP_hscsdmultislotclass_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MultislotCap__BSSGP_presenceBitGprs_descr_.raw); if (field_gprsmultislot.ispresent()) { myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MultislotCap__BSSGP_gprsmultislot_descr_.raw); } else myleaf.body.node.nodes[3] = NULL; myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MultislotCap__BSSGP_presenceBitSms_descr_.raw); if (field_multislotCap__SMS.ispresent()) { myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MultislotCap__BSSGP_multislotCap__SMS_descr_.raw); } else myleaf.body.node.nodes[5] = NULL; if (field_multislotCapAdditionsAfterRel97.ispresent()) { myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MultislotCap__BSSGP_multislotCapAdditionsAfterRel97_descr_.raw); } else myleaf.body.node.nodes[6] = NULL; encoded_length += field_presenceBitHscsd.RAW_encode(MultislotCap__BSSGP_presenceBitHscsd_descr_, *myleaf.body.node.nodes[0]); if (field_hscsdmultislotclass.ispresent()) { encoded_length += field_hscsdmultislotclass().RAW_encode(MultislotCap__BSSGP_hscsdmultislotclass_descr_, *myleaf.body.node.nodes[1]); } encoded_length += field_presenceBitGprs.RAW_encode(MultislotCap__BSSGP_presenceBitGprs_descr_, *myleaf.body.node.nodes[2]); if (field_gprsmultislot.ispresent()) { encoded_length += field_gprsmultislot().RAW_encode(MultislotCap__BSSGP_gprsmultislot_descr_, *myleaf.body.node.nodes[3]); } encoded_length += field_presenceBitSms.RAW_encode(MultislotCap__BSSGP_presenceBitSms_descr_, *myleaf.body.node.nodes[4]); if (field_multislotCap__SMS.ispresent()) { encoded_length += field_multislotCap__SMS().RAW_encode(MultislotCap__BSSGP_multislotCap__SMS_descr_, *myleaf.body.node.nodes[5]); } if (field_multislotCapAdditionsAfterRel97.ispresent()) { encoded_length += field_multislotCapAdditionsAfterRel97().RAW_encode(MultislotCap__BSSGP_multislotCapAdditionsAfterRel97_descr_, *myleaf.body.node.nodes[6]); } if (field_hscsdmultislotclass.ispresent() && (field_presenceBitHscsd != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(MultislotCap__BSSGP_presenceBitHscsd_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } if (field_gprsmultislot.ispresent() && (field_presenceBitGprs != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={2}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(MultislotCap__BSSGP_presenceBitGprs_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } if (field_multislotCap__SMS.ispresent() && (field_presenceBitSms != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={4}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(MultislotCap__BSSGP_presenceBitSms_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct MultislotCap__BSSGP_template::single_value_struct { BITSTRING_template field_presenceBitHscsd; BITSTRING_template field_hscsdmultislotclass; BITSTRING_template field_presenceBitGprs; MultislotCap__GPRS__BSSGP_template field_gprsmultislot; BITSTRING_template field_presenceBitSms; MultislotCap__SMS__BSSGP_template field_multislotCap__SMS; MultislotCapAdditionsAfterRel97__BSSGP_template field_multislotCapAdditionsAfterRel97; }; void MultislotCap__BSSGP_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_presenceBitHscsd = ANY_VALUE; single_value->field_hscsdmultislotclass = ANY_OR_OMIT; single_value->field_presenceBitGprs = ANY_VALUE; single_value->field_gprsmultislot = ANY_OR_OMIT; single_value->field_presenceBitSms = ANY_VALUE; single_value->field_multislotCap__SMS = ANY_OR_OMIT; single_value->field_multislotCapAdditionsAfterRel97 = ANY_OR_OMIT; } } } void MultislotCap__BSSGP_template::copy_value(const MultislotCap__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.presenceBitHscsd().is_bound()) { single_value->field_presenceBitHscsd = other_value.presenceBitHscsd(); } else { single_value->field_presenceBitHscsd.clean_up(); } if (other_value.hscsdmultislotclass().is_bound()) { if (other_value.hscsdmultislotclass().ispresent()) single_value->field_hscsdmultislotclass = other_value.hscsdmultislotclass()(); else single_value->field_hscsdmultislotclass = OMIT_VALUE; } else { single_value->field_hscsdmultislotclass.clean_up(); } if (other_value.presenceBitGprs().is_bound()) { single_value->field_presenceBitGprs = other_value.presenceBitGprs(); } else { single_value->field_presenceBitGprs.clean_up(); } if (other_value.gprsmultislot().is_bound()) { if (other_value.gprsmultislot().ispresent()) single_value->field_gprsmultislot = other_value.gprsmultislot()(); else single_value->field_gprsmultislot = OMIT_VALUE; } else { single_value->field_gprsmultislot.clean_up(); } if (other_value.presenceBitSms().is_bound()) { single_value->field_presenceBitSms = other_value.presenceBitSms(); } else { single_value->field_presenceBitSms.clean_up(); } if (other_value.multislotCap__SMS().is_bound()) { if (other_value.multislotCap__SMS().ispresent()) single_value->field_multislotCap__SMS = other_value.multislotCap__SMS()(); else single_value->field_multislotCap__SMS = OMIT_VALUE; } else { single_value->field_multislotCap__SMS.clean_up(); } if (other_value.multislotCapAdditionsAfterRel97().is_bound()) { if (other_value.multislotCapAdditionsAfterRel97().ispresent()) single_value->field_multislotCapAdditionsAfterRel97 = other_value.multislotCapAdditionsAfterRel97()(); else single_value->field_multislotCapAdditionsAfterRel97 = OMIT_VALUE; } else { single_value->field_multislotCapAdditionsAfterRel97.clean_up(); } set_selection(SPECIFIC_VALUE); } void MultislotCap__BSSGP_template::copy_template(const MultislotCap__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.presenceBitHscsd().get_selection()) { single_value->field_presenceBitHscsd = other_value.presenceBitHscsd(); } else { single_value->field_presenceBitHscsd.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.hscsdmultislotclass().get_selection()) { single_value->field_hscsdmultislotclass = other_value.hscsdmultislotclass(); } else { single_value->field_hscsdmultislotclass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitGprs().get_selection()) { single_value->field_presenceBitGprs = other_value.presenceBitGprs(); } else { single_value->field_presenceBitGprs.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gprsmultislot().get_selection()) { single_value->field_gprsmultislot = other_value.gprsmultislot(); } else { single_value->field_gprsmultislot.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitSms().get_selection()) { single_value->field_presenceBitSms = other_value.presenceBitSms(); } else { single_value->field_presenceBitSms.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.multislotCap__SMS().get_selection()) { single_value->field_multislotCap__SMS = other_value.multislotCap__SMS(); } else { single_value->field_multislotCap__SMS.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.multislotCapAdditionsAfterRel97().get_selection()) { single_value->field_multislotCapAdditionsAfterRel97 = other_value.multislotCapAdditionsAfterRel97(); } else { single_value->field_multislotCapAdditionsAfterRel97.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 MultislotCap__BSSGP_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 MultislotCap__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MultislotCap__BSSGP_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 @BSSGP_Types.MultislotCap_BSSGP."); break; } set_selection(other_value); } MultislotCap__BSSGP_template::MultislotCap__BSSGP_template() { } MultislotCap__BSSGP_template::MultislotCap__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MultislotCap__BSSGP_template::MultislotCap__BSSGP_template(const MultislotCap__BSSGP& other_value) { copy_value(other_value); } MultislotCap__BSSGP_template::MultislotCap__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MultislotCap_BSSGP from an unbound optional field."); } } MultislotCap__BSSGP_template::MultislotCap__BSSGP_template(MultislotCap__BSSGP_template* p_precondition, MultislotCap__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MultislotCap__BSSGP_template::MultislotCap__BSSGP_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; } MultislotCap__BSSGP_template::MultislotCap__BSSGP_template(const MultislotCap__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MultislotCap__BSSGP_template::~MultislotCap__BSSGP_template() { clean_up(); } MultislotCap__BSSGP_template& MultislotCap__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MultislotCap__BSSGP_template& MultislotCap__BSSGP_template::operator=(const MultislotCap__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MultislotCap__BSSGP_template& MultislotCap__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__BSSGP&)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 @BSSGP_Types.MultislotCap_BSSGP."); } return *this; } MultislotCap__BSSGP_template& MultislotCap__BSSGP_template::operator=(const MultislotCap__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MultislotCap__BSSGP_template::match(const MultislotCap__BSSGP& 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.presenceBitHscsd().is_bound()) return FALSE; if(!single_value->field_presenceBitHscsd.match(other_value.presenceBitHscsd(), legacy))return FALSE; if(!other_value.hscsdmultislotclass().is_bound()) return FALSE; if((other_value.hscsdmultislotclass().ispresent() ? !single_value->field_hscsdmultislotclass.match((const BITSTRING&)other_value.hscsdmultislotclass(), legacy) : !single_value->field_hscsdmultislotclass.match_omit(legacy)))return FALSE; if(!other_value.presenceBitGprs().is_bound()) return FALSE; if(!single_value->field_presenceBitGprs.match(other_value.presenceBitGprs(), legacy))return FALSE; if(!other_value.gprsmultislot().is_bound()) return FALSE; if((other_value.gprsmultislot().ispresent() ? !single_value->field_gprsmultislot.match((const MultislotCap__GPRS__BSSGP&)other_value.gprsmultislot(), legacy) : !single_value->field_gprsmultislot.match_omit(legacy)))return FALSE; if(!other_value.presenceBitSms().is_bound()) return FALSE; if(!single_value->field_presenceBitSms.match(other_value.presenceBitSms(), legacy))return FALSE; if(!other_value.multislotCap__SMS().is_bound()) return FALSE; if((other_value.multislotCap__SMS().ispresent() ? !single_value->field_multislotCap__SMS.match((const MultislotCap__SMS__BSSGP&)other_value.multislotCap__SMS(), legacy) : !single_value->field_multislotCap__SMS.match_omit(legacy)))return FALSE; if(!other_value.multislotCapAdditionsAfterRel97().is_bound()) return FALSE; if((other_value.multislotCapAdditionsAfterRel97().ispresent() ? !single_value->field_multislotCapAdditionsAfterRel97.match((const MultislotCapAdditionsAfterRel97__BSSGP&)other_value.multislotCapAdditionsAfterRel97(), legacy) : !single_value->field_multislotCapAdditionsAfterRel97.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 @BSSGP_Types.MultislotCap_BSSGP."); } return FALSE; } boolean MultislotCap__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_presenceBitHscsd.is_bound() || (single_value->field_hscsdmultislotclass.is_omit() || single_value->field_hscsdmultislotclass.is_bound()) || single_value->field_presenceBitGprs.is_bound() || (single_value->field_gprsmultislot.is_omit() || single_value->field_gprsmultislot.is_bound()) || single_value->field_presenceBitSms.is_bound() || (single_value->field_multislotCap__SMS.is_omit() || single_value->field_multislotCap__SMS.is_bound()) || (single_value->field_multislotCapAdditionsAfterRel97.is_omit() || single_value->field_multislotCapAdditionsAfterRel97.is_bound()); } boolean MultislotCap__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_presenceBitHscsd.is_value() && (single_value->field_hscsdmultislotclass.is_omit() || single_value->field_hscsdmultislotclass.is_value()) && single_value->field_presenceBitGprs.is_value() && (single_value->field_gprsmultislot.is_omit() || single_value->field_gprsmultislot.is_value()) && single_value->field_presenceBitSms.is_value() && (single_value->field_multislotCap__SMS.is_omit() || single_value->field_multislotCap__SMS.is_value()) && (single_value->field_multislotCapAdditionsAfterRel97.is_omit() || single_value->field_multislotCapAdditionsAfterRel97.is_value()); } void MultislotCap__BSSGP_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; } MultislotCap__BSSGP MultislotCap__BSSGP_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 @BSSGP_Types.MultislotCap_BSSGP."); MultislotCap__BSSGP ret_val; if (single_value->field_presenceBitHscsd.is_bound()) { ret_val.presenceBitHscsd() = single_value->field_presenceBitHscsd.valueof(); } if (single_value->field_hscsdmultislotclass.is_omit()) ret_val.hscsdmultislotclass() = OMIT_VALUE; else if (single_value->field_hscsdmultislotclass.is_bound()) { ret_val.hscsdmultislotclass() = single_value->field_hscsdmultislotclass.valueof(); } if (single_value->field_presenceBitGprs.is_bound()) { ret_val.presenceBitGprs() = single_value->field_presenceBitGprs.valueof(); } if (single_value->field_gprsmultislot.is_omit()) ret_val.gprsmultislot() = OMIT_VALUE; else if (single_value->field_gprsmultislot.is_bound()) { ret_val.gprsmultislot() = single_value->field_gprsmultislot.valueof(); } if (single_value->field_presenceBitSms.is_bound()) { ret_val.presenceBitSms() = single_value->field_presenceBitSms.valueof(); } if (single_value->field_multislotCap__SMS.is_omit()) ret_val.multislotCap__SMS() = OMIT_VALUE; else if (single_value->field_multislotCap__SMS.is_bound()) { ret_val.multislotCap__SMS() = single_value->field_multislotCap__SMS.valueof(); } if (single_value->field_multislotCapAdditionsAfterRel97.is_omit()) ret_val.multislotCapAdditionsAfterRel97() = OMIT_VALUE; else if (single_value->field_multislotCapAdditionsAfterRel97.is_bound()) { ret_val.multislotCapAdditionsAfterRel97() = single_value->field_multislotCapAdditionsAfterRel97.valueof(); } return ret_val; } void MultislotCap__BSSGP_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 @BSSGP_Types.MultislotCap_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MultislotCap__BSSGP_template[list_length]; } MultislotCap__BSSGP_template& MultislotCap__BSSGP_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 @BSSGP_Types.MultislotCap_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MultislotCap_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& MultislotCap__BSSGP_template::presenceBitHscsd() { set_specific(); return single_value->field_presenceBitHscsd; } const BITSTRING_template& MultislotCap__BSSGP_template::presenceBitHscsd() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitHscsd of a non-specific template of type @BSSGP_Types.MultislotCap_BSSGP."); return single_value->field_presenceBitHscsd; } BITSTRING_template& MultislotCap__BSSGP_template::hscsdmultislotclass() { set_specific(); return single_value->field_hscsdmultislotclass; } const BITSTRING_template& MultislotCap__BSSGP_template::hscsdmultislotclass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field hscsdmultislotclass of a non-specific template of type @BSSGP_Types.MultislotCap_BSSGP."); return single_value->field_hscsdmultislotclass; } BITSTRING_template& MultislotCap__BSSGP_template::presenceBitGprs() { set_specific(); return single_value->field_presenceBitGprs; } const BITSTRING_template& MultislotCap__BSSGP_template::presenceBitGprs() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitGprs of a non-specific template of type @BSSGP_Types.MultislotCap_BSSGP."); return single_value->field_presenceBitGprs; } MultislotCap__GPRS__BSSGP_template& MultislotCap__BSSGP_template::gprsmultislot() { set_specific(); return single_value->field_gprsmultislot; } const MultislotCap__GPRS__BSSGP_template& MultislotCap__BSSGP_template::gprsmultislot() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprsmultislot of a non-specific template of type @BSSGP_Types.MultislotCap_BSSGP."); return single_value->field_gprsmultislot; } BITSTRING_template& MultislotCap__BSSGP_template::presenceBitSms() { set_specific(); return single_value->field_presenceBitSms; } const BITSTRING_template& MultislotCap__BSSGP_template::presenceBitSms() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitSms of a non-specific template of type @BSSGP_Types.MultislotCap_BSSGP."); return single_value->field_presenceBitSms; } MultislotCap__SMS__BSSGP_template& MultislotCap__BSSGP_template::multislotCap__SMS() { set_specific(); return single_value->field_multislotCap__SMS; } const MultislotCap__SMS__BSSGP_template& MultislotCap__BSSGP_template::multislotCap__SMS() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field multislotCap_SMS of a non-specific template of type @BSSGP_Types.MultislotCap_BSSGP."); return single_value->field_multislotCap__SMS; } MultislotCapAdditionsAfterRel97__BSSGP_template& MultislotCap__BSSGP_template::multislotCapAdditionsAfterRel97() { set_specific(); return single_value->field_multislotCapAdditionsAfterRel97; } const MultislotCapAdditionsAfterRel97__BSSGP_template& MultislotCap__BSSGP_template::multislotCapAdditionsAfterRel97() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field multislotCapAdditionsAfterRel97 of a non-specific template of type @BSSGP_Types.MultislotCap_BSSGP."); return single_value->field_multislotCapAdditionsAfterRel97; } int MultislotCap__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 3; if (single_value->field_hscsdmultislotclass.is_present()) ret_val++; if (single_value->field_gprsmultislot.is_present()) ret_val++; if (single_value->field_multislotCap__SMS.is_present()) ret_val++; if (single_value->field_multislotCapAdditionsAfterRel97.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 @BSSGP_Types.MultislotCap_BSSGP 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 @BSSGP_Types.MultislotCap_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MultislotCap_BSSGP."); } return 0; } void MultislotCap__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ presenceBitHscsd := "); single_value->field_presenceBitHscsd.log(); TTCN_Logger::log_event_str(", hscsdmultislotclass := "); single_value->field_hscsdmultislotclass.log(); TTCN_Logger::log_event_str(", presenceBitGprs := "); single_value->field_presenceBitGprs.log(); TTCN_Logger::log_event_str(", gprsmultislot := "); single_value->field_gprsmultislot.log(); TTCN_Logger::log_event_str(", presenceBitSms := "); single_value->field_presenceBitSms.log(); TTCN_Logger::log_event_str(", multislotCap_SMS := "); single_value->field_multislotCap__SMS.log(); TTCN_Logger::log_event_str(", multislotCapAdditionsAfterRel97 := "); single_value->field_multislotCapAdditionsAfterRel97.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 MultislotCap__BSSGP_template::log_match(const MultislotCap__BSSGP& 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_presenceBitHscsd.match(match_value.presenceBitHscsd(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitHscsd"); single_value->field_presenceBitHscsd.log_match(match_value.presenceBitHscsd(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.hscsdmultislotclass().ispresent()){ if(!single_value->field_hscsdmultislotclass.match(match_value.hscsdmultislotclass(), legacy)){ TTCN_Logger::log_logmatch_info(".hscsdmultislotclass"); single_value->field_hscsdmultislotclass.log_match(match_value.hscsdmultislotclass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_hscsdmultislotclass.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".hscsdmultislotclass := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_hscsdmultislotclass.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_presenceBitGprs.match(match_value.presenceBitGprs(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitGprs"); single_value->field_presenceBitGprs.log_match(match_value.presenceBitGprs(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.gprsmultislot().ispresent()){ if(!single_value->field_gprsmultislot.match(match_value.gprsmultislot(), legacy)){ TTCN_Logger::log_logmatch_info(".gprsmultislot"); single_value->field_gprsmultislot.log_match(match_value.gprsmultislot(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_gprsmultislot.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".gprsmultislot := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_gprsmultislot.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_presenceBitSms.match(match_value.presenceBitSms(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitSms"); single_value->field_presenceBitSms.log_match(match_value.presenceBitSms(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.multislotCap__SMS().ispresent()){ if(!single_value->field_multislotCap__SMS.match(match_value.multislotCap__SMS(), legacy)){ TTCN_Logger::log_logmatch_info(".multislotCap_SMS"); single_value->field_multislotCap__SMS.log_match(match_value.multislotCap__SMS(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_multislotCap__SMS.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".multislotCap_SMS := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_multislotCap__SMS.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if (match_value.multislotCapAdditionsAfterRel97().ispresent()){ if(!single_value->field_multislotCapAdditionsAfterRel97.match(match_value.multislotCapAdditionsAfterRel97(), legacy)){ TTCN_Logger::log_logmatch_info(".multislotCapAdditionsAfterRel97"); single_value->field_multislotCapAdditionsAfterRel97.log_match(match_value.multislotCapAdditionsAfterRel97(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_multislotCapAdditionsAfterRel97.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".multislotCapAdditionsAfterRel97 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_multislotCapAdditionsAfterRel97.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("{ presenceBitHscsd := "); single_value->field_presenceBitHscsd.log_match(match_value.presenceBitHscsd(), legacy); TTCN_Logger::log_event_str(", hscsdmultislotclass := "); if (match_value.hscsdmultislotclass().ispresent()) { single_value->field_hscsdmultislotclass.log_match(match_value.hscsdmultislotclass(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_hscsdmultislotclass.log(); if (single_value->field_hscsdmultislotclass.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", presenceBitGprs := "); single_value->field_presenceBitGprs.log_match(match_value.presenceBitGprs(), legacy); TTCN_Logger::log_event_str(", gprsmultislot := "); if (match_value.gprsmultislot().ispresent()) { single_value->field_gprsmultislot.log_match(match_value.gprsmultislot(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_gprsmultislot.log(); if (single_value->field_gprsmultislot.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", presenceBitSms := "); single_value->field_presenceBitSms.log_match(match_value.presenceBitSms(), legacy); TTCN_Logger::log_event_str(", multislotCap_SMS := "); if (match_value.multislotCap__SMS().ispresent()) { single_value->field_multislotCap__SMS.log_match(match_value.multislotCap__SMS(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_multislotCap__SMS.log(); if (single_value->field_multislotCap__SMS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", multislotCapAdditionsAfterRel97 := "); if (match_value.multislotCapAdditionsAfterRel97().ispresent()) { single_value->field_multislotCapAdditionsAfterRel97.log_match(match_value.multislotCapAdditionsAfterRel97(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_multislotCapAdditionsAfterRel97.log(); if (single_value->field_multislotCapAdditionsAfterRel97.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 MultislotCap__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_presenceBitHscsd.encode_text(text_buf); single_value->field_hscsdmultislotclass.encode_text(text_buf); single_value->field_presenceBitGprs.encode_text(text_buf); single_value->field_gprsmultislot.encode_text(text_buf); single_value->field_presenceBitSms.encode_text(text_buf); single_value->field_multislotCap__SMS.encode_text(text_buf); single_value->field_multislotCapAdditionsAfterRel97.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 @BSSGP_Types.MultislotCap_BSSGP."); } } void MultislotCap__BSSGP_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_presenceBitHscsd.decode_text(text_buf); single_value->field_hscsdmultislotclass.decode_text(text_buf); single_value->field_presenceBitGprs.decode_text(text_buf); single_value->field_gprsmultislot.decode_text(text_buf); single_value->field_presenceBitSms.decode_text(text_buf); single_value->field_multislotCap__SMS.decode_text(text_buf); single_value->field_multislotCapAdditionsAfterRel97.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 MultislotCap__BSSGP_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 @BSSGP_Types.MultislotCap_BSSGP."); } } void MultislotCap__BSSGP_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: { MultislotCap__BSSGP_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) presenceBitHscsd().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) hscsdmultislotclass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitGprs().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gprsmultislot().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitSms().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) multislotCap__SMS().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) multislotCapAdditionsAfterRel97().set_param(*param.get_elem(6)); 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(), "presenceBitHscsd")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitHscsd().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "hscsdmultislotclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { hscsdmultislotclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitGprs")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitGprs().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gprsmultislot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gprsmultislot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitSms")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitSms().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotCap_SMS")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCap__SMS().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotCapAdditionsAfterRel97")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCapAdditionsAfterRel97().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MultislotCap__BSSGP_template* precondition = new MultislotCap__BSSGP_template; precondition->set_param(*param.get_elem(0)); MultislotCap__BSSGP_template* implied_template = new MultislotCap__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MultislotCap__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MultislotCap_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MultislotCap__BSSGP_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_presenceBitHscsd.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_BSSGP"); single_value->field_hscsdmultislotclass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_BSSGP"); single_value->field_presenceBitGprs.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_BSSGP"); single_value->field_gprsmultislot.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_BSSGP"); single_value->field_presenceBitSms.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_BSSGP"); single_value->field_multislotCap__SMS.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_BSSGP"); single_value->field_multislotCapAdditionsAfterRel97.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_BSSGP"); 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 : "@BSSGP_Types.MultislotCap_BSSGP"); } boolean MultislotCap__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MultislotCap__BSSGP_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) gprsmultislotclass().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gprsextendeddynalloccap().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(), "gprsmultislotclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gprsmultislotclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gprsextendeddynalloccap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gprsextendeddynalloccap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_GPRS_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MultislotCap_GPRS_BSSGP"); } } void MultislotCap__GPRS__BSSGP::encode_text(Text_Buf& text_buf) const { field_gprsmultislotclass.encode_text(text_buf); field_gprsextendeddynalloccap.encode_text(text_buf); } void MultislotCap__GPRS__BSSGP::decode_text(Text_Buf& text_buf) { field_gprsmultislotclass.decode_text(text_buf); field_gprsextendeddynalloccap.decode_text(text_buf); } void MultislotCap__GPRS__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MultislotCap__GPRS__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MultislotCap__GPRS__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, MultislotCap__GPRS__BSSGP_gprsmultislotclass_descr_.raw->forceomit); decoded_field_length = field_gprsmultislotclass.RAW_decode(MultislotCap__GPRS__BSSGP_gprsmultislotclass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotCap__GPRS__BSSGP_gprsextendeddynalloccap_descr_.raw->forceomit); decoded_field_length = field_gprsextendeddynalloccap.RAW_decode(MultislotCap__GPRS__BSSGP_gprsextendeddynalloccap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MultislotCap__GPRS__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MultislotCap__GPRS__BSSGP_gprsmultislotclass_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__GPRS__BSSGP_gprsextendeddynalloccap_descr_.raw); encoded_length += field_gprsmultislotclass.RAW_encode(MultislotCap__GPRS__BSSGP_gprsmultislotclass_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_gprsextendeddynalloccap.RAW_encode(MultislotCap__GPRS__BSSGP_gprsextendeddynalloccap_descr_, *myleaf.body.node.nodes[1]); return myleaf.length = encoded_length; } struct MultislotCap__GPRS__BSSGP_template::single_value_struct { BITSTRING_template field_gprsmultislotclass; BITSTRING_template field_gprsextendeddynalloccap; }; void MultislotCap__GPRS__BSSGP_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_gprsmultislotclass = ANY_VALUE; single_value->field_gprsextendeddynalloccap = ANY_VALUE; } } } void MultislotCap__GPRS__BSSGP_template::copy_value(const MultislotCap__GPRS__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.gprsmultislotclass().is_bound()) { single_value->field_gprsmultislotclass = other_value.gprsmultislotclass(); } else { single_value->field_gprsmultislotclass.clean_up(); } if (other_value.gprsextendeddynalloccap().is_bound()) { single_value->field_gprsextendeddynalloccap = other_value.gprsextendeddynalloccap(); } else { single_value->field_gprsextendeddynalloccap.clean_up(); } set_selection(SPECIFIC_VALUE); } void MultislotCap__GPRS__BSSGP_template::copy_template(const MultislotCap__GPRS__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.gprsmultislotclass().get_selection()) { single_value->field_gprsmultislotclass = other_value.gprsmultislotclass(); } else { single_value->field_gprsmultislotclass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gprsextendeddynalloccap().get_selection()) { single_value->field_gprsextendeddynalloccap = other_value.gprsextendeddynalloccap(); } else { single_value->field_gprsextendeddynalloccap.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 MultislotCap__GPRS__BSSGP_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 MultislotCap__GPRS__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MultislotCap__GPRS__BSSGP_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 @BSSGP_Types.MultislotCap_GPRS_BSSGP."); break; } set_selection(other_value); } MultislotCap__GPRS__BSSGP_template::MultislotCap__GPRS__BSSGP_template() { } MultislotCap__GPRS__BSSGP_template::MultislotCap__GPRS__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MultislotCap__GPRS__BSSGP_template::MultislotCap__GPRS__BSSGP_template(const MultislotCap__GPRS__BSSGP& other_value) { copy_value(other_value); } MultislotCap__GPRS__BSSGP_template::MultislotCap__GPRS__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__GPRS__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP from an unbound optional field."); } } MultislotCap__GPRS__BSSGP_template::MultislotCap__GPRS__BSSGP_template(MultislotCap__GPRS__BSSGP_template* p_precondition, MultislotCap__GPRS__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MultislotCap__GPRS__BSSGP_template::MultislotCap__GPRS__BSSGP_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; } MultislotCap__GPRS__BSSGP_template::MultislotCap__GPRS__BSSGP_template(const MultislotCap__GPRS__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MultislotCap__GPRS__BSSGP_template::~MultislotCap__GPRS__BSSGP_template() { clean_up(); } MultislotCap__GPRS__BSSGP_template& MultislotCap__GPRS__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MultislotCap__GPRS__BSSGP_template& MultislotCap__GPRS__BSSGP_template::operator=(const MultislotCap__GPRS__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MultislotCap__GPRS__BSSGP_template& MultislotCap__GPRS__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__GPRS__BSSGP&)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 @BSSGP_Types.MultislotCap_GPRS_BSSGP."); } return *this; } MultislotCap__GPRS__BSSGP_template& MultislotCap__GPRS__BSSGP_template::operator=(const MultislotCap__GPRS__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MultislotCap__GPRS__BSSGP_template::match(const MultislotCap__GPRS__BSSGP& 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.gprsmultislotclass().is_bound()) return FALSE; if(!single_value->field_gprsmultislotclass.match(other_value.gprsmultislotclass(), legacy))return FALSE; if(!other_value.gprsextendeddynalloccap().is_bound()) return FALSE; if(!single_value->field_gprsextendeddynalloccap.match(other_value.gprsextendeddynalloccap(), 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 @BSSGP_Types.MultislotCap_GPRS_BSSGP."); } return FALSE; } boolean MultislotCap__GPRS__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_gprsmultislotclass.is_bound() || single_value->field_gprsextendeddynalloccap.is_bound(); } boolean MultislotCap__GPRS__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_gprsmultislotclass.is_value() && single_value->field_gprsextendeddynalloccap.is_value(); } void MultislotCap__GPRS__BSSGP_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; } MultislotCap__GPRS__BSSGP MultislotCap__GPRS__BSSGP_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 @BSSGP_Types.MultislotCap_GPRS_BSSGP."); MultislotCap__GPRS__BSSGP ret_val; if (single_value->field_gprsmultislotclass.is_bound()) { ret_val.gprsmultislotclass() = single_value->field_gprsmultislotclass.valueof(); } if (single_value->field_gprsextendeddynalloccap.is_bound()) { ret_val.gprsextendeddynalloccap() = single_value->field_gprsextendeddynalloccap.valueof(); } return ret_val; } void MultislotCap__GPRS__BSSGP_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 @BSSGP_Types.MultislotCap_GPRS_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MultislotCap__GPRS__BSSGP_template[list_length]; } MultislotCap__GPRS__BSSGP_template& MultislotCap__GPRS__BSSGP_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 @BSSGP_Types.MultislotCap_GPRS_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& MultislotCap__GPRS__BSSGP_template::gprsmultislotclass() { set_specific(); return single_value->field_gprsmultislotclass; } const BITSTRING_template& MultislotCap__GPRS__BSSGP_template::gprsmultislotclass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprsmultislotclass of a non-specific template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP."); return single_value->field_gprsmultislotclass; } BITSTRING_template& MultislotCap__GPRS__BSSGP_template::gprsextendeddynalloccap() { set_specific(); return single_value->field_gprsextendeddynalloccap; } const BITSTRING_template& MultislotCap__GPRS__BSSGP_template::gprsextendeddynalloccap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gprsextendeddynalloccap of a non-specific template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP."); return single_value->field_gprsextendeddynalloccap; } int MultislotCap__GPRS__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP 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 @BSSGP_Types.MultislotCap_GPRS_BSSGP 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 @BSSGP_Types.MultislotCap_GPRS_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MultislotCap_GPRS_BSSGP."); } return 0; } void MultislotCap__GPRS__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ gprsmultislotclass := "); single_value->field_gprsmultislotclass.log(); TTCN_Logger::log_event_str(", gprsextendeddynalloccap := "); single_value->field_gprsextendeddynalloccap.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 MultislotCap__GPRS__BSSGP_template::log_match(const MultislotCap__GPRS__BSSGP& 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_gprsmultislotclass.match(match_value.gprsmultislotclass(), legacy)){ TTCN_Logger::log_logmatch_info(".gprsmultislotclass"); single_value->field_gprsmultislotclass.log_match(match_value.gprsmultislotclass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gprsextendeddynalloccap.match(match_value.gprsextendeddynalloccap(), legacy)){ TTCN_Logger::log_logmatch_info(".gprsextendeddynalloccap"); single_value->field_gprsextendeddynalloccap.log_match(match_value.gprsextendeddynalloccap(), 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("{ gprsmultislotclass := "); single_value->field_gprsmultislotclass.log_match(match_value.gprsmultislotclass(), legacy); TTCN_Logger::log_event_str(", gprsextendeddynalloccap := "); single_value->field_gprsextendeddynalloccap.log_match(match_value.gprsextendeddynalloccap(), 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 MultislotCap__GPRS__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_gprsmultislotclass.encode_text(text_buf); single_value->field_gprsextendeddynalloccap.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 @BSSGP_Types.MultislotCap_GPRS_BSSGP."); } } void MultislotCap__GPRS__BSSGP_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_gprsmultislotclass.decode_text(text_buf); single_value->field_gprsextendeddynalloccap.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 MultislotCap__GPRS__BSSGP_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 @BSSGP_Types.MultislotCap_GPRS_BSSGP."); } } void MultislotCap__GPRS__BSSGP_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: { MultislotCap__GPRS__BSSGP_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) gprsmultislotclass().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gprsextendeddynalloccap().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(), "gprsmultislotclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gprsmultislotclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gprsextendeddynalloccap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gprsextendeddynalloccap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_GPRS_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MultislotCap__GPRS__BSSGP_template* precondition = new MultislotCap__GPRS__BSSGP_template; precondition->set_param(*param.get_elem(0)); MultislotCap__GPRS__BSSGP_template* implied_template = new MultislotCap__GPRS__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MultislotCap__GPRS__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MultislotCap_GPRS_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MultislotCap__GPRS__BSSGP_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_gprsmultislotclass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_GPRS_BSSGP"); single_value->field_gprsextendeddynalloccap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_GPRS_BSSGP"); 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 : "@BSSGP_Types.MultislotCap_GPRS_BSSGP"); } boolean MultislotCap__GPRS__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MultislotCap__GPRS__BSSGP_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) smsValue().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) smValue().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(), "smsValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { smsValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "smValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { smValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_SMS_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MultislotCap_SMS_BSSGP"); } } void MultislotCap__SMS__BSSGP::encode_text(Text_Buf& text_buf) const { field_smsValue.encode_text(text_buf); field_smValue.encode_text(text_buf); } void MultislotCap__SMS__BSSGP::decode_text(Text_Buf& text_buf) { field_smsValue.decode_text(text_buf); field_smValue.decode_text(text_buf); } void MultislotCap__SMS__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MultislotCap__SMS__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MultislotCap__SMS__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, MultislotCap__SMS__BSSGP_smsValue_descr_.raw->forceomit); decoded_field_length = field_smsValue.RAW_decode(MultislotCap__SMS__BSSGP_smsValue_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotCap__SMS__BSSGP_smValue_descr_.raw->forceomit); decoded_field_length = field_smValue.RAW_decode(MultislotCap__SMS__BSSGP_smValue_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MultislotCap__SMS__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MultislotCap__SMS__BSSGP_smsValue_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__SMS__BSSGP_smValue_descr_.raw); encoded_length += field_smsValue.RAW_encode(MultislotCap__SMS__BSSGP_smsValue_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_smValue.RAW_encode(MultislotCap__SMS__BSSGP_smValue_descr_, *myleaf.body.node.nodes[1]); return myleaf.length = encoded_length; } struct MultislotCap__SMS__BSSGP_template::single_value_struct { BITSTRING_template field_smsValue; BITSTRING_template field_smValue; }; void MultislotCap__SMS__BSSGP_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_smsValue = ANY_VALUE; single_value->field_smValue = ANY_VALUE; } } } void MultislotCap__SMS__BSSGP_template::copy_value(const MultislotCap__SMS__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.smsValue().is_bound()) { single_value->field_smsValue = other_value.smsValue(); } else { single_value->field_smsValue.clean_up(); } if (other_value.smValue().is_bound()) { single_value->field_smValue = other_value.smValue(); } else { single_value->field_smValue.clean_up(); } set_selection(SPECIFIC_VALUE); } void MultislotCap__SMS__BSSGP_template::copy_template(const MultislotCap__SMS__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.smsValue().get_selection()) { single_value->field_smsValue = other_value.smsValue(); } else { single_value->field_smsValue.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.smValue().get_selection()) { single_value->field_smValue = other_value.smValue(); } else { single_value->field_smValue.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 MultislotCap__SMS__BSSGP_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 MultislotCap__SMS__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MultislotCap__SMS__BSSGP_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 @BSSGP_Types.MultislotCap_SMS_BSSGP."); break; } set_selection(other_value); } MultislotCap__SMS__BSSGP_template::MultislotCap__SMS__BSSGP_template() { } MultislotCap__SMS__BSSGP_template::MultislotCap__SMS__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MultislotCap__SMS__BSSGP_template::MultislotCap__SMS__BSSGP_template(const MultislotCap__SMS__BSSGP& other_value) { copy_value(other_value); } MultislotCap__SMS__BSSGP_template::MultislotCap__SMS__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__SMS__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MultislotCap_SMS_BSSGP from an unbound optional field."); } } MultislotCap__SMS__BSSGP_template::MultislotCap__SMS__BSSGP_template(MultislotCap__SMS__BSSGP_template* p_precondition, MultislotCap__SMS__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MultislotCap__SMS__BSSGP_template::MultislotCap__SMS__BSSGP_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; } MultislotCap__SMS__BSSGP_template::MultislotCap__SMS__BSSGP_template(const MultislotCap__SMS__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MultislotCap__SMS__BSSGP_template::~MultislotCap__SMS__BSSGP_template() { clean_up(); } MultislotCap__SMS__BSSGP_template& MultislotCap__SMS__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MultislotCap__SMS__BSSGP_template& MultislotCap__SMS__BSSGP_template::operator=(const MultislotCap__SMS__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MultislotCap__SMS__BSSGP_template& MultislotCap__SMS__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__SMS__BSSGP&)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 @BSSGP_Types.MultislotCap_SMS_BSSGP."); } return *this; } MultislotCap__SMS__BSSGP_template& MultislotCap__SMS__BSSGP_template::operator=(const MultislotCap__SMS__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MultislotCap__SMS__BSSGP_template::match(const MultislotCap__SMS__BSSGP& 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.smsValue().is_bound()) return FALSE; if(!single_value->field_smsValue.match(other_value.smsValue(), legacy))return FALSE; if(!other_value.smValue().is_bound()) return FALSE; if(!single_value->field_smValue.match(other_value.smValue(), 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 @BSSGP_Types.MultislotCap_SMS_BSSGP."); } return FALSE; } boolean MultislotCap__SMS__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_smsValue.is_bound() || single_value->field_smValue.is_bound(); } boolean MultislotCap__SMS__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_smsValue.is_value() && single_value->field_smValue.is_value(); } void MultislotCap__SMS__BSSGP_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; } MultislotCap__SMS__BSSGP MultislotCap__SMS__BSSGP_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 @BSSGP_Types.MultislotCap_SMS_BSSGP."); MultislotCap__SMS__BSSGP ret_val; if (single_value->field_smsValue.is_bound()) { ret_val.smsValue() = single_value->field_smsValue.valueof(); } if (single_value->field_smValue.is_bound()) { ret_val.smValue() = single_value->field_smValue.valueof(); } return ret_val; } void MultislotCap__SMS__BSSGP_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 @BSSGP_Types.MultislotCap_SMS_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MultislotCap__SMS__BSSGP_template[list_length]; } MultislotCap__SMS__BSSGP_template& MultislotCap__SMS__BSSGP_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 @BSSGP_Types.MultislotCap_SMS_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MultislotCap_SMS_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& MultislotCap__SMS__BSSGP_template::smsValue() { set_specific(); return single_value->field_smsValue; } const BITSTRING_template& MultislotCap__SMS__BSSGP_template::smsValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field smsValue of a non-specific template of type @BSSGP_Types.MultislotCap_SMS_BSSGP."); return single_value->field_smsValue; } BITSTRING_template& MultislotCap__SMS__BSSGP_template::smValue() { set_specific(); return single_value->field_smValue; } const BITSTRING_template& MultislotCap__SMS__BSSGP_template::smValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field smValue of a non-specific template of type @BSSGP_Types.MultislotCap_SMS_BSSGP."); return single_value->field_smValue; } int MultislotCap__SMS__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_SMS_BSSGP 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 @BSSGP_Types.MultislotCap_SMS_BSSGP 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 @BSSGP_Types.MultislotCap_SMS_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_SMS_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_SMS_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_SMS_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_SMS_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_SMS_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_SMS_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MultislotCap_SMS_BSSGP."); } return 0; } void MultislotCap__SMS__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ smsValue := "); single_value->field_smsValue.log(); TTCN_Logger::log_event_str(", smValue := "); single_value->field_smValue.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 MultislotCap__SMS__BSSGP_template::log_match(const MultislotCap__SMS__BSSGP& 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_smsValue.match(match_value.smsValue(), legacy)){ TTCN_Logger::log_logmatch_info(".smsValue"); single_value->field_smsValue.log_match(match_value.smsValue(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_smValue.match(match_value.smValue(), legacy)){ TTCN_Logger::log_logmatch_info(".smValue"); single_value->field_smValue.log_match(match_value.smValue(), 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("{ smsValue := "); single_value->field_smsValue.log_match(match_value.smsValue(), legacy); TTCN_Logger::log_event_str(", smValue := "); single_value->field_smValue.log_match(match_value.smValue(), 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 MultislotCap__SMS__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_smsValue.encode_text(text_buf); single_value->field_smValue.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 @BSSGP_Types.MultislotCap_SMS_BSSGP."); } } void MultislotCap__SMS__BSSGP_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_smsValue.decode_text(text_buf); single_value->field_smValue.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 MultislotCap__SMS__BSSGP_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 @BSSGP_Types.MultislotCap_SMS_BSSGP."); } } void MultislotCap__SMS__BSSGP_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: { MultislotCap__SMS__BSSGP_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) smsValue().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) smValue().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(), "smsValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { smsValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "smValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { smValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_SMS_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MultislotCap__SMS__BSSGP_template* precondition = new MultislotCap__SMS__BSSGP_template; precondition->set_param(*param.get_elem(0)); MultislotCap__SMS__BSSGP_template* implied_template = new MultislotCap__SMS__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MultislotCap__SMS__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MultislotCap_SMS_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MultislotCap__SMS__BSSGP_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_smsValue.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_SMS_BSSGP"); single_value->field_smValue.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_SMS_BSSGP"); 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 : "@BSSGP_Types.MultislotCap_SMS_BSSGP"); } boolean MultislotCap__SMS__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MultislotCap__SMS__BSSGP_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_ecsdmultislotclass, const BITSTRING& par_presenceBitEgprsmulti, const OPTIONAL< MultislotCap__EGPRS__BSSGP >& par_multislotCap__EGPRS, const BITSTRING& par_presenceBitDtmGprsmulti, const OPTIONAL< MultislotCap__dtmgprsmultislotsubclass__BSSGP >& par_multislotCapdtmgprsmultislotsubclass) : field_presenceBitEcsdmulti(par_presenceBitEcsdmulti), field_ecsdmultislotclass(par_ecsdmultislotclass), field_presenceBitEgprsmulti(par_presenceBitEgprsmulti), field_multislotCap__EGPRS(par_multislotCap__EGPRS), field_presenceBitDtmGprsmulti(par_presenceBitDtmGprsmulti), field_multislotCapdtmgprsmultislotsubclass(par_multislotCapdtmgprsmultislotsubclass) { } MultislotCapAdditionsAfterRel97__BSSGP::MultislotCapAdditionsAfterRel97__BSSGP(const MultislotCapAdditionsAfterRel97__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); if (other_value.presenceBitEcsdmulti().is_bound()) field_presenceBitEcsdmulti = other_value.presenceBitEcsdmulti(); else field_presenceBitEcsdmulti.clean_up(); if (other_value.ecsdmultislotclass().is_bound()) field_ecsdmultislotclass = other_value.ecsdmultislotclass(); else field_ecsdmultislotclass.clean_up(); if (other_value.presenceBitEgprsmulti().is_bound()) field_presenceBitEgprsmulti = other_value.presenceBitEgprsmulti(); else field_presenceBitEgprsmulti.clean_up(); if (other_value.multislotCap__EGPRS().is_bound()) field_multislotCap__EGPRS = other_value.multislotCap__EGPRS(); else field_multislotCap__EGPRS.clean_up(); if (other_value.presenceBitDtmGprsmulti().is_bound()) field_presenceBitDtmGprsmulti = other_value.presenceBitDtmGprsmulti(); else field_presenceBitDtmGprsmulti.clean_up(); if (other_value.multislotCapdtmgprsmultislotsubclass().is_bound()) field_multislotCapdtmgprsmultislotsubclass = other_value.multislotCapdtmgprsmultislotsubclass(); else field_multislotCapdtmgprsmultislotsubclass.clean_up(); } void MultislotCapAdditionsAfterRel97__BSSGP::clean_up() { field_presenceBitEcsdmulti.clean_up(); field_ecsdmultislotclass.clean_up(); field_presenceBitEgprsmulti.clean_up(); field_multislotCap__EGPRS.clean_up(); field_presenceBitDtmGprsmulti.clean_up(); field_multislotCapdtmgprsmultislotsubclass.clean_up(); } const TTCN_Typedescriptor_t* MultislotCapAdditionsAfterRel97__BSSGP::get_descriptor() const { return &MultislotCapAdditionsAfterRel97__BSSGP_descr_; } MultislotCapAdditionsAfterRel97__BSSGP& MultislotCapAdditionsAfterRel97__BSSGP::operator=(const MultislotCapAdditionsAfterRel97__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); if (other_value.presenceBitEcsdmulti().is_bound()) field_presenceBitEcsdmulti = other_value.presenceBitEcsdmulti(); else field_presenceBitEcsdmulti.clean_up(); if (other_value.ecsdmultislotclass().is_bound()) field_ecsdmultislotclass = other_value.ecsdmultislotclass(); else field_ecsdmultislotclass.clean_up(); if (other_value.presenceBitEgprsmulti().is_bound()) field_presenceBitEgprsmulti = other_value.presenceBitEgprsmulti(); else field_presenceBitEgprsmulti.clean_up(); if (other_value.multislotCap__EGPRS().is_bound()) field_multislotCap__EGPRS = other_value.multislotCap__EGPRS(); else field_multislotCap__EGPRS.clean_up(); if (other_value.presenceBitDtmGprsmulti().is_bound()) field_presenceBitDtmGprsmulti = other_value.presenceBitDtmGprsmulti(); else field_presenceBitDtmGprsmulti.clean_up(); if (other_value.multislotCapdtmgprsmultislotsubclass().is_bound()) field_multislotCapdtmgprsmultislotsubclass = other_value.multislotCapdtmgprsmultislotsubclass(); else field_multislotCapdtmgprsmultislotsubclass.clean_up(); } return *this; } boolean MultislotCapAdditionsAfterRel97__BSSGP::operator==(const MultislotCapAdditionsAfterRel97__BSSGP& other_value) const { return field_presenceBitEcsdmulti==other_value.field_presenceBitEcsdmulti && field_ecsdmultislotclass==other_value.field_ecsdmultislotclass && field_presenceBitEgprsmulti==other_value.field_presenceBitEgprsmulti && field_multislotCap__EGPRS==other_value.field_multislotCap__EGPRS && field_presenceBitDtmGprsmulti==other_value.field_presenceBitDtmGprsmulti && field_multislotCapdtmgprsmultislotsubclass==other_value.field_multislotCapdtmgprsmultislotsubclass; } boolean MultislotCapAdditionsAfterRel97__BSSGP::is_bound() const { return (field_presenceBitEcsdmulti.is_bound()) || (OPTIONAL_OMIT == field_ecsdmultislotclass.get_selection() || field_ecsdmultislotclass.is_bound()) || (field_presenceBitEgprsmulti.is_bound()) || (OPTIONAL_OMIT == field_multislotCap__EGPRS.get_selection() || field_multislotCap__EGPRS.is_bound()) || (field_presenceBitDtmGprsmulti.is_bound()) || (OPTIONAL_OMIT == field_multislotCapdtmgprsmultislotsubclass.get_selection() || field_multislotCapdtmgprsmultislotsubclass.is_bound()); } boolean MultislotCapAdditionsAfterRel97__BSSGP::is_value() const { return field_presenceBitEcsdmulti.is_value() && (OPTIONAL_OMIT == field_ecsdmultislotclass.get_selection() || field_ecsdmultislotclass.is_value()) && field_presenceBitEgprsmulti.is_value() && (OPTIONAL_OMIT == field_multislotCap__EGPRS.get_selection() || field_multislotCap__EGPRS.is_value()) && field_presenceBitDtmGprsmulti.is_value() && (OPTIONAL_OMIT == field_multislotCapdtmgprsmultislotsubclass.get_selection() || field_multislotCapdtmgprsmultislotsubclass.is_value()); } int MultislotCapAdditionsAfterRel97__BSSGP::size_of() const { int ret_val = 3; if (field_ecsdmultislotclass.ispresent()) ret_val++; if (field_multislotCap__EGPRS.ispresent()) ret_val++; if (field_multislotCapdtmgprsmultislotsubclass.ispresent()) ret_val++; return ret_val; } void MultislotCapAdditionsAfterRel97__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ presenceBitEcsdmulti := "); field_presenceBitEcsdmulti.log(); TTCN_Logger::log_event_str(", ecsdmultislotclass := "); field_ecsdmultislotclass.log(); TTCN_Logger::log_event_str(", presenceBitEgprsmulti := "); field_presenceBitEgprsmulti.log(); TTCN_Logger::log_event_str(", multislotCap_EGPRS := "); field_multislotCap__EGPRS.log(); TTCN_Logger::log_event_str(", presenceBitDtmGprsmulti := "); field_presenceBitDtmGprsmulti.log(); TTCN_Logger::log_event_str(", multislotCapdtmgprsmultislotsubclass := "); field_multislotCapdtmgprsmultislotsubclass.log(); TTCN_Logger::log_event_str(" }"); } void MultislotCapAdditionsAfterRel97__BSSGP::set_implicit_omit() { if (presenceBitEcsdmulti().is_bound()) presenceBitEcsdmulti().set_implicit_omit(); if (!ecsdmultislotclass().is_bound()) ecsdmultislotclass() = OMIT_VALUE; else ecsdmultislotclass().set_implicit_omit(); if (presenceBitEgprsmulti().is_bound()) presenceBitEgprsmulti().set_implicit_omit(); if (!multislotCap__EGPRS().is_bound()) multislotCap__EGPRS() = OMIT_VALUE; else multislotCap__EGPRS().set_implicit_omit(); if (presenceBitDtmGprsmulti().is_bound()) presenceBitDtmGprsmulti().set_implicit_omit(); if (!multislotCapdtmgprsmultislotsubclass().is_bound()) multislotCapdtmgprsmultislotsubclass() = OMIT_VALUE; else multislotCapdtmgprsmultislotsubclass().set_implicit_omit(); } void MultislotCapAdditionsAfterRel97__BSSGP::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 (60 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) presenceBitEcsdmulti().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ecsdmultislotclass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitEgprsmulti().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) multislotCap__EGPRS().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitDtmGprsmulti().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) multislotCapdtmgprsmultislotsubclass().set_param(*param.get_elem(5)); 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(), "presenceBitEcsdmulti")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitEcsdmulti().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ecsdmultislotclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ecsdmultislotclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitEgprsmulti")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitEgprsmulti().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotCap_EGPRS")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCap__EGPRS().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDtmGprsmulti")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDtmGprsmulti().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotCapdtmgprsmultislotsubclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCapdtmgprsmultislotsubclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); } } void MultislotCapAdditionsAfterRel97__BSSGP::encode_text(Text_Buf& text_buf) const { field_presenceBitEcsdmulti.encode_text(text_buf); field_ecsdmultislotclass.encode_text(text_buf); field_presenceBitEgprsmulti.encode_text(text_buf); field_multislotCap__EGPRS.encode_text(text_buf); field_presenceBitDtmGprsmulti.encode_text(text_buf); field_multislotCapdtmgprsmultislotsubclass.encode_text(text_buf); } void MultislotCapAdditionsAfterRel97__BSSGP::decode_text(Text_Buf& text_buf) { field_presenceBitEcsdmulti.decode_text(text_buf); field_ecsdmultislotclass.decode_text(text_buf); field_presenceBitEgprsmulti.decode_text(text_buf); field_multislotCap__EGPRS.decode_text(text_buf); field_presenceBitDtmGprsmulti.decode_text(text_buf); field_multislotCapdtmgprsmultislotsubclass.decode_text(text_buf); } void MultislotCapAdditionsAfterRel97__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MultislotCapAdditionsAfterRel97__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MultislotCapAdditionsAfterRel97__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEcsdmulti_descr_.raw->forceomit); decoded_field_length = field_presenceBitEcsdmulti.RAW_decode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEcsdmulti_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitEcsdmulti == bs_0){ if (force_omit != NULL && (*force_omit)(1)) { field_ecsdmultislotclass = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotCapAdditionsAfterRel97__BSSGP_ecsdmultislotclass_descr_.raw->forceomit); decoded_field_length = field_ecsdmultislotclass().RAW_decode(MultislotCapAdditionsAfterRel97__BSSGP_ecsdmultislotclass_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_ecsdmultislotclass = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_ecsdmultislotclass=OMIT_VALUE; RAW_Force_Omit field_2_force_omit(2, force_omit, MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEgprsmulti_descr_.raw->forceomit); decoded_field_length = field_presenceBitEgprsmulti.RAW_decode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEgprsmulti_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitEgprsmulti == bs_0){ if (force_omit != NULL && (*force_omit)(3)) { field_multislotCap__EGPRS = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_3_force_omit(3, force_omit, MultislotCapAdditionsAfterRel97__BSSGP_multislotCap__EGPRS_descr_.raw->forceomit); decoded_field_length = field_multislotCap__EGPRS().RAW_decode(MultislotCapAdditionsAfterRel97__BSSGP_multislotCap__EGPRS_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 1) { field_multislotCap__EGPRS = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_multislotCap__EGPRS=OMIT_VALUE; RAW_Force_Omit field_4_force_omit(4, force_omit, MultislotCapAdditionsAfterRel97__BSSGP_presenceBitDtmGprsmulti_descr_.raw->forceomit); decoded_field_length = field_presenceBitDtmGprsmulti.RAW_decode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitDtmGprsmulti_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitDtmGprsmulti == bs_0){ if (force_omit != NULL && (*force_omit)(5)) { field_multislotCapdtmgprsmultislotsubclass = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_5_force_omit(5, force_omit, MultislotCapAdditionsAfterRel97__BSSGP_multislotCapdtmgprsmultislotsubclass_descr_.raw->forceomit); decoded_field_length = field_multislotCapdtmgprsmultislotsubclass().RAW_decode(MultislotCapAdditionsAfterRel97__BSSGP_multislotCapdtmgprsmultislotsubclass_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 1) { field_multislotCapdtmgprsmultislotsubclass = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_multislotCapdtmgprsmultislotsubclass=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MultislotCapAdditionsAfterRel97__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 6; myleaf.body.node.nodes = init_nodes_of_enc_tree(6); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEcsdmulti_descr_.raw); if (field_ecsdmultislotclass.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCapAdditionsAfterRel97__BSSGP_ecsdmultislotclass_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEgprsmulti_descr_.raw); if (field_multislotCap__EGPRS.ispresent()) { myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MultislotCapAdditionsAfterRel97__BSSGP_multislotCap__EGPRS_descr_.raw); } else myleaf.body.node.nodes[3] = NULL; myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MultislotCapAdditionsAfterRel97__BSSGP_presenceBitDtmGprsmulti_descr_.raw); if (field_multislotCapdtmgprsmultislotsubclass.ispresent()) { myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MultislotCapAdditionsAfterRel97__BSSGP_multislotCapdtmgprsmultislotsubclass_descr_.raw); } else myleaf.body.node.nodes[5] = NULL; encoded_length += field_presenceBitEcsdmulti.RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEcsdmulti_descr_, *myleaf.body.node.nodes[0]); if (field_ecsdmultislotclass.ispresent()) { encoded_length += field_ecsdmultislotclass().RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_ecsdmultislotclass_descr_, *myleaf.body.node.nodes[1]); } encoded_length += field_presenceBitEgprsmulti.RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEgprsmulti_descr_, *myleaf.body.node.nodes[2]); if (field_multislotCap__EGPRS.ispresent()) { encoded_length += field_multislotCap__EGPRS().RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_multislotCap__EGPRS_descr_, *myleaf.body.node.nodes[3]); } encoded_length += field_presenceBitDtmGprsmulti.RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitDtmGprsmulti_descr_, *myleaf.body.node.nodes[4]); if (field_multislotCapdtmgprsmultislotsubclass.ispresent()) { encoded_length += field_multislotCapdtmgprsmultislotsubclass().RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_multislotCapdtmgprsmultislotsubclass_descr_, *myleaf.body.node.nodes[5]); } if (field_ecsdmultislotclass.ispresent() && (field_presenceBitEcsdmulti != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEcsdmulti_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } if (field_multislotCap__EGPRS.ispresent() && (field_presenceBitEgprsmulti != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={2}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitEgprsmulti_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } if (field_multislotCapdtmgprsmultislotsubclass.ispresent() && (field_presenceBitDtmGprsmulti != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={4}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(MultislotCapAdditionsAfterRel97__BSSGP_presenceBitDtmGprsmulti_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct MultislotCapAdditionsAfterRel97__BSSGP_template::single_value_struct { BITSTRING_template field_presenceBitEcsdmulti; BITSTRING_template field_ecsdmultislotclass; BITSTRING_template field_presenceBitEgprsmulti; MultislotCap__EGPRS__BSSGP_template field_multislotCap__EGPRS; BITSTRING_template field_presenceBitDtmGprsmulti; MultislotCap__dtmgprsmultislotsubclass__BSSGP_template field_multislotCapdtmgprsmultislotsubclass; }; void MultislotCapAdditionsAfterRel97__BSSGP_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_presenceBitEcsdmulti = ANY_VALUE; single_value->field_ecsdmultislotclass = ANY_OR_OMIT; single_value->field_presenceBitEgprsmulti = ANY_VALUE; single_value->field_multislotCap__EGPRS = ANY_OR_OMIT; single_value->field_presenceBitDtmGprsmulti = ANY_VALUE; single_value->field_multislotCapdtmgprsmultislotsubclass = ANY_OR_OMIT; } } } void MultislotCapAdditionsAfterRel97__BSSGP_template::copy_value(const MultislotCapAdditionsAfterRel97__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.presenceBitEcsdmulti().is_bound()) { single_value->field_presenceBitEcsdmulti = other_value.presenceBitEcsdmulti(); } else { single_value->field_presenceBitEcsdmulti.clean_up(); } if (other_value.ecsdmultislotclass().is_bound()) { if (other_value.ecsdmultislotclass().ispresent()) single_value->field_ecsdmultislotclass = other_value.ecsdmultislotclass()(); else single_value->field_ecsdmultislotclass = OMIT_VALUE; } else { single_value->field_ecsdmultislotclass.clean_up(); } if (other_value.presenceBitEgprsmulti().is_bound()) { single_value->field_presenceBitEgprsmulti = other_value.presenceBitEgprsmulti(); } else { single_value->field_presenceBitEgprsmulti.clean_up(); } if (other_value.multislotCap__EGPRS().is_bound()) { if (other_value.multislotCap__EGPRS().ispresent()) single_value->field_multislotCap__EGPRS = other_value.multislotCap__EGPRS()(); else single_value->field_multislotCap__EGPRS = OMIT_VALUE; } else { single_value->field_multislotCap__EGPRS.clean_up(); } if (other_value.presenceBitDtmGprsmulti().is_bound()) { single_value->field_presenceBitDtmGprsmulti = other_value.presenceBitDtmGprsmulti(); } else { single_value->field_presenceBitDtmGprsmulti.clean_up(); } if (other_value.multislotCapdtmgprsmultislotsubclass().is_bound()) { if (other_value.multislotCapdtmgprsmultislotsubclass().ispresent()) single_value->field_multislotCapdtmgprsmultislotsubclass = other_value.multislotCapdtmgprsmultislotsubclass()(); else single_value->field_multislotCapdtmgprsmultislotsubclass = OMIT_VALUE; } else { single_value->field_multislotCapdtmgprsmultislotsubclass.clean_up(); } set_selection(SPECIFIC_VALUE); } void MultislotCapAdditionsAfterRel97__BSSGP_template::copy_template(const MultislotCapAdditionsAfterRel97__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.presenceBitEcsdmulti().get_selection()) { single_value->field_presenceBitEcsdmulti = other_value.presenceBitEcsdmulti(); } else { single_value->field_presenceBitEcsdmulti.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ecsdmultislotclass().get_selection()) { single_value->field_ecsdmultislotclass = other_value.ecsdmultislotclass(); } else { single_value->field_ecsdmultislotclass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitEgprsmulti().get_selection()) { single_value->field_presenceBitEgprsmulti = other_value.presenceBitEgprsmulti(); } else { single_value->field_presenceBitEgprsmulti.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.multislotCap__EGPRS().get_selection()) { single_value->field_multislotCap__EGPRS = other_value.multislotCap__EGPRS(); } else { single_value->field_multislotCap__EGPRS.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDtmGprsmulti().get_selection()) { single_value->field_presenceBitDtmGprsmulti = other_value.presenceBitDtmGprsmulti(); } else { single_value->field_presenceBitDtmGprsmulti.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.multislotCapdtmgprsmultislotsubclass().get_selection()) { single_value->field_multislotCapdtmgprsmultislotsubclass = other_value.multislotCapdtmgprsmultislotsubclass(); } else { single_value->field_multislotCapdtmgprsmultislotsubclass.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 MultislotCapAdditionsAfterRel97__BSSGP_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 MultislotCapAdditionsAfterRel97__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MultislotCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); break; } set_selection(other_value); } MultislotCapAdditionsAfterRel97__BSSGP_template::MultislotCapAdditionsAfterRel97__BSSGP_template() { } MultislotCapAdditionsAfterRel97__BSSGP_template::MultislotCapAdditionsAfterRel97__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MultislotCapAdditionsAfterRel97__BSSGP_template::MultislotCapAdditionsAfterRel97__BSSGP_template(const MultislotCapAdditionsAfterRel97__BSSGP& other_value) { copy_value(other_value); } MultislotCapAdditionsAfterRel97__BSSGP_template::MultislotCapAdditionsAfterRel97__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCapAdditionsAfterRel97__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP from an unbound optional field."); } } MultislotCapAdditionsAfterRel97__BSSGP_template::MultislotCapAdditionsAfterRel97__BSSGP_template(MultislotCapAdditionsAfterRel97__BSSGP_template* p_precondition, MultislotCapAdditionsAfterRel97__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MultislotCapAdditionsAfterRel97__BSSGP_template::MultislotCapAdditionsAfterRel97__BSSGP_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; } MultislotCapAdditionsAfterRel97__BSSGP_template::MultislotCapAdditionsAfterRel97__BSSGP_template(const MultislotCapAdditionsAfterRel97__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MultislotCapAdditionsAfterRel97__BSSGP_template::~MultislotCapAdditionsAfterRel97__BSSGP_template() { clean_up(); } MultislotCapAdditionsAfterRel97__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MultislotCapAdditionsAfterRel97__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_template::operator=(const MultislotCapAdditionsAfterRel97__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MultislotCapAdditionsAfterRel97__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCapAdditionsAfterRel97__BSSGP&)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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); } return *this; } MultislotCapAdditionsAfterRel97__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_template::operator=(const MultislotCapAdditionsAfterRel97__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MultislotCapAdditionsAfterRel97__BSSGP_template::match(const MultislotCapAdditionsAfterRel97__BSSGP& 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.presenceBitEcsdmulti().is_bound()) return FALSE; if(!single_value->field_presenceBitEcsdmulti.match(other_value.presenceBitEcsdmulti(), legacy))return FALSE; if(!other_value.ecsdmultislotclass().is_bound()) return FALSE; if((other_value.ecsdmultislotclass().ispresent() ? !single_value->field_ecsdmultislotclass.match((const BITSTRING&)other_value.ecsdmultislotclass(), legacy) : !single_value->field_ecsdmultislotclass.match_omit(legacy)))return FALSE; if(!other_value.presenceBitEgprsmulti().is_bound()) return FALSE; if(!single_value->field_presenceBitEgprsmulti.match(other_value.presenceBitEgprsmulti(), legacy))return FALSE; if(!other_value.multislotCap__EGPRS().is_bound()) return FALSE; if((other_value.multislotCap__EGPRS().ispresent() ? !single_value->field_multislotCap__EGPRS.match((const MultislotCap__EGPRS__BSSGP&)other_value.multislotCap__EGPRS(), legacy) : !single_value->field_multislotCap__EGPRS.match_omit(legacy)))return FALSE; if(!other_value.presenceBitDtmGprsmulti().is_bound()) return FALSE; if(!single_value->field_presenceBitDtmGprsmulti.match(other_value.presenceBitDtmGprsmulti(), legacy))return FALSE; if(!other_value.multislotCapdtmgprsmultislotsubclass().is_bound()) return FALSE; if((other_value.multislotCapdtmgprsmultislotsubclass().ispresent() ? !single_value->field_multislotCapdtmgprsmultislotsubclass.match((const MultislotCap__dtmgprsmultislotsubclass__BSSGP&)other_value.multislotCapdtmgprsmultislotsubclass(), legacy) : !single_value->field_multislotCapdtmgprsmultislotsubclass.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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); } return FALSE; } boolean MultislotCapAdditionsAfterRel97__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_presenceBitEcsdmulti.is_bound() || (single_value->field_ecsdmultislotclass.is_omit() || single_value->field_ecsdmultislotclass.is_bound()) || single_value->field_presenceBitEgprsmulti.is_bound() || (single_value->field_multislotCap__EGPRS.is_omit() || single_value->field_multislotCap__EGPRS.is_bound()) || single_value->field_presenceBitDtmGprsmulti.is_bound() || (single_value->field_multislotCapdtmgprsmultislotsubclass.is_omit() || single_value->field_multislotCapdtmgprsmultislotsubclass.is_bound()); } boolean MultislotCapAdditionsAfterRel97__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_presenceBitEcsdmulti.is_value() && (single_value->field_ecsdmultislotclass.is_omit() || single_value->field_ecsdmultislotclass.is_value()) && single_value->field_presenceBitEgprsmulti.is_value() && (single_value->field_multislotCap__EGPRS.is_omit() || single_value->field_multislotCap__EGPRS.is_value()) && single_value->field_presenceBitDtmGprsmulti.is_value() && (single_value->field_multislotCapdtmgprsmultislotsubclass.is_omit() || single_value->field_multislotCapdtmgprsmultislotsubclass.is_value()); } void MultislotCapAdditionsAfterRel97__BSSGP_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; } MultislotCapAdditionsAfterRel97__BSSGP MultislotCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); MultislotCapAdditionsAfterRel97__BSSGP ret_val; if (single_value->field_presenceBitEcsdmulti.is_bound()) { ret_val.presenceBitEcsdmulti() = single_value->field_presenceBitEcsdmulti.valueof(); } if (single_value->field_ecsdmultislotclass.is_omit()) ret_val.ecsdmultislotclass() = OMIT_VALUE; else if (single_value->field_ecsdmultislotclass.is_bound()) { ret_val.ecsdmultislotclass() = single_value->field_ecsdmultislotclass.valueof(); } if (single_value->field_presenceBitEgprsmulti.is_bound()) { ret_val.presenceBitEgprsmulti() = single_value->field_presenceBitEgprsmulti.valueof(); } if (single_value->field_multislotCap__EGPRS.is_omit()) ret_val.multislotCap__EGPRS() = OMIT_VALUE; else if (single_value->field_multislotCap__EGPRS.is_bound()) { ret_val.multislotCap__EGPRS() = single_value->field_multislotCap__EGPRS.valueof(); } if (single_value->field_presenceBitDtmGprsmulti.is_bound()) { ret_val.presenceBitDtmGprsmulti() = single_value->field_presenceBitDtmGprsmulti.valueof(); } if (single_value->field_multislotCapdtmgprsmultislotsubclass.is_omit()) ret_val.multislotCapdtmgprsmultislotsubclass() = OMIT_VALUE; else if (single_value->field_multislotCapdtmgprsmultislotsubclass.is_bound()) { ret_val.multislotCapdtmgprsmultislotsubclass() = single_value->field_multislotCapdtmgprsmultislotsubclass.valueof(); } return ret_val; } void MultislotCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MultislotCapAdditionsAfterRel97__BSSGP_template[list_length]; } MultislotCapAdditionsAfterRel97__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& MultislotCapAdditionsAfterRel97__BSSGP_template::presenceBitEcsdmulti() { set_specific(); return single_value->field_presenceBitEcsdmulti; } const BITSTRING_template& MultislotCapAdditionsAfterRel97__BSSGP_template::presenceBitEcsdmulti() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitEcsdmulti of a non-specific template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); return single_value->field_presenceBitEcsdmulti; } BITSTRING_template& MultislotCapAdditionsAfterRel97__BSSGP_template::ecsdmultislotclass() { set_specific(); return single_value->field_ecsdmultislotclass; } const BITSTRING_template& MultislotCapAdditionsAfterRel97__BSSGP_template::ecsdmultislotclass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ecsdmultislotclass of a non-specific template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); return single_value->field_ecsdmultislotclass; } BITSTRING_template& MultislotCapAdditionsAfterRel97__BSSGP_template::presenceBitEgprsmulti() { set_specific(); return single_value->field_presenceBitEgprsmulti; } const BITSTRING_template& MultislotCapAdditionsAfterRel97__BSSGP_template::presenceBitEgprsmulti() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitEgprsmulti of a non-specific template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); return single_value->field_presenceBitEgprsmulti; } MultislotCap__EGPRS__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_template::multislotCap__EGPRS() { set_specific(); return single_value->field_multislotCap__EGPRS; } const MultislotCap__EGPRS__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_template::multislotCap__EGPRS() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field multislotCap_EGPRS of a non-specific template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); return single_value->field_multislotCap__EGPRS; } BITSTRING_template& MultislotCapAdditionsAfterRel97__BSSGP_template::presenceBitDtmGprsmulti() { set_specific(); return single_value->field_presenceBitDtmGprsmulti; } const BITSTRING_template& MultislotCapAdditionsAfterRel97__BSSGP_template::presenceBitDtmGprsmulti() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitDtmGprsmulti of a non-specific template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); return single_value->field_presenceBitDtmGprsmulti; } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_template::multislotCapdtmgprsmultislotsubclass() { set_specific(); return single_value->field_multislotCapdtmgprsmultislotsubclass; } const MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& MultislotCapAdditionsAfterRel97__BSSGP_template::multislotCapdtmgprsmultislotsubclass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field multislotCapdtmgprsmultislotsubclass of a non-specific template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); return single_value->field_multislotCapdtmgprsmultislotsubclass; } int MultislotCapAdditionsAfterRel97__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 3; if (single_value->field_ecsdmultislotclass.is_present()) ret_val++; if (single_value->field_multislotCap__EGPRS.is_present()) ret_val++; if (single_value->field_multislotCapdtmgprsmultislotsubclass.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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP 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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); } return 0; } void MultislotCapAdditionsAfterRel97__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ presenceBitEcsdmulti := "); single_value->field_presenceBitEcsdmulti.log(); TTCN_Logger::log_event_str(", ecsdmultislotclass := "); single_value->field_ecsdmultislotclass.log(); TTCN_Logger::log_event_str(", presenceBitEgprsmulti := "); single_value->field_presenceBitEgprsmulti.log(); TTCN_Logger::log_event_str(", multislotCap_EGPRS := "); single_value->field_multislotCap__EGPRS.log(); TTCN_Logger::log_event_str(", presenceBitDtmGprsmulti := "); single_value->field_presenceBitDtmGprsmulti.log(); TTCN_Logger::log_event_str(", multislotCapdtmgprsmultislotsubclass := "); single_value->field_multislotCapdtmgprsmultislotsubclass.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 MultislotCapAdditionsAfterRel97__BSSGP_template::log_match(const MultislotCapAdditionsAfterRel97__BSSGP& 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_presenceBitEcsdmulti.match(match_value.presenceBitEcsdmulti(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitEcsdmulti"); single_value->field_presenceBitEcsdmulti.log_match(match_value.presenceBitEcsdmulti(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.ecsdmultislotclass().ispresent()){ if(!single_value->field_ecsdmultislotclass.match(match_value.ecsdmultislotclass(), legacy)){ TTCN_Logger::log_logmatch_info(".ecsdmultislotclass"); single_value->field_ecsdmultislotclass.log_match(match_value.ecsdmultislotclass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_ecsdmultislotclass.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".ecsdmultislotclass := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_ecsdmultislotclass.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_presenceBitEgprsmulti.match(match_value.presenceBitEgprsmulti(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitEgprsmulti"); single_value->field_presenceBitEgprsmulti.log_match(match_value.presenceBitEgprsmulti(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.multislotCap__EGPRS().ispresent()){ if(!single_value->field_multislotCap__EGPRS.match(match_value.multislotCap__EGPRS(), legacy)){ TTCN_Logger::log_logmatch_info(".multislotCap_EGPRS"); single_value->field_multislotCap__EGPRS.log_match(match_value.multislotCap__EGPRS(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_multislotCap__EGPRS.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".multislotCap_EGPRS := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_multislotCap__EGPRS.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_presenceBitDtmGprsmulti.match(match_value.presenceBitDtmGprsmulti(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitDtmGprsmulti"); single_value->field_presenceBitDtmGprsmulti.log_match(match_value.presenceBitDtmGprsmulti(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.multislotCapdtmgprsmultislotsubclass().ispresent()){ if(!single_value->field_multislotCapdtmgprsmultislotsubclass.match(match_value.multislotCapdtmgprsmultislotsubclass(), legacy)){ TTCN_Logger::log_logmatch_info(".multislotCapdtmgprsmultislotsubclass"); single_value->field_multislotCapdtmgprsmultislotsubclass.log_match(match_value.multislotCapdtmgprsmultislotsubclass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_multislotCapdtmgprsmultislotsubclass.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".multislotCapdtmgprsmultislotsubclass := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_multislotCapdtmgprsmultislotsubclass.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("{ presenceBitEcsdmulti := "); single_value->field_presenceBitEcsdmulti.log_match(match_value.presenceBitEcsdmulti(), legacy); TTCN_Logger::log_event_str(", ecsdmultislotclass := "); if (match_value.ecsdmultislotclass().ispresent()) { single_value->field_ecsdmultislotclass.log_match(match_value.ecsdmultislotclass(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_ecsdmultislotclass.log(); if (single_value->field_ecsdmultislotclass.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", presenceBitEgprsmulti := "); single_value->field_presenceBitEgprsmulti.log_match(match_value.presenceBitEgprsmulti(), legacy); TTCN_Logger::log_event_str(", multislotCap_EGPRS := "); if (match_value.multislotCap__EGPRS().ispresent()) { single_value->field_multislotCap__EGPRS.log_match(match_value.multislotCap__EGPRS(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_multislotCap__EGPRS.log(); if (single_value->field_multislotCap__EGPRS.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", presenceBitDtmGprsmulti := "); single_value->field_presenceBitDtmGprsmulti.log_match(match_value.presenceBitDtmGprsmulti(), legacy); TTCN_Logger::log_event_str(", multislotCapdtmgprsmultislotsubclass := "); if (match_value.multislotCapdtmgprsmultislotsubclass().ispresent()) { single_value->field_multislotCapdtmgprsmultislotsubclass.log_match(match_value.multislotCapdtmgprsmultislotsubclass(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_multislotCapdtmgprsmultislotsubclass.log(); if (single_value->field_multislotCapdtmgprsmultislotsubclass.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 MultislotCapAdditionsAfterRel97__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_presenceBitEcsdmulti.encode_text(text_buf); single_value->field_ecsdmultislotclass.encode_text(text_buf); single_value->field_presenceBitEgprsmulti.encode_text(text_buf); single_value->field_multislotCap__EGPRS.encode_text(text_buf); single_value->field_presenceBitDtmGprsmulti.encode_text(text_buf); single_value->field_multislotCapdtmgprsmultislotsubclass.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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); } } void MultislotCapAdditionsAfterRel97__BSSGP_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_presenceBitEcsdmulti.decode_text(text_buf); single_value->field_ecsdmultislotclass.decode_text(text_buf); single_value->field_presenceBitEgprsmulti.decode_text(text_buf); single_value->field_multislotCap__EGPRS.decode_text(text_buf); single_value->field_presenceBitDtmGprsmulti.decode_text(text_buf); single_value->field_multislotCapdtmgprsmultislotsubclass.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 MultislotCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP."); } } void MultislotCapAdditionsAfterRel97__BSSGP_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: { MultislotCapAdditionsAfterRel97__BSSGP_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) presenceBitEcsdmulti().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ecsdmultislotclass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitEgprsmulti().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) multislotCap__EGPRS().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitDtmGprsmulti().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) multislotCapdtmgprsmultislotsubclass().set_param(*param.get_elem(5)); 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(), "presenceBitEcsdmulti")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitEcsdmulti().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ecsdmultislotclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ecsdmultislotclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitEgprsmulti")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitEgprsmulti().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotCap_EGPRS")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCap__EGPRS().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDtmGprsmulti")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDtmGprsmulti().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "multislotCapdtmgprsmultislotsubclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCapdtmgprsmultislotsubclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MultislotCapAdditionsAfterRel97__BSSGP_template* precondition = new MultislotCapAdditionsAfterRel97__BSSGP_template; precondition->set_param(*param.get_elem(0)); MultislotCapAdditionsAfterRel97__BSSGP_template* implied_template = new MultislotCapAdditionsAfterRel97__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MultislotCapAdditionsAfterRel97__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MultislotCapAdditionsAfterRel97__BSSGP_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_presenceBitEcsdmulti.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); single_value->field_ecsdmultislotclass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); single_value->field_presenceBitEgprsmulti.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); single_value->field_multislotCap__EGPRS.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); single_value->field_presenceBitDtmGprsmulti.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); single_value->field_multislotCapdtmgprsmultislotsubclass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); 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 : "@BSSGP_Types.MultislotCapAdditionsAfterRel97_BSSGP"); } boolean MultislotCapAdditionsAfterRel97__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MultislotCapAdditionsAfterRel97__BSSGP_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) egprsmultislotclass().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) egprsextendeddynalloccap().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(), "egprsmultislotclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { egprsmultislotclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "egprsextendeddynalloccap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { egprsextendeddynalloccap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_EGPRS_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MultislotCap_EGPRS_BSSGP"); } } void MultislotCap__EGPRS__BSSGP::encode_text(Text_Buf& text_buf) const { field_egprsmultislotclass.encode_text(text_buf); field_egprsextendeddynalloccap.encode_text(text_buf); } void MultislotCap__EGPRS__BSSGP::decode_text(Text_Buf& text_buf) { field_egprsmultislotclass.decode_text(text_buf); field_egprsextendeddynalloccap.decode_text(text_buf); } void MultislotCap__EGPRS__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MultislotCap__EGPRS__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MultislotCap__EGPRS__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, MultislotCap__EGPRS__BSSGP_egprsmultislotclass_descr_.raw->forceomit); decoded_field_length = field_egprsmultislotclass.RAW_decode(MultislotCap__EGPRS__BSSGP_egprsmultislotclass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotCap__EGPRS__BSSGP_egprsextendeddynalloccap_descr_.raw->forceomit); decoded_field_length = field_egprsextendeddynalloccap.RAW_decode(MultislotCap__EGPRS__BSSGP_egprsextendeddynalloccap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MultislotCap__EGPRS__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MultislotCap__EGPRS__BSSGP_egprsmultislotclass_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__EGPRS__BSSGP_egprsextendeddynalloccap_descr_.raw); encoded_length += field_egprsmultislotclass.RAW_encode(MultislotCap__EGPRS__BSSGP_egprsmultislotclass_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_egprsextendeddynalloccap.RAW_encode(MultislotCap__EGPRS__BSSGP_egprsextendeddynalloccap_descr_, *myleaf.body.node.nodes[1]); return myleaf.length = encoded_length; } struct MultislotCap__EGPRS__BSSGP_template::single_value_struct { BITSTRING_template field_egprsmultislotclass; BITSTRING_template field_egprsextendeddynalloccap; }; void MultislotCap__EGPRS__BSSGP_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_egprsmultislotclass = ANY_VALUE; single_value->field_egprsextendeddynalloccap = ANY_VALUE; } } } void MultislotCap__EGPRS__BSSGP_template::copy_value(const MultislotCap__EGPRS__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.egprsmultislotclass().is_bound()) { single_value->field_egprsmultislotclass = other_value.egprsmultislotclass(); } else { single_value->field_egprsmultislotclass.clean_up(); } if (other_value.egprsextendeddynalloccap().is_bound()) { single_value->field_egprsextendeddynalloccap = other_value.egprsextendeddynalloccap(); } else { single_value->field_egprsextendeddynalloccap.clean_up(); } set_selection(SPECIFIC_VALUE); } void MultislotCap__EGPRS__BSSGP_template::copy_template(const MultislotCap__EGPRS__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.egprsmultislotclass().get_selection()) { single_value->field_egprsmultislotclass = other_value.egprsmultislotclass(); } else { single_value->field_egprsmultislotclass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.egprsextendeddynalloccap().get_selection()) { single_value->field_egprsextendeddynalloccap = other_value.egprsextendeddynalloccap(); } else { single_value->field_egprsextendeddynalloccap.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 MultislotCap__EGPRS__BSSGP_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 MultislotCap__EGPRS__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MultislotCap__EGPRS__BSSGP_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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); break; } set_selection(other_value); } MultislotCap__EGPRS__BSSGP_template::MultislotCap__EGPRS__BSSGP_template() { } MultislotCap__EGPRS__BSSGP_template::MultislotCap__EGPRS__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MultislotCap__EGPRS__BSSGP_template::MultislotCap__EGPRS__BSSGP_template(const MultislotCap__EGPRS__BSSGP& other_value) { copy_value(other_value); } MultislotCap__EGPRS__BSSGP_template::MultislotCap__EGPRS__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__EGPRS__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP from an unbound optional field."); } } MultislotCap__EGPRS__BSSGP_template::MultislotCap__EGPRS__BSSGP_template(MultislotCap__EGPRS__BSSGP_template* p_precondition, MultislotCap__EGPRS__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MultislotCap__EGPRS__BSSGP_template::MultislotCap__EGPRS__BSSGP_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; } MultislotCap__EGPRS__BSSGP_template::MultislotCap__EGPRS__BSSGP_template(const MultislotCap__EGPRS__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MultislotCap__EGPRS__BSSGP_template::~MultislotCap__EGPRS__BSSGP_template() { clean_up(); } MultislotCap__EGPRS__BSSGP_template& MultislotCap__EGPRS__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MultislotCap__EGPRS__BSSGP_template& MultislotCap__EGPRS__BSSGP_template::operator=(const MultislotCap__EGPRS__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MultislotCap__EGPRS__BSSGP_template& MultislotCap__EGPRS__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__EGPRS__BSSGP&)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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); } return *this; } MultislotCap__EGPRS__BSSGP_template& MultislotCap__EGPRS__BSSGP_template::operator=(const MultislotCap__EGPRS__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MultislotCap__EGPRS__BSSGP_template::match(const MultislotCap__EGPRS__BSSGP& 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.egprsmultislotclass().is_bound()) return FALSE; if(!single_value->field_egprsmultislotclass.match(other_value.egprsmultislotclass(), legacy))return FALSE; if(!other_value.egprsextendeddynalloccap().is_bound()) return FALSE; if(!single_value->field_egprsextendeddynalloccap.match(other_value.egprsextendeddynalloccap(), 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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); } return FALSE; } boolean MultislotCap__EGPRS__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_egprsmultislotclass.is_bound() || single_value->field_egprsextendeddynalloccap.is_bound(); } boolean MultislotCap__EGPRS__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_egprsmultislotclass.is_value() && single_value->field_egprsextendeddynalloccap.is_value(); } void MultislotCap__EGPRS__BSSGP_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; } MultislotCap__EGPRS__BSSGP MultislotCap__EGPRS__BSSGP_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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); MultislotCap__EGPRS__BSSGP ret_val; if (single_value->field_egprsmultislotclass.is_bound()) { ret_val.egprsmultislotclass() = single_value->field_egprsmultislotclass.valueof(); } if (single_value->field_egprsextendeddynalloccap.is_bound()) { ret_val.egprsextendeddynalloccap() = single_value->field_egprsextendeddynalloccap.valueof(); } return ret_val; } void MultislotCap__EGPRS__BSSGP_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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MultislotCap__EGPRS__BSSGP_template[list_length]; } MultislotCap__EGPRS__BSSGP_template& MultislotCap__EGPRS__BSSGP_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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& MultislotCap__EGPRS__BSSGP_template::egprsmultislotclass() { set_specific(); return single_value->field_egprsmultislotclass; } const BITSTRING_template& MultislotCap__EGPRS__BSSGP_template::egprsmultislotclass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field egprsmultislotclass of a non-specific template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); return single_value->field_egprsmultislotclass; } BITSTRING_template& MultislotCap__EGPRS__BSSGP_template::egprsextendeddynalloccap() { set_specific(); return single_value->field_egprsextendeddynalloccap; } const BITSTRING_template& MultislotCap__EGPRS__BSSGP_template::egprsextendeddynalloccap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field egprsextendeddynalloccap of a non-specific template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); return single_value->field_egprsextendeddynalloccap; } int MultislotCap__EGPRS__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP 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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP 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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); } return 0; } void MultislotCap__EGPRS__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ egprsmultislotclass := "); single_value->field_egprsmultislotclass.log(); TTCN_Logger::log_event_str(", egprsextendeddynalloccap := "); single_value->field_egprsextendeddynalloccap.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 MultislotCap__EGPRS__BSSGP_template::log_match(const MultislotCap__EGPRS__BSSGP& 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_egprsmultislotclass.match(match_value.egprsmultislotclass(), legacy)){ TTCN_Logger::log_logmatch_info(".egprsmultislotclass"); single_value->field_egprsmultislotclass.log_match(match_value.egprsmultislotclass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_egprsextendeddynalloccap.match(match_value.egprsextendeddynalloccap(), legacy)){ TTCN_Logger::log_logmatch_info(".egprsextendeddynalloccap"); single_value->field_egprsextendeddynalloccap.log_match(match_value.egprsextendeddynalloccap(), 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("{ egprsmultislotclass := "); single_value->field_egprsmultislotclass.log_match(match_value.egprsmultislotclass(), legacy); TTCN_Logger::log_event_str(", egprsextendeddynalloccap := "); single_value->field_egprsextendeddynalloccap.log_match(match_value.egprsextendeddynalloccap(), 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 MultislotCap__EGPRS__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_egprsmultislotclass.encode_text(text_buf); single_value->field_egprsextendeddynalloccap.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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); } } void MultislotCap__EGPRS__BSSGP_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_egprsmultislotclass.decode_text(text_buf); single_value->field_egprsextendeddynalloccap.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 MultislotCap__EGPRS__BSSGP_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 @BSSGP_Types.MultislotCap_EGPRS_BSSGP."); } } void MultislotCap__EGPRS__BSSGP_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: { MultislotCap__EGPRS__BSSGP_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) egprsmultislotclass().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) egprsextendeddynalloccap().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(), "egprsmultislotclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { egprsmultislotclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "egprsextendeddynalloccap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { egprsextendeddynalloccap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_EGPRS_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MultislotCap__EGPRS__BSSGP_template* precondition = new MultislotCap__EGPRS__BSSGP_template; precondition->set_param(*param.get_elem(0)); MultislotCap__EGPRS__BSSGP_template* implied_template = new MultislotCap__EGPRS__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MultislotCap__EGPRS__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MultislotCap_EGPRS_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MultislotCap__EGPRS__BSSGP_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_egprsmultislotclass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_EGPRS_BSSGP"); single_value->field_egprsextendeddynalloccap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_EGPRS_BSSGP"); 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 : "@BSSGP_Types.MultislotCap_EGPRS_BSSGP"); } boolean MultislotCap__EGPRS__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MultislotCap__EGPRS__BSSGP_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_dTM__EGPRSMultiSlot) : field_dtmgprsmultislotsubclass(par_dtmgprsmultislotsubclass), field_singleSlotDTM(par_singleSlotDTM), field_presenceBitDTM__EGPRSMultiSlot(par_presenceBitDTM__EGPRSMultiSlot), field_dTM__EGPRSMultiSlot(par_dTM__EGPRSMultiSlot) { } MultislotCap__dtmgprsmultislotsubclass__BSSGP::MultislotCap__dtmgprsmultislotsubclass__BSSGP(const MultislotCap__dtmgprsmultislotsubclass__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); if (other_value.dtmgprsmultislotsubclass().is_bound()) field_dtmgprsmultislotsubclass = other_value.dtmgprsmultislotsubclass(); else field_dtmgprsmultislotsubclass.clean_up(); if (other_value.singleSlotDTM().is_bound()) field_singleSlotDTM = other_value.singleSlotDTM(); else field_singleSlotDTM.clean_up(); if (other_value.presenceBitDTM__EGPRSMultiSlot().is_bound()) field_presenceBitDTM__EGPRSMultiSlot = other_value.presenceBitDTM__EGPRSMultiSlot(); else field_presenceBitDTM__EGPRSMultiSlot.clean_up(); if (other_value.dTM__EGPRSMultiSlot().is_bound()) field_dTM__EGPRSMultiSlot = other_value.dTM__EGPRSMultiSlot(); else field_dTM__EGPRSMultiSlot.clean_up(); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP::clean_up() { field_dtmgprsmultislotsubclass.clean_up(); field_singleSlotDTM.clean_up(); field_presenceBitDTM__EGPRSMultiSlot.clean_up(); field_dTM__EGPRSMultiSlot.clean_up(); } const TTCN_Typedescriptor_t* MultislotCap__dtmgprsmultislotsubclass__BSSGP::get_descriptor() const { return &MultislotCap__dtmgprsmultislotsubclass__BSSGP_descr_; } MultislotCap__dtmgprsmultislotsubclass__BSSGP& MultislotCap__dtmgprsmultislotsubclass__BSSGP::operator=(const MultislotCap__dtmgprsmultislotsubclass__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); if (other_value.dtmgprsmultislotsubclass().is_bound()) field_dtmgprsmultislotsubclass = other_value.dtmgprsmultislotsubclass(); else field_dtmgprsmultislotsubclass.clean_up(); if (other_value.singleSlotDTM().is_bound()) field_singleSlotDTM = other_value.singleSlotDTM(); else field_singleSlotDTM.clean_up(); if (other_value.presenceBitDTM__EGPRSMultiSlot().is_bound()) field_presenceBitDTM__EGPRSMultiSlot = other_value.presenceBitDTM__EGPRSMultiSlot(); else field_presenceBitDTM__EGPRSMultiSlot.clean_up(); if (other_value.dTM__EGPRSMultiSlot().is_bound()) field_dTM__EGPRSMultiSlot = other_value.dTM__EGPRSMultiSlot(); else field_dTM__EGPRSMultiSlot.clean_up(); } return *this; } boolean MultislotCap__dtmgprsmultislotsubclass__BSSGP::operator==(const MultislotCap__dtmgprsmultislotsubclass__BSSGP& other_value) const { return field_dtmgprsmultislotsubclass==other_value.field_dtmgprsmultislotsubclass && field_singleSlotDTM==other_value.field_singleSlotDTM && field_presenceBitDTM__EGPRSMultiSlot==other_value.field_presenceBitDTM__EGPRSMultiSlot && field_dTM__EGPRSMultiSlot==other_value.field_dTM__EGPRSMultiSlot; } boolean MultislotCap__dtmgprsmultislotsubclass__BSSGP::is_bound() const { return (field_dtmgprsmultislotsubclass.is_bound()) || (field_singleSlotDTM.is_bound()) || (field_presenceBitDTM__EGPRSMultiSlot.is_bound()) || (OPTIONAL_OMIT == field_dTM__EGPRSMultiSlot.get_selection() || field_dTM__EGPRSMultiSlot.is_bound()); } boolean MultislotCap__dtmgprsmultislotsubclass__BSSGP::is_value() const { return field_dtmgprsmultislotsubclass.is_value() && field_singleSlotDTM.is_value() && field_presenceBitDTM__EGPRSMultiSlot.is_value() && (OPTIONAL_OMIT == field_dTM__EGPRSMultiSlot.get_selection() || field_dTM__EGPRSMultiSlot.is_value()); } int MultislotCap__dtmgprsmultislotsubclass__BSSGP::size_of() const { int ret_val = 3; if (field_dTM__EGPRSMultiSlot.ispresent()) ret_val++; return ret_val; } void MultislotCap__dtmgprsmultislotsubclass__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ dtmgprsmultislotsubclass := "); field_dtmgprsmultislotsubclass.log(); TTCN_Logger::log_event_str(", singleSlotDTM := "); field_singleSlotDTM.log(); TTCN_Logger::log_event_str(", presenceBitDTM_EGPRSMultiSlot := "); field_presenceBitDTM__EGPRSMultiSlot.log(); TTCN_Logger::log_event_str(", dTM_EGPRSMultiSlot := "); field_dTM__EGPRSMultiSlot.log(); TTCN_Logger::log_event_str(" }"); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP::set_implicit_omit() { if (dtmgprsmultislotsubclass().is_bound()) dtmgprsmultislotsubclass().set_implicit_omit(); if (singleSlotDTM().is_bound()) singleSlotDTM().set_implicit_omit(); if (presenceBitDTM__EGPRSMultiSlot().is_bound()) presenceBitDTM__EGPRSMultiSlot().set_implicit_omit(); if (!dTM__EGPRSMultiSlot().is_bound()) dTM__EGPRSMultiSlot() = OMIT_VALUE; else dTM__EGPRSMultiSlot().set_implicit_omit(); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP::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) dtmgprsmultislotsubclass().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) singleSlotDTM().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTM__EGPRSMultiSlot().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dTM__EGPRSMultiSlot().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(), "dtmgprsmultislotsubclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dtmgprsmultislotsubclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "singleSlotDTM")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { singleSlotDTM().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDTM_EGPRSMultiSlot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDTM__EGPRSMultiSlot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dTM_EGPRSMultiSlot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTM__EGPRSMultiSlot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP"); } } void MultislotCap__dtmgprsmultislotsubclass__BSSGP::encode_text(Text_Buf& text_buf) const { field_dtmgprsmultislotsubclass.encode_text(text_buf); field_singleSlotDTM.encode_text(text_buf); field_presenceBitDTM__EGPRSMultiSlot.encode_text(text_buf); field_dTM__EGPRSMultiSlot.encode_text(text_buf); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP::decode_text(Text_Buf& text_buf) { field_dtmgprsmultislotsubclass.decode_text(text_buf); field_singleSlotDTM.decode_text(text_buf); field_presenceBitDTM__EGPRSMultiSlot.decode_text(text_buf); field_dTM__EGPRSMultiSlot.decode_text(text_buf); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MultislotCap__dtmgprsmultislotsubclass__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, MultislotCap__dtmgprsmultislotsubclass__BSSGP_dtmgprsmultislotsubclass_descr_.raw->forceomit); decoded_field_length = field_dtmgprsmultislotsubclass.RAW_decode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_dtmgprsmultislotsubclass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MultislotCap__dtmgprsmultislotsubclass__BSSGP_singleSlotDTM_descr_.raw->forceomit); decoded_field_length = field_singleSlotDTM.RAW_decode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_singleSlotDTM_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, MultislotCap__dtmgprsmultislotsubclass__BSSGP_presenceBitDTM__EGPRSMultiSlot_descr_.raw->forceomit); decoded_field_length = field_presenceBitDTM__EGPRSMultiSlot.RAW_decode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_presenceBitDTM__EGPRSMultiSlot_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitDTM__EGPRSMultiSlot == bs_0){ if (force_omit != NULL && (*force_omit)(3)) { field_dTM__EGPRSMultiSlot = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_3_force_omit(3, force_omit, MultislotCap__dtmgprsmultislotsubclass__BSSGP_dTM__EGPRSMultiSlot_descr_.raw->forceomit); decoded_field_length = field_dTM__EGPRSMultiSlot().RAW_decode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_dTM__EGPRSMultiSlot_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 1) { field_dTM__EGPRSMultiSlot = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_dTM__EGPRSMultiSlot=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MultislotCap__dtmgprsmultislotsubclass__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MultislotCap__dtmgprsmultislotsubclass__BSSGP_dtmgprsmultislotsubclass_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MultislotCap__dtmgprsmultislotsubclass__BSSGP_singleSlotDTM_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MultislotCap__dtmgprsmultislotsubclass__BSSGP_presenceBitDTM__EGPRSMultiSlot_descr_.raw); if (field_dTM__EGPRSMultiSlot.ispresent()) { myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MultislotCap__dtmgprsmultislotsubclass__BSSGP_dTM__EGPRSMultiSlot_descr_.raw); } else myleaf.body.node.nodes[3] = NULL; encoded_length += field_dtmgprsmultislotsubclass.RAW_encode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_dtmgprsmultislotsubclass_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_singleSlotDTM.RAW_encode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_singleSlotDTM_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_presenceBitDTM__EGPRSMultiSlot.RAW_encode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_presenceBitDTM__EGPRSMultiSlot_descr_, *myleaf.body.node.nodes[2]); if (field_dTM__EGPRSMultiSlot.ispresent()) { encoded_length += field_dTM__EGPRSMultiSlot().RAW_encode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_dTM__EGPRSMultiSlot_descr_, *myleaf.body.node.nodes[3]); } if (field_dTM__EGPRSMultiSlot.ispresent() && (field_presenceBitDTM__EGPRSMultiSlot != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={2}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(MultislotCap__dtmgprsmultislotsubclass__BSSGP_presenceBitDTM__EGPRSMultiSlot_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::single_value_struct { BITSTRING_template field_dtmgprsmultislotsubclass; BITSTRING_template field_singleSlotDTM; BITSTRING_template field_presenceBitDTM__EGPRSMultiSlot; BITSTRING_template field_dTM__EGPRSMultiSlot; }; void MultislotCap__dtmgprsmultislotsubclass__BSSGP_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_dtmgprsmultislotsubclass = ANY_VALUE; single_value->field_singleSlotDTM = ANY_VALUE; single_value->field_presenceBitDTM__EGPRSMultiSlot = ANY_VALUE; single_value->field_dTM__EGPRSMultiSlot = ANY_OR_OMIT; } } } void MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::copy_value(const MultislotCap__dtmgprsmultislotsubclass__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.dtmgprsmultislotsubclass().is_bound()) { single_value->field_dtmgprsmultislotsubclass = other_value.dtmgprsmultislotsubclass(); } else { single_value->field_dtmgprsmultislotsubclass.clean_up(); } if (other_value.singleSlotDTM().is_bound()) { single_value->field_singleSlotDTM = other_value.singleSlotDTM(); } else { single_value->field_singleSlotDTM.clean_up(); } if (other_value.presenceBitDTM__EGPRSMultiSlot().is_bound()) { single_value->field_presenceBitDTM__EGPRSMultiSlot = other_value.presenceBitDTM__EGPRSMultiSlot(); } else { single_value->field_presenceBitDTM__EGPRSMultiSlot.clean_up(); } if (other_value.dTM__EGPRSMultiSlot().is_bound()) { if (other_value.dTM__EGPRSMultiSlot().ispresent()) single_value->field_dTM__EGPRSMultiSlot = other_value.dTM__EGPRSMultiSlot()(); else single_value->field_dTM__EGPRSMultiSlot = OMIT_VALUE; } else { single_value->field_dTM__EGPRSMultiSlot.clean_up(); } set_selection(SPECIFIC_VALUE); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::copy_template(const MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.dtmgprsmultislotsubclass().get_selection()) { single_value->field_dtmgprsmultislotsubclass = other_value.dtmgprsmultislotsubclass(); } else { single_value->field_dtmgprsmultislotsubclass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.singleSlotDTM().get_selection()) { single_value->field_singleSlotDTM = other_value.singleSlotDTM(); } else { single_value->field_singleSlotDTM.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDTM__EGPRSMultiSlot().get_selection()) { single_value->field_presenceBitDTM__EGPRSMultiSlot = other_value.presenceBitDTM__EGPRSMultiSlot(); } else { single_value->field_presenceBitDTM__EGPRSMultiSlot.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dTM__EGPRSMultiSlot().get_selection()) { single_value->field_dTM__EGPRSMultiSlot = other_value.dTM__EGPRSMultiSlot(); } else { single_value->field_dTM__EGPRSMultiSlot.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 MultislotCap__dtmgprsmultislotsubclass__BSSGP_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 MultislotCap__dtmgprsmultislotsubclass__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MultislotCap__dtmgprsmultislotsubclass__BSSGP_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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); break; } set_selection(other_value); } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::MultislotCap__dtmgprsmultislotsubclass__BSSGP_template() { } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::MultislotCap__dtmgprsmultislotsubclass__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::MultislotCap__dtmgprsmultislotsubclass__BSSGP_template(const MultislotCap__dtmgprsmultislotsubclass__BSSGP& other_value) { copy_value(other_value); } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::MultislotCap__dtmgprsmultislotsubclass__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__dtmgprsmultislotsubclass__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP from an unbound optional field."); } } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::MultislotCap__dtmgprsmultislotsubclass__BSSGP_template(MultislotCap__dtmgprsmultislotsubclass__BSSGP_template* p_precondition, MultislotCap__dtmgprsmultislotsubclass__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::MultislotCap__dtmgprsmultislotsubclass__BSSGP_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; } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::MultislotCap__dtmgprsmultislotsubclass__BSSGP_template(const MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::~MultislotCap__dtmgprsmultislotsubclass__BSSGP_template() { clean_up(); } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::operator=(const MultislotCap__dtmgprsmultislotsubclass__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MultislotCap__dtmgprsmultislotsubclass__BSSGP&)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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); } return *this; } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::operator=(const MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::match(const MultislotCap__dtmgprsmultislotsubclass__BSSGP& 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.dtmgprsmultislotsubclass().is_bound()) return FALSE; if(!single_value->field_dtmgprsmultislotsubclass.match(other_value.dtmgprsmultislotsubclass(), legacy))return FALSE; if(!other_value.singleSlotDTM().is_bound()) return FALSE; if(!single_value->field_singleSlotDTM.match(other_value.singleSlotDTM(), legacy))return FALSE; if(!other_value.presenceBitDTM__EGPRSMultiSlot().is_bound()) return FALSE; if(!single_value->field_presenceBitDTM__EGPRSMultiSlot.match(other_value.presenceBitDTM__EGPRSMultiSlot(), legacy))return FALSE; if(!other_value.dTM__EGPRSMultiSlot().is_bound()) return FALSE; if((other_value.dTM__EGPRSMultiSlot().ispresent() ? !single_value->field_dTM__EGPRSMultiSlot.match((const BITSTRING&)other_value.dTM__EGPRSMultiSlot(), legacy) : !single_value->field_dTM__EGPRSMultiSlot.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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); } return FALSE; } boolean MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_dtmgprsmultislotsubclass.is_bound() || single_value->field_singleSlotDTM.is_bound() || single_value->field_presenceBitDTM__EGPRSMultiSlot.is_bound() || (single_value->field_dTM__EGPRSMultiSlot.is_omit() || single_value->field_dTM__EGPRSMultiSlot.is_bound()); } boolean MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_dtmgprsmultislotsubclass.is_value() && single_value->field_singleSlotDTM.is_value() && single_value->field_presenceBitDTM__EGPRSMultiSlot.is_value() && (single_value->field_dTM__EGPRSMultiSlot.is_omit() || single_value->field_dTM__EGPRSMultiSlot.is_value()); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP_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; } MultislotCap__dtmgprsmultislotsubclass__BSSGP MultislotCap__dtmgprsmultislotsubclass__BSSGP_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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); MultislotCap__dtmgprsmultislotsubclass__BSSGP ret_val; if (single_value->field_dtmgprsmultislotsubclass.is_bound()) { ret_val.dtmgprsmultislotsubclass() = single_value->field_dtmgprsmultislotsubclass.valueof(); } if (single_value->field_singleSlotDTM.is_bound()) { ret_val.singleSlotDTM() = single_value->field_singleSlotDTM.valueof(); } if (single_value->field_presenceBitDTM__EGPRSMultiSlot.is_bound()) { ret_val.presenceBitDTM__EGPRSMultiSlot() = single_value->field_presenceBitDTM__EGPRSMultiSlot.valueof(); } if (single_value->field_dTM__EGPRSMultiSlot.is_omit()) ret_val.dTM__EGPRSMultiSlot() = OMIT_VALUE; else if (single_value->field_dTM__EGPRSMultiSlot.is_bound()) { ret_val.dTM__EGPRSMultiSlot() = single_value->field_dTM__EGPRSMultiSlot.valueof(); } return ret_val; } void MultislotCap__dtmgprsmultislotsubclass__BSSGP_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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MultislotCap__dtmgprsmultislotsubclass__BSSGP_template[list_length]; } MultislotCap__dtmgprsmultislotsubclass__BSSGP_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::dtmgprsmultislotsubclass() { set_specific(); return single_value->field_dtmgprsmultislotsubclass; } const BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::dtmgprsmultislotsubclass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dtmgprsmultislotsubclass of a non-specific template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); return single_value->field_dtmgprsmultislotsubclass; } BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::singleSlotDTM() { set_specific(); return single_value->field_singleSlotDTM; } const BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::singleSlotDTM() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field singleSlotDTM of a non-specific template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); return single_value->field_singleSlotDTM; } BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::presenceBitDTM__EGPRSMultiSlot() { set_specific(); return single_value->field_presenceBitDTM__EGPRSMultiSlot; } const BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::presenceBitDTM__EGPRSMultiSlot() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitDTM_EGPRSMultiSlot of a non-specific template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); return single_value->field_presenceBitDTM__EGPRSMultiSlot; } BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::dTM__EGPRSMultiSlot() { set_specific(); return single_value->field_dTM__EGPRSMultiSlot; } const BITSTRING_template& MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::dTM__EGPRSMultiSlot() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTM_EGPRSMultiSlot of a non-specific template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); return single_value->field_dTM__EGPRSMultiSlot; } int MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 3; if (single_value->field_dTM__EGPRSMultiSlot.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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP 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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); } return 0; } void MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ dtmgprsmultislotsubclass := "); single_value->field_dtmgprsmultislotsubclass.log(); TTCN_Logger::log_event_str(", singleSlotDTM := "); single_value->field_singleSlotDTM.log(); TTCN_Logger::log_event_str(", presenceBitDTM_EGPRSMultiSlot := "); single_value->field_presenceBitDTM__EGPRSMultiSlot.log(); TTCN_Logger::log_event_str(", dTM_EGPRSMultiSlot := "); single_value->field_dTM__EGPRSMultiSlot.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 MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::log_match(const MultislotCap__dtmgprsmultislotsubclass__BSSGP& 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_dtmgprsmultislotsubclass.match(match_value.dtmgprsmultislotsubclass(), legacy)){ TTCN_Logger::log_logmatch_info(".dtmgprsmultislotsubclass"); single_value->field_dtmgprsmultislotsubclass.log_match(match_value.dtmgprsmultislotsubclass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_singleSlotDTM.match(match_value.singleSlotDTM(), legacy)){ TTCN_Logger::log_logmatch_info(".singleSlotDTM"); single_value->field_singleSlotDTM.log_match(match_value.singleSlotDTM(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitDTM__EGPRSMultiSlot.match(match_value.presenceBitDTM__EGPRSMultiSlot(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitDTM_EGPRSMultiSlot"); single_value->field_presenceBitDTM__EGPRSMultiSlot.log_match(match_value.presenceBitDTM__EGPRSMultiSlot(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.dTM__EGPRSMultiSlot().ispresent()){ if(!single_value->field_dTM__EGPRSMultiSlot.match(match_value.dTM__EGPRSMultiSlot(), legacy)){ TTCN_Logger::log_logmatch_info(".dTM_EGPRSMultiSlot"); single_value->field_dTM__EGPRSMultiSlot.log_match(match_value.dTM__EGPRSMultiSlot(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_dTM__EGPRSMultiSlot.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".dTM_EGPRSMultiSlot := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_dTM__EGPRSMultiSlot.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("{ dtmgprsmultislotsubclass := "); single_value->field_dtmgprsmultislotsubclass.log_match(match_value.dtmgprsmultislotsubclass(), legacy); TTCN_Logger::log_event_str(", singleSlotDTM := "); single_value->field_singleSlotDTM.log_match(match_value.singleSlotDTM(), legacy); TTCN_Logger::log_event_str(", presenceBitDTM_EGPRSMultiSlot := "); single_value->field_presenceBitDTM__EGPRSMultiSlot.log_match(match_value.presenceBitDTM__EGPRSMultiSlot(), legacy); TTCN_Logger::log_event_str(", dTM_EGPRSMultiSlot := "); if (match_value.dTM__EGPRSMultiSlot().ispresent()) { single_value->field_dTM__EGPRSMultiSlot.log_match(match_value.dTM__EGPRSMultiSlot(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_dTM__EGPRSMultiSlot.log(); if (single_value->field_dTM__EGPRSMultiSlot.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 MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_dtmgprsmultislotsubclass.encode_text(text_buf); single_value->field_singleSlotDTM.encode_text(text_buf); single_value->field_presenceBitDTM__EGPRSMultiSlot.encode_text(text_buf); single_value->field_dTM__EGPRSMultiSlot.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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); } } void MultislotCap__dtmgprsmultislotsubclass__BSSGP_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_dtmgprsmultislotsubclass.decode_text(text_buf); single_value->field_singleSlotDTM.decode_text(text_buf); single_value->field_presenceBitDTM__EGPRSMultiSlot.decode_text(text_buf); single_value->field_dTM__EGPRSMultiSlot.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 MultislotCap__dtmgprsmultislotsubclass__BSSGP_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 @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP."); } } void MultislotCap__dtmgprsmultislotsubclass__BSSGP_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: { MultislotCap__dtmgprsmultislotsubclass__BSSGP_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) dtmgprsmultislotsubclass().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) singleSlotDTM().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTM__EGPRSMultiSlot().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dTM__EGPRSMultiSlot().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(), "dtmgprsmultislotsubclass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dtmgprsmultislotsubclass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "singleSlotDTM")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { singleSlotDTM().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDTM_EGPRSMultiSlot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDTM__EGPRSMultiSlot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dTM_EGPRSMultiSlot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTM__EGPRSMultiSlot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MultislotCap__dtmgprsmultislotsubclass__BSSGP_template* precondition = new MultislotCap__dtmgprsmultislotsubclass__BSSGP_template; precondition->set_param(*param.get_elem(0)); MultislotCap__dtmgprsmultislotsubclass__BSSGP_template* implied_template = new MultislotCap__dtmgprsmultislotsubclass__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MultislotCap__dtmgprsmultislotsubclass__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MultislotCap__dtmgprsmultislotsubclass__BSSGP_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_dtmgprsmultislotsubclass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP"); single_value->field_singleSlotDTM.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP"); single_value->field_presenceBitDTM__EGPRSMultiSlot.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP"); single_value->field_dTM__EGPRSMultiSlot.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP"); 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 : "@BSSGP_Types.MultislotCap_dtmgprsmultislotsubclass_BSSGP"); } boolean MultislotCap__dtmgprsmultislotsubclass__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MultislotCap__dtmgprsmultislotsubclass__BSSGP_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_pskpowercap, const BITSTRING& par_compactIntMeasurCap, const BITSTRING& par_revisionLevelInd, const BITSTRING& par_umtsfddRadAccTechCap, const BITSTRING& par_umtstddRadAccTechCap, const BITSTRING& par_cdma2kRadAccTechCap) : field_presenceBitPskpow(par_presenceBitPskpow), field_pskpowercap(par_pskpowercap), field_compactIntMeasurCap(par_compactIntMeasurCap), field_revisionLevelInd(par_revisionLevelInd), field_umtsfddRadAccTechCap(par_umtsfddRadAccTechCap), field_umtstddRadAccTechCap(par_umtstddRadAccTechCap), field_cdma2kRadAccTechCap(par_cdma2kRadAccTechCap) { } AccessCapAdditionsRel99__BSSGP::AccessCapAdditionsRel99__BSSGP(const AccessCapAdditionsRel99__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); if (other_value.presenceBitPskpow().is_bound()) field_presenceBitPskpow = other_value.presenceBitPskpow(); else field_presenceBitPskpow.clean_up(); if (other_value.pskpowercap().is_bound()) field_pskpowercap = other_value.pskpowercap(); else field_pskpowercap.clean_up(); if (other_value.compactIntMeasurCap().is_bound()) field_compactIntMeasurCap = other_value.compactIntMeasurCap(); else field_compactIntMeasurCap.clean_up(); if (other_value.revisionLevelInd().is_bound()) field_revisionLevelInd = other_value.revisionLevelInd(); else field_revisionLevelInd.clean_up(); if (other_value.umtsfddRadAccTechCap().is_bound()) field_umtsfddRadAccTechCap = other_value.umtsfddRadAccTechCap(); else field_umtsfddRadAccTechCap.clean_up(); if (other_value.umtstddRadAccTechCap().is_bound()) field_umtstddRadAccTechCap = other_value.umtstddRadAccTechCap(); else field_umtstddRadAccTechCap.clean_up(); if (other_value.cdma2kRadAccTechCap().is_bound()) field_cdma2kRadAccTechCap = other_value.cdma2kRadAccTechCap(); else field_cdma2kRadAccTechCap.clean_up(); } void AccessCapAdditionsRel99__BSSGP::clean_up() { field_presenceBitPskpow.clean_up(); field_pskpowercap.clean_up(); field_compactIntMeasurCap.clean_up(); field_revisionLevelInd.clean_up(); field_umtsfddRadAccTechCap.clean_up(); field_umtstddRadAccTechCap.clean_up(); field_cdma2kRadAccTechCap.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsRel99__BSSGP::get_descriptor() const { return &AccessCapAdditionsRel99__BSSGP_descr_; } AccessCapAdditionsRel99__BSSGP& AccessCapAdditionsRel99__BSSGP::operator=(const AccessCapAdditionsRel99__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); if (other_value.presenceBitPskpow().is_bound()) field_presenceBitPskpow = other_value.presenceBitPskpow(); else field_presenceBitPskpow.clean_up(); if (other_value.pskpowercap().is_bound()) field_pskpowercap = other_value.pskpowercap(); else field_pskpowercap.clean_up(); if (other_value.compactIntMeasurCap().is_bound()) field_compactIntMeasurCap = other_value.compactIntMeasurCap(); else field_compactIntMeasurCap.clean_up(); if (other_value.revisionLevelInd().is_bound()) field_revisionLevelInd = other_value.revisionLevelInd(); else field_revisionLevelInd.clean_up(); if (other_value.umtsfddRadAccTechCap().is_bound()) field_umtsfddRadAccTechCap = other_value.umtsfddRadAccTechCap(); else field_umtsfddRadAccTechCap.clean_up(); if (other_value.umtstddRadAccTechCap().is_bound()) field_umtstddRadAccTechCap = other_value.umtstddRadAccTechCap(); else field_umtstddRadAccTechCap.clean_up(); if (other_value.cdma2kRadAccTechCap().is_bound()) field_cdma2kRadAccTechCap = other_value.cdma2kRadAccTechCap(); else field_cdma2kRadAccTechCap.clean_up(); } return *this; } boolean AccessCapAdditionsRel99__BSSGP::operator==(const AccessCapAdditionsRel99__BSSGP& other_value) const { return field_presenceBitPskpow==other_value.field_presenceBitPskpow && field_pskpowercap==other_value.field_pskpowercap && field_compactIntMeasurCap==other_value.field_compactIntMeasurCap && field_revisionLevelInd==other_value.field_revisionLevelInd && field_umtsfddRadAccTechCap==other_value.field_umtsfddRadAccTechCap && field_umtstddRadAccTechCap==other_value.field_umtstddRadAccTechCap && field_cdma2kRadAccTechCap==other_value.field_cdma2kRadAccTechCap; } boolean AccessCapAdditionsRel99__BSSGP::is_bound() const { return (field_presenceBitPskpow.is_bound()) || (OPTIONAL_OMIT == field_pskpowercap.get_selection() || field_pskpowercap.is_bound()) || (field_compactIntMeasurCap.is_bound()) || (field_revisionLevelInd.is_bound()) || (field_umtsfddRadAccTechCap.is_bound()) || (field_umtstddRadAccTechCap.is_bound()) || (field_cdma2kRadAccTechCap.is_bound()); } boolean AccessCapAdditionsRel99__BSSGP::is_value() const { return field_presenceBitPskpow.is_value() && (OPTIONAL_OMIT == field_pskpowercap.get_selection() || field_pskpowercap.is_value()) && field_compactIntMeasurCap.is_value() && field_revisionLevelInd.is_value() && field_umtsfddRadAccTechCap.is_value() && field_umtstddRadAccTechCap.is_value() && field_cdma2kRadAccTechCap.is_value(); } int AccessCapAdditionsRel99__BSSGP::size_of() const { int ret_val = 6; if (field_pskpowercap.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsRel99__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ presenceBitPskpow := "); field_presenceBitPskpow.log(); TTCN_Logger::log_event_str(", pskpowercap := "); field_pskpowercap.log(); TTCN_Logger::log_event_str(", compactIntMeasurCap := "); field_compactIntMeasurCap.log(); TTCN_Logger::log_event_str(", revisionLevelInd := "); field_revisionLevelInd.log(); TTCN_Logger::log_event_str(", umtsfddRadAccTechCap := "); field_umtsfddRadAccTechCap.log(); TTCN_Logger::log_event_str(", umtstddRadAccTechCap := "); field_umtstddRadAccTechCap.log(); TTCN_Logger::log_event_str(", cdma2kRadAccTechCap := "); field_cdma2kRadAccTechCap.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsRel99__BSSGP::set_implicit_omit() { if (presenceBitPskpow().is_bound()) presenceBitPskpow().set_implicit_omit(); if (!pskpowercap().is_bound()) pskpowercap() = OMIT_VALUE; else pskpowercap().set_implicit_omit(); if (compactIntMeasurCap().is_bound()) compactIntMeasurCap().set_implicit_omit(); if (revisionLevelInd().is_bound()) revisionLevelInd().set_implicit_omit(); if (umtsfddRadAccTechCap().is_bound()) umtsfddRadAccTechCap().set_implicit_omit(); if (umtstddRadAccTechCap().is_bound()) umtstddRadAccTechCap().set_implicit_omit(); if (cdma2kRadAccTechCap().is_bound()) cdma2kRadAccTechCap().set_implicit_omit(); } void AccessCapAdditionsRel99__BSSGP::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 (70 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) presenceBitPskpow().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pskpowercap().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) compactIntMeasurCap().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) revisionLevelInd().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) umtsfddRadAccTechCap().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) umtstddRadAccTechCap().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cdma2kRadAccTechCap().set_param(*param.get_elem(6)); 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(), "presenceBitPskpow")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitPskpow().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pskpowercap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pskpowercap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "compactIntMeasurCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { compactIntMeasurCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "revisionLevelInd")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { revisionLevelInd().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "umtsfddRadAccTechCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { umtsfddRadAccTechCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "umtstddRadAccTechCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { umtstddRadAccTechCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cdma2kRadAccTechCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cdma2kRadAccTechCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); } } void AccessCapAdditionsRel99__BSSGP::encode_text(Text_Buf& text_buf) const { field_presenceBitPskpow.encode_text(text_buf); field_pskpowercap.encode_text(text_buf); field_compactIntMeasurCap.encode_text(text_buf); field_revisionLevelInd.encode_text(text_buf); field_umtsfddRadAccTechCap.encode_text(text_buf); field_umtstddRadAccTechCap.encode_text(text_buf); field_cdma2kRadAccTechCap.encode_text(text_buf); } void AccessCapAdditionsRel99__BSSGP::decode_text(Text_Buf& text_buf) { field_presenceBitPskpow.decode_text(text_buf); field_pskpowercap.decode_text(text_buf); field_compactIntMeasurCap.decode_text(text_buf); field_revisionLevelInd.decode_text(text_buf); field_umtsfddRadAccTechCap.decode_text(text_buf); field_umtstddRadAccTechCap.decode_text(text_buf); field_cdma2kRadAccTechCap.decode_text(text_buf); } void AccessCapAdditionsRel99__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel99__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel99__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel99__BSSGP_presenceBitPskpow_descr_.raw->forceomit); decoded_field_length = field_presenceBitPskpow.RAW_decode(AccessCapAdditionsRel99__BSSGP_presenceBitPskpow_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitPskpow == bs_0){ if (force_omit != NULL && (*force_omit)(1)) { field_pskpowercap = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel99__BSSGP_pskpowercap_descr_.raw->forceomit); decoded_field_length = field_pskpowercap().RAW_decode(AccessCapAdditionsRel99__BSSGP_pskpowercap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_pskpowercap = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_pskpowercap=OMIT_VALUE; RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel99__BSSGP_compactIntMeasurCap_descr_.raw->forceomit); decoded_field_length = field_compactIntMeasurCap.RAW_decode(AccessCapAdditionsRel99__BSSGP_compactIntMeasurCap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel99__BSSGP_revisionLevelInd_descr_.raw->forceomit); decoded_field_length = field_revisionLevelInd.RAW_decode(AccessCapAdditionsRel99__BSSGP_revisionLevelInd_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel99__BSSGP_umtsfddRadAccTechCap_descr_.raw->forceomit); decoded_field_length = field_umtsfddRadAccTechCap.RAW_decode(AccessCapAdditionsRel99__BSSGP_umtsfddRadAccTechCap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapAdditionsRel99__BSSGP_umtstddRadAccTechCap_descr_.raw->forceomit); decoded_field_length = field_umtstddRadAccTechCap.RAW_decode(AccessCapAdditionsRel99__BSSGP_umtstddRadAccTechCap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_6_force_omit(6, force_omit, AccessCapAdditionsRel99__BSSGP_cdma2kRadAccTechCap_descr_.raw->forceomit); decoded_field_length = field_cdma2kRadAccTechCap.RAW_decode(AccessCapAdditionsRel99__BSSGP_cdma2kRadAccTechCap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel99__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 7; myleaf.body.node.nodes = init_nodes_of_enc_tree(7); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel99__BSSGP_presenceBitPskpow_descr_.raw); if (field_pskpowercap.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel99__BSSGP_pskpowercap_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel99__BSSGP_compactIntMeasurCap_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel99__BSSGP_revisionLevelInd_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel99__BSSGP_umtsfddRadAccTechCap_descr_.raw); myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel99__BSSGP_umtstddRadAccTechCap_descr_.raw); myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapAdditionsRel99__BSSGP_cdma2kRadAccTechCap_descr_.raw); encoded_length += field_presenceBitPskpow.RAW_encode(AccessCapAdditionsRel99__BSSGP_presenceBitPskpow_descr_, *myleaf.body.node.nodes[0]); if (field_pskpowercap.ispresent()) { encoded_length += field_pskpowercap().RAW_encode(AccessCapAdditionsRel99__BSSGP_pskpowercap_descr_, *myleaf.body.node.nodes[1]); } encoded_length += field_compactIntMeasurCap.RAW_encode(AccessCapAdditionsRel99__BSSGP_compactIntMeasurCap_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_revisionLevelInd.RAW_encode(AccessCapAdditionsRel99__BSSGP_revisionLevelInd_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_umtsfddRadAccTechCap.RAW_encode(AccessCapAdditionsRel99__BSSGP_umtsfddRadAccTechCap_descr_, *myleaf.body.node.nodes[4]); encoded_length += field_umtstddRadAccTechCap.RAW_encode(AccessCapAdditionsRel99__BSSGP_umtstddRadAccTechCap_descr_, *myleaf.body.node.nodes[5]); encoded_length += field_cdma2kRadAccTechCap.RAW_encode(AccessCapAdditionsRel99__BSSGP_cdma2kRadAccTechCap_descr_, *myleaf.body.node.nodes[6]); if (field_pskpowercap.ispresent() && (field_presenceBitPskpow != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapAdditionsRel99__BSSGP_presenceBitPskpow_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct AccessCapAdditionsRel99__BSSGP_template::single_value_struct { BITSTRING_template field_presenceBitPskpow; BITSTRING_template field_pskpowercap; BITSTRING_template field_compactIntMeasurCap; BITSTRING_template field_revisionLevelInd; BITSTRING_template field_umtsfddRadAccTechCap; BITSTRING_template field_umtstddRadAccTechCap; BITSTRING_template field_cdma2kRadAccTechCap; }; void AccessCapAdditionsRel99__BSSGP_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_presenceBitPskpow = ANY_VALUE; single_value->field_pskpowercap = ANY_OR_OMIT; single_value->field_compactIntMeasurCap = ANY_VALUE; single_value->field_revisionLevelInd = ANY_VALUE; single_value->field_umtsfddRadAccTechCap = ANY_VALUE; single_value->field_umtstddRadAccTechCap = ANY_VALUE; single_value->field_cdma2kRadAccTechCap = ANY_VALUE; } } } void AccessCapAdditionsRel99__BSSGP_template::copy_value(const AccessCapAdditionsRel99__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.presenceBitPskpow().is_bound()) { single_value->field_presenceBitPskpow = other_value.presenceBitPskpow(); } else { single_value->field_presenceBitPskpow.clean_up(); } if (other_value.pskpowercap().is_bound()) { if (other_value.pskpowercap().ispresent()) single_value->field_pskpowercap = other_value.pskpowercap()(); else single_value->field_pskpowercap = OMIT_VALUE; } else { single_value->field_pskpowercap.clean_up(); } if (other_value.compactIntMeasurCap().is_bound()) { single_value->field_compactIntMeasurCap = other_value.compactIntMeasurCap(); } else { single_value->field_compactIntMeasurCap.clean_up(); } if (other_value.revisionLevelInd().is_bound()) { single_value->field_revisionLevelInd = other_value.revisionLevelInd(); } else { single_value->field_revisionLevelInd.clean_up(); } if (other_value.umtsfddRadAccTechCap().is_bound()) { single_value->field_umtsfddRadAccTechCap = other_value.umtsfddRadAccTechCap(); } else { single_value->field_umtsfddRadAccTechCap.clean_up(); } if (other_value.umtstddRadAccTechCap().is_bound()) { single_value->field_umtstddRadAccTechCap = other_value.umtstddRadAccTechCap(); } else { single_value->field_umtstddRadAccTechCap.clean_up(); } if (other_value.cdma2kRadAccTechCap().is_bound()) { single_value->field_cdma2kRadAccTechCap = other_value.cdma2kRadAccTechCap(); } else { single_value->field_cdma2kRadAccTechCap.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel99__BSSGP_template::copy_template(const AccessCapAdditionsRel99__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.presenceBitPskpow().get_selection()) { single_value->field_presenceBitPskpow = other_value.presenceBitPskpow(); } else { single_value->field_presenceBitPskpow.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pskpowercap().get_selection()) { single_value->field_pskpowercap = other_value.pskpowercap(); } else { single_value->field_pskpowercap.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.compactIntMeasurCap().get_selection()) { single_value->field_compactIntMeasurCap = other_value.compactIntMeasurCap(); } else { single_value->field_compactIntMeasurCap.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.revisionLevelInd().get_selection()) { single_value->field_revisionLevelInd = other_value.revisionLevelInd(); } else { single_value->field_revisionLevelInd.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.umtsfddRadAccTechCap().get_selection()) { single_value->field_umtsfddRadAccTechCap = other_value.umtsfddRadAccTechCap(); } else { single_value->field_umtsfddRadAccTechCap.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.umtstddRadAccTechCap().get_selection()) { single_value->field_umtstddRadAccTechCap = other_value.umtstddRadAccTechCap(); } else { single_value->field_umtstddRadAccTechCap.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.cdma2kRadAccTechCap().get_selection()) { single_value->field_cdma2kRadAccTechCap = other_value.cdma2kRadAccTechCap(); } else { single_value->field_cdma2kRadAccTechCap.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 AccessCapAdditionsRel99__BSSGP_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 AccessCapAdditionsRel99__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel99__BSSGP_template::AccessCapAdditionsRel99__BSSGP_template() { } AccessCapAdditionsRel99__BSSGP_template::AccessCapAdditionsRel99__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel99__BSSGP_template::AccessCapAdditionsRel99__BSSGP_template(const AccessCapAdditionsRel99__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel99__BSSGP_template::AccessCapAdditionsRel99__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel99__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel99__BSSGP_template::AccessCapAdditionsRel99__BSSGP_template(AccessCapAdditionsRel99__BSSGP_template* p_precondition, AccessCapAdditionsRel99__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel99__BSSGP_template::AccessCapAdditionsRel99__BSSGP_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; } AccessCapAdditionsRel99__BSSGP_template::AccessCapAdditionsRel99__BSSGP_template(const AccessCapAdditionsRel99__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel99__BSSGP_template::~AccessCapAdditionsRel99__BSSGP_template() { clean_up(); } AccessCapAdditionsRel99__BSSGP_template& AccessCapAdditionsRel99__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel99__BSSGP_template& AccessCapAdditionsRel99__BSSGP_template::operator=(const AccessCapAdditionsRel99__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel99__BSSGP_template& AccessCapAdditionsRel99__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel99__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); } return *this; } AccessCapAdditionsRel99__BSSGP_template& AccessCapAdditionsRel99__BSSGP_template::operator=(const AccessCapAdditionsRel99__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel99__BSSGP_template::match(const AccessCapAdditionsRel99__BSSGP& 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.presenceBitPskpow().is_bound()) return FALSE; if(!single_value->field_presenceBitPskpow.match(other_value.presenceBitPskpow(), legacy))return FALSE; if(!other_value.pskpowercap().is_bound()) return FALSE; if((other_value.pskpowercap().ispresent() ? !single_value->field_pskpowercap.match((const BITSTRING&)other_value.pskpowercap(), legacy) : !single_value->field_pskpowercap.match_omit(legacy)))return FALSE; if(!other_value.compactIntMeasurCap().is_bound()) return FALSE; if(!single_value->field_compactIntMeasurCap.match(other_value.compactIntMeasurCap(), legacy))return FALSE; if(!other_value.revisionLevelInd().is_bound()) return FALSE; if(!single_value->field_revisionLevelInd.match(other_value.revisionLevelInd(), legacy))return FALSE; if(!other_value.umtsfddRadAccTechCap().is_bound()) return FALSE; if(!single_value->field_umtsfddRadAccTechCap.match(other_value.umtsfddRadAccTechCap(), legacy))return FALSE; if(!other_value.umtstddRadAccTechCap().is_bound()) return FALSE; if(!single_value->field_umtstddRadAccTechCap.match(other_value.umtstddRadAccTechCap(), legacy))return FALSE; if(!other_value.cdma2kRadAccTechCap().is_bound()) return FALSE; if(!single_value->field_cdma2kRadAccTechCap.match(other_value.cdma2kRadAccTechCap(), 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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel99__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_presenceBitPskpow.is_bound() || (single_value->field_pskpowercap.is_omit() || single_value->field_pskpowercap.is_bound()) || single_value->field_compactIntMeasurCap.is_bound() || single_value->field_revisionLevelInd.is_bound() || single_value->field_umtsfddRadAccTechCap.is_bound() || single_value->field_umtstddRadAccTechCap.is_bound() || single_value->field_cdma2kRadAccTechCap.is_bound(); } boolean AccessCapAdditionsRel99__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_presenceBitPskpow.is_value() && (single_value->field_pskpowercap.is_omit() || single_value->field_pskpowercap.is_value()) && single_value->field_compactIntMeasurCap.is_value() && single_value->field_revisionLevelInd.is_value() && single_value->field_umtsfddRadAccTechCap.is_value() && single_value->field_umtstddRadAccTechCap.is_value() && single_value->field_cdma2kRadAccTechCap.is_value(); } void AccessCapAdditionsRel99__BSSGP_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; } AccessCapAdditionsRel99__BSSGP AccessCapAdditionsRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); AccessCapAdditionsRel99__BSSGP ret_val; if (single_value->field_presenceBitPskpow.is_bound()) { ret_val.presenceBitPskpow() = single_value->field_presenceBitPskpow.valueof(); } if (single_value->field_pskpowercap.is_omit()) ret_val.pskpowercap() = OMIT_VALUE; else if (single_value->field_pskpowercap.is_bound()) { ret_val.pskpowercap() = single_value->field_pskpowercap.valueof(); } if (single_value->field_compactIntMeasurCap.is_bound()) { ret_val.compactIntMeasurCap() = single_value->field_compactIntMeasurCap.valueof(); } if (single_value->field_revisionLevelInd.is_bound()) { ret_val.revisionLevelInd() = single_value->field_revisionLevelInd.valueof(); } if (single_value->field_umtsfddRadAccTechCap.is_bound()) { ret_val.umtsfddRadAccTechCap() = single_value->field_umtsfddRadAccTechCap.valueof(); } if (single_value->field_umtstddRadAccTechCap.is_bound()) { ret_val.umtstddRadAccTechCap() = single_value->field_umtstddRadAccTechCap.valueof(); } if (single_value->field_cdma2kRadAccTechCap.is_bound()) { ret_val.cdma2kRadAccTechCap() = single_value->field_cdma2kRadAccTechCap.valueof(); } return ret_val; } void AccessCapAdditionsRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel99__BSSGP_template[list_length]; } AccessCapAdditionsRel99__BSSGP_template& AccessCapAdditionsRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::presenceBitPskpow() { set_specific(); return single_value->field_presenceBitPskpow; } const BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::presenceBitPskpow() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitPskpow of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); return single_value->field_presenceBitPskpow; } BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::pskpowercap() { set_specific(); return single_value->field_pskpowercap; } const BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::pskpowercap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pskpowercap of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); return single_value->field_pskpowercap; } BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::compactIntMeasurCap() { set_specific(); return single_value->field_compactIntMeasurCap; } const BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::compactIntMeasurCap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field compactIntMeasurCap of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); return single_value->field_compactIntMeasurCap; } BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::revisionLevelInd() { set_specific(); return single_value->field_revisionLevelInd; } const BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::revisionLevelInd() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field revisionLevelInd of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); return single_value->field_revisionLevelInd; } BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::umtsfddRadAccTechCap() { set_specific(); return single_value->field_umtsfddRadAccTechCap; } const BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::umtsfddRadAccTechCap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field umtsfddRadAccTechCap of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); return single_value->field_umtsfddRadAccTechCap; } BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::umtstddRadAccTechCap() { set_specific(); return single_value->field_umtstddRadAccTechCap; } const BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::umtstddRadAccTechCap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field umtstddRadAccTechCap of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); return single_value->field_umtstddRadAccTechCap; } BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::cdma2kRadAccTechCap() { set_specific(); return single_value->field_cdma2kRadAccTechCap; } const BITSTRING_template& AccessCapAdditionsRel99__BSSGP_template::cdma2kRadAccTechCap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field cdma2kRadAccTechCap of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); return single_value->field_cdma2kRadAccTechCap; } int AccessCapAdditionsRel99__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 6; if (single_value->field_pskpowercap.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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); } return 0; } void AccessCapAdditionsRel99__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ presenceBitPskpow := "); single_value->field_presenceBitPskpow.log(); TTCN_Logger::log_event_str(", pskpowercap := "); single_value->field_pskpowercap.log(); TTCN_Logger::log_event_str(", compactIntMeasurCap := "); single_value->field_compactIntMeasurCap.log(); TTCN_Logger::log_event_str(", revisionLevelInd := "); single_value->field_revisionLevelInd.log(); TTCN_Logger::log_event_str(", umtsfddRadAccTechCap := "); single_value->field_umtsfddRadAccTechCap.log(); TTCN_Logger::log_event_str(", umtstddRadAccTechCap := "); single_value->field_umtstddRadAccTechCap.log(); TTCN_Logger::log_event_str(", cdma2kRadAccTechCap := "); single_value->field_cdma2kRadAccTechCap.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 AccessCapAdditionsRel99__BSSGP_template::log_match(const AccessCapAdditionsRel99__BSSGP& 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_presenceBitPskpow.match(match_value.presenceBitPskpow(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitPskpow"); single_value->field_presenceBitPskpow.log_match(match_value.presenceBitPskpow(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.pskpowercap().ispresent()){ if(!single_value->field_pskpowercap.match(match_value.pskpowercap(), legacy)){ TTCN_Logger::log_logmatch_info(".pskpowercap"); single_value->field_pskpowercap.log_match(match_value.pskpowercap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_pskpowercap.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".pskpowercap := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_pskpowercap.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_compactIntMeasurCap.match(match_value.compactIntMeasurCap(), legacy)){ TTCN_Logger::log_logmatch_info(".compactIntMeasurCap"); single_value->field_compactIntMeasurCap.log_match(match_value.compactIntMeasurCap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_revisionLevelInd.match(match_value.revisionLevelInd(), legacy)){ TTCN_Logger::log_logmatch_info(".revisionLevelInd"); single_value->field_revisionLevelInd.log_match(match_value.revisionLevelInd(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_umtsfddRadAccTechCap.match(match_value.umtsfddRadAccTechCap(), legacy)){ TTCN_Logger::log_logmatch_info(".umtsfddRadAccTechCap"); single_value->field_umtsfddRadAccTechCap.log_match(match_value.umtsfddRadAccTechCap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_umtstddRadAccTechCap.match(match_value.umtstddRadAccTechCap(), legacy)){ TTCN_Logger::log_logmatch_info(".umtstddRadAccTechCap"); single_value->field_umtstddRadAccTechCap.log_match(match_value.umtstddRadAccTechCap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_cdma2kRadAccTechCap.match(match_value.cdma2kRadAccTechCap(), legacy)){ TTCN_Logger::log_logmatch_info(".cdma2kRadAccTechCap"); single_value->field_cdma2kRadAccTechCap.log_match(match_value.cdma2kRadAccTechCap(), 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("{ presenceBitPskpow := "); single_value->field_presenceBitPskpow.log_match(match_value.presenceBitPskpow(), legacy); TTCN_Logger::log_event_str(", pskpowercap := "); if (match_value.pskpowercap().ispresent()) { single_value->field_pskpowercap.log_match(match_value.pskpowercap(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_pskpowercap.log(); if (single_value->field_pskpowercap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", compactIntMeasurCap := "); single_value->field_compactIntMeasurCap.log_match(match_value.compactIntMeasurCap(), legacy); TTCN_Logger::log_event_str(", revisionLevelInd := "); single_value->field_revisionLevelInd.log_match(match_value.revisionLevelInd(), legacy); TTCN_Logger::log_event_str(", umtsfddRadAccTechCap := "); single_value->field_umtsfddRadAccTechCap.log_match(match_value.umtsfddRadAccTechCap(), legacy); TTCN_Logger::log_event_str(", umtstddRadAccTechCap := "); single_value->field_umtstddRadAccTechCap.log_match(match_value.umtstddRadAccTechCap(), legacy); TTCN_Logger::log_event_str(", cdma2kRadAccTechCap := "); single_value->field_cdma2kRadAccTechCap.log_match(match_value.cdma2kRadAccTechCap(), 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 AccessCapAdditionsRel99__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_presenceBitPskpow.encode_text(text_buf); single_value->field_pskpowercap.encode_text(text_buf); single_value->field_compactIntMeasurCap.encode_text(text_buf); single_value->field_revisionLevelInd.encode_text(text_buf); single_value->field_umtsfddRadAccTechCap.encode_text(text_buf); single_value->field_umtstddRadAccTechCap.encode_text(text_buf); single_value->field_cdma2kRadAccTechCap.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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); } } void AccessCapAdditionsRel99__BSSGP_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_presenceBitPskpow.decode_text(text_buf); single_value->field_pskpowercap.decode_text(text_buf); single_value->field_compactIntMeasurCap.decode_text(text_buf); single_value->field_revisionLevelInd.decode_text(text_buf); single_value->field_umtsfddRadAccTechCap.decode_text(text_buf); single_value->field_umtstddRadAccTechCap.decode_text(text_buf); single_value->field_cdma2kRadAccTechCap.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 AccessCapAdditionsRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel99_BSSGP."); } } void AccessCapAdditionsRel99__BSSGP_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: { AccessCapAdditionsRel99__BSSGP_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) presenceBitPskpow().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) pskpowercap().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) compactIntMeasurCap().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) revisionLevelInd().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) umtsfddRadAccTechCap().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) umtstddRadAccTechCap().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cdma2kRadAccTechCap().set_param(*param.get_elem(6)); 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(), "presenceBitPskpow")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitPskpow().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pskpowercap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pskpowercap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "compactIntMeasurCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { compactIntMeasurCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "revisionLevelInd")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { revisionLevelInd().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "umtsfddRadAccTechCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { umtsfddRadAccTechCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "umtstddRadAccTechCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { umtstddRadAccTechCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "cdma2kRadAccTechCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { cdma2kRadAccTechCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel99_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel99__BSSGP_template* precondition = new AccessCapAdditionsRel99__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel99__BSSGP_template* implied_template = new AccessCapAdditionsRel99__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel99__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel99__BSSGP_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_presenceBitPskpow.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); single_value->field_pskpowercap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); single_value->field_compactIntMeasurCap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); single_value->field_revisionLevelInd.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); single_value->field_umtsfddRadAccTechCap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); single_value->field_umtstddRadAccTechCap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); single_value->field_cdma2kRadAccTechCap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel99_BSSGP"); } boolean AccessCapAdditionsRel99__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel99__BSSGP_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_accessCapAdditionsAfterRel99) : field_accessCapAdditionsRel99(par_accessCapAdditionsRel99), field_accessCapAdditionsAfterRel99(par_accessCapAdditionsAfterRel99) { } AccessCapAdditionsAfterRel97__BSSGP::AccessCapAdditionsAfterRel97__BSSGP(const AccessCapAdditionsAfterRel97__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); if (other_value.accessCapAdditionsRel99().is_bound()) field_accessCapAdditionsRel99 = other_value.accessCapAdditionsRel99(); else field_accessCapAdditionsRel99.clean_up(); if (other_value.accessCapAdditionsAfterRel99().is_bound()) field_accessCapAdditionsAfterRel99 = other_value.accessCapAdditionsAfterRel99(); else field_accessCapAdditionsAfterRel99.clean_up(); } void AccessCapAdditionsAfterRel97__BSSGP::clean_up() { field_accessCapAdditionsRel99.clean_up(); field_accessCapAdditionsAfterRel99.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel97__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel97__BSSGP_descr_; } AccessCapAdditionsAfterRel97__BSSGP& AccessCapAdditionsAfterRel97__BSSGP::operator=(const AccessCapAdditionsAfterRel97__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); if (other_value.accessCapAdditionsRel99().is_bound()) field_accessCapAdditionsRel99 = other_value.accessCapAdditionsRel99(); else field_accessCapAdditionsRel99.clean_up(); if (other_value.accessCapAdditionsAfterRel99().is_bound()) field_accessCapAdditionsAfterRel99 = other_value.accessCapAdditionsAfterRel99(); else field_accessCapAdditionsAfterRel99.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel97__BSSGP::operator==(const AccessCapAdditionsAfterRel97__BSSGP& other_value) const { return field_accessCapAdditionsRel99==other_value.field_accessCapAdditionsRel99 && field_accessCapAdditionsAfterRel99==other_value.field_accessCapAdditionsAfterRel99; } boolean AccessCapAdditionsAfterRel97__BSSGP::is_bound() const { return (field_accessCapAdditionsRel99.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel99.get_selection() || field_accessCapAdditionsAfterRel99.is_bound()); } boolean AccessCapAdditionsAfterRel97__BSSGP::is_value() const { return field_accessCapAdditionsRel99.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel99.get_selection() || field_accessCapAdditionsAfterRel99.is_value()); } int AccessCapAdditionsAfterRel97__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel99.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel97__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel99 := "); field_accessCapAdditionsRel99.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel99 := "); field_accessCapAdditionsAfterRel99.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel97__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel99().is_bound()) accessCapAdditionsRel99().set_implicit_omit(); if (!accessCapAdditionsAfterRel99().is_bound()) accessCapAdditionsAfterRel99() = OMIT_VALUE; else accessCapAdditionsAfterRel99().set_implicit_omit(); } void AccessCapAdditionsAfterRel97__BSSGP::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) accessCapAdditionsRel99().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel99().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(), "accessCapAdditionsRel99")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel99().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel99")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel99().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP"); } } void AccessCapAdditionsAfterRel97__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel99.encode_text(text_buf); field_accessCapAdditionsAfterRel99.encode_text(text_buf); } void AccessCapAdditionsAfterRel97__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel99.decode_text(text_buf); field_accessCapAdditionsAfterRel99.decode_text(text_buf); } void AccessCapAdditionsAfterRel97__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel97__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel97__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel97__BSSGP_accessCapAdditionsRel99_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel99.RAW_decode(AccessCapAdditionsAfterRel97__BSSGP_accessCapAdditionsRel99_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel99 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel97__BSSGP_accessCapAdditionsAfterRel99_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel99().RAW_decode(AccessCapAdditionsAfterRel97__BSSGP_accessCapAdditionsAfterRel99_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel99 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel99=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel97__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsAfterRel97__BSSGP_accessCapAdditionsRel99_descr_.raw); if (field_accessCapAdditionsAfterRel99.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel97__BSSGP_accessCapAdditionsAfterRel99_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel99.RAW_encode(AccessCapAdditionsAfterRel97__BSSGP_accessCapAdditionsRel99_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel99.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel99().RAW_encode(AccessCapAdditionsAfterRel97__BSSGP_accessCapAdditionsAfterRel99_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel97__BSSGP_template::single_value_struct { AccessCapAdditionsRel99__BSSGP_template field_accessCapAdditionsRel99; AccessCapAdditionsAfterRel99__BSSGP_template field_accessCapAdditionsAfterRel99; }; void AccessCapAdditionsAfterRel97__BSSGP_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_accessCapAdditionsRel99 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel99 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel97__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel97__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel99().is_bound()) { single_value->field_accessCapAdditionsRel99 = other_value.accessCapAdditionsRel99(); } else { single_value->field_accessCapAdditionsRel99.clean_up(); } if (other_value.accessCapAdditionsAfterRel99().is_bound()) { if (other_value.accessCapAdditionsAfterRel99().ispresent()) single_value->field_accessCapAdditionsAfterRel99 = other_value.accessCapAdditionsAfterRel99()(); else single_value->field_accessCapAdditionsAfterRel99 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel99.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel97__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel97__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel99().get_selection()) { single_value->field_accessCapAdditionsRel99 = other_value.accessCapAdditionsRel99(); } else { single_value->field_accessCapAdditionsRel99.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel99().get_selection()) { single_value->field_accessCapAdditionsAfterRel99 = other_value.accessCapAdditionsAfterRel99(); } else { single_value->field_accessCapAdditionsAfterRel99.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 AccessCapAdditionsAfterRel97__BSSGP_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 AccessCapAdditionsAfterRel97__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel97__BSSGP_template::AccessCapAdditionsAfterRel97__BSSGP_template() { } AccessCapAdditionsAfterRel97__BSSGP_template::AccessCapAdditionsAfterRel97__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel97__BSSGP_template::AccessCapAdditionsAfterRel97__BSSGP_template(const AccessCapAdditionsAfterRel97__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel97__BSSGP_template::AccessCapAdditionsAfterRel97__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel97__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel97__BSSGP_template::AccessCapAdditionsAfterRel97__BSSGP_template(AccessCapAdditionsAfterRel97__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel97__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel97__BSSGP_template::AccessCapAdditionsAfterRel97__BSSGP_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; } AccessCapAdditionsAfterRel97__BSSGP_template::AccessCapAdditionsAfterRel97__BSSGP_template(const AccessCapAdditionsAfterRel97__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel97__BSSGP_template::~AccessCapAdditionsAfterRel97__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel97__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel97__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_template::operator=(const AccessCapAdditionsAfterRel97__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel97__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel97__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); } return *this; } AccessCapAdditionsAfterRel97__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_template::operator=(const AccessCapAdditionsAfterRel97__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel97__BSSGP_template::match(const AccessCapAdditionsAfterRel97__BSSGP& 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.accessCapAdditionsRel99().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel99.match(other_value.accessCapAdditionsRel99(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel99().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel99().ispresent() ? !single_value->field_accessCapAdditionsAfterRel99.match((const AccessCapAdditionsAfterRel99__BSSGP&)other_value.accessCapAdditionsAfterRel99(), legacy) : !single_value->field_accessCapAdditionsAfterRel99.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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel97__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel99.is_bound() || (single_value->field_accessCapAdditionsAfterRel99.is_omit() || single_value->field_accessCapAdditionsAfterRel99.is_bound()); } boolean AccessCapAdditionsAfterRel97__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel99.is_value() && (single_value->field_accessCapAdditionsAfterRel99.is_omit() || single_value->field_accessCapAdditionsAfterRel99.is_value()); } void AccessCapAdditionsAfterRel97__BSSGP_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; } AccessCapAdditionsAfterRel97__BSSGP AccessCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); AccessCapAdditionsAfterRel97__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel99.is_bound()) { ret_val.accessCapAdditionsRel99() = single_value->field_accessCapAdditionsRel99.valueof(); } if (single_value->field_accessCapAdditionsAfterRel99.is_omit()) ret_val.accessCapAdditionsAfterRel99() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel99.is_bound()) { ret_val.accessCapAdditionsAfterRel99() = single_value->field_accessCapAdditionsAfterRel99.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel97__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel97__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel99__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_template::accessCapAdditionsRel99() { set_specific(); return single_value->field_accessCapAdditionsRel99; } const AccessCapAdditionsRel99__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_template::accessCapAdditionsRel99() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel99 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); return single_value->field_accessCapAdditionsRel99; } AccessCapAdditionsAfterRel99__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_template::accessCapAdditionsAfterRel99() { set_specific(); return single_value->field_accessCapAdditionsAfterRel99; } const AccessCapAdditionsAfterRel99__BSSGP_template& AccessCapAdditionsAfterRel97__BSSGP_template::accessCapAdditionsAfterRel99() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel99 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); return single_value->field_accessCapAdditionsAfterRel99; } int AccessCapAdditionsAfterRel97__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel99.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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel97__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel99 := "); single_value->field_accessCapAdditionsRel99.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel99 := "); single_value->field_accessCapAdditionsAfterRel99.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 AccessCapAdditionsAfterRel97__BSSGP_template::log_match(const AccessCapAdditionsAfterRel97__BSSGP& 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_accessCapAdditionsRel99.match(match_value.accessCapAdditionsRel99(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel99"); single_value->field_accessCapAdditionsRel99.log_match(match_value.accessCapAdditionsRel99(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel99().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel99.match(match_value.accessCapAdditionsAfterRel99(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel99"); single_value->field_accessCapAdditionsAfterRel99.log_match(match_value.accessCapAdditionsAfterRel99(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel99.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel99 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel99.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("{ accessCapAdditionsRel99 := "); single_value->field_accessCapAdditionsRel99.log_match(match_value.accessCapAdditionsRel99(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel99 := "); if (match_value.accessCapAdditionsAfterRel99().ispresent()) { single_value->field_accessCapAdditionsAfterRel99.log_match(match_value.accessCapAdditionsAfterRel99(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel99.log(); if (single_value->field_accessCapAdditionsAfterRel99.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 AccessCapAdditionsAfterRel97__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel99.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel99.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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); } } void AccessCapAdditionsAfterRel97__BSSGP_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_accessCapAdditionsRel99.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel99.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 AccessCapAdditionsAfterRel97__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP."); } } void AccessCapAdditionsAfterRel97__BSSGP_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: { AccessCapAdditionsAfterRel97__BSSGP_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) accessCapAdditionsRel99().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel99().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(), "accessCapAdditionsRel99")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel99().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel99")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel99().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel97__BSSGP_template* precondition = new AccessCapAdditionsAfterRel97__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel97__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel97__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel97__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel97__BSSGP_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_accessCapAdditionsRel99.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP"); single_value->field_accessCapAdditionsAfterRel99.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel97_BSSGP"); } boolean AccessCapAdditionsAfterRel97__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel97__BSSGP_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_extendedDTM, const BITSTRING& par_modulationBasedMultislotClass) : field_umts128RadAccTechCap(par_umts128RadAccTechCap), field_geranFeaturePackage(par_geranFeaturePackage), field_presenceBitExtendedDTM(par_presenceBitExtendedDTM), field_extendedDTM(par_extendedDTM), field_modulationBasedMultislotClass(par_modulationBasedMultislotClass) { } AccessCapAdditionsRel4__BSSGP::AccessCapAdditionsRel4__BSSGP(const AccessCapAdditionsRel4__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); if (other_value.umts128RadAccTechCap().is_bound()) field_umts128RadAccTechCap = other_value.umts128RadAccTechCap(); else field_umts128RadAccTechCap.clean_up(); if (other_value.geranFeaturePackage().is_bound()) field_geranFeaturePackage = other_value.geranFeaturePackage(); else field_geranFeaturePackage.clean_up(); if (other_value.presenceBitExtendedDTM().is_bound()) field_presenceBitExtendedDTM = other_value.presenceBitExtendedDTM(); else field_presenceBitExtendedDTM.clean_up(); if (other_value.extendedDTM().is_bound()) field_extendedDTM = other_value.extendedDTM(); else field_extendedDTM.clean_up(); if (other_value.modulationBasedMultislotClass().is_bound()) field_modulationBasedMultislotClass = other_value.modulationBasedMultislotClass(); else field_modulationBasedMultislotClass.clean_up(); } void AccessCapAdditionsRel4__BSSGP::clean_up() { field_umts128RadAccTechCap.clean_up(); field_geranFeaturePackage.clean_up(); field_presenceBitExtendedDTM.clean_up(); field_extendedDTM.clean_up(); field_modulationBasedMultislotClass.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsRel4__BSSGP::get_descriptor() const { return &AccessCapAdditionsRel4__BSSGP_descr_; } AccessCapAdditionsRel4__BSSGP& AccessCapAdditionsRel4__BSSGP::operator=(const AccessCapAdditionsRel4__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); if (other_value.umts128RadAccTechCap().is_bound()) field_umts128RadAccTechCap = other_value.umts128RadAccTechCap(); else field_umts128RadAccTechCap.clean_up(); if (other_value.geranFeaturePackage().is_bound()) field_geranFeaturePackage = other_value.geranFeaturePackage(); else field_geranFeaturePackage.clean_up(); if (other_value.presenceBitExtendedDTM().is_bound()) field_presenceBitExtendedDTM = other_value.presenceBitExtendedDTM(); else field_presenceBitExtendedDTM.clean_up(); if (other_value.extendedDTM().is_bound()) field_extendedDTM = other_value.extendedDTM(); else field_extendedDTM.clean_up(); if (other_value.modulationBasedMultislotClass().is_bound()) field_modulationBasedMultislotClass = other_value.modulationBasedMultislotClass(); else field_modulationBasedMultislotClass.clean_up(); } return *this; } boolean AccessCapAdditionsRel4__BSSGP::operator==(const AccessCapAdditionsRel4__BSSGP& other_value) const { return field_umts128RadAccTechCap==other_value.field_umts128RadAccTechCap && field_geranFeaturePackage==other_value.field_geranFeaturePackage && field_presenceBitExtendedDTM==other_value.field_presenceBitExtendedDTM && field_extendedDTM==other_value.field_extendedDTM && field_modulationBasedMultislotClass==other_value.field_modulationBasedMultislotClass; } boolean AccessCapAdditionsRel4__BSSGP::is_bound() const { return (field_umts128RadAccTechCap.is_bound()) || (field_geranFeaturePackage.is_bound()) || (field_presenceBitExtendedDTM.is_bound()) || (OPTIONAL_OMIT == field_extendedDTM.get_selection() || field_extendedDTM.is_bound()) || (field_modulationBasedMultislotClass.is_bound()); } boolean AccessCapAdditionsRel4__BSSGP::is_value() const { return field_umts128RadAccTechCap.is_value() && field_geranFeaturePackage.is_value() && field_presenceBitExtendedDTM.is_value() && (OPTIONAL_OMIT == field_extendedDTM.get_selection() || field_extendedDTM.is_value()) && field_modulationBasedMultislotClass.is_value(); } int AccessCapAdditionsRel4__BSSGP::size_of() const { int ret_val = 4; if (field_extendedDTM.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsRel4__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ umts128RadAccTechCap := "); field_umts128RadAccTechCap.log(); TTCN_Logger::log_event_str(", geranFeaturePackage := "); field_geranFeaturePackage.log(); TTCN_Logger::log_event_str(", presenceBitExtendedDTM := "); field_presenceBitExtendedDTM.log(); TTCN_Logger::log_event_str(", extendedDTM := "); field_extendedDTM.log(); TTCN_Logger::log_event_str(", modulationBasedMultislotClass := "); field_modulationBasedMultislotClass.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsRel4__BSSGP::set_implicit_omit() { if (umts128RadAccTechCap().is_bound()) umts128RadAccTechCap().set_implicit_omit(); if (geranFeaturePackage().is_bound()) geranFeaturePackage().set_implicit_omit(); if (presenceBitExtendedDTM().is_bound()) presenceBitExtendedDTM().set_implicit_omit(); if (!extendedDTM().is_bound()) extendedDTM() = OMIT_VALUE; else extendedDTM().set_implicit_omit(); if (modulationBasedMultislotClass().is_bound()) modulationBasedMultislotClass().set_implicit_omit(); } void AccessCapAdditionsRel4__BSSGP::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) umts128RadAccTechCap().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) geranFeaturePackage().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitExtendedDTM().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) extendedDTM().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) modulationBasedMultislotClass().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(), "umts128RadAccTechCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { umts128RadAccTechCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "geranFeaturePackage")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { geranFeaturePackage().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitExtendedDTM")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitExtendedDTM().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extendedDTM")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extendedDTM().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "modulationBasedMultislotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { modulationBasedMultislotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel4_BSSGP"); } } void AccessCapAdditionsRel4__BSSGP::encode_text(Text_Buf& text_buf) const { field_umts128RadAccTechCap.encode_text(text_buf); field_geranFeaturePackage.encode_text(text_buf); field_presenceBitExtendedDTM.encode_text(text_buf); field_extendedDTM.encode_text(text_buf); field_modulationBasedMultislotClass.encode_text(text_buf); } void AccessCapAdditionsRel4__BSSGP::decode_text(Text_Buf& text_buf) { field_umts128RadAccTechCap.decode_text(text_buf); field_geranFeaturePackage.decode_text(text_buf); field_presenceBitExtendedDTM.decode_text(text_buf); field_extendedDTM.decode_text(text_buf); field_modulationBasedMultislotClass.decode_text(text_buf); } void AccessCapAdditionsRel4__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel4__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel4__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel4__BSSGP_umts128RadAccTechCap_descr_.raw->forceomit); decoded_field_length = field_umts128RadAccTechCap.RAW_decode(AccessCapAdditionsRel4__BSSGP_umts128RadAccTechCap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel4__BSSGP_geranFeaturePackage_descr_.raw->forceomit); decoded_field_length = field_geranFeaturePackage.RAW_decode(AccessCapAdditionsRel4__BSSGP_geranFeaturePackage_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel4__BSSGP_presenceBitExtendedDTM_descr_.raw->forceomit); decoded_field_length = field_presenceBitExtendedDTM.RAW_decode(AccessCapAdditionsRel4__BSSGP_presenceBitExtendedDTM_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitExtendedDTM == bs_0){ if (force_omit != NULL && (*force_omit)(3)) { field_extendedDTM = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel4__BSSGP_extendedDTM_descr_.raw->forceomit); decoded_field_length = field_extendedDTM().RAW_decode(AccessCapAdditionsRel4__BSSGP_extendedDTM_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 1) { field_extendedDTM = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_extendedDTM=OMIT_VALUE; RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel4__BSSGP_modulationBasedMultislotClass_descr_.raw->forceomit); decoded_field_length = field_modulationBasedMultislotClass.RAW_decode(AccessCapAdditionsRel4__BSSGP_modulationBasedMultislotClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel4__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 5; myleaf.body.node.nodes = init_nodes_of_enc_tree(5); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel4__BSSGP_umts128RadAccTechCap_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel4__BSSGP_geranFeaturePackage_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel4__BSSGP_presenceBitExtendedDTM_descr_.raw); if (field_extendedDTM.ispresent()) { myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel4__BSSGP_extendedDTM_descr_.raw); } else myleaf.body.node.nodes[3] = NULL; myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel4__BSSGP_modulationBasedMultislotClass_descr_.raw); encoded_length += field_umts128RadAccTechCap.RAW_encode(AccessCapAdditionsRel4__BSSGP_umts128RadAccTechCap_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_geranFeaturePackage.RAW_encode(AccessCapAdditionsRel4__BSSGP_geranFeaturePackage_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_presenceBitExtendedDTM.RAW_encode(AccessCapAdditionsRel4__BSSGP_presenceBitExtendedDTM_descr_, *myleaf.body.node.nodes[2]); if (field_extendedDTM.ispresent()) { encoded_length += field_extendedDTM().RAW_encode(AccessCapAdditionsRel4__BSSGP_extendedDTM_descr_, *myleaf.body.node.nodes[3]); } encoded_length += field_modulationBasedMultislotClass.RAW_encode(AccessCapAdditionsRel4__BSSGP_modulationBasedMultislotClass_descr_, *myleaf.body.node.nodes[4]); if (field_extendedDTM.ispresent() && (field_presenceBitExtendedDTM != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={2}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapAdditionsRel4__BSSGP_presenceBitExtendedDTM_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct AccessCapAdditionsRel4__BSSGP_template::single_value_struct { BITSTRING_template field_umts128RadAccTechCap; BITSTRING_template field_geranFeaturePackage; BITSTRING_template field_presenceBitExtendedDTM; ExtendedDTM__BSSGP_template field_extendedDTM; BITSTRING_template field_modulationBasedMultislotClass; }; void AccessCapAdditionsRel4__BSSGP_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_umts128RadAccTechCap = ANY_VALUE; single_value->field_geranFeaturePackage = ANY_VALUE; single_value->field_presenceBitExtendedDTM = ANY_VALUE; single_value->field_extendedDTM = ANY_OR_OMIT; single_value->field_modulationBasedMultislotClass = ANY_VALUE; } } } void AccessCapAdditionsRel4__BSSGP_template::copy_value(const AccessCapAdditionsRel4__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.umts128RadAccTechCap().is_bound()) { single_value->field_umts128RadAccTechCap = other_value.umts128RadAccTechCap(); } else { single_value->field_umts128RadAccTechCap.clean_up(); } if (other_value.geranFeaturePackage().is_bound()) { single_value->field_geranFeaturePackage = other_value.geranFeaturePackage(); } else { single_value->field_geranFeaturePackage.clean_up(); } if (other_value.presenceBitExtendedDTM().is_bound()) { single_value->field_presenceBitExtendedDTM = other_value.presenceBitExtendedDTM(); } else { single_value->field_presenceBitExtendedDTM.clean_up(); } if (other_value.extendedDTM().is_bound()) { if (other_value.extendedDTM().ispresent()) single_value->field_extendedDTM = other_value.extendedDTM()(); else single_value->field_extendedDTM = OMIT_VALUE; } else { single_value->field_extendedDTM.clean_up(); } if (other_value.modulationBasedMultislotClass().is_bound()) { single_value->field_modulationBasedMultislotClass = other_value.modulationBasedMultislotClass(); } else { single_value->field_modulationBasedMultislotClass.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel4__BSSGP_template::copy_template(const AccessCapAdditionsRel4__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.umts128RadAccTechCap().get_selection()) { single_value->field_umts128RadAccTechCap = other_value.umts128RadAccTechCap(); } else { single_value->field_umts128RadAccTechCap.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.geranFeaturePackage().get_selection()) { single_value->field_geranFeaturePackage = other_value.geranFeaturePackage(); } else { single_value->field_geranFeaturePackage.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitExtendedDTM().get_selection()) { single_value->field_presenceBitExtendedDTM = other_value.presenceBitExtendedDTM(); } else { single_value->field_presenceBitExtendedDTM.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.extendedDTM().get_selection()) { single_value->field_extendedDTM = other_value.extendedDTM(); } else { single_value->field_extendedDTM.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.modulationBasedMultislotClass().get_selection()) { single_value->field_modulationBasedMultislotClass = other_value.modulationBasedMultislotClass(); } else { single_value->field_modulationBasedMultislotClass.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 AccessCapAdditionsRel4__BSSGP_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 AccessCapAdditionsRel4__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel4__BSSGP_template::AccessCapAdditionsRel4__BSSGP_template() { } AccessCapAdditionsRel4__BSSGP_template::AccessCapAdditionsRel4__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel4__BSSGP_template::AccessCapAdditionsRel4__BSSGP_template(const AccessCapAdditionsRel4__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel4__BSSGP_template::AccessCapAdditionsRel4__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel4__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel4__BSSGP_template::AccessCapAdditionsRel4__BSSGP_template(AccessCapAdditionsRel4__BSSGP_template* p_precondition, AccessCapAdditionsRel4__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel4__BSSGP_template::AccessCapAdditionsRel4__BSSGP_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; } AccessCapAdditionsRel4__BSSGP_template::AccessCapAdditionsRel4__BSSGP_template(const AccessCapAdditionsRel4__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel4__BSSGP_template::~AccessCapAdditionsRel4__BSSGP_template() { clean_up(); } AccessCapAdditionsRel4__BSSGP_template& AccessCapAdditionsRel4__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel4__BSSGP_template& AccessCapAdditionsRel4__BSSGP_template::operator=(const AccessCapAdditionsRel4__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel4__BSSGP_template& AccessCapAdditionsRel4__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel4__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); } return *this; } AccessCapAdditionsRel4__BSSGP_template& AccessCapAdditionsRel4__BSSGP_template::operator=(const AccessCapAdditionsRel4__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel4__BSSGP_template::match(const AccessCapAdditionsRel4__BSSGP& 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.umts128RadAccTechCap().is_bound()) return FALSE; if(!single_value->field_umts128RadAccTechCap.match(other_value.umts128RadAccTechCap(), legacy))return FALSE; if(!other_value.geranFeaturePackage().is_bound()) return FALSE; if(!single_value->field_geranFeaturePackage.match(other_value.geranFeaturePackage(), legacy))return FALSE; if(!other_value.presenceBitExtendedDTM().is_bound()) return FALSE; if(!single_value->field_presenceBitExtendedDTM.match(other_value.presenceBitExtendedDTM(), legacy))return FALSE; if(!other_value.extendedDTM().is_bound()) return FALSE; if((other_value.extendedDTM().ispresent() ? !single_value->field_extendedDTM.match((const ExtendedDTM__BSSGP&)other_value.extendedDTM(), legacy) : !single_value->field_extendedDTM.match_omit(legacy)))return FALSE; if(!other_value.modulationBasedMultislotClass().is_bound()) return FALSE; if(!single_value->field_modulationBasedMultislotClass.match(other_value.modulationBasedMultislotClass(), 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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel4__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_umts128RadAccTechCap.is_bound() || single_value->field_geranFeaturePackage.is_bound() || single_value->field_presenceBitExtendedDTM.is_bound() || (single_value->field_extendedDTM.is_omit() || single_value->field_extendedDTM.is_bound()) || single_value->field_modulationBasedMultislotClass.is_bound(); } boolean AccessCapAdditionsRel4__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_umts128RadAccTechCap.is_value() && single_value->field_geranFeaturePackage.is_value() && single_value->field_presenceBitExtendedDTM.is_value() && (single_value->field_extendedDTM.is_omit() || single_value->field_extendedDTM.is_value()) && single_value->field_modulationBasedMultislotClass.is_value(); } void AccessCapAdditionsRel4__BSSGP_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; } AccessCapAdditionsRel4__BSSGP AccessCapAdditionsRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); AccessCapAdditionsRel4__BSSGP ret_val; if (single_value->field_umts128RadAccTechCap.is_bound()) { ret_val.umts128RadAccTechCap() = single_value->field_umts128RadAccTechCap.valueof(); } if (single_value->field_geranFeaturePackage.is_bound()) { ret_val.geranFeaturePackage() = single_value->field_geranFeaturePackage.valueof(); } if (single_value->field_presenceBitExtendedDTM.is_bound()) { ret_val.presenceBitExtendedDTM() = single_value->field_presenceBitExtendedDTM.valueof(); } if (single_value->field_extendedDTM.is_omit()) ret_val.extendedDTM() = OMIT_VALUE; else if (single_value->field_extendedDTM.is_bound()) { ret_val.extendedDTM() = single_value->field_extendedDTM.valueof(); } if (single_value->field_modulationBasedMultislotClass.is_bound()) { ret_val.modulationBasedMultislotClass() = single_value->field_modulationBasedMultislotClass.valueof(); } return ret_val; } void AccessCapAdditionsRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel4__BSSGP_template[list_length]; } AccessCapAdditionsRel4__BSSGP_template& AccessCapAdditionsRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel4__BSSGP_template::umts128RadAccTechCap() { set_specific(); return single_value->field_umts128RadAccTechCap; } const BITSTRING_template& AccessCapAdditionsRel4__BSSGP_template::umts128RadAccTechCap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field umts128RadAccTechCap of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); return single_value->field_umts128RadAccTechCap; } BITSTRING_template& AccessCapAdditionsRel4__BSSGP_template::geranFeaturePackage() { set_specific(); return single_value->field_geranFeaturePackage; } const BITSTRING_template& AccessCapAdditionsRel4__BSSGP_template::geranFeaturePackage() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field geranFeaturePackage of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); return single_value->field_geranFeaturePackage; } BITSTRING_template& AccessCapAdditionsRel4__BSSGP_template::presenceBitExtendedDTM() { set_specific(); return single_value->field_presenceBitExtendedDTM; } const BITSTRING_template& AccessCapAdditionsRel4__BSSGP_template::presenceBitExtendedDTM() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitExtendedDTM of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); return single_value->field_presenceBitExtendedDTM; } ExtendedDTM__BSSGP_template& AccessCapAdditionsRel4__BSSGP_template::extendedDTM() { set_specific(); return single_value->field_extendedDTM; } const ExtendedDTM__BSSGP_template& AccessCapAdditionsRel4__BSSGP_template::extendedDTM() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extendedDTM of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); return single_value->field_extendedDTM; } BITSTRING_template& AccessCapAdditionsRel4__BSSGP_template::modulationBasedMultislotClass() { set_specific(); return single_value->field_modulationBasedMultislotClass; } const BITSTRING_template& AccessCapAdditionsRel4__BSSGP_template::modulationBasedMultislotClass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field modulationBasedMultislotClass of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); return single_value->field_modulationBasedMultislotClass; } int AccessCapAdditionsRel4__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; if (single_value->field_extendedDTM.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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); } return 0; } void AccessCapAdditionsRel4__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ umts128RadAccTechCap := "); single_value->field_umts128RadAccTechCap.log(); TTCN_Logger::log_event_str(", geranFeaturePackage := "); single_value->field_geranFeaturePackage.log(); TTCN_Logger::log_event_str(", presenceBitExtendedDTM := "); single_value->field_presenceBitExtendedDTM.log(); TTCN_Logger::log_event_str(", extendedDTM := "); single_value->field_extendedDTM.log(); TTCN_Logger::log_event_str(", modulationBasedMultislotClass := "); single_value->field_modulationBasedMultislotClass.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 AccessCapAdditionsRel4__BSSGP_template::log_match(const AccessCapAdditionsRel4__BSSGP& 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_umts128RadAccTechCap.match(match_value.umts128RadAccTechCap(), legacy)){ TTCN_Logger::log_logmatch_info(".umts128RadAccTechCap"); single_value->field_umts128RadAccTechCap.log_match(match_value.umts128RadAccTechCap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_geranFeaturePackage.match(match_value.geranFeaturePackage(), legacy)){ TTCN_Logger::log_logmatch_info(".geranFeaturePackage"); single_value->field_geranFeaturePackage.log_match(match_value.geranFeaturePackage(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitExtendedDTM.match(match_value.presenceBitExtendedDTM(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitExtendedDTM"); single_value->field_presenceBitExtendedDTM.log_match(match_value.presenceBitExtendedDTM(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.extendedDTM().ispresent()){ if(!single_value->field_extendedDTM.match(match_value.extendedDTM(), legacy)){ TTCN_Logger::log_logmatch_info(".extendedDTM"); single_value->field_extendedDTM.log_match(match_value.extendedDTM(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_extendedDTM.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".extendedDTM := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_extendedDTM.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_modulationBasedMultislotClass.match(match_value.modulationBasedMultislotClass(), legacy)){ TTCN_Logger::log_logmatch_info(".modulationBasedMultislotClass"); single_value->field_modulationBasedMultislotClass.log_match(match_value.modulationBasedMultislotClass(), 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("{ umts128RadAccTechCap := "); single_value->field_umts128RadAccTechCap.log_match(match_value.umts128RadAccTechCap(), legacy); TTCN_Logger::log_event_str(", geranFeaturePackage := "); single_value->field_geranFeaturePackage.log_match(match_value.geranFeaturePackage(), legacy); TTCN_Logger::log_event_str(", presenceBitExtendedDTM := "); single_value->field_presenceBitExtendedDTM.log_match(match_value.presenceBitExtendedDTM(), legacy); TTCN_Logger::log_event_str(", extendedDTM := "); if (match_value.extendedDTM().ispresent()) { single_value->field_extendedDTM.log_match(match_value.extendedDTM(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_extendedDTM.log(); if (single_value->field_extendedDTM.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", modulationBasedMultislotClass := "); single_value->field_modulationBasedMultislotClass.log_match(match_value.modulationBasedMultislotClass(), 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 AccessCapAdditionsRel4__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_umts128RadAccTechCap.encode_text(text_buf); single_value->field_geranFeaturePackage.encode_text(text_buf); single_value->field_presenceBitExtendedDTM.encode_text(text_buf); single_value->field_extendedDTM.encode_text(text_buf); single_value->field_modulationBasedMultislotClass.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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); } } void AccessCapAdditionsRel4__BSSGP_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_umts128RadAccTechCap.decode_text(text_buf); single_value->field_geranFeaturePackage.decode_text(text_buf); single_value->field_presenceBitExtendedDTM.decode_text(text_buf); single_value->field_extendedDTM.decode_text(text_buf); single_value->field_modulationBasedMultislotClass.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 AccessCapAdditionsRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel4_BSSGP."); } } void AccessCapAdditionsRel4__BSSGP_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: { AccessCapAdditionsRel4__BSSGP_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) umts128RadAccTechCap().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) geranFeaturePackage().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitExtendedDTM().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) extendedDTM().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) modulationBasedMultislotClass().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(), "umts128RadAccTechCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { umts128RadAccTechCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "geranFeaturePackage")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { geranFeaturePackage().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitExtendedDTM")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitExtendedDTM().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extendedDTM")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extendedDTM().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "modulationBasedMultislotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { modulationBasedMultislotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel4_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel4__BSSGP_template* precondition = new AccessCapAdditionsRel4__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel4__BSSGP_template* implied_template = new AccessCapAdditionsRel4__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel4__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel4_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel4__BSSGP_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_umts128RadAccTechCap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel4_BSSGP"); single_value->field_geranFeaturePackage.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel4_BSSGP"); single_value->field_presenceBitExtendedDTM.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel4_BSSGP"); single_value->field_extendedDTM.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel4_BSSGP"); single_value->field_modulationBasedMultislotClass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel4_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel4_BSSGP"); } boolean AccessCapAdditionsRel4__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel4__BSSGP_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) ExtendedDTM__GPRSMultislot().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ExtendedDTM__EGPRSMultislot().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(), "ExtendedDTM_GPRSMultislot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ExtendedDTM__GPRSMultislot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ExtendedDTM_EGPRSMultislot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ExtendedDTM__EGPRSMultislot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.ExtendedDTM_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.ExtendedDTM_BSSGP"); } } void ExtendedDTM__BSSGP::encode_text(Text_Buf& text_buf) const { field_ExtendedDTM__GPRSMultislot.encode_text(text_buf); field_ExtendedDTM__EGPRSMultislot.encode_text(text_buf); } void ExtendedDTM__BSSGP::decode_text(Text_Buf& text_buf) { field_ExtendedDTM__GPRSMultislot.decode_text(text_buf); field_ExtendedDTM__EGPRSMultislot.decode_text(text_buf); } void ExtendedDTM__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void ExtendedDTM__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int ExtendedDTM__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, ExtendedDTM__BSSGP_ExtendedDTM__GPRSMultislot_descr_.raw->forceomit); decoded_field_length = field_ExtendedDTM__GPRSMultislot.RAW_decode(ExtendedDTM__BSSGP_ExtendedDTM__GPRSMultislot_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, ExtendedDTM__BSSGP_ExtendedDTM__EGPRSMultislot_descr_.raw->forceomit); decoded_field_length = field_ExtendedDTM__EGPRSMultislot.RAW_decode(ExtendedDTM__BSSGP_ExtendedDTM__EGPRSMultislot_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int ExtendedDTM__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, ExtendedDTM__BSSGP_ExtendedDTM__GPRSMultislot_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ExtendedDTM__BSSGP_ExtendedDTM__EGPRSMultislot_descr_.raw); encoded_length += field_ExtendedDTM__GPRSMultislot.RAW_encode(ExtendedDTM__BSSGP_ExtendedDTM__GPRSMultislot_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ExtendedDTM__EGPRSMultislot.RAW_encode(ExtendedDTM__BSSGP_ExtendedDTM__EGPRSMultislot_descr_, *myleaf.body.node.nodes[1]); return myleaf.length = encoded_length; } struct ExtendedDTM__BSSGP_template::single_value_struct { BITSTRING_template field_ExtendedDTM__GPRSMultislot; BITSTRING_template field_ExtendedDTM__EGPRSMultislot; }; void ExtendedDTM__BSSGP_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_ExtendedDTM__GPRSMultislot = ANY_VALUE; single_value->field_ExtendedDTM__EGPRSMultislot = ANY_VALUE; } } } void ExtendedDTM__BSSGP_template::copy_value(const ExtendedDTM__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.ExtendedDTM__GPRSMultislot().is_bound()) { single_value->field_ExtendedDTM__GPRSMultislot = other_value.ExtendedDTM__GPRSMultislot(); } else { single_value->field_ExtendedDTM__GPRSMultislot.clean_up(); } if (other_value.ExtendedDTM__EGPRSMultislot().is_bound()) { single_value->field_ExtendedDTM__EGPRSMultislot = other_value.ExtendedDTM__EGPRSMultislot(); } else { single_value->field_ExtendedDTM__EGPRSMultislot.clean_up(); } set_selection(SPECIFIC_VALUE); } void ExtendedDTM__BSSGP_template::copy_template(const ExtendedDTM__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.ExtendedDTM__GPRSMultislot().get_selection()) { single_value->field_ExtendedDTM__GPRSMultislot = other_value.ExtendedDTM__GPRSMultislot(); } else { single_value->field_ExtendedDTM__GPRSMultislot.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ExtendedDTM__EGPRSMultislot().get_selection()) { single_value->field_ExtendedDTM__EGPRSMultislot = other_value.ExtendedDTM__EGPRSMultislot(); } else { single_value->field_ExtendedDTM__EGPRSMultislot.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 ExtendedDTM__BSSGP_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 ExtendedDTM__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new ExtendedDTM__BSSGP_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 @BSSGP_Types.ExtendedDTM_BSSGP."); break; } set_selection(other_value); } ExtendedDTM__BSSGP_template::ExtendedDTM__BSSGP_template() { } ExtendedDTM__BSSGP_template::ExtendedDTM__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } ExtendedDTM__BSSGP_template::ExtendedDTM__BSSGP_template(const ExtendedDTM__BSSGP& other_value) { copy_value(other_value); } ExtendedDTM__BSSGP_template::ExtendedDTM__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ExtendedDTM__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.ExtendedDTM_BSSGP from an unbound optional field."); } } ExtendedDTM__BSSGP_template::ExtendedDTM__BSSGP_template(ExtendedDTM__BSSGP_template* p_precondition, ExtendedDTM__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } ExtendedDTM__BSSGP_template::ExtendedDTM__BSSGP_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; } ExtendedDTM__BSSGP_template::ExtendedDTM__BSSGP_template(const ExtendedDTM__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } ExtendedDTM__BSSGP_template::~ExtendedDTM__BSSGP_template() { clean_up(); } ExtendedDTM__BSSGP_template& ExtendedDTM__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } ExtendedDTM__BSSGP_template& ExtendedDTM__BSSGP_template::operator=(const ExtendedDTM__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } ExtendedDTM__BSSGP_template& ExtendedDTM__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const ExtendedDTM__BSSGP&)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 @BSSGP_Types.ExtendedDTM_BSSGP."); } return *this; } ExtendedDTM__BSSGP_template& ExtendedDTM__BSSGP_template::operator=(const ExtendedDTM__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean ExtendedDTM__BSSGP_template::match(const ExtendedDTM__BSSGP& 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.ExtendedDTM__GPRSMultislot().is_bound()) return FALSE; if(!single_value->field_ExtendedDTM__GPRSMultislot.match(other_value.ExtendedDTM__GPRSMultislot(), legacy))return FALSE; if(!other_value.ExtendedDTM__EGPRSMultislot().is_bound()) return FALSE; if(!single_value->field_ExtendedDTM__EGPRSMultislot.match(other_value.ExtendedDTM__EGPRSMultislot(), 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 @BSSGP_Types.ExtendedDTM_BSSGP."); } return FALSE; } boolean ExtendedDTM__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_ExtendedDTM__GPRSMultislot.is_bound() || single_value->field_ExtendedDTM__EGPRSMultislot.is_bound(); } boolean ExtendedDTM__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_ExtendedDTM__GPRSMultislot.is_value() && single_value->field_ExtendedDTM__EGPRSMultislot.is_value(); } void ExtendedDTM__BSSGP_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; } ExtendedDTM__BSSGP ExtendedDTM__BSSGP_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 @BSSGP_Types.ExtendedDTM_BSSGP."); ExtendedDTM__BSSGP ret_val; if (single_value->field_ExtendedDTM__GPRSMultislot.is_bound()) { ret_val.ExtendedDTM__GPRSMultislot() = single_value->field_ExtendedDTM__GPRSMultislot.valueof(); } if (single_value->field_ExtendedDTM__EGPRSMultislot.is_bound()) { ret_val.ExtendedDTM__EGPRSMultislot() = single_value->field_ExtendedDTM__EGPRSMultislot.valueof(); } return ret_val; } void ExtendedDTM__BSSGP_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 @BSSGP_Types.ExtendedDTM_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new ExtendedDTM__BSSGP_template[list_length]; } ExtendedDTM__BSSGP_template& ExtendedDTM__BSSGP_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 @BSSGP_Types.ExtendedDTM_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.ExtendedDTM_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& ExtendedDTM__BSSGP_template::ExtendedDTM__GPRSMultislot() { set_specific(); return single_value->field_ExtendedDTM__GPRSMultislot; } const BITSTRING_template& ExtendedDTM__BSSGP_template::ExtendedDTM__GPRSMultislot() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ExtendedDTM_GPRSMultislot of a non-specific template of type @BSSGP_Types.ExtendedDTM_BSSGP."); return single_value->field_ExtendedDTM__GPRSMultislot; } BITSTRING_template& ExtendedDTM__BSSGP_template::ExtendedDTM__EGPRSMultislot() { set_specific(); return single_value->field_ExtendedDTM__EGPRSMultislot; } const BITSTRING_template& ExtendedDTM__BSSGP_template::ExtendedDTM__EGPRSMultislot() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ExtendedDTM_EGPRSMultislot of a non-specific template of type @BSSGP_Types.ExtendedDTM_BSSGP."); return single_value->field_ExtendedDTM__EGPRSMultislot; } int ExtendedDTM__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ExtendedDTM_BSSGP 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 @BSSGP_Types.ExtendedDTM_BSSGP 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 @BSSGP_Types.ExtendedDTM_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ExtendedDTM_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ExtendedDTM_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ExtendedDTM_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ExtendedDTM_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ExtendedDTM_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.ExtendedDTM_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.ExtendedDTM_BSSGP."); } return 0; } void ExtendedDTM__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ ExtendedDTM_GPRSMultislot := "); single_value->field_ExtendedDTM__GPRSMultislot.log(); TTCN_Logger::log_event_str(", ExtendedDTM_EGPRSMultislot := "); single_value->field_ExtendedDTM__EGPRSMultislot.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 ExtendedDTM__BSSGP_template::log_match(const ExtendedDTM__BSSGP& 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_ExtendedDTM__GPRSMultislot.match(match_value.ExtendedDTM__GPRSMultislot(), legacy)){ TTCN_Logger::log_logmatch_info(".ExtendedDTM_GPRSMultislot"); single_value->field_ExtendedDTM__GPRSMultislot.log_match(match_value.ExtendedDTM__GPRSMultislot(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ExtendedDTM__EGPRSMultislot.match(match_value.ExtendedDTM__EGPRSMultislot(), legacy)){ TTCN_Logger::log_logmatch_info(".ExtendedDTM_EGPRSMultislot"); single_value->field_ExtendedDTM__EGPRSMultislot.log_match(match_value.ExtendedDTM__EGPRSMultislot(), 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("{ ExtendedDTM_GPRSMultislot := "); single_value->field_ExtendedDTM__GPRSMultislot.log_match(match_value.ExtendedDTM__GPRSMultislot(), legacy); TTCN_Logger::log_event_str(", ExtendedDTM_EGPRSMultislot := "); single_value->field_ExtendedDTM__EGPRSMultislot.log_match(match_value.ExtendedDTM__EGPRSMultislot(), 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 ExtendedDTM__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_ExtendedDTM__GPRSMultislot.encode_text(text_buf); single_value->field_ExtendedDTM__EGPRSMultislot.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 @BSSGP_Types.ExtendedDTM_BSSGP."); } } void ExtendedDTM__BSSGP_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_ExtendedDTM__GPRSMultislot.decode_text(text_buf); single_value->field_ExtendedDTM__EGPRSMultislot.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 ExtendedDTM__BSSGP_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 @BSSGP_Types.ExtendedDTM_BSSGP."); } } void ExtendedDTM__BSSGP_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: { ExtendedDTM__BSSGP_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) ExtendedDTM__GPRSMultislot().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ExtendedDTM__EGPRSMultislot().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(), "ExtendedDTM_GPRSMultislot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ExtendedDTM__GPRSMultislot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ExtendedDTM_EGPRSMultislot")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ExtendedDTM__EGPRSMultislot().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.ExtendedDTM_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { ExtendedDTM__BSSGP_template* precondition = new ExtendedDTM__BSSGP_template; precondition->set_param(*param.get_elem(0)); ExtendedDTM__BSSGP_template* implied_template = new ExtendedDTM__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = ExtendedDTM__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.ExtendedDTM_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void ExtendedDTM__BSSGP_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_ExtendedDTM__GPRSMultislot.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ExtendedDTM_BSSGP"); single_value->field_ExtendedDTM__EGPRSMultislot.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.ExtendedDTM_BSSGP"); 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 : "@BSSGP_Types.ExtendedDTM_BSSGP"); } boolean ExtendedDTM__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean ExtendedDTM__BSSGP_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_accessCapAdditionsAfterRel4) : field_accessCapAdditionsRel4(par_accessCapAdditionsRel4), field_accessCapAdditionsAfterRel4(par_accessCapAdditionsAfterRel4) { } AccessCapAdditionsAfterRel99__BSSGP::AccessCapAdditionsAfterRel99__BSSGP(const AccessCapAdditionsAfterRel99__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); if (other_value.accessCapAdditionsRel4().is_bound()) field_accessCapAdditionsRel4 = other_value.accessCapAdditionsRel4(); else field_accessCapAdditionsRel4.clean_up(); if (other_value.accessCapAdditionsAfterRel4().is_bound()) field_accessCapAdditionsAfterRel4 = other_value.accessCapAdditionsAfterRel4(); else field_accessCapAdditionsAfterRel4.clean_up(); } void AccessCapAdditionsAfterRel99__BSSGP::clean_up() { field_accessCapAdditionsRel4.clean_up(); field_accessCapAdditionsAfterRel4.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel99__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel99__BSSGP_descr_; } AccessCapAdditionsAfterRel99__BSSGP& AccessCapAdditionsAfterRel99__BSSGP::operator=(const AccessCapAdditionsAfterRel99__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); if (other_value.accessCapAdditionsRel4().is_bound()) field_accessCapAdditionsRel4 = other_value.accessCapAdditionsRel4(); else field_accessCapAdditionsRel4.clean_up(); if (other_value.accessCapAdditionsAfterRel4().is_bound()) field_accessCapAdditionsAfterRel4 = other_value.accessCapAdditionsAfterRel4(); else field_accessCapAdditionsAfterRel4.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel99__BSSGP::operator==(const AccessCapAdditionsAfterRel99__BSSGP& other_value) const { return field_accessCapAdditionsRel4==other_value.field_accessCapAdditionsRel4 && field_accessCapAdditionsAfterRel4==other_value.field_accessCapAdditionsAfterRel4; } boolean AccessCapAdditionsAfterRel99__BSSGP::is_bound() const { return (field_accessCapAdditionsRel4.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel4.get_selection() || field_accessCapAdditionsAfterRel4.is_bound()); } boolean AccessCapAdditionsAfterRel99__BSSGP::is_value() const { return field_accessCapAdditionsRel4.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel4.get_selection() || field_accessCapAdditionsAfterRel4.is_value()); } int AccessCapAdditionsAfterRel99__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel4.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel99__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel4 := "); field_accessCapAdditionsRel4.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel4 := "); field_accessCapAdditionsAfterRel4.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel99__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel4().is_bound()) accessCapAdditionsRel4().set_implicit_omit(); if (!accessCapAdditionsAfterRel4().is_bound()) accessCapAdditionsAfterRel4() = OMIT_VALUE; else accessCapAdditionsAfterRel4().set_implicit_omit(); } void AccessCapAdditionsAfterRel99__BSSGP::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) accessCapAdditionsRel4().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel4().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(), "accessCapAdditionsRel4")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel4().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel4")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel4().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP"); } } void AccessCapAdditionsAfterRel99__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel4.encode_text(text_buf); field_accessCapAdditionsAfterRel4.encode_text(text_buf); } void AccessCapAdditionsAfterRel99__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel4.decode_text(text_buf); field_accessCapAdditionsAfterRel4.decode_text(text_buf); } void AccessCapAdditionsAfterRel99__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel99__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel99__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel99__BSSGP_accessCapAdditionsRel4_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel4.RAW_decode(AccessCapAdditionsAfterRel99__BSSGP_accessCapAdditionsRel4_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel4 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel99__BSSGP_accessCapAdditionsAfterRel4_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel4().RAW_decode(AccessCapAdditionsAfterRel99__BSSGP_accessCapAdditionsAfterRel4_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel4 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel4=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel99__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsAfterRel99__BSSGP_accessCapAdditionsRel4_descr_.raw); if (field_accessCapAdditionsAfterRel4.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel99__BSSGP_accessCapAdditionsAfterRel4_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel4.RAW_encode(AccessCapAdditionsAfterRel99__BSSGP_accessCapAdditionsRel4_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel4.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel4().RAW_encode(AccessCapAdditionsAfterRel99__BSSGP_accessCapAdditionsAfterRel4_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel99__BSSGP_template::single_value_struct { AccessCapAdditionsRel4__BSSGP_template field_accessCapAdditionsRel4; AccessCapAdditionsAfterRel4__BSSGP_template field_accessCapAdditionsAfterRel4; }; void AccessCapAdditionsAfterRel99__BSSGP_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_accessCapAdditionsRel4 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel4 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel99__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel99__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel4().is_bound()) { single_value->field_accessCapAdditionsRel4 = other_value.accessCapAdditionsRel4(); } else { single_value->field_accessCapAdditionsRel4.clean_up(); } if (other_value.accessCapAdditionsAfterRel4().is_bound()) { if (other_value.accessCapAdditionsAfterRel4().ispresent()) single_value->field_accessCapAdditionsAfterRel4 = other_value.accessCapAdditionsAfterRel4()(); else single_value->field_accessCapAdditionsAfterRel4 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel4.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel99__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel99__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel4().get_selection()) { single_value->field_accessCapAdditionsRel4 = other_value.accessCapAdditionsRel4(); } else { single_value->field_accessCapAdditionsRel4.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel4().get_selection()) { single_value->field_accessCapAdditionsAfterRel4 = other_value.accessCapAdditionsAfterRel4(); } else { single_value->field_accessCapAdditionsAfterRel4.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 AccessCapAdditionsAfterRel99__BSSGP_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 AccessCapAdditionsAfterRel99__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel99__BSSGP_template::AccessCapAdditionsAfterRel99__BSSGP_template() { } AccessCapAdditionsAfterRel99__BSSGP_template::AccessCapAdditionsAfterRel99__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel99__BSSGP_template::AccessCapAdditionsAfterRel99__BSSGP_template(const AccessCapAdditionsAfterRel99__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel99__BSSGP_template::AccessCapAdditionsAfterRel99__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel99__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel99__BSSGP_template::AccessCapAdditionsAfterRel99__BSSGP_template(AccessCapAdditionsAfterRel99__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel99__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel99__BSSGP_template::AccessCapAdditionsAfterRel99__BSSGP_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; } AccessCapAdditionsAfterRel99__BSSGP_template::AccessCapAdditionsAfterRel99__BSSGP_template(const AccessCapAdditionsAfterRel99__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel99__BSSGP_template::~AccessCapAdditionsAfterRel99__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel99__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel99__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_template::operator=(const AccessCapAdditionsAfterRel99__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel99__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel99__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); } return *this; } AccessCapAdditionsAfterRel99__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_template::operator=(const AccessCapAdditionsAfterRel99__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel99__BSSGP_template::match(const AccessCapAdditionsAfterRel99__BSSGP& 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.accessCapAdditionsRel4().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel4.match(other_value.accessCapAdditionsRel4(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel4().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel4().ispresent() ? !single_value->field_accessCapAdditionsAfterRel4.match((const AccessCapAdditionsAfterRel4__BSSGP&)other_value.accessCapAdditionsAfterRel4(), legacy) : !single_value->field_accessCapAdditionsAfterRel4.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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel99__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel4.is_bound() || (single_value->field_accessCapAdditionsAfterRel4.is_omit() || single_value->field_accessCapAdditionsAfterRel4.is_bound()); } boolean AccessCapAdditionsAfterRel99__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel4.is_value() && (single_value->field_accessCapAdditionsAfterRel4.is_omit() || single_value->field_accessCapAdditionsAfterRel4.is_value()); } void AccessCapAdditionsAfterRel99__BSSGP_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; } AccessCapAdditionsAfterRel99__BSSGP AccessCapAdditionsAfterRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); AccessCapAdditionsAfterRel99__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel4.is_bound()) { ret_val.accessCapAdditionsRel4() = single_value->field_accessCapAdditionsRel4.valueof(); } if (single_value->field_accessCapAdditionsAfterRel4.is_omit()) ret_val.accessCapAdditionsAfterRel4() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel4.is_bound()) { ret_val.accessCapAdditionsAfterRel4() = single_value->field_accessCapAdditionsAfterRel4.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel99__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel99__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel4__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_template::accessCapAdditionsRel4() { set_specific(); return single_value->field_accessCapAdditionsRel4; } const AccessCapAdditionsRel4__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_template::accessCapAdditionsRel4() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel4 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); return single_value->field_accessCapAdditionsRel4; } AccessCapAdditionsAfterRel4__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_template::accessCapAdditionsAfterRel4() { set_specific(); return single_value->field_accessCapAdditionsAfterRel4; } const AccessCapAdditionsAfterRel4__BSSGP_template& AccessCapAdditionsAfterRel99__BSSGP_template::accessCapAdditionsAfterRel4() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel4 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); return single_value->field_accessCapAdditionsAfterRel4; } int AccessCapAdditionsAfterRel99__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel4.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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel99__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel4 := "); single_value->field_accessCapAdditionsRel4.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel4 := "); single_value->field_accessCapAdditionsAfterRel4.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 AccessCapAdditionsAfterRel99__BSSGP_template::log_match(const AccessCapAdditionsAfterRel99__BSSGP& 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_accessCapAdditionsRel4.match(match_value.accessCapAdditionsRel4(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel4"); single_value->field_accessCapAdditionsRel4.log_match(match_value.accessCapAdditionsRel4(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel4().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel4.match(match_value.accessCapAdditionsAfterRel4(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel4"); single_value->field_accessCapAdditionsAfterRel4.log_match(match_value.accessCapAdditionsAfterRel4(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel4.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel4 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel4.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("{ accessCapAdditionsRel4 := "); single_value->field_accessCapAdditionsRel4.log_match(match_value.accessCapAdditionsRel4(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel4 := "); if (match_value.accessCapAdditionsAfterRel4().ispresent()) { single_value->field_accessCapAdditionsAfterRel4.log_match(match_value.accessCapAdditionsAfterRel4(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel4.log(); if (single_value->field_accessCapAdditionsAfterRel4.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 AccessCapAdditionsAfterRel99__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel4.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel4.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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); } } void AccessCapAdditionsAfterRel99__BSSGP_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_accessCapAdditionsRel4.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel4.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 AccessCapAdditionsAfterRel99__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP."); } } void AccessCapAdditionsAfterRel99__BSSGP_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: { AccessCapAdditionsAfterRel99__BSSGP_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) accessCapAdditionsRel4().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel4().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(), "accessCapAdditionsRel4")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel4().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel4")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel4().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel99__BSSGP_template* precondition = new AccessCapAdditionsAfterRel99__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel99__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel99__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel99__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel99__BSSGP_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_accessCapAdditionsRel4.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP"); single_value->field_accessCapAdditionsAfterRel4.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel99_BSSGP"); } boolean AccessCapAdditionsAfterRel99__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel99__BSSGP_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_highMultislotCapability, const BITSTRING& par_presenceBitGeranIuModeCapability, const OPTIONAL< GeranIuModeCap__BSSGP >& par_geranIuModeCap, const BITSTRING& par_gMSKMultislotPowerProfile, const BITSTRING& par_eightPSKMultislotPowerProfile) : field_presenceBitHighMultislotCapability(par_presenceBitHighMultislotCapability), field_highMultislotCapability(par_highMultislotCapability), field_presenceBitGeranIuModeCapability(par_presenceBitGeranIuModeCapability), field_geranIuModeCap(par_geranIuModeCap), field_gMSKMultislotPowerProfile(par_gMSKMultislotPowerProfile), field_eightPSKMultislotPowerProfile(par_eightPSKMultislotPowerProfile) { } AccessCapAdditionsRel5__BSSGP::AccessCapAdditionsRel5__BSSGP(const AccessCapAdditionsRel5__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); if (other_value.presenceBitHighMultislotCapability().is_bound()) field_presenceBitHighMultislotCapability = other_value.presenceBitHighMultislotCapability(); else field_presenceBitHighMultislotCapability.clean_up(); if (other_value.highMultislotCapability().is_bound()) field_highMultislotCapability = other_value.highMultislotCapability(); else field_highMultislotCapability.clean_up(); if (other_value.presenceBitGeranIuModeCapability().is_bound()) field_presenceBitGeranIuModeCapability = other_value.presenceBitGeranIuModeCapability(); else field_presenceBitGeranIuModeCapability.clean_up(); if (other_value.geranIuModeCap().is_bound()) field_geranIuModeCap = other_value.geranIuModeCap(); else field_geranIuModeCap.clean_up(); if (other_value.gMSKMultislotPowerProfile().is_bound()) field_gMSKMultislotPowerProfile = other_value.gMSKMultislotPowerProfile(); else field_gMSKMultislotPowerProfile.clean_up(); if (other_value.eightPSKMultislotPowerProfile().is_bound()) field_eightPSKMultislotPowerProfile = other_value.eightPSKMultislotPowerProfile(); else field_eightPSKMultislotPowerProfile.clean_up(); } void AccessCapAdditionsRel5__BSSGP::clean_up() { field_presenceBitHighMultislotCapability.clean_up(); field_highMultislotCapability.clean_up(); field_presenceBitGeranIuModeCapability.clean_up(); field_geranIuModeCap.clean_up(); field_gMSKMultislotPowerProfile.clean_up(); field_eightPSKMultislotPowerProfile.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsRel5__BSSGP::get_descriptor() const { return &AccessCapAdditionsRel5__BSSGP_descr_; } AccessCapAdditionsRel5__BSSGP& AccessCapAdditionsRel5__BSSGP::operator=(const AccessCapAdditionsRel5__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); if (other_value.presenceBitHighMultislotCapability().is_bound()) field_presenceBitHighMultislotCapability = other_value.presenceBitHighMultislotCapability(); else field_presenceBitHighMultislotCapability.clean_up(); if (other_value.highMultislotCapability().is_bound()) field_highMultislotCapability = other_value.highMultislotCapability(); else field_highMultislotCapability.clean_up(); if (other_value.presenceBitGeranIuModeCapability().is_bound()) field_presenceBitGeranIuModeCapability = other_value.presenceBitGeranIuModeCapability(); else field_presenceBitGeranIuModeCapability.clean_up(); if (other_value.geranIuModeCap().is_bound()) field_geranIuModeCap = other_value.geranIuModeCap(); else field_geranIuModeCap.clean_up(); if (other_value.gMSKMultislotPowerProfile().is_bound()) field_gMSKMultislotPowerProfile = other_value.gMSKMultislotPowerProfile(); else field_gMSKMultislotPowerProfile.clean_up(); if (other_value.eightPSKMultislotPowerProfile().is_bound()) field_eightPSKMultislotPowerProfile = other_value.eightPSKMultislotPowerProfile(); else field_eightPSKMultislotPowerProfile.clean_up(); } return *this; } boolean AccessCapAdditionsRel5__BSSGP::operator==(const AccessCapAdditionsRel5__BSSGP& other_value) const { return field_presenceBitHighMultislotCapability==other_value.field_presenceBitHighMultislotCapability && field_highMultislotCapability==other_value.field_highMultislotCapability && field_presenceBitGeranIuModeCapability==other_value.field_presenceBitGeranIuModeCapability && field_geranIuModeCap==other_value.field_geranIuModeCap && field_gMSKMultislotPowerProfile==other_value.field_gMSKMultislotPowerProfile && field_eightPSKMultislotPowerProfile==other_value.field_eightPSKMultislotPowerProfile; } boolean AccessCapAdditionsRel5__BSSGP::is_bound() const { return (field_presenceBitHighMultislotCapability.is_bound()) || (OPTIONAL_OMIT == field_highMultislotCapability.get_selection() || field_highMultislotCapability.is_bound()) || (field_presenceBitGeranIuModeCapability.is_bound()) || (OPTIONAL_OMIT == field_geranIuModeCap.get_selection() || field_geranIuModeCap.is_bound()) || (field_gMSKMultislotPowerProfile.is_bound()) || (field_eightPSKMultislotPowerProfile.is_bound()); } boolean AccessCapAdditionsRel5__BSSGP::is_value() const { return field_presenceBitHighMultislotCapability.is_value() && (OPTIONAL_OMIT == field_highMultislotCapability.get_selection() || field_highMultislotCapability.is_value()) && field_presenceBitGeranIuModeCapability.is_value() && (OPTIONAL_OMIT == field_geranIuModeCap.get_selection() || field_geranIuModeCap.is_value()) && field_gMSKMultislotPowerProfile.is_value() && field_eightPSKMultislotPowerProfile.is_value(); } int AccessCapAdditionsRel5__BSSGP::size_of() const { int ret_val = 4; if (field_highMultislotCapability.ispresent()) ret_val++; if (field_geranIuModeCap.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsRel5__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ presenceBitHighMultislotCapability := "); field_presenceBitHighMultislotCapability.log(); TTCN_Logger::log_event_str(", highMultislotCapability := "); field_highMultislotCapability.log(); TTCN_Logger::log_event_str(", presenceBitGeranIuModeCapability := "); field_presenceBitGeranIuModeCapability.log(); TTCN_Logger::log_event_str(", geranIuModeCap := "); field_geranIuModeCap.log(); TTCN_Logger::log_event_str(", gMSKMultislotPowerProfile := "); field_gMSKMultislotPowerProfile.log(); TTCN_Logger::log_event_str(", eightPSKMultislotPowerProfile := "); field_eightPSKMultislotPowerProfile.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsRel5__BSSGP::set_implicit_omit() { if (presenceBitHighMultislotCapability().is_bound()) presenceBitHighMultislotCapability().set_implicit_omit(); if (!highMultislotCapability().is_bound()) highMultislotCapability() = OMIT_VALUE; else highMultislotCapability().set_implicit_omit(); if (presenceBitGeranIuModeCapability().is_bound()) presenceBitGeranIuModeCapability().set_implicit_omit(); if (!geranIuModeCap().is_bound()) geranIuModeCap() = OMIT_VALUE; else geranIuModeCap().set_implicit_omit(); if (gMSKMultislotPowerProfile().is_bound()) gMSKMultislotPowerProfile().set_implicit_omit(); if (eightPSKMultislotPowerProfile().is_bound()) eightPSKMultislotPowerProfile().set_implicit_omit(); } void AccessCapAdditionsRel5__BSSGP::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 (60 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) presenceBitHighMultislotCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) highMultislotCapability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitGeranIuModeCapability().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) geranIuModeCap().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gMSKMultislotPowerProfile().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eightPSKMultislotPowerProfile().set_param(*param.get_elem(5)); 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(), "presenceBitHighMultislotCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitHighMultislotCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "highMultislotCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { highMultislotCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitGeranIuModeCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitGeranIuModeCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "geranIuModeCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { geranIuModeCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gMSKMultislotPowerProfile")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gMSKMultislotPowerProfile().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eightPSKMultislotPowerProfile")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eightPSKMultislotPowerProfile().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); } } void AccessCapAdditionsRel5__BSSGP::encode_text(Text_Buf& text_buf) const { field_presenceBitHighMultislotCapability.encode_text(text_buf); field_highMultislotCapability.encode_text(text_buf); field_presenceBitGeranIuModeCapability.encode_text(text_buf); field_geranIuModeCap.encode_text(text_buf); field_gMSKMultislotPowerProfile.encode_text(text_buf); field_eightPSKMultislotPowerProfile.encode_text(text_buf); } void AccessCapAdditionsRel5__BSSGP::decode_text(Text_Buf& text_buf) { field_presenceBitHighMultislotCapability.decode_text(text_buf); field_highMultislotCapability.decode_text(text_buf); field_presenceBitGeranIuModeCapability.decode_text(text_buf); field_geranIuModeCap.decode_text(text_buf); field_gMSKMultislotPowerProfile.decode_text(text_buf); field_eightPSKMultislotPowerProfile.decode_text(text_buf); } void AccessCapAdditionsRel5__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel5__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel5__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel5__BSSGP_presenceBitHighMultislotCapability_descr_.raw->forceomit); decoded_field_length = field_presenceBitHighMultislotCapability.RAW_decode(AccessCapAdditionsRel5__BSSGP_presenceBitHighMultislotCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitHighMultislotCapability == bs_0){ if (force_omit != NULL && (*force_omit)(1)) { field_highMultislotCapability = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel5__BSSGP_highMultislotCapability_descr_.raw->forceomit); decoded_field_length = field_highMultislotCapability().RAW_decode(AccessCapAdditionsRel5__BSSGP_highMultislotCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_highMultislotCapability = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_highMultislotCapability=OMIT_VALUE; RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel5__BSSGP_presenceBitGeranIuModeCapability_descr_.raw->forceomit); decoded_field_length = field_presenceBitGeranIuModeCapability.RAW_decode(AccessCapAdditionsRel5__BSSGP_presenceBitGeranIuModeCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitGeranIuModeCapability == bs_0){ if (force_omit != NULL && (*force_omit)(3)) { field_geranIuModeCap = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel5__BSSGP_geranIuModeCap_descr_.raw->forceomit); decoded_field_length = field_geranIuModeCap().RAW_decode(AccessCapAdditionsRel5__BSSGP_geranIuModeCap_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 1) { field_geranIuModeCap = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_geranIuModeCap=OMIT_VALUE; RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel5__BSSGP_gMSKMultislotPowerProfile_descr_.raw->forceomit); decoded_field_length = field_gMSKMultislotPowerProfile.RAW_decode(AccessCapAdditionsRel5__BSSGP_gMSKMultislotPowerProfile_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapAdditionsRel5__BSSGP_eightPSKMultislotPowerProfile_descr_.raw->forceomit); decoded_field_length = field_eightPSKMultislotPowerProfile.RAW_decode(AccessCapAdditionsRel5__BSSGP_eightPSKMultislotPowerProfile_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel5__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 6; myleaf.body.node.nodes = init_nodes_of_enc_tree(6); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel5__BSSGP_presenceBitHighMultislotCapability_descr_.raw); if (field_highMultislotCapability.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel5__BSSGP_highMultislotCapability_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel5__BSSGP_presenceBitGeranIuModeCapability_descr_.raw); if (field_geranIuModeCap.ispresent()) { myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel5__BSSGP_geranIuModeCap_descr_.raw); } else myleaf.body.node.nodes[3] = NULL; myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel5__BSSGP_gMSKMultislotPowerProfile_descr_.raw); myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel5__BSSGP_eightPSKMultislotPowerProfile_descr_.raw); encoded_length += field_presenceBitHighMultislotCapability.RAW_encode(AccessCapAdditionsRel5__BSSGP_presenceBitHighMultislotCapability_descr_, *myleaf.body.node.nodes[0]); if (field_highMultislotCapability.ispresent()) { encoded_length += field_highMultislotCapability().RAW_encode(AccessCapAdditionsRel5__BSSGP_highMultislotCapability_descr_, *myleaf.body.node.nodes[1]); } encoded_length += field_presenceBitGeranIuModeCapability.RAW_encode(AccessCapAdditionsRel5__BSSGP_presenceBitGeranIuModeCapability_descr_, *myleaf.body.node.nodes[2]); if (field_geranIuModeCap.ispresent()) { encoded_length += field_geranIuModeCap().RAW_encode(AccessCapAdditionsRel5__BSSGP_geranIuModeCap_descr_, *myleaf.body.node.nodes[3]); } encoded_length += field_gMSKMultislotPowerProfile.RAW_encode(AccessCapAdditionsRel5__BSSGP_gMSKMultislotPowerProfile_descr_, *myleaf.body.node.nodes[4]); encoded_length += field_eightPSKMultislotPowerProfile.RAW_encode(AccessCapAdditionsRel5__BSSGP_eightPSKMultislotPowerProfile_descr_, *myleaf.body.node.nodes[5]); if (field_highMultislotCapability.ispresent() && (field_presenceBitHighMultislotCapability != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapAdditionsRel5__BSSGP_presenceBitHighMultislotCapability_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } if (field_geranIuModeCap.ispresent() && (field_presenceBitGeranIuModeCapability != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={2}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapAdditionsRel5__BSSGP_presenceBitGeranIuModeCapability_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct AccessCapAdditionsRel5__BSSGP_template::single_value_struct { BITSTRING_template field_presenceBitHighMultislotCapability; BITSTRING_template field_highMultislotCapability; BITSTRING_template field_presenceBitGeranIuModeCapability; GeranIuModeCap__BSSGP_template field_geranIuModeCap; BITSTRING_template field_gMSKMultislotPowerProfile; BITSTRING_template field_eightPSKMultislotPowerProfile; }; void AccessCapAdditionsRel5__BSSGP_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_presenceBitHighMultislotCapability = ANY_VALUE; single_value->field_highMultislotCapability = ANY_OR_OMIT; single_value->field_presenceBitGeranIuModeCapability = ANY_VALUE; single_value->field_geranIuModeCap = ANY_OR_OMIT; single_value->field_gMSKMultislotPowerProfile = ANY_VALUE; single_value->field_eightPSKMultislotPowerProfile = ANY_VALUE; } } } void AccessCapAdditionsRel5__BSSGP_template::copy_value(const AccessCapAdditionsRel5__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.presenceBitHighMultislotCapability().is_bound()) { single_value->field_presenceBitHighMultislotCapability = other_value.presenceBitHighMultislotCapability(); } else { single_value->field_presenceBitHighMultislotCapability.clean_up(); } if (other_value.highMultislotCapability().is_bound()) { if (other_value.highMultislotCapability().ispresent()) single_value->field_highMultislotCapability = other_value.highMultislotCapability()(); else single_value->field_highMultislotCapability = OMIT_VALUE; } else { single_value->field_highMultislotCapability.clean_up(); } if (other_value.presenceBitGeranIuModeCapability().is_bound()) { single_value->field_presenceBitGeranIuModeCapability = other_value.presenceBitGeranIuModeCapability(); } else { single_value->field_presenceBitGeranIuModeCapability.clean_up(); } if (other_value.geranIuModeCap().is_bound()) { if (other_value.geranIuModeCap().ispresent()) single_value->field_geranIuModeCap = other_value.geranIuModeCap()(); else single_value->field_geranIuModeCap = OMIT_VALUE; } else { single_value->field_geranIuModeCap.clean_up(); } if (other_value.gMSKMultislotPowerProfile().is_bound()) { single_value->field_gMSKMultislotPowerProfile = other_value.gMSKMultislotPowerProfile(); } else { single_value->field_gMSKMultislotPowerProfile.clean_up(); } if (other_value.eightPSKMultislotPowerProfile().is_bound()) { single_value->field_eightPSKMultislotPowerProfile = other_value.eightPSKMultislotPowerProfile(); } else { single_value->field_eightPSKMultislotPowerProfile.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel5__BSSGP_template::copy_template(const AccessCapAdditionsRel5__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.presenceBitHighMultislotCapability().get_selection()) { single_value->field_presenceBitHighMultislotCapability = other_value.presenceBitHighMultislotCapability(); } else { single_value->field_presenceBitHighMultislotCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.highMultislotCapability().get_selection()) { single_value->field_highMultislotCapability = other_value.highMultislotCapability(); } else { single_value->field_highMultislotCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitGeranIuModeCapability().get_selection()) { single_value->field_presenceBitGeranIuModeCapability = other_value.presenceBitGeranIuModeCapability(); } else { single_value->field_presenceBitGeranIuModeCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.geranIuModeCap().get_selection()) { single_value->field_geranIuModeCap = other_value.geranIuModeCap(); } else { single_value->field_geranIuModeCap.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gMSKMultislotPowerProfile().get_selection()) { single_value->field_gMSKMultislotPowerProfile = other_value.gMSKMultislotPowerProfile(); } else { single_value->field_gMSKMultislotPowerProfile.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eightPSKMultislotPowerProfile().get_selection()) { single_value->field_eightPSKMultislotPowerProfile = other_value.eightPSKMultislotPowerProfile(); } else { single_value->field_eightPSKMultislotPowerProfile.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 AccessCapAdditionsRel5__BSSGP_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 AccessCapAdditionsRel5__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel5__BSSGP_template::AccessCapAdditionsRel5__BSSGP_template() { } AccessCapAdditionsRel5__BSSGP_template::AccessCapAdditionsRel5__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel5__BSSGP_template::AccessCapAdditionsRel5__BSSGP_template(const AccessCapAdditionsRel5__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel5__BSSGP_template::AccessCapAdditionsRel5__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel5__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel5__BSSGP_template::AccessCapAdditionsRel5__BSSGP_template(AccessCapAdditionsRel5__BSSGP_template* p_precondition, AccessCapAdditionsRel5__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel5__BSSGP_template::AccessCapAdditionsRel5__BSSGP_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; } AccessCapAdditionsRel5__BSSGP_template::AccessCapAdditionsRel5__BSSGP_template(const AccessCapAdditionsRel5__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel5__BSSGP_template::~AccessCapAdditionsRel5__BSSGP_template() { clean_up(); } AccessCapAdditionsRel5__BSSGP_template& AccessCapAdditionsRel5__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel5__BSSGP_template& AccessCapAdditionsRel5__BSSGP_template::operator=(const AccessCapAdditionsRel5__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel5__BSSGP_template& AccessCapAdditionsRel5__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel5__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); } return *this; } AccessCapAdditionsRel5__BSSGP_template& AccessCapAdditionsRel5__BSSGP_template::operator=(const AccessCapAdditionsRel5__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel5__BSSGP_template::match(const AccessCapAdditionsRel5__BSSGP& 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.presenceBitHighMultislotCapability().is_bound()) return FALSE; if(!single_value->field_presenceBitHighMultislotCapability.match(other_value.presenceBitHighMultislotCapability(), legacy))return FALSE; if(!other_value.highMultislotCapability().is_bound()) return FALSE; if((other_value.highMultislotCapability().ispresent() ? !single_value->field_highMultislotCapability.match((const BITSTRING&)other_value.highMultislotCapability(), legacy) : !single_value->field_highMultislotCapability.match_omit(legacy)))return FALSE; if(!other_value.presenceBitGeranIuModeCapability().is_bound()) return FALSE; if(!single_value->field_presenceBitGeranIuModeCapability.match(other_value.presenceBitGeranIuModeCapability(), legacy))return FALSE; if(!other_value.geranIuModeCap().is_bound()) return FALSE; if((other_value.geranIuModeCap().ispresent() ? !single_value->field_geranIuModeCap.match((const GeranIuModeCap__BSSGP&)other_value.geranIuModeCap(), legacy) : !single_value->field_geranIuModeCap.match_omit(legacy)))return FALSE; if(!other_value.gMSKMultislotPowerProfile().is_bound()) return FALSE; if(!single_value->field_gMSKMultislotPowerProfile.match(other_value.gMSKMultislotPowerProfile(), legacy))return FALSE; if(!other_value.eightPSKMultislotPowerProfile().is_bound()) return FALSE; if(!single_value->field_eightPSKMultislotPowerProfile.match(other_value.eightPSKMultislotPowerProfile(), 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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel5__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_presenceBitHighMultislotCapability.is_bound() || (single_value->field_highMultislotCapability.is_omit() || single_value->field_highMultislotCapability.is_bound()) || single_value->field_presenceBitGeranIuModeCapability.is_bound() || (single_value->field_geranIuModeCap.is_omit() || single_value->field_geranIuModeCap.is_bound()) || single_value->field_gMSKMultislotPowerProfile.is_bound() || single_value->field_eightPSKMultislotPowerProfile.is_bound(); } boolean AccessCapAdditionsRel5__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_presenceBitHighMultislotCapability.is_value() && (single_value->field_highMultislotCapability.is_omit() || single_value->field_highMultislotCapability.is_value()) && single_value->field_presenceBitGeranIuModeCapability.is_value() && (single_value->field_geranIuModeCap.is_omit() || single_value->field_geranIuModeCap.is_value()) && single_value->field_gMSKMultislotPowerProfile.is_value() && single_value->field_eightPSKMultislotPowerProfile.is_value(); } void AccessCapAdditionsRel5__BSSGP_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; } AccessCapAdditionsRel5__BSSGP AccessCapAdditionsRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); AccessCapAdditionsRel5__BSSGP ret_val; if (single_value->field_presenceBitHighMultislotCapability.is_bound()) { ret_val.presenceBitHighMultislotCapability() = single_value->field_presenceBitHighMultislotCapability.valueof(); } if (single_value->field_highMultislotCapability.is_omit()) ret_val.highMultislotCapability() = OMIT_VALUE; else if (single_value->field_highMultislotCapability.is_bound()) { ret_val.highMultislotCapability() = single_value->field_highMultislotCapability.valueof(); } if (single_value->field_presenceBitGeranIuModeCapability.is_bound()) { ret_val.presenceBitGeranIuModeCapability() = single_value->field_presenceBitGeranIuModeCapability.valueof(); } if (single_value->field_geranIuModeCap.is_omit()) ret_val.geranIuModeCap() = OMIT_VALUE; else if (single_value->field_geranIuModeCap.is_bound()) { ret_val.geranIuModeCap() = single_value->field_geranIuModeCap.valueof(); } if (single_value->field_gMSKMultislotPowerProfile.is_bound()) { ret_val.gMSKMultislotPowerProfile() = single_value->field_gMSKMultislotPowerProfile.valueof(); } if (single_value->field_eightPSKMultislotPowerProfile.is_bound()) { ret_val.eightPSKMultislotPowerProfile() = single_value->field_eightPSKMultislotPowerProfile.valueof(); } return ret_val; } void AccessCapAdditionsRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel5__BSSGP_template[list_length]; } AccessCapAdditionsRel5__BSSGP_template& AccessCapAdditionsRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::presenceBitHighMultislotCapability() { set_specific(); return single_value->field_presenceBitHighMultislotCapability; } const BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::presenceBitHighMultislotCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitHighMultislotCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); return single_value->field_presenceBitHighMultislotCapability; } BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::highMultislotCapability() { set_specific(); return single_value->field_highMultislotCapability; } const BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::highMultislotCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field highMultislotCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); return single_value->field_highMultislotCapability; } BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::presenceBitGeranIuModeCapability() { set_specific(); return single_value->field_presenceBitGeranIuModeCapability; } const BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::presenceBitGeranIuModeCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitGeranIuModeCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); return single_value->field_presenceBitGeranIuModeCapability; } GeranIuModeCap__BSSGP_template& AccessCapAdditionsRel5__BSSGP_template::geranIuModeCap() { set_specific(); return single_value->field_geranIuModeCap; } const GeranIuModeCap__BSSGP_template& AccessCapAdditionsRel5__BSSGP_template::geranIuModeCap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field geranIuModeCap of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); return single_value->field_geranIuModeCap; } BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::gMSKMultislotPowerProfile() { set_specific(); return single_value->field_gMSKMultislotPowerProfile; } const BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::gMSKMultislotPowerProfile() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gMSKMultislotPowerProfile of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); return single_value->field_gMSKMultislotPowerProfile; } BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::eightPSKMultislotPowerProfile() { set_specific(); return single_value->field_eightPSKMultislotPowerProfile; } const BITSTRING_template& AccessCapAdditionsRel5__BSSGP_template::eightPSKMultislotPowerProfile() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eightPSKMultislotPowerProfile of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); return single_value->field_eightPSKMultislotPowerProfile; } int AccessCapAdditionsRel5__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; if (single_value->field_highMultislotCapability.is_present()) ret_val++; if (single_value->field_geranIuModeCap.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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); } return 0; } void AccessCapAdditionsRel5__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ presenceBitHighMultislotCapability := "); single_value->field_presenceBitHighMultislotCapability.log(); TTCN_Logger::log_event_str(", highMultislotCapability := "); single_value->field_highMultislotCapability.log(); TTCN_Logger::log_event_str(", presenceBitGeranIuModeCapability := "); single_value->field_presenceBitGeranIuModeCapability.log(); TTCN_Logger::log_event_str(", geranIuModeCap := "); single_value->field_geranIuModeCap.log(); TTCN_Logger::log_event_str(", gMSKMultislotPowerProfile := "); single_value->field_gMSKMultislotPowerProfile.log(); TTCN_Logger::log_event_str(", eightPSKMultislotPowerProfile := "); single_value->field_eightPSKMultislotPowerProfile.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 AccessCapAdditionsRel5__BSSGP_template::log_match(const AccessCapAdditionsRel5__BSSGP& 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_presenceBitHighMultislotCapability.match(match_value.presenceBitHighMultislotCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitHighMultislotCapability"); single_value->field_presenceBitHighMultislotCapability.log_match(match_value.presenceBitHighMultislotCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.highMultislotCapability().ispresent()){ if(!single_value->field_highMultislotCapability.match(match_value.highMultislotCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".highMultislotCapability"); single_value->field_highMultislotCapability.log_match(match_value.highMultislotCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_highMultislotCapability.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".highMultislotCapability := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_highMultislotCapability.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_presenceBitGeranIuModeCapability.match(match_value.presenceBitGeranIuModeCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitGeranIuModeCapability"); single_value->field_presenceBitGeranIuModeCapability.log_match(match_value.presenceBitGeranIuModeCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.geranIuModeCap().ispresent()){ if(!single_value->field_geranIuModeCap.match(match_value.geranIuModeCap(), legacy)){ TTCN_Logger::log_logmatch_info(".geranIuModeCap"); single_value->field_geranIuModeCap.log_match(match_value.geranIuModeCap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_geranIuModeCap.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".geranIuModeCap := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_geranIuModeCap.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_gMSKMultislotPowerProfile.match(match_value.gMSKMultislotPowerProfile(), legacy)){ TTCN_Logger::log_logmatch_info(".gMSKMultislotPowerProfile"); single_value->field_gMSKMultislotPowerProfile.log_match(match_value.gMSKMultislotPowerProfile(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eightPSKMultislotPowerProfile.match(match_value.eightPSKMultislotPowerProfile(), legacy)){ TTCN_Logger::log_logmatch_info(".eightPSKMultislotPowerProfile"); single_value->field_eightPSKMultislotPowerProfile.log_match(match_value.eightPSKMultislotPowerProfile(), 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("{ presenceBitHighMultislotCapability := "); single_value->field_presenceBitHighMultislotCapability.log_match(match_value.presenceBitHighMultislotCapability(), legacy); TTCN_Logger::log_event_str(", highMultislotCapability := "); if (match_value.highMultislotCapability().ispresent()) { single_value->field_highMultislotCapability.log_match(match_value.highMultislotCapability(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_highMultislotCapability.log(); if (single_value->field_highMultislotCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", presenceBitGeranIuModeCapability := "); single_value->field_presenceBitGeranIuModeCapability.log_match(match_value.presenceBitGeranIuModeCapability(), legacy); TTCN_Logger::log_event_str(", geranIuModeCap := "); if (match_value.geranIuModeCap().ispresent()) { single_value->field_geranIuModeCap.log_match(match_value.geranIuModeCap(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_geranIuModeCap.log(); if (single_value->field_geranIuModeCap.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", gMSKMultislotPowerProfile := "); single_value->field_gMSKMultislotPowerProfile.log_match(match_value.gMSKMultislotPowerProfile(), legacy); TTCN_Logger::log_event_str(", eightPSKMultislotPowerProfile := "); single_value->field_eightPSKMultislotPowerProfile.log_match(match_value.eightPSKMultislotPowerProfile(), 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 AccessCapAdditionsRel5__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_presenceBitHighMultislotCapability.encode_text(text_buf); single_value->field_highMultislotCapability.encode_text(text_buf); single_value->field_presenceBitGeranIuModeCapability.encode_text(text_buf); single_value->field_geranIuModeCap.encode_text(text_buf); single_value->field_gMSKMultislotPowerProfile.encode_text(text_buf); single_value->field_eightPSKMultislotPowerProfile.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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); } } void AccessCapAdditionsRel5__BSSGP_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_presenceBitHighMultislotCapability.decode_text(text_buf); single_value->field_highMultislotCapability.decode_text(text_buf); single_value->field_presenceBitGeranIuModeCapability.decode_text(text_buf); single_value->field_geranIuModeCap.decode_text(text_buf); single_value->field_gMSKMultislotPowerProfile.decode_text(text_buf); single_value->field_eightPSKMultislotPowerProfile.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 AccessCapAdditionsRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel5_BSSGP."); } } void AccessCapAdditionsRel5__BSSGP_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: { AccessCapAdditionsRel5__BSSGP_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) presenceBitHighMultislotCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) highMultislotCapability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitGeranIuModeCapability().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) geranIuModeCap().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gMSKMultislotPowerProfile().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eightPSKMultislotPowerProfile().set_param(*param.get_elem(5)); 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(), "presenceBitHighMultislotCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitHighMultislotCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "highMultislotCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { highMultislotCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitGeranIuModeCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitGeranIuModeCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "geranIuModeCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { geranIuModeCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gMSKMultislotPowerProfile")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gMSKMultislotPowerProfile().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eightPSKMultislotPowerProfile")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eightPSKMultislotPowerProfile().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel5_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel5__BSSGP_template* precondition = new AccessCapAdditionsRel5__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel5__BSSGP_template* implied_template = new AccessCapAdditionsRel5__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel5__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel5__BSSGP_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_presenceBitHighMultislotCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); single_value->field_highMultislotCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); single_value->field_presenceBitGeranIuModeCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); single_value->field_geranIuModeCap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); single_value->field_gMSKMultislotPowerProfile.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); single_value->field_eightPSKMultislotPowerProfile.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel5_BSSGP"); } boolean AccessCapAdditionsRel5__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel5__BSSGP_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) lengthIndicator().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fLOIuCapability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare__bits().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(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fLOIuCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fLOIuCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "spare_bits")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { spare__bits().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.GeranIuModeCap_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.GeranIuModeCap_BSSGP"); } } void GeranIuModeCap__BSSGP::encode_text(Text_Buf& text_buf) const { field_lengthIndicator.encode_text(text_buf); field_fLOIuCapability.encode_text(text_buf); field_spare__bits.encode_text(text_buf); } void GeranIuModeCap__BSSGP::decode_text(Text_Buf& text_buf) { field_lengthIndicator.decode_text(text_buf); field_fLOIuCapability.decode_text(text_buf); field_spare__bits.decode_text(text_buf); } void GeranIuModeCap__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void GeranIuModeCap__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int GeranIuModeCap__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field0 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, GeranIuModeCap__BSSGP_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(GeranIuModeCap__BSSGP_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(GeranIuModeCap__BSSGP_lengthIndicator_descr_); field_lengthIndicator = tmp0; value_of_length_field0 += tmp0.get_long_long_val() * 1; RAW_Force_Omit field_1_force_omit(1, force_omit, GeranIuModeCap__BSSGP_fLOIuCapability_descr_.raw->forceomit); decoded_field_length = field_fLOIuCapability.RAW_decode(GeranIuModeCap__BSSGP_fLOIuCapability_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field0 -= decoded_field_length; RAW_Force_Omit field_2_force_omit(2, force_omit, GeranIuModeCap__BSSGP_spare__bits_descr_.raw->forceomit); decoded_field_length = field_spare__bits.RAW_decode(GeranIuModeCap__BSSGP_spare__bits_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field0 -= decoded_field_length; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int GeranIuModeCap__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 3; myleaf.body.node.nodes = init_nodes_of_enc_tree(3); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, GeranIuModeCap__BSSGP_lengthIndicator_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GeranIuModeCap__BSSGP_fLOIuCapability_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GeranIuModeCap__BSSGP_spare__bits_descr_.raw); encoded_length += 4; myleaf.body.node.nodes[0]->calc = CALC_LENGTH; myleaf.body.node.nodes[0]->coding_descr = &GeranIuModeCap__BSSGP_lengthIndicator_descr_; myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 2; myleaf.body.node.nodes[0]->calcof.lengthto.unit = 1; myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(2); myleaf.body.node.nodes[0]->length = 4; myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level; myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos; myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level; myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos; encoded_length += field_fLOIuCapability.RAW_encode(GeranIuModeCap__BSSGP_fLOIuCapability_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_spare__bits.RAW_encode(GeranIuModeCap__BSSGP_spare__bits_descr_, *myleaf.body.node.nodes[2]); return myleaf.length = encoded_length; } struct GeranIuModeCap__BSSGP_template::single_value_struct { INTEGER_template field_lengthIndicator; BITSTRING_template field_fLOIuCapability; BITSTRING_template field_spare__bits; }; void GeranIuModeCap__BSSGP_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_lengthIndicator = ANY_VALUE; single_value->field_fLOIuCapability = ANY_VALUE; single_value->field_spare__bits = ANY_VALUE; } } } void GeranIuModeCap__BSSGP_template::copy_value(const GeranIuModeCap__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.fLOIuCapability().is_bound()) { single_value->field_fLOIuCapability = other_value.fLOIuCapability(); } else { single_value->field_fLOIuCapability.clean_up(); } if (other_value.spare__bits().is_bound()) { single_value->field_spare__bits = other_value.spare__bits(); } else { single_value->field_spare__bits.clean_up(); } set_selection(SPECIFIC_VALUE); } void GeranIuModeCap__BSSGP_template::copy_template(const GeranIuModeCap__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.fLOIuCapability().get_selection()) { single_value->field_fLOIuCapability = other_value.fLOIuCapability(); } else { single_value->field_fLOIuCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.spare__bits().get_selection()) { single_value->field_spare__bits = other_value.spare__bits(); } else { single_value->field_spare__bits.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 GeranIuModeCap__BSSGP_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 GeranIuModeCap__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new GeranIuModeCap__BSSGP_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 @BSSGP_Types.GeranIuModeCap_BSSGP."); break; } set_selection(other_value); } GeranIuModeCap__BSSGP_template::GeranIuModeCap__BSSGP_template() { } GeranIuModeCap__BSSGP_template::GeranIuModeCap__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } GeranIuModeCap__BSSGP_template::GeranIuModeCap__BSSGP_template(const GeranIuModeCap__BSSGP& other_value) { copy_value(other_value); } GeranIuModeCap__BSSGP_template::GeranIuModeCap__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GeranIuModeCap__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.GeranIuModeCap_BSSGP from an unbound optional field."); } } GeranIuModeCap__BSSGP_template::GeranIuModeCap__BSSGP_template(GeranIuModeCap__BSSGP_template* p_precondition, GeranIuModeCap__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } GeranIuModeCap__BSSGP_template::GeranIuModeCap__BSSGP_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; } GeranIuModeCap__BSSGP_template::GeranIuModeCap__BSSGP_template(const GeranIuModeCap__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } GeranIuModeCap__BSSGP_template::~GeranIuModeCap__BSSGP_template() { clean_up(); } GeranIuModeCap__BSSGP_template& GeranIuModeCap__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } GeranIuModeCap__BSSGP_template& GeranIuModeCap__BSSGP_template::operator=(const GeranIuModeCap__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } GeranIuModeCap__BSSGP_template& GeranIuModeCap__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const GeranIuModeCap__BSSGP&)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 @BSSGP_Types.GeranIuModeCap_BSSGP."); } return *this; } GeranIuModeCap__BSSGP_template& GeranIuModeCap__BSSGP_template::operator=(const GeranIuModeCap__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean GeranIuModeCap__BSSGP_template::match(const GeranIuModeCap__BSSGP& 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.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.fLOIuCapability().is_bound()) return FALSE; if(!single_value->field_fLOIuCapability.match(other_value.fLOIuCapability(), legacy))return FALSE; if(!other_value.spare__bits().is_bound()) return FALSE; if(!single_value->field_spare__bits.match(other_value.spare__bits(), 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 @BSSGP_Types.GeranIuModeCap_BSSGP."); } return FALSE; } boolean GeranIuModeCap__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_lengthIndicator.is_bound() || single_value->field_fLOIuCapability.is_bound() || single_value->field_spare__bits.is_bound(); } boolean GeranIuModeCap__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_lengthIndicator.is_value() && single_value->field_fLOIuCapability.is_value() && single_value->field_spare__bits.is_value(); } void GeranIuModeCap__BSSGP_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; } GeranIuModeCap__BSSGP GeranIuModeCap__BSSGP_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 @BSSGP_Types.GeranIuModeCap_BSSGP."); GeranIuModeCap__BSSGP ret_val; if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_fLOIuCapability.is_bound()) { ret_val.fLOIuCapability() = single_value->field_fLOIuCapability.valueof(); } if (single_value->field_spare__bits.is_bound()) { ret_val.spare__bits() = single_value->field_spare__bits.valueof(); } return ret_val; } void GeranIuModeCap__BSSGP_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 @BSSGP_Types.GeranIuModeCap_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new GeranIuModeCap__BSSGP_template[list_length]; } GeranIuModeCap__BSSGP_template& GeranIuModeCap__BSSGP_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 @BSSGP_Types.GeranIuModeCap_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.GeranIuModeCap_BSSGP."); return value_list.list_value[list_index]; } INTEGER_template& GeranIuModeCap__BSSGP_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const INTEGER_template& GeranIuModeCap__BSSGP_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.GeranIuModeCap_BSSGP."); return single_value->field_lengthIndicator; } BITSTRING_template& GeranIuModeCap__BSSGP_template::fLOIuCapability() { set_specific(); return single_value->field_fLOIuCapability; } const BITSTRING_template& GeranIuModeCap__BSSGP_template::fLOIuCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field fLOIuCapability of a non-specific template of type @BSSGP_Types.GeranIuModeCap_BSSGP."); return single_value->field_fLOIuCapability; } BITSTRING_template& GeranIuModeCap__BSSGP_template::spare__bits() { set_specific(); return single_value->field_spare__bits; } const BITSTRING_template& GeranIuModeCap__BSSGP_template::spare__bits() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field spare_bits of a non-specific template of type @BSSGP_Types.GeranIuModeCap_BSSGP."); return single_value->field_spare__bits; } int GeranIuModeCap__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GeranIuModeCap_BSSGP 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 @BSSGP_Types.GeranIuModeCap_BSSGP 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 @BSSGP_Types.GeranIuModeCap_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GeranIuModeCap_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GeranIuModeCap_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GeranIuModeCap_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GeranIuModeCap_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GeranIuModeCap_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.GeranIuModeCap_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.GeranIuModeCap_BSSGP."); } return 0; } void GeranIuModeCap__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", fLOIuCapability := "); single_value->field_fLOIuCapability.log(); TTCN_Logger::log_event_str(", spare_bits := "); single_value->field_spare__bits.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 GeranIuModeCap__BSSGP_template::log_match(const GeranIuModeCap__BSSGP& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_fLOIuCapability.match(match_value.fLOIuCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".fLOIuCapability"); single_value->field_fLOIuCapability.log_match(match_value.fLOIuCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_spare__bits.match(match_value.spare__bits(), legacy)){ TTCN_Logger::log_logmatch_info(".spare_bits"); single_value->field_spare__bits.log_match(match_value.spare__bits(), 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("{ lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", fLOIuCapability := "); single_value->field_fLOIuCapability.log_match(match_value.fLOIuCapability(), legacy); TTCN_Logger::log_event_str(", spare_bits := "); single_value->field_spare__bits.log_match(match_value.spare__bits(), 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 GeranIuModeCap__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_fLOIuCapability.encode_text(text_buf); single_value->field_spare__bits.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 @BSSGP_Types.GeranIuModeCap_BSSGP."); } } void GeranIuModeCap__BSSGP_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_lengthIndicator.decode_text(text_buf); single_value->field_fLOIuCapability.decode_text(text_buf); single_value->field_spare__bits.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 GeranIuModeCap__BSSGP_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 @BSSGP_Types.GeranIuModeCap_BSSGP."); } } void GeranIuModeCap__BSSGP_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: { GeranIuModeCap__BSSGP_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) lengthIndicator().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fLOIuCapability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare__bits().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(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fLOIuCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fLOIuCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "spare_bits")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { spare__bits().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.GeranIuModeCap_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { GeranIuModeCap__BSSGP_template* precondition = new GeranIuModeCap__BSSGP_template; precondition->set_param(*param.get_elem(0)); GeranIuModeCap__BSSGP_template* implied_template = new GeranIuModeCap__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = GeranIuModeCap__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.GeranIuModeCap_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void GeranIuModeCap__BSSGP_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GeranIuModeCap_BSSGP"); single_value->field_fLOIuCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GeranIuModeCap_BSSGP"); single_value->field_spare__bits.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.GeranIuModeCap_BSSGP"); 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 : "@BSSGP_Types.GeranIuModeCap_BSSGP"); } boolean GeranIuModeCap__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean GeranIuModeCap__BSSGP_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_accessCapAdditionsAfterRel5) : field_accessCapAdditionsRel5(par_accessCapAdditionsRel5), field_accessCapAdditionsAfterRel5(par_accessCapAdditionsAfterRel5) { } AccessCapAdditionsAfterRel4__BSSGP::AccessCapAdditionsAfterRel4__BSSGP(const AccessCapAdditionsAfterRel4__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); if (other_value.accessCapAdditionsRel5().is_bound()) field_accessCapAdditionsRel5 = other_value.accessCapAdditionsRel5(); else field_accessCapAdditionsRel5.clean_up(); if (other_value.accessCapAdditionsAfterRel5().is_bound()) field_accessCapAdditionsAfterRel5 = other_value.accessCapAdditionsAfterRel5(); else field_accessCapAdditionsAfterRel5.clean_up(); } void AccessCapAdditionsAfterRel4__BSSGP::clean_up() { field_accessCapAdditionsRel5.clean_up(); field_accessCapAdditionsAfterRel5.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel4__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel4__BSSGP_descr_; } AccessCapAdditionsAfterRel4__BSSGP& AccessCapAdditionsAfterRel4__BSSGP::operator=(const AccessCapAdditionsAfterRel4__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); if (other_value.accessCapAdditionsRel5().is_bound()) field_accessCapAdditionsRel5 = other_value.accessCapAdditionsRel5(); else field_accessCapAdditionsRel5.clean_up(); if (other_value.accessCapAdditionsAfterRel5().is_bound()) field_accessCapAdditionsAfterRel5 = other_value.accessCapAdditionsAfterRel5(); else field_accessCapAdditionsAfterRel5.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel4__BSSGP::operator==(const AccessCapAdditionsAfterRel4__BSSGP& other_value) const { return field_accessCapAdditionsRel5==other_value.field_accessCapAdditionsRel5 && field_accessCapAdditionsAfterRel5==other_value.field_accessCapAdditionsAfterRel5; } boolean AccessCapAdditionsAfterRel4__BSSGP::is_bound() const { return (field_accessCapAdditionsRel5.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel5.get_selection() || field_accessCapAdditionsAfterRel5.is_bound()); } boolean AccessCapAdditionsAfterRel4__BSSGP::is_value() const { return field_accessCapAdditionsRel5.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel5.get_selection() || field_accessCapAdditionsAfterRel5.is_value()); } int AccessCapAdditionsAfterRel4__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel5.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel4__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel5 := "); field_accessCapAdditionsRel5.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel5 := "); field_accessCapAdditionsAfterRel5.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel4__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel5().is_bound()) accessCapAdditionsRel5().set_implicit_omit(); if (!accessCapAdditionsAfterRel5().is_bound()) accessCapAdditionsAfterRel5() = OMIT_VALUE; else accessCapAdditionsAfterRel5().set_implicit_omit(); } void AccessCapAdditionsAfterRel4__BSSGP::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) accessCapAdditionsRel5().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel5().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(), "accessCapAdditionsRel5")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel5().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel5")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel5().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP"); } } void AccessCapAdditionsAfterRel4__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel5.encode_text(text_buf); field_accessCapAdditionsAfterRel5.encode_text(text_buf); } void AccessCapAdditionsAfterRel4__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel5.decode_text(text_buf); field_accessCapAdditionsAfterRel5.decode_text(text_buf); } void AccessCapAdditionsAfterRel4__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel4__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel4__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel4__BSSGP_accessCapAdditionsRel5_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel5.RAW_decode(AccessCapAdditionsAfterRel4__BSSGP_accessCapAdditionsRel5_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel5 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel4__BSSGP_accessCapAdditionsAfterRel5_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel5().RAW_decode(AccessCapAdditionsAfterRel4__BSSGP_accessCapAdditionsAfterRel5_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel5 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel5=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel4__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsAfterRel4__BSSGP_accessCapAdditionsRel5_descr_.raw); if (field_accessCapAdditionsAfterRel5.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel4__BSSGP_accessCapAdditionsAfterRel5_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel5.RAW_encode(AccessCapAdditionsAfterRel4__BSSGP_accessCapAdditionsRel5_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel5.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel5().RAW_encode(AccessCapAdditionsAfterRel4__BSSGP_accessCapAdditionsAfterRel5_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel4__BSSGP_template::single_value_struct { AccessCapAdditionsRel5__BSSGP_template field_accessCapAdditionsRel5; AccessCapAdditionsAfterRel5__BSSGP_template field_accessCapAdditionsAfterRel5; }; void AccessCapAdditionsAfterRel4__BSSGP_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_accessCapAdditionsRel5 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel5 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel4__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel4__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel5().is_bound()) { single_value->field_accessCapAdditionsRel5 = other_value.accessCapAdditionsRel5(); } else { single_value->field_accessCapAdditionsRel5.clean_up(); } if (other_value.accessCapAdditionsAfterRel5().is_bound()) { if (other_value.accessCapAdditionsAfterRel5().ispresent()) single_value->field_accessCapAdditionsAfterRel5 = other_value.accessCapAdditionsAfterRel5()(); else single_value->field_accessCapAdditionsAfterRel5 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel5.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel4__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel4__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel5().get_selection()) { single_value->field_accessCapAdditionsRel5 = other_value.accessCapAdditionsRel5(); } else { single_value->field_accessCapAdditionsRel5.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel5().get_selection()) { single_value->field_accessCapAdditionsAfterRel5 = other_value.accessCapAdditionsAfterRel5(); } else { single_value->field_accessCapAdditionsAfterRel5.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 AccessCapAdditionsAfterRel4__BSSGP_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 AccessCapAdditionsAfterRel4__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel4__BSSGP_template::AccessCapAdditionsAfterRel4__BSSGP_template() { } AccessCapAdditionsAfterRel4__BSSGP_template::AccessCapAdditionsAfterRel4__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel4__BSSGP_template::AccessCapAdditionsAfterRel4__BSSGP_template(const AccessCapAdditionsAfterRel4__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel4__BSSGP_template::AccessCapAdditionsAfterRel4__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel4__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel4__BSSGP_template::AccessCapAdditionsAfterRel4__BSSGP_template(AccessCapAdditionsAfterRel4__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel4__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel4__BSSGP_template::AccessCapAdditionsAfterRel4__BSSGP_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; } AccessCapAdditionsAfterRel4__BSSGP_template::AccessCapAdditionsAfterRel4__BSSGP_template(const AccessCapAdditionsAfterRel4__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel4__BSSGP_template::~AccessCapAdditionsAfterRel4__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel4__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel4__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_template::operator=(const AccessCapAdditionsAfterRel4__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel4__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel4__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); } return *this; } AccessCapAdditionsAfterRel4__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_template::operator=(const AccessCapAdditionsAfterRel4__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel4__BSSGP_template::match(const AccessCapAdditionsAfterRel4__BSSGP& 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.accessCapAdditionsRel5().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel5.match(other_value.accessCapAdditionsRel5(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel5().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel5().ispresent() ? !single_value->field_accessCapAdditionsAfterRel5.match((const AccessCapAdditionsAfterRel5__BSSGP&)other_value.accessCapAdditionsAfterRel5(), legacy) : !single_value->field_accessCapAdditionsAfterRel5.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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel4__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel5.is_bound() || (single_value->field_accessCapAdditionsAfterRel5.is_omit() || single_value->field_accessCapAdditionsAfterRel5.is_bound()); } boolean AccessCapAdditionsAfterRel4__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel5.is_value() && (single_value->field_accessCapAdditionsAfterRel5.is_omit() || single_value->field_accessCapAdditionsAfterRel5.is_value()); } void AccessCapAdditionsAfterRel4__BSSGP_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; } AccessCapAdditionsAfterRel4__BSSGP AccessCapAdditionsAfterRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); AccessCapAdditionsAfterRel4__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel5.is_bound()) { ret_val.accessCapAdditionsRel5() = single_value->field_accessCapAdditionsRel5.valueof(); } if (single_value->field_accessCapAdditionsAfterRel5.is_omit()) ret_val.accessCapAdditionsAfterRel5() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel5.is_bound()) { ret_val.accessCapAdditionsAfterRel5() = single_value->field_accessCapAdditionsAfterRel5.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel4__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel4__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel5__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_template::accessCapAdditionsRel5() { set_specific(); return single_value->field_accessCapAdditionsRel5; } const AccessCapAdditionsRel5__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_template::accessCapAdditionsRel5() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel5 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); return single_value->field_accessCapAdditionsRel5; } AccessCapAdditionsAfterRel5__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_template::accessCapAdditionsAfterRel5() { set_specific(); return single_value->field_accessCapAdditionsAfterRel5; } const AccessCapAdditionsAfterRel5__BSSGP_template& AccessCapAdditionsAfterRel4__BSSGP_template::accessCapAdditionsAfterRel5() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel5 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); return single_value->field_accessCapAdditionsAfterRel5; } int AccessCapAdditionsAfterRel4__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel5.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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel4__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel5 := "); single_value->field_accessCapAdditionsRel5.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel5 := "); single_value->field_accessCapAdditionsAfterRel5.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 AccessCapAdditionsAfterRel4__BSSGP_template::log_match(const AccessCapAdditionsAfterRel4__BSSGP& 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_accessCapAdditionsRel5.match(match_value.accessCapAdditionsRel5(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel5"); single_value->field_accessCapAdditionsRel5.log_match(match_value.accessCapAdditionsRel5(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel5().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel5.match(match_value.accessCapAdditionsAfterRel5(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel5"); single_value->field_accessCapAdditionsAfterRel5.log_match(match_value.accessCapAdditionsAfterRel5(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel5.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel5 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel5.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("{ accessCapAdditionsRel5 := "); single_value->field_accessCapAdditionsRel5.log_match(match_value.accessCapAdditionsRel5(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel5 := "); if (match_value.accessCapAdditionsAfterRel5().ispresent()) { single_value->field_accessCapAdditionsAfterRel5.log_match(match_value.accessCapAdditionsAfterRel5(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel5.log(); if (single_value->field_accessCapAdditionsAfterRel5.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 AccessCapAdditionsAfterRel4__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel5.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel5.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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); } } void AccessCapAdditionsAfterRel4__BSSGP_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_accessCapAdditionsRel5.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel5.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 AccessCapAdditionsAfterRel4__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP."); } } void AccessCapAdditionsAfterRel4__BSSGP_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: { AccessCapAdditionsAfterRel4__BSSGP_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) accessCapAdditionsRel5().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel5().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(), "accessCapAdditionsRel5")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel5().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel5")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel5().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel4__BSSGP_template* precondition = new AccessCapAdditionsAfterRel4__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel4__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel4__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel4__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel4__BSSGP_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_accessCapAdditionsRel5.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP"); single_value->field_accessCapAdditionsAfterRel5.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel4_BSSGP"); } boolean AccessCapAdditionsAfterRel4__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel4__BSSGP_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_dTMGPRSHighMultiSlotClass, const BITSTRING& par_pSHandoverCapability) : field_multipleTBFCapability(par_multipleTBFCapability), field_downlinkAdvancedReceiverPerformance(par_downlinkAdvancedReceiverPerformance), field_extendedRLCMACCtrlMsgSegmentationCap(par_extendedRLCMACCtrlMsgSegmentationCap), field_dTMEnhancementsCapability(par_dTMEnhancementsCapability), field_presenceBitDTMGPRSHighMultiSlotClass(par_presenceBitDTMGPRSHighMultiSlotClass), field_dTMGPRSHighMultiSlotClass(par_dTMGPRSHighMultiSlotClass), field_pSHandoverCapability(par_pSHandoverCapability) { } AccessCapAdditionsRel6__BSSGP::AccessCapAdditionsRel6__BSSGP(const AccessCapAdditionsRel6__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); if (other_value.multipleTBFCapability().is_bound()) field_multipleTBFCapability = other_value.multipleTBFCapability(); else field_multipleTBFCapability.clean_up(); if (other_value.downlinkAdvancedReceiverPerformance().is_bound()) field_downlinkAdvancedReceiverPerformance = other_value.downlinkAdvancedReceiverPerformance(); else field_downlinkAdvancedReceiverPerformance.clean_up(); if (other_value.extendedRLCMACCtrlMsgSegmentationCap().is_bound()) field_extendedRLCMACCtrlMsgSegmentationCap = other_value.extendedRLCMACCtrlMsgSegmentationCap(); else field_extendedRLCMACCtrlMsgSegmentationCap.clean_up(); if (other_value.dTMEnhancementsCapability().is_bound()) field_dTMEnhancementsCapability = other_value.dTMEnhancementsCapability(); else field_dTMEnhancementsCapability.clean_up(); if (other_value.presenceBitDTMGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMGPRSHighMultiSlotClass = other_value.presenceBitDTMGPRSHighMultiSlotClass(); else field_presenceBitDTMGPRSHighMultiSlotClass.clean_up(); if (other_value.dTMGPRSHighMultiSlotClass().is_bound()) field_dTMGPRSHighMultiSlotClass = other_value.dTMGPRSHighMultiSlotClass(); else field_dTMGPRSHighMultiSlotClass.clean_up(); if (other_value.pSHandoverCapability().is_bound()) field_pSHandoverCapability = other_value.pSHandoverCapability(); else field_pSHandoverCapability.clean_up(); } void AccessCapAdditionsRel6__BSSGP::clean_up() { field_multipleTBFCapability.clean_up(); field_downlinkAdvancedReceiverPerformance.clean_up(); field_extendedRLCMACCtrlMsgSegmentationCap.clean_up(); field_dTMEnhancementsCapability.clean_up(); field_presenceBitDTMGPRSHighMultiSlotClass.clean_up(); field_dTMGPRSHighMultiSlotClass.clean_up(); field_pSHandoverCapability.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsRel6__BSSGP::get_descriptor() const { return &AccessCapAdditionsRel6__BSSGP_descr_; } AccessCapAdditionsRel6__BSSGP& AccessCapAdditionsRel6__BSSGP::operator=(const AccessCapAdditionsRel6__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); if (other_value.multipleTBFCapability().is_bound()) field_multipleTBFCapability = other_value.multipleTBFCapability(); else field_multipleTBFCapability.clean_up(); if (other_value.downlinkAdvancedReceiverPerformance().is_bound()) field_downlinkAdvancedReceiverPerformance = other_value.downlinkAdvancedReceiverPerformance(); else field_downlinkAdvancedReceiverPerformance.clean_up(); if (other_value.extendedRLCMACCtrlMsgSegmentationCap().is_bound()) field_extendedRLCMACCtrlMsgSegmentationCap = other_value.extendedRLCMACCtrlMsgSegmentationCap(); else field_extendedRLCMACCtrlMsgSegmentationCap.clean_up(); if (other_value.dTMEnhancementsCapability().is_bound()) field_dTMEnhancementsCapability = other_value.dTMEnhancementsCapability(); else field_dTMEnhancementsCapability.clean_up(); if (other_value.presenceBitDTMGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMGPRSHighMultiSlotClass = other_value.presenceBitDTMGPRSHighMultiSlotClass(); else field_presenceBitDTMGPRSHighMultiSlotClass.clean_up(); if (other_value.dTMGPRSHighMultiSlotClass().is_bound()) field_dTMGPRSHighMultiSlotClass = other_value.dTMGPRSHighMultiSlotClass(); else field_dTMGPRSHighMultiSlotClass.clean_up(); if (other_value.pSHandoverCapability().is_bound()) field_pSHandoverCapability = other_value.pSHandoverCapability(); else field_pSHandoverCapability.clean_up(); } return *this; } boolean AccessCapAdditionsRel6__BSSGP::operator==(const AccessCapAdditionsRel6__BSSGP& other_value) const { return field_multipleTBFCapability==other_value.field_multipleTBFCapability && field_downlinkAdvancedReceiverPerformance==other_value.field_downlinkAdvancedReceiverPerformance && field_extendedRLCMACCtrlMsgSegmentationCap==other_value.field_extendedRLCMACCtrlMsgSegmentationCap && field_dTMEnhancementsCapability==other_value.field_dTMEnhancementsCapability && field_presenceBitDTMGPRSHighMultiSlotClass==other_value.field_presenceBitDTMGPRSHighMultiSlotClass && field_dTMGPRSHighMultiSlotClass==other_value.field_dTMGPRSHighMultiSlotClass && field_pSHandoverCapability==other_value.field_pSHandoverCapability; } boolean AccessCapAdditionsRel6__BSSGP::is_bound() const { return (field_multipleTBFCapability.is_bound()) || (field_downlinkAdvancedReceiverPerformance.is_bound()) || (field_extendedRLCMACCtrlMsgSegmentationCap.is_bound()) || (field_dTMEnhancementsCapability.is_bound()) || (field_presenceBitDTMGPRSHighMultiSlotClass.is_bound()) || (OPTIONAL_OMIT == field_dTMGPRSHighMultiSlotClass.get_selection() || field_dTMGPRSHighMultiSlotClass.is_bound()) || (field_pSHandoverCapability.is_bound()); } boolean AccessCapAdditionsRel6__BSSGP::is_value() const { return field_multipleTBFCapability.is_value() && field_downlinkAdvancedReceiverPerformance.is_value() && field_extendedRLCMACCtrlMsgSegmentationCap.is_value() && field_dTMEnhancementsCapability.is_value() && field_presenceBitDTMGPRSHighMultiSlotClass.is_value() && (OPTIONAL_OMIT == field_dTMGPRSHighMultiSlotClass.get_selection() || field_dTMGPRSHighMultiSlotClass.is_value()) && field_pSHandoverCapability.is_value(); } int AccessCapAdditionsRel6__BSSGP::size_of() const { int ret_val = 6; if (field_dTMGPRSHighMultiSlotClass.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsRel6__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ multipleTBFCapability := "); field_multipleTBFCapability.log(); TTCN_Logger::log_event_str(", downlinkAdvancedReceiverPerformance := "); field_downlinkAdvancedReceiverPerformance.log(); TTCN_Logger::log_event_str(", extendedRLCMACCtrlMsgSegmentationCap := "); field_extendedRLCMACCtrlMsgSegmentationCap.log(); TTCN_Logger::log_event_str(", dTMEnhancementsCapability := "); field_dTMEnhancementsCapability.log(); TTCN_Logger::log_event_str(", presenceBitDTMGPRSHighMultiSlotClass := "); field_presenceBitDTMGPRSHighMultiSlotClass.log(); TTCN_Logger::log_event_str(", dTMGPRSHighMultiSlotClass := "); field_dTMGPRSHighMultiSlotClass.log(); TTCN_Logger::log_event_str(", pSHandoverCapability := "); field_pSHandoverCapability.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsRel6__BSSGP::set_implicit_omit() { if (multipleTBFCapability().is_bound()) multipleTBFCapability().set_implicit_omit(); if (downlinkAdvancedReceiverPerformance().is_bound()) downlinkAdvancedReceiverPerformance().set_implicit_omit(); if (extendedRLCMACCtrlMsgSegmentationCap().is_bound()) extendedRLCMACCtrlMsgSegmentationCap().set_implicit_omit(); if (dTMEnhancementsCapability().is_bound()) dTMEnhancementsCapability().set_implicit_omit(); if (presenceBitDTMGPRSHighMultiSlotClass().is_bound()) presenceBitDTMGPRSHighMultiSlotClass().set_implicit_omit(); if (!dTMGPRSHighMultiSlotClass().is_bound()) dTMGPRSHighMultiSlotClass() = OMIT_VALUE; else dTMGPRSHighMultiSlotClass().set_implicit_omit(); if (pSHandoverCapability().is_bound()) pSHandoverCapability().set_implicit_omit(); } void AccessCapAdditionsRel6__BSSGP::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 (70 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) multipleTBFCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) downlinkAdvancedReceiverPerformance().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) extendedRLCMACCtrlMsgSegmentationCap().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dTMEnhancementsCapability().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTMGPRSHighMultiSlotClass().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) dTMGPRSHighMultiSlotClass().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pSHandoverCapability().set_param(*param.get_elem(6)); 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(), "multipleTBFCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multipleTBFCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "downlinkAdvancedReceiverPerformance")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { downlinkAdvancedReceiverPerformance().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extendedRLCMACCtrlMsgSegmentationCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extendedRLCMACCtrlMsgSegmentationCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dTMEnhancementsCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMEnhancementsCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDTMGPRSHighMultiSlotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDTMGPRSHighMultiSlotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dTMGPRSHighMultiSlotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMGPRSHighMultiSlotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pSHandoverCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pSHandoverCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); } } void AccessCapAdditionsRel6__BSSGP::encode_text(Text_Buf& text_buf) const { field_multipleTBFCapability.encode_text(text_buf); field_downlinkAdvancedReceiverPerformance.encode_text(text_buf); field_extendedRLCMACCtrlMsgSegmentationCap.encode_text(text_buf); field_dTMEnhancementsCapability.encode_text(text_buf); field_presenceBitDTMGPRSHighMultiSlotClass.encode_text(text_buf); field_dTMGPRSHighMultiSlotClass.encode_text(text_buf); field_pSHandoverCapability.encode_text(text_buf); } void AccessCapAdditionsRel6__BSSGP::decode_text(Text_Buf& text_buf) { field_multipleTBFCapability.decode_text(text_buf); field_downlinkAdvancedReceiverPerformance.decode_text(text_buf); field_extendedRLCMACCtrlMsgSegmentationCap.decode_text(text_buf); field_dTMEnhancementsCapability.decode_text(text_buf); field_presenceBitDTMGPRSHighMultiSlotClass.decode_text(text_buf); field_dTMGPRSHighMultiSlotClass.decode_text(text_buf); field_pSHandoverCapability.decode_text(text_buf); } void AccessCapAdditionsRel6__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel6__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel6__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel6__BSSGP_multipleTBFCapability_descr_.raw->forceomit); decoded_field_length = field_multipleTBFCapability.RAW_decode(AccessCapAdditionsRel6__BSSGP_multipleTBFCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel6__BSSGP_downlinkAdvancedReceiverPerformance_descr_.raw->forceomit); decoded_field_length = field_downlinkAdvancedReceiverPerformance.RAW_decode(AccessCapAdditionsRel6__BSSGP_downlinkAdvancedReceiverPerformance_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel6__BSSGP_extendedRLCMACCtrlMsgSegmentationCap_descr_.raw->forceomit); decoded_field_length = field_extendedRLCMACCtrlMsgSegmentationCap.RAW_decode(AccessCapAdditionsRel6__BSSGP_extendedRLCMACCtrlMsgSegmentationCap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel6__BSSGP_dTMEnhancementsCapability_descr_.raw->forceomit); decoded_field_length = field_dTMEnhancementsCapability.RAW_decode(AccessCapAdditionsRel6__BSSGP_dTMEnhancementsCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel6__BSSGP_presenceBitDTMGPRSHighMultiSlotClass_descr_.raw->forceomit); decoded_field_length = field_presenceBitDTMGPRSHighMultiSlotClass.RAW_decode(AccessCapAdditionsRel6__BSSGP_presenceBitDTMGPRSHighMultiSlotClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitDTMGPRSHighMultiSlotClass == bs_0){ if (force_omit != NULL && (*force_omit)(5)) { field_dTMGPRSHighMultiSlotClass = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapAdditionsRel6__BSSGP_dTMGPRSHighMultiSlotClass_descr_.raw->forceomit); decoded_field_length = field_dTMGPRSHighMultiSlotClass().RAW_decode(AccessCapAdditionsRel6__BSSGP_dTMGPRSHighMultiSlotClass_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 1) { field_dTMGPRSHighMultiSlotClass = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_dTMGPRSHighMultiSlotClass=OMIT_VALUE; RAW_Force_Omit field_6_force_omit(6, force_omit, AccessCapAdditionsRel6__BSSGP_pSHandoverCapability_descr_.raw->forceomit); decoded_field_length = field_pSHandoverCapability.RAW_decode(AccessCapAdditionsRel6__BSSGP_pSHandoverCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel6__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 7; myleaf.body.node.nodes = init_nodes_of_enc_tree(7); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel6__BSSGP_multipleTBFCapability_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel6__BSSGP_downlinkAdvancedReceiverPerformance_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel6__BSSGP_extendedRLCMACCtrlMsgSegmentationCap_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel6__BSSGP_dTMEnhancementsCapability_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel6__BSSGP_presenceBitDTMGPRSHighMultiSlotClass_descr_.raw); if (field_dTMGPRSHighMultiSlotClass.ispresent()) { myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel6__BSSGP_dTMGPRSHighMultiSlotClass_descr_.raw); } else myleaf.body.node.nodes[5] = NULL; myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapAdditionsRel6__BSSGP_pSHandoverCapability_descr_.raw); encoded_length += field_multipleTBFCapability.RAW_encode(AccessCapAdditionsRel6__BSSGP_multipleTBFCapability_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_downlinkAdvancedReceiverPerformance.RAW_encode(AccessCapAdditionsRel6__BSSGP_downlinkAdvancedReceiverPerformance_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_extendedRLCMACCtrlMsgSegmentationCap.RAW_encode(AccessCapAdditionsRel6__BSSGP_extendedRLCMACCtrlMsgSegmentationCap_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_dTMEnhancementsCapability.RAW_encode(AccessCapAdditionsRel6__BSSGP_dTMEnhancementsCapability_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_presenceBitDTMGPRSHighMultiSlotClass.RAW_encode(AccessCapAdditionsRel6__BSSGP_presenceBitDTMGPRSHighMultiSlotClass_descr_, *myleaf.body.node.nodes[4]); if (field_dTMGPRSHighMultiSlotClass.ispresent()) { encoded_length += field_dTMGPRSHighMultiSlotClass().RAW_encode(AccessCapAdditionsRel6__BSSGP_dTMGPRSHighMultiSlotClass_descr_, *myleaf.body.node.nodes[5]); } encoded_length += field_pSHandoverCapability.RAW_encode(AccessCapAdditionsRel6__BSSGP_pSHandoverCapability_descr_, *myleaf.body.node.nodes[6]); if (field_dTMGPRSHighMultiSlotClass.ispresent() && (field_presenceBitDTMGPRSHighMultiSlotClass != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={4}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapAdditionsRel6__BSSGP_presenceBitDTMGPRSHighMultiSlotClass_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct AccessCapAdditionsRel6__BSSGP_template::single_value_struct { BITSTRING_template field_multipleTBFCapability; BITSTRING_template field_downlinkAdvancedReceiverPerformance; BITSTRING_template field_extendedRLCMACCtrlMsgSegmentationCap; BITSTRING_template field_dTMEnhancementsCapability; BITSTRING_template field_presenceBitDTMGPRSHighMultiSlotClass; DTMGPRSHighMultiSlotClass__BSSGP_template field_dTMGPRSHighMultiSlotClass; BITSTRING_template field_pSHandoverCapability; }; void AccessCapAdditionsRel6__BSSGP_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_multipleTBFCapability = ANY_VALUE; single_value->field_downlinkAdvancedReceiverPerformance = ANY_VALUE; single_value->field_extendedRLCMACCtrlMsgSegmentationCap = ANY_VALUE; single_value->field_dTMEnhancementsCapability = ANY_VALUE; single_value->field_presenceBitDTMGPRSHighMultiSlotClass = ANY_VALUE; single_value->field_dTMGPRSHighMultiSlotClass = ANY_OR_OMIT; single_value->field_pSHandoverCapability = ANY_VALUE; } } } void AccessCapAdditionsRel6__BSSGP_template::copy_value(const AccessCapAdditionsRel6__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.multipleTBFCapability().is_bound()) { single_value->field_multipleTBFCapability = other_value.multipleTBFCapability(); } else { single_value->field_multipleTBFCapability.clean_up(); } if (other_value.downlinkAdvancedReceiverPerformance().is_bound()) { single_value->field_downlinkAdvancedReceiverPerformance = other_value.downlinkAdvancedReceiverPerformance(); } else { single_value->field_downlinkAdvancedReceiverPerformance.clean_up(); } if (other_value.extendedRLCMACCtrlMsgSegmentationCap().is_bound()) { single_value->field_extendedRLCMACCtrlMsgSegmentationCap = other_value.extendedRLCMACCtrlMsgSegmentationCap(); } else { single_value->field_extendedRLCMACCtrlMsgSegmentationCap.clean_up(); } if (other_value.dTMEnhancementsCapability().is_bound()) { single_value->field_dTMEnhancementsCapability = other_value.dTMEnhancementsCapability(); } else { single_value->field_dTMEnhancementsCapability.clean_up(); } if (other_value.presenceBitDTMGPRSHighMultiSlotClass().is_bound()) { single_value->field_presenceBitDTMGPRSHighMultiSlotClass = other_value.presenceBitDTMGPRSHighMultiSlotClass(); } else { single_value->field_presenceBitDTMGPRSHighMultiSlotClass.clean_up(); } if (other_value.dTMGPRSHighMultiSlotClass().is_bound()) { if (other_value.dTMGPRSHighMultiSlotClass().ispresent()) single_value->field_dTMGPRSHighMultiSlotClass = other_value.dTMGPRSHighMultiSlotClass()(); else single_value->field_dTMGPRSHighMultiSlotClass = OMIT_VALUE; } else { single_value->field_dTMGPRSHighMultiSlotClass.clean_up(); } if (other_value.pSHandoverCapability().is_bound()) { single_value->field_pSHandoverCapability = other_value.pSHandoverCapability(); } else { single_value->field_pSHandoverCapability.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel6__BSSGP_template::copy_template(const AccessCapAdditionsRel6__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.multipleTBFCapability().get_selection()) { single_value->field_multipleTBFCapability = other_value.multipleTBFCapability(); } else { single_value->field_multipleTBFCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.downlinkAdvancedReceiverPerformance().get_selection()) { single_value->field_downlinkAdvancedReceiverPerformance = other_value.downlinkAdvancedReceiverPerformance(); } else { single_value->field_downlinkAdvancedReceiverPerformance.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.extendedRLCMACCtrlMsgSegmentationCap().get_selection()) { single_value->field_extendedRLCMACCtrlMsgSegmentationCap = other_value.extendedRLCMACCtrlMsgSegmentationCap(); } else { single_value->field_extendedRLCMACCtrlMsgSegmentationCap.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dTMEnhancementsCapability().get_selection()) { single_value->field_dTMEnhancementsCapability = other_value.dTMEnhancementsCapability(); } else { single_value->field_dTMEnhancementsCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDTMGPRSHighMultiSlotClass().get_selection()) { single_value->field_presenceBitDTMGPRSHighMultiSlotClass = other_value.presenceBitDTMGPRSHighMultiSlotClass(); } else { single_value->field_presenceBitDTMGPRSHighMultiSlotClass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dTMGPRSHighMultiSlotClass().get_selection()) { single_value->field_dTMGPRSHighMultiSlotClass = other_value.dTMGPRSHighMultiSlotClass(); } else { single_value->field_dTMGPRSHighMultiSlotClass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pSHandoverCapability().get_selection()) { single_value->field_pSHandoverCapability = other_value.pSHandoverCapability(); } else { single_value->field_pSHandoverCapability.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 AccessCapAdditionsRel6__BSSGP_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 AccessCapAdditionsRel6__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel6__BSSGP_template::AccessCapAdditionsRel6__BSSGP_template() { } AccessCapAdditionsRel6__BSSGP_template::AccessCapAdditionsRel6__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel6__BSSGP_template::AccessCapAdditionsRel6__BSSGP_template(const AccessCapAdditionsRel6__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel6__BSSGP_template::AccessCapAdditionsRel6__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel6__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel6__BSSGP_template::AccessCapAdditionsRel6__BSSGP_template(AccessCapAdditionsRel6__BSSGP_template* p_precondition, AccessCapAdditionsRel6__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel6__BSSGP_template::AccessCapAdditionsRel6__BSSGP_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; } AccessCapAdditionsRel6__BSSGP_template::AccessCapAdditionsRel6__BSSGP_template(const AccessCapAdditionsRel6__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel6__BSSGP_template::~AccessCapAdditionsRel6__BSSGP_template() { clean_up(); } AccessCapAdditionsRel6__BSSGP_template& AccessCapAdditionsRel6__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel6__BSSGP_template& AccessCapAdditionsRel6__BSSGP_template::operator=(const AccessCapAdditionsRel6__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel6__BSSGP_template& AccessCapAdditionsRel6__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel6__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); } return *this; } AccessCapAdditionsRel6__BSSGP_template& AccessCapAdditionsRel6__BSSGP_template::operator=(const AccessCapAdditionsRel6__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel6__BSSGP_template::match(const AccessCapAdditionsRel6__BSSGP& 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.multipleTBFCapability().is_bound()) return FALSE; if(!single_value->field_multipleTBFCapability.match(other_value.multipleTBFCapability(), legacy))return FALSE; if(!other_value.downlinkAdvancedReceiverPerformance().is_bound()) return FALSE; if(!single_value->field_downlinkAdvancedReceiverPerformance.match(other_value.downlinkAdvancedReceiverPerformance(), legacy))return FALSE; if(!other_value.extendedRLCMACCtrlMsgSegmentationCap().is_bound()) return FALSE; if(!single_value->field_extendedRLCMACCtrlMsgSegmentationCap.match(other_value.extendedRLCMACCtrlMsgSegmentationCap(), legacy))return FALSE; if(!other_value.dTMEnhancementsCapability().is_bound()) return FALSE; if(!single_value->field_dTMEnhancementsCapability.match(other_value.dTMEnhancementsCapability(), legacy))return FALSE; if(!other_value.presenceBitDTMGPRSHighMultiSlotClass().is_bound()) return FALSE; if(!single_value->field_presenceBitDTMGPRSHighMultiSlotClass.match(other_value.presenceBitDTMGPRSHighMultiSlotClass(), legacy))return FALSE; if(!other_value.dTMGPRSHighMultiSlotClass().is_bound()) return FALSE; if((other_value.dTMGPRSHighMultiSlotClass().ispresent() ? !single_value->field_dTMGPRSHighMultiSlotClass.match((const DTMGPRSHighMultiSlotClass__BSSGP&)other_value.dTMGPRSHighMultiSlotClass(), legacy) : !single_value->field_dTMGPRSHighMultiSlotClass.match_omit(legacy)))return FALSE; if(!other_value.pSHandoverCapability().is_bound()) return FALSE; if(!single_value->field_pSHandoverCapability.match(other_value.pSHandoverCapability(), 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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel6__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_multipleTBFCapability.is_bound() || single_value->field_downlinkAdvancedReceiverPerformance.is_bound() || single_value->field_extendedRLCMACCtrlMsgSegmentationCap.is_bound() || single_value->field_dTMEnhancementsCapability.is_bound() || single_value->field_presenceBitDTMGPRSHighMultiSlotClass.is_bound() || (single_value->field_dTMGPRSHighMultiSlotClass.is_omit() || single_value->field_dTMGPRSHighMultiSlotClass.is_bound()) || single_value->field_pSHandoverCapability.is_bound(); } boolean AccessCapAdditionsRel6__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_multipleTBFCapability.is_value() && single_value->field_downlinkAdvancedReceiverPerformance.is_value() && single_value->field_extendedRLCMACCtrlMsgSegmentationCap.is_value() && single_value->field_dTMEnhancementsCapability.is_value() && single_value->field_presenceBitDTMGPRSHighMultiSlotClass.is_value() && (single_value->field_dTMGPRSHighMultiSlotClass.is_omit() || single_value->field_dTMGPRSHighMultiSlotClass.is_value()) && single_value->field_pSHandoverCapability.is_value(); } void AccessCapAdditionsRel6__BSSGP_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; } AccessCapAdditionsRel6__BSSGP AccessCapAdditionsRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); AccessCapAdditionsRel6__BSSGP ret_val; if (single_value->field_multipleTBFCapability.is_bound()) { ret_val.multipleTBFCapability() = single_value->field_multipleTBFCapability.valueof(); } if (single_value->field_downlinkAdvancedReceiverPerformance.is_bound()) { ret_val.downlinkAdvancedReceiverPerformance() = single_value->field_downlinkAdvancedReceiverPerformance.valueof(); } if (single_value->field_extendedRLCMACCtrlMsgSegmentationCap.is_bound()) { ret_val.extendedRLCMACCtrlMsgSegmentationCap() = single_value->field_extendedRLCMACCtrlMsgSegmentationCap.valueof(); } if (single_value->field_dTMEnhancementsCapability.is_bound()) { ret_val.dTMEnhancementsCapability() = single_value->field_dTMEnhancementsCapability.valueof(); } if (single_value->field_presenceBitDTMGPRSHighMultiSlotClass.is_bound()) { ret_val.presenceBitDTMGPRSHighMultiSlotClass() = single_value->field_presenceBitDTMGPRSHighMultiSlotClass.valueof(); } if (single_value->field_dTMGPRSHighMultiSlotClass.is_omit()) ret_val.dTMGPRSHighMultiSlotClass() = OMIT_VALUE; else if (single_value->field_dTMGPRSHighMultiSlotClass.is_bound()) { ret_val.dTMGPRSHighMultiSlotClass() = single_value->field_dTMGPRSHighMultiSlotClass.valueof(); } if (single_value->field_pSHandoverCapability.is_bound()) { ret_val.pSHandoverCapability() = single_value->field_pSHandoverCapability.valueof(); } return ret_val; } void AccessCapAdditionsRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel6__BSSGP_template[list_length]; } AccessCapAdditionsRel6__BSSGP_template& AccessCapAdditionsRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::multipleTBFCapability() { set_specific(); return single_value->field_multipleTBFCapability; } const BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::multipleTBFCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field multipleTBFCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); return single_value->field_multipleTBFCapability; } BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::downlinkAdvancedReceiverPerformance() { set_specific(); return single_value->field_downlinkAdvancedReceiverPerformance; } const BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::downlinkAdvancedReceiverPerformance() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field downlinkAdvancedReceiverPerformance of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); return single_value->field_downlinkAdvancedReceiverPerformance; } BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::extendedRLCMACCtrlMsgSegmentationCap() { set_specific(); return single_value->field_extendedRLCMACCtrlMsgSegmentationCap; } const BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::extendedRLCMACCtrlMsgSegmentationCap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extendedRLCMACCtrlMsgSegmentationCap of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); return single_value->field_extendedRLCMACCtrlMsgSegmentationCap; } BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::dTMEnhancementsCapability() { set_specific(); return single_value->field_dTMEnhancementsCapability; } const BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::dTMEnhancementsCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTMEnhancementsCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); return single_value->field_dTMEnhancementsCapability; } BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::presenceBitDTMGPRSHighMultiSlotClass() { set_specific(); return single_value->field_presenceBitDTMGPRSHighMultiSlotClass; } const BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::presenceBitDTMGPRSHighMultiSlotClass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitDTMGPRSHighMultiSlotClass of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); return single_value->field_presenceBitDTMGPRSHighMultiSlotClass; } DTMGPRSHighMultiSlotClass__BSSGP_template& AccessCapAdditionsRel6__BSSGP_template::dTMGPRSHighMultiSlotClass() { set_specific(); return single_value->field_dTMGPRSHighMultiSlotClass; } const DTMGPRSHighMultiSlotClass__BSSGP_template& AccessCapAdditionsRel6__BSSGP_template::dTMGPRSHighMultiSlotClass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTMGPRSHighMultiSlotClass of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); return single_value->field_dTMGPRSHighMultiSlotClass; } BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::pSHandoverCapability() { set_specific(); return single_value->field_pSHandoverCapability; } const BITSTRING_template& AccessCapAdditionsRel6__BSSGP_template::pSHandoverCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pSHandoverCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); return single_value->field_pSHandoverCapability; } int AccessCapAdditionsRel6__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 6; if (single_value->field_dTMGPRSHighMultiSlotClass.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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); } return 0; } void AccessCapAdditionsRel6__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ multipleTBFCapability := "); single_value->field_multipleTBFCapability.log(); TTCN_Logger::log_event_str(", downlinkAdvancedReceiverPerformance := "); single_value->field_downlinkAdvancedReceiverPerformance.log(); TTCN_Logger::log_event_str(", extendedRLCMACCtrlMsgSegmentationCap := "); single_value->field_extendedRLCMACCtrlMsgSegmentationCap.log(); TTCN_Logger::log_event_str(", dTMEnhancementsCapability := "); single_value->field_dTMEnhancementsCapability.log(); TTCN_Logger::log_event_str(", presenceBitDTMGPRSHighMultiSlotClass := "); single_value->field_presenceBitDTMGPRSHighMultiSlotClass.log(); TTCN_Logger::log_event_str(", dTMGPRSHighMultiSlotClass := "); single_value->field_dTMGPRSHighMultiSlotClass.log(); TTCN_Logger::log_event_str(", pSHandoverCapability := "); single_value->field_pSHandoverCapability.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 AccessCapAdditionsRel6__BSSGP_template::log_match(const AccessCapAdditionsRel6__BSSGP& 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_multipleTBFCapability.match(match_value.multipleTBFCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".multipleTBFCapability"); single_value->field_multipleTBFCapability.log_match(match_value.multipleTBFCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_downlinkAdvancedReceiverPerformance.match(match_value.downlinkAdvancedReceiverPerformance(), legacy)){ TTCN_Logger::log_logmatch_info(".downlinkAdvancedReceiverPerformance"); single_value->field_downlinkAdvancedReceiverPerformance.log_match(match_value.downlinkAdvancedReceiverPerformance(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_extendedRLCMACCtrlMsgSegmentationCap.match(match_value.extendedRLCMACCtrlMsgSegmentationCap(), legacy)){ TTCN_Logger::log_logmatch_info(".extendedRLCMACCtrlMsgSegmentationCap"); single_value->field_extendedRLCMACCtrlMsgSegmentationCap.log_match(match_value.extendedRLCMACCtrlMsgSegmentationCap(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_dTMEnhancementsCapability.match(match_value.dTMEnhancementsCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".dTMEnhancementsCapability"); single_value->field_dTMEnhancementsCapability.log_match(match_value.dTMEnhancementsCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitDTMGPRSHighMultiSlotClass.match(match_value.presenceBitDTMGPRSHighMultiSlotClass(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitDTMGPRSHighMultiSlotClass"); single_value->field_presenceBitDTMGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMGPRSHighMultiSlotClass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.dTMGPRSHighMultiSlotClass().ispresent()){ if(!single_value->field_dTMGPRSHighMultiSlotClass.match(match_value.dTMGPRSHighMultiSlotClass(), legacy)){ TTCN_Logger::log_logmatch_info(".dTMGPRSHighMultiSlotClass"); single_value->field_dTMGPRSHighMultiSlotClass.log_match(match_value.dTMGPRSHighMultiSlotClass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_dTMGPRSHighMultiSlotClass.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".dTMGPRSHighMultiSlotClass := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_dTMGPRSHighMultiSlotClass.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_pSHandoverCapability.match(match_value.pSHandoverCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".pSHandoverCapability"); single_value->field_pSHandoverCapability.log_match(match_value.pSHandoverCapability(), 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("{ multipleTBFCapability := "); single_value->field_multipleTBFCapability.log_match(match_value.multipleTBFCapability(), legacy); TTCN_Logger::log_event_str(", downlinkAdvancedReceiverPerformance := "); single_value->field_downlinkAdvancedReceiverPerformance.log_match(match_value.downlinkAdvancedReceiverPerformance(), legacy); TTCN_Logger::log_event_str(", extendedRLCMACCtrlMsgSegmentationCap := "); single_value->field_extendedRLCMACCtrlMsgSegmentationCap.log_match(match_value.extendedRLCMACCtrlMsgSegmentationCap(), legacy); TTCN_Logger::log_event_str(", dTMEnhancementsCapability := "); single_value->field_dTMEnhancementsCapability.log_match(match_value.dTMEnhancementsCapability(), legacy); TTCN_Logger::log_event_str(", presenceBitDTMGPRSHighMultiSlotClass := "); single_value->field_presenceBitDTMGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMGPRSHighMultiSlotClass(), legacy); TTCN_Logger::log_event_str(", dTMGPRSHighMultiSlotClass := "); if (match_value.dTMGPRSHighMultiSlotClass().ispresent()) { single_value->field_dTMGPRSHighMultiSlotClass.log_match(match_value.dTMGPRSHighMultiSlotClass(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_dTMGPRSHighMultiSlotClass.log(); if (single_value->field_dTMGPRSHighMultiSlotClass.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", pSHandoverCapability := "); single_value->field_pSHandoverCapability.log_match(match_value.pSHandoverCapability(), 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 AccessCapAdditionsRel6__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_multipleTBFCapability.encode_text(text_buf); single_value->field_downlinkAdvancedReceiverPerformance.encode_text(text_buf); single_value->field_extendedRLCMACCtrlMsgSegmentationCap.encode_text(text_buf); single_value->field_dTMEnhancementsCapability.encode_text(text_buf); single_value->field_presenceBitDTMGPRSHighMultiSlotClass.encode_text(text_buf); single_value->field_dTMGPRSHighMultiSlotClass.encode_text(text_buf); single_value->field_pSHandoverCapability.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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); } } void AccessCapAdditionsRel6__BSSGP_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_multipleTBFCapability.decode_text(text_buf); single_value->field_downlinkAdvancedReceiverPerformance.decode_text(text_buf); single_value->field_extendedRLCMACCtrlMsgSegmentationCap.decode_text(text_buf); single_value->field_dTMEnhancementsCapability.decode_text(text_buf); single_value->field_presenceBitDTMGPRSHighMultiSlotClass.decode_text(text_buf); single_value->field_dTMGPRSHighMultiSlotClass.decode_text(text_buf); single_value->field_pSHandoverCapability.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 AccessCapAdditionsRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel6_BSSGP."); } } void AccessCapAdditionsRel6__BSSGP_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: { AccessCapAdditionsRel6__BSSGP_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) multipleTBFCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) downlinkAdvancedReceiverPerformance().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) extendedRLCMACCtrlMsgSegmentationCap().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dTMEnhancementsCapability().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTMGPRSHighMultiSlotClass().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) dTMGPRSHighMultiSlotClass().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pSHandoverCapability().set_param(*param.get_elem(6)); 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(), "multipleTBFCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multipleTBFCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "downlinkAdvancedReceiverPerformance")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { downlinkAdvancedReceiverPerformance().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extendedRLCMACCtrlMsgSegmentationCap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extendedRLCMACCtrlMsgSegmentationCap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dTMEnhancementsCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMEnhancementsCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDTMGPRSHighMultiSlotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDTMGPRSHighMultiSlotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dTMGPRSHighMultiSlotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMGPRSHighMultiSlotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pSHandoverCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pSHandoverCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel6_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel6__BSSGP_template* precondition = new AccessCapAdditionsRel6__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel6__BSSGP_template* implied_template = new AccessCapAdditionsRel6__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel6__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel6__BSSGP_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_multipleTBFCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); single_value->field_downlinkAdvancedReceiverPerformance.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); single_value->field_extendedRLCMACCtrlMsgSegmentationCap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); single_value->field_dTMEnhancementsCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); single_value->field_presenceBitDTMGPRSHighMultiSlotClass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); single_value->field_dTMGPRSHighMultiSlotClass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); single_value->field_pSHandoverCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel6_BSSGP"); } boolean AccessCapAdditionsRel6__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel6__BSSGP_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_dTMEGPRSHighMultiSlotClassValue) : field_dTMGPRSHighMultiSlotClassValue(par_dTMGPRSHighMultiSlotClassValue), field_presenceBitDTMEGPRSHighMultiSlotClass(par_presenceBitDTMEGPRSHighMultiSlotClass), field_dTMEGPRSHighMultiSlotClassValue(par_dTMEGPRSHighMultiSlotClassValue) { } DTMGPRSHighMultiSlotClass__BSSGP::DTMGPRSHighMultiSlotClass__BSSGP(const DTMGPRSHighMultiSlotClass__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue(); else field_dTMGPRSHighMultiSlotClassValue.clean_up(); if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass(); else field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up(); if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue(); else field_dTMEGPRSHighMultiSlotClassValue.clean_up(); } void DTMGPRSHighMultiSlotClass__BSSGP::clean_up() { field_dTMGPRSHighMultiSlotClassValue.clean_up(); field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up(); field_dTMEGPRSHighMultiSlotClassValue.clean_up(); } const TTCN_Typedescriptor_t* DTMGPRSHighMultiSlotClass__BSSGP::get_descriptor() const { return &DTMGPRSHighMultiSlotClass__BSSGP_descr_; } DTMGPRSHighMultiSlotClass__BSSGP& DTMGPRSHighMultiSlotClass__BSSGP::operator=(const DTMGPRSHighMultiSlotClass__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue(); else field_dTMGPRSHighMultiSlotClassValue.clean_up(); if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass(); else field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up(); if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue(); else field_dTMEGPRSHighMultiSlotClassValue.clean_up(); } return *this; } boolean DTMGPRSHighMultiSlotClass__BSSGP::operator==(const DTMGPRSHighMultiSlotClass__BSSGP& other_value) const { return field_dTMGPRSHighMultiSlotClassValue==other_value.field_dTMGPRSHighMultiSlotClassValue && field_presenceBitDTMEGPRSHighMultiSlotClass==other_value.field_presenceBitDTMEGPRSHighMultiSlotClass && field_dTMEGPRSHighMultiSlotClassValue==other_value.field_dTMEGPRSHighMultiSlotClassValue; } boolean DTMGPRSHighMultiSlotClass__BSSGP::is_bound() const { return (field_dTMGPRSHighMultiSlotClassValue.is_bound()) || (field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound()) || (OPTIONAL_OMIT == field_dTMEGPRSHighMultiSlotClassValue.get_selection() || field_dTMEGPRSHighMultiSlotClassValue.is_bound()); } boolean DTMGPRSHighMultiSlotClass__BSSGP::is_value() const { return field_dTMGPRSHighMultiSlotClassValue.is_value() && field_presenceBitDTMEGPRSHighMultiSlotClass.is_value() && (OPTIONAL_OMIT == field_dTMEGPRSHighMultiSlotClassValue.get_selection() || field_dTMEGPRSHighMultiSlotClassValue.is_value()); } int DTMGPRSHighMultiSlotClass__BSSGP::size_of() const { int ret_val = 2; if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) ret_val++; return ret_val; } void DTMGPRSHighMultiSlotClass__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ dTMGPRSHighMultiSlotClassValue := "); field_dTMGPRSHighMultiSlotClassValue.log(); TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := "); field_presenceBitDTMEGPRSHighMultiSlotClass.log(); TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := "); field_dTMEGPRSHighMultiSlotClassValue.log(); TTCN_Logger::log_event_str(" }"); } void DTMGPRSHighMultiSlotClass__BSSGP::set_implicit_omit() { if (dTMGPRSHighMultiSlotClassValue().is_bound()) dTMGPRSHighMultiSlotClassValue().set_implicit_omit(); if (presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) presenceBitDTMEGPRSHighMultiSlotClass().set_implicit_omit(); if (!dTMEGPRSHighMultiSlotClassValue().is_bound()) dTMEGPRSHighMultiSlotClassValue() = OMIT_VALUE; else dTMEGPRSHighMultiSlotClassValue().set_implicit_omit(); } void DTMGPRSHighMultiSlotClass__BSSGP::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) dTMGPRSHighMultiSlotClassValue().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTMEGPRSHighMultiSlotClass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dTMEGPRSHighMultiSlotClassValue().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(), "dTMGPRSHighMultiSlotClassValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMGPRSHighMultiSlotClassValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDTMEGPRSHighMultiSlotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDTMEGPRSHighMultiSlotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dTMEGPRSHighMultiSlotClassValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMEGPRSHighMultiSlotClassValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP"); } } void DTMGPRSHighMultiSlotClass__BSSGP::encode_text(Text_Buf& text_buf) const { field_dTMGPRSHighMultiSlotClassValue.encode_text(text_buf); field_presenceBitDTMEGPRSHighMultiSlotClass.encode_text(text_buf); field_dTMEGPRSHighMultiSlotClassValue.encode_text(text_buf); } void DTMGPRSHighMultiSlotClass__BSSGP::decode_text(Text_Buf& text_buf) { field_dTMGPRSHighMultiSlotClassValue.decode_text(text_buf); field_presenceBitDTMEGPRSHighMultiSlotClass.decode_text(text_buf); field_dTMEGPRSHighMultiSlotClassValue.decode_text(text_buf); } void DTMGPRSHighMultiSlotClass__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void DTMGPRSHighMultiSlotClass__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int DTMGPRSHighMultiSlotClass__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, DTMGPRSHighMultiSlotClass__BSSGP_dTMGPRSHighMultiSlotClassValue_descr_.raw->forceomit); decoded_field_length = field_dTMGPRSHighMultiSlotClassValue.RAW_decode(DTMGPRSHighMultiSlotClass__BSSGP_dTMGPRSHighMultiSlotClassValue_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, DTMGPRSHighMultiSlotClass__BSSGP_presenceBitDTMEGPRSHighMultiSlotClass_descr_.raw->forceomit); decoded_field_length = field_presenceBitDTMEGPRSHighMultiSlotClass.RAW_decode(DTMGPRSHighMultiSlotClass__BSSGP_presenceBitDTMEGPRSHighMultiSlotClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitDTMEGPRSHighMultiSlotClass == bs_0){ if (force_omit != NULL && (*force_omit)(2)) { field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_2_force_omit(2, force_omit, DTMGPRSHighMultiSlotClass__BSSGP_dTMEGPRSHighMultiSlotClassValue_descr_.raw->forceomit); decoded_field_length = field_dTMEGPRSHighMultiSlotClassValue().RAW_decode(DTMGPRSHighMultiSlotClass__BSSGP_dTMEGPRSHighMultiSlotClassValue_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 1) { field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_dTMEGPRSHighMultiSlotClassValue=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int DTMGPRSHighMultiSlotClass__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 3; myleaf.body.node.nodes = init_nodes_of_enc_tree(3); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, DTMGPRSHighMultiSlotClass__BSSGP_dTMGPRSHighMultiSlotClassValue_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DTMGPRSHighMultiSlotClass__BSSGP_presenceBitDTMEGPRSHighMultiSlotClass_descr_.raw); if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) { myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DTMGPRSHighMultiSlotClass__BSSGP_dTMEGPRSHighMultiSlotClassValue_descr_.raw); } else myleaf.body.node.nodes[2] = NULL; encoded_length += field_dTMGPRSHighMultiSlotClassValue.RAW_encode(DTMGPRSHighMultiSlotClass__BSSGP_dTMGPRSHighMultiSlotClassValue_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_presenceBitDTMEGPRSHighMultiSlotClass.RAW_encode(DTMGPRSHighMultiSlotClass__BSSGP_presenceBitDTMEGPRSHighMultiSlotClass_descr_, *myleaf.body.node.nodes[1]); if (field_dTMEGPRSHighMultiSlotClassValue.ispresent()) { encoded_length += field_dTMEGPRSHighMultiSlotClassValue().RAW_encode(DTMGPRSHighMultiSlotClass__BSSGP_dTMEGPRSHighMultiSlotClassValue_descr_, *myleaf.body.node.nodes[2]); } if (field_dTMEGPRSHighMultiSlotClassValue.ispresent() && (field_presenceBitDTMEGPRSHighMultiSlotClass != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={1}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(DTMGPRSHighMultiSlotClass__BSSGP_presenceBitDTMEGPRSHighMultiSlotClass_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct DTMGPRSHighMultiSlotClass__BSSGP_template::single_value_struct { BITSTRING_template field_dTMGPRSHighMultiSlotClassValue; BITSTRING_template field_presenceBitDTMEGPRSHighMultiSlotClass; BITSTRING_template field_dTMEGPRSHighMultiSlotClassValue; }; void DTMGPRSHighMultiSlotClass__BSSGP_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_dTMGPRSHighMultiSlotClassValue = ANY_VALUE; single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = ANY_VALUE; single_value->field_dTMEGPRSHighMultiSlotClassValue = ANY_OR_OMIT; } } } void DTMGPRSHighMultiSlotClass__BSSGP_template::copy_value(const DTMGPRSHighMultiSlotClass__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.dTMGPRSHighMultiSlotClassValue().is_bound()) { single_value->field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue(); } else { single_value->field_dTMGPRSHighMultiSlotClassValue.clean_up(); } if (other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) { single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass(); } else { single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up(); } if (other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) { if (other_value.dTMEGPRSHighMultiSlotClassValue().ispresent()) single_value->field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue()(); else single_value->field_dTMEGPRSHighMultiSlotClassValue = OMIT_VALUE; } else { single_value->field_dTMEGPRSHighMultiSlotClassValue.clean_up(); } set_selection(SPECIFIC_VALUE); } void DTMGPRSHighMultiSlotClass__BSSGP_template::copy_template(const DTMGPRSHighMultiSlotClass__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.dTMGPRSHighMultiSlotClassValue().get_selection()) { single_value->field_dTMGPRSHighMultiSlotClassValue = other_value.dTMGPRSHighMultiSlotClassValue(); } else { single_value->field_dTMGPRSHighMultiSlotClassValue.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDTMEGPRSHighMultiSlotClass().get_selection()) { single_value->field_presenceBitDTMEGPRSHighMultiSlotClass = other_value.presenceBitDTMEGPRSHighMultiSlotClass(); } else { single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dTMEGPRSHighMultiSlotClassValue().get_selection()) { single_value->field_dTMEGPRSHighMultiSlotClassValue = other_value.dTMEGPRSHighMultiSlotClassValue(); } else { single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass__BSSGP_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 DTMGPRSHighMultiSlotClass__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new DTMGPRSHighMultiSlotClass__BSSGP_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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); break; } set_selection(other_value); } DTMGPRSHighMultiSlotClass__BSSGP_template::DTMGPRSHighMultiSlotClass__BSSGP_template() { } DTMGPRSHighMultiSlotClass__BSSGP_template::DTMGPRSHighMultiSlotClass__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DTMGPRSHighMultiSlotClass__BSSGP_template::DTMGPRSHighMultiSlotClass__BSSGP_template(const DTMGPRSHighMultiSlotClass__BSSGP& other_value) { copy_value(other_value); } DTMGPRSHighMultiSlotClass__BSSGP_template::DTMGPRSHighMultiSlotClass__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DTMGPRSHighMultiSlotClass__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP from an unbound optional field."); } } DTMGPRSHighMultiSlotClass__BSSGP_template::DTMGPRSHighMultiSlotClass__BSSGP_template(DTMGPRSHighMultiSlotClass__BSSGP_template* p_precondition, DTMGPRSHighMultiSlotClass__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DTMGPRSHighMultiSlotClass__BSSGP_template::DTMGPRSHighMultiSlotClass__BSSGP_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; } DTMGPRSHighMultiSlotClass__BSSGP_template::DTMGPRSHighMultiSlotClass__BSSGP_template(const DTMGPRSHighMultiSlotClass__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } DTMGPRSHighMultiSlotClass__BSSGP_template::~DTMGPRSHighMultiSlotClass__BSSGP_template() { clean_up(); } DTMGPRSHighMultiSlotClass__BSSGP_template& DTMGPRSHighMultiSlotClass__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DTMGPRSHighMultiSlotClass__BSSGP_template& DTMGPRSHighMultiSlotClass__BSSGP_template::operator=(const DTMGPRSHighMultiSlotClass__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } DTMGPRSHighMultiSlotClass__BSSGP_template& DTMGPRSHighMultiSlotClass__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DTMGPRSHighMultiSlotClass__BSSGP&)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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); } return *this; } DTMGPRSHighMultiSlotClass__BSSGP_template& DTMGPRSHighMultiSlotClass__BSSGP_template::operator=(const DTMGPRSHighMultiSlotClass__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean DTMGPRSHighMultiSlotClass__BSSGP_template::match(const DTMGPRSHighMultiSlotClass__BSSGP& 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.dTMGPRSHighMultiSlotClassValue().is_bound()) return FALSE; if(!single_value->field_dTMGPRSHighMultiSlotClassValue.match(other_value.dTMGPRSHighMultiSlotClassValue(), legacy))return FALSE; if(!other_value.presenceBitDTMEGPRSHighMultiSlotClass().is_bound()) return FALSE; if(!single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.match(other_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy))return FALSE; if(!other_value.dTMEGPRSHighMultiSlotClassValue().is_bound()) return FALSE; if((other_value.dTMEGPRSHighMultiSlotClassValue().ispresent() ? !single_value->field_dTMEGPRSHighMultiSlotClassValue.match((const BITSTRING&)other_value.dTMEGPRSHighMultiSlotClassValue(), legacy) : !single_value->field_dTMEGPRSHighMultiSlotClassValue.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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); } return FALSE; } boolean DTMGPRSHighMultiSlotClass__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_dTMGPRSHighMultiSlotClassValue.is_bound() || single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound() || (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit() || single_value->field_dTMEGPRSHighMultiSlotClassValue.is_bound()); } boolean DTMGPRSHighMultiSlotClass__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_dTMGPRSHighMultiSlotClassValue.is_value() && single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_value() && (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit() || single_value->field_dTMEGPRSHighMultiSlotClassValue.is_value()); } void DTMGPRSHighMultiSlotClass__BSSGP_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; } DTMGPRSHighMultiSlotClass__BSSGP DTMGPRSHighMultiSlotClass__BSSGP_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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); DTMGPRSHighMultiSlotClass__BSSGP ret_val; if (single_value->field_dTMGPRSHighMultiSlotClassValue.is_bound()) { ret_val.dTMGPRSHighMultiSlotClassValue() = single_value->field_dTMGPRSHighMultiSlotClassValue.valueof(); } if (single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.is_bound()) { ret_val.presenceBitDTMEGPRSHighMultiSlotClass() = single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.valueof(); } if (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_omit()) ret_val.dTMEGPRSHighMultiSlotClassValue() = OMIT_VALUE; else if (single_value->field_dTMEGPRSHighMultiSlotClassValue.is_bound()) { ret_val.dTMEGPRSHighMultiSlotClassValue() = single_value->field_dTMEGPRSHighMultiSlotClassValue.valueof(); } return ret_val; } void DTMGPRSHighMultiSlotClass__BSSGP_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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DTMGPRSHighMultiSlotClass__BSSGP_template[list_length]; } DTMGPRSHighMultiSlotClass__BSSGP_template& DTMGPRSHighMultiSlotClass__BSSGP_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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& DTMGPRSHighMultiSlotClass__BSSGP_template::dTMGPRSHighMultiSlotClassValue() { set_specific(); return single_value->field_dTMGPRSHighMultiSlotClassValue; } const BITSTRING_template& DTMGPRSHighMultiSlotClass__BSSGP_template::dTMGPRSHighMultiSlotClassValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTMGPRSHighMultiSlotClassValue of a non-specific template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); return single_value->field_dTMGPRSHighMultiSlotClassValue; } BITSTRING_template& DTMGPRSHighMultiSlotClass__BSSGP_template::presenceBitDTMEGPRSHighMultiSlotClass() { set_specific(); return single_value->field_presenceBitDTMEGPRSHighMultiSlotClass; } const BITSTRING_template& DTMGPRSHighMultiSlotClass__BSSGP_template::presenceBitDTMEGPRSHighMultiSlotClass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitDTMEGPRSHighMultiSlotClass of a non-specific template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); return single_value->field_presenceBitDTMEGPRSHighMultiSlotClass; } BITSTRING_template& DTMGPRSHighMultiSlotClass__BSSGP_template::dTMEGPRSHighMultiSlotClassValue() { set_specific(); return single_value->field_dTMEGPRSHighMultiSlotClassValue; } const BITSTRING_template& DTMGPRSHighMultiSlotClass__BSSGP_template::dTMEGPRSHighMultiSlotClassValue() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTMEGPRSHighMultiSlotClassValue of a non-specific template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); return single_value->field_dTMEGPRSHighMultiSlotClassValue; } int DTMGPRSHighMultiSlotClass__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 2; if (single_value->field_dTMEGPRSHighMultiSlotClassValue.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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP 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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); } return 0; } void DTMGPRSHighMultiSlotClass__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ dTMGPRSHighMultiSlotClassValue := "); single_value->field_dTMGPRSHighMultiSlotClassValue.log(); TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := "); single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log(); TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := "); single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass__BSSGP_template::log_match(const DTMGPRSHighMultiSlotClass__BSSGP& 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_dTMGPRSHighMultiSlotClassValue.match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy)){ TTCN_Logger::log_logmatch_info(".dTMGPRSHighMultiSlotClassValue"); single_value->field_dTMGPRSHighMultiSlotClassValue.log_match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitDTMEGPRSHighMultiSlotClass"); single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.dTMEGPRSHighMultiSlotClassValue().ispresent()){ if(!single_value->field_dTMEGPRSHighMultiSlotClassValue.match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy)){ TTCN_Logger::log_logmatch_info(".dTMEGPRSHighMultiSlotClassValue"); single_value->field_dTMEGPRSHighMultiSlotClassValue.log_match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_dTMEGPRSHighMultiSlotClassValue.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".dTMEGPRSHighMultiSlotClassValue := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_dTMEGPRSHighMultiSlotClassValue.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("{ dTMGPRSHighMultiSlotClassValue := "); single_value->field_dTMGPRSHighMultiSlotClassValue.log_match(match_value.dTMGPRSHighMultiSlotClassValue(), legacy); TTCN_Logger::log_event_str(", presenceBitDTMEGPRSHighMultiSlotClass := "); single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.log_match(match_value.presenceBitDTMEGPRSHighMultiSlotClass(), legacy); TTCN_Logger::log_event_str(", dTMEGPRSHighMultiSlotClassValue := "); if (match_value.dTMEGPRSHighMultiSlotClassValue().ispresent()) { single_value->field_dTMEGPRSHighMultiSlotClassValue.log_match(match_value.dTMEGPRSHighMultiSlotClassValue(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_dTMEGPRSHighMultiSlotClassValue.log(); if (single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_dTMGPRSHighMultiSlotClassValue.encode_text(text_buf); single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.encode_text(text_buf); single_value->field_dTMEGPRSHighMultiSlotClassValue.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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); } } void DTMGPRSHighMultiSlotClass__BSSGP_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_dTMGPRSHighMultiSlotClassValue.decode_text(text_buf); single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.decode_text(text_buf); single_value->field_dTMEGPRSHighMultiSlotClassValue.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 DTMGPRSHighMultiSlotClass__BSSGP_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 @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP."); } } void DTMGPRSHighMultiSlotClass__BSSGP_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: { DTMGPRSHighMultiSlotClass__BSSGP_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) dTMGPRSHighMultiSlotClassValue().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDTMEGPRSHighMultiSlotClass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dTMEGPRSHighMultiSlotClassValue().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(), "dTMGPRSHighMultiSlotClassValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMGPRSHighMultiSlotClassValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDTMEGPRSHighMultiSlotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDTMEGPRSHighMultiSlotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dTMEGPRSHighMultiSlotClassValue")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMEGPRSHighMultiSlotClassValue().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { DTMGPRSHighMultiSlotClass__BSSGP_template* precondition = new DTMGPRSHighMultiSlotClass__BSSGP_template; precondition->set_param(*param.get_elem(0)); DTMGPRSHighMultiSlotClass__BSSGP_template* implied_template = new DTMGPRSHighMultiSlotClass__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = DTMGPRSHighMultiSlotClass__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void DTMGPRSHighMultiSlotClass__BSSGP_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_dTMGPRSHighMultiSlotClassValue.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP"); single_value->field_presenceBitDTMEGPRSHighMultiSlotClass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP"); single_value->field_dTMEGPRSHighMultiSlotClassValue.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP"); 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 : "@BSSGP_Types.DTMGPRSHighMultiSlotClass_BSSGP"); } boolean DTMGPRSHighMultiSlotClass__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DTMGPRSHighMultiSlotClass__BSSGP_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_accessCapAdditionsAfterRel6) : field_accessCapAdditionsRel6(par_accessCapAdditionsRel6), field_accessCapAdditionsAfterRel6(par_accessCapAdditionsAfterRel6) { } AccessCapAdditionsAfterRel5__BSSGP::AccessCapAdditionsAfterRel5__BSSGP(const AccessCapAdditionsAfterRel5__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); if (other_value.accessCapAdditionsRel6().is_bound()) field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6(); else field_accessCapAdditionsRel6.clean_up(); if (other_value.accessCapAdditionsAfterRel6().is_bound()) field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6(); else field_accessCapAdditionsAfterRel6.clean_up(); } void AccessCapAdditionsAfterRel5__BSSGP::clean_up() { field_accessCapAdditionsRel6.clean_up(); field_accessCapAdditionsAfterRel6.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel5__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel5__BSSGP_descr_; } AccessCapAdditionsAfterRel5__BSSGP& AccessCapAdditionsAfterRel5__BSSGP::operator=(const AccessCapAdditionsAfterRel5__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); if (other_value.accessCapAdditionsRel6().is_bound()) field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6(); else field_accessCapAdditionsRel6.clean_up(); if (other_value.accessCapAdditionsAfterRel6().is_bound()) field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6(); else field_accessCapAdditionsAfterRel6.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel5__BSSGP::operator==(const AccessCapAdditionsAfterRel5__BSSGP& other_value) const { return field_accessCapAdditionsRel6==other_value.field_accessCapAdditionsRel6 && field_accessCapAdditionsAfterRel6==other_value.field_accessCapAdditionsAfterRel6; } boolean AccessCapAdditionsAfterRel5__BSSGP::is_bound() const { return (field_accessCapAdditionsRel6.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel6.get_selection() || field_accessCapAdditionsAfterRel6.is_bound()); } boolean AccessCapAdditionsAfterRel5__BSSGP::is_value() const { return field_accessCapAdditionsRel6.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel6.get_selection() || field_accessCapAdditionsAfterRel6.is_value()); } int AccessCapAdditionsAfterRel5__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel6.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel5__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel6 := "); field_accessCapAdditionsRel6.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := "); field_accessCapAdditionsAfterRel6.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel5__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel6().is_bound()) accessCapAdditionsRel6().set_implicit_omit(); if (!accessCapAdditionsAfterRel6().is_bound()) accessCapAdditionsAfterRel6() = OMIT_VALUE; else accessCapAdditionsAfterRel6().set_implicit_omit(); } void AccessCapAdditionsAfterRel5__BSSGP::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) accessCapAdditionsRel6().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel6().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(), "accessCapAdditionsRel6")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel6().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel6")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel6().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP"); } } void AccessCapAdditionsAfterRel5__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel6.encode_text(text_buf); field_accessCapAdditionsAfterRel6.encode_text(text_buf); } void AccessCapAdditionsAfterRel5__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel6.decode_text(text_buf); field_accessCapAdditionsAfterRel6.decode_text(text_buf); } void AccessCapAdditionsAfterRel5__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel5__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel5__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel5__BSSGP_accessCapAdditionsRel6_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel6.RAW_decode(AccessCapAdditionsAfterRel5__BSSGP_accessCapAdditionsRel6_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel6 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel5__BSSGP_accessCapAdditionsAfterRel6_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel6().RAW_decode(AccessCapAdditionsAfterRel5__BSSGP_accessCapAdditionsAfterRel6_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel6 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel6=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel5__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsAfterRel5__BSSGP_accessCapAdditionsRel6_descr_.raw); if (field_accessCapAdditionsAfterRel6.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel5__BSSGP_accessCapAdditionsAfterRel6_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel6.RAW_encode(AccessCapAdditionsAfterRel5__BSSGP_accessCapAdditionsRel6_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel6.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel6().RAW_encode(AccessCapAdditionsAfterRel5__BSSGP_accessCapAdditionsAfterRel6_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel5__BSSGP_template::single_value_struct { AccessCapAdditionsRel6__BSSGP_template field_accessCapAdditionsRel6; AccessCapAdditionsAfterRel6__BSSGP_template field_accessCapAdditionsAfterRel6; }; void AccessCapAdditionsAfterRel5__BSSGP_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_accessCapAdditionsRel6 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel6 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel5__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel5__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel6().is_bound()) { single_value->field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6(); } else { single_value->field_accessCapAdditionsRel6.clean_up(); } if (other_value.accessCapAdditionsAfterRel6().is_bound()) { if (other_value.accessCapAdditionsAfterRel6().ispresent()) single_value->field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6()(); else single_value->field_accessCapAdditionsAfterRel6 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel6.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel5__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel5__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel6().get_selection()) { single_value->field_accessCapAdditionsRel6 = other_value.accessCapAdditionsRel6(); } else { single_value->field_accessCapAdditionsRel6.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel6().get_selection()) { single_value->field_accessCapAdditionsAfterRel6 = other_value.accessCapAdditionsAfterRel6(); } else { single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5__BSSGP_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 AccessCapAdditionsAfterRel5__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel5__BSSGP_template::AccessCapAdditionsAfterRel5__BSSGP_template() { } AccessCapAdditionsAfterRel5__BSSGP_template::AccessCapAdditionsAfterRel5__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel5__BSSGP_template::AccessCapAdditionsAfterRel5__BSSGP_template(const AccessCapAdditionsAfterRel5__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel5__BSSGP_template::AccessCapAdditionsAfterRel5__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel5__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel5__BSSGP_template::AccessCapAdditionsAfterRel5__BSSGP_template(AccessCapAdditionsAfterRel5__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel5__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel5__BSSGP_template::AccessCapAdditionsAfterRel5__BSSGP_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; } AccessCapAdditionsAfterRel5__BSSGP_template::AccessCapAdditionsAfterRel5__BSSGP_template(const AccessCapAdditionsAfterRel5__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel5__BSSGP_template::~AccessCapAdditionsAfterRel5__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel5__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel5__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_template::operator=(const AccessCapAdditionsAfterRel5__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel5__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel5__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); } return *this; } AccessCapAdditionsAfterRel5__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_template::operator=(const AccessCapAdditionsAfterRel5__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel5__BSSGP_template::match(const AccessCapAdditionsAfterRel5__BSSGP& 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.accessCapAdditionsRel6().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel6.match(other_value.accessCapAdditionsRel6(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel6().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel6().ispresent() ? !single_value->field_accessCapAdditionsAfterRel6.match((const AccessCapAdditionsAfterRel6__BSSGP&)other_value.accessCapAdditionsAfterRel6(), legacy) : !single_value->field_accessCapAdditionsAfterRel6.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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel5__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel6.is_bound() || (single_value->field_accessCapAdditionsAfterRel6.is_omit() || single_value->field_accessCapAdditionsAfterRel6.is_bound()); } boolean AccessCapAdditionsAfterRel5__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel6.is_value() && (single_value->field_accessCapAdditionsAfterRel6.is_omit() || single_value->field_accessCapAdditionsAfterRel6.is_value()); } void AccessCapAdditionsAfterRel5__BSSGP_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; } AccessCapAdditionsAfterRel5__BSSGP AccessCapAdditionsAfterRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); AccessCapAdditionsAfterRel5__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel6.is_bound()) { ret_val.accessCapAdditionsRel6() = single_value->field_accessCapAdditionsRel6.valueof(); } if (single_value->field_accessCapAdditionsAfterRel6.is_omit()) ret_val.accessCapAdditionsAfterRel6() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel6.is_bound()) { ret_val.accessCapAdditionsAfterRel6() = single_value->field_accessCapAdditionsAfterRel6.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel5__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel5__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel6__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_template::accessCapAdditionsRel6() { set_specific(); return single_value->field_accessCapAdditionsRel6; } const AccessCapAdditionsRel6__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_template::accessCapAdditionsRel6() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel6 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); return single_value->field_accessCapAdditionsRel6; } AccessCapAdditionsAfterRel6__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_template::accessCapAdditionsAfterRel6() { set_specific(); return single_value->field_accessCapAdditionsAfterRel6; } const AccessCapAdditionsAfterRel6__BSSGP_template& AccessCapAdditionsAfterRel5__BSSGP_template::accessCapAdditionsAfterRel6() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel6 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); return single_value->field_accessCapAdditionsAfterRel6; } int AccessCapAdditionsAfterRel5__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel6.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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel5__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel6 := "); single_value->field_accessCapAdditionsRel6.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := "); single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5__BSSGP_template::log_match(const AccessCapAdditionsAfterRel5__BSSGP& 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_accessCapAdditionsRel6.match(match_value.accessCapAdditionsRel6(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel6"); single_value->field_accessCapAdditionsRel6.log_match(match_value.accessCapAdditionsRel6(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel6().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel6.match(match_value.accessCapAdditionsAfterRel6(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel6"); single_value->field_accessCapAdditionsAfterRel6.log_match(match_value.accessCapAdditionsAfterRel6(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel6.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel6 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel6.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("{ accessCapAdditionsRel6 := "); single_value->field_accessCapAdditionsRel6.log_match(match_value.accessCapAdditionsRel6(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel6 := "); if (match_value.accessCapAdditionsAfterRel6().ispresent()) { single_value->field_accessCapAdditionsAfterRel6.log_match(match_value.accessCapAdditionsAfterRel6(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel6.log(); if (single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel6.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel6.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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); } } void AccessCapAdditionsAfterRel5__BSSGP_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_accessCapAdditionsRel6.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel6.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 AccessCapAdditionsAfterRel5__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP."); } } void AccessCapAdditionsAfterRel5__BSSGP_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: { AccessCapAdditionsAfterRel5__BSSGP_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) accessCapAdditionsRel6().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel6().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(), "accessCapAdditionsRel6")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel6().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel6")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel6().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel5__BSSGP_template* precondition = new AccessCapAdditionsAfterRel5__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel5__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel5__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel5__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel5__BSSGP_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_accessCapAdditionsRel6.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP"); single_value->field_accessCapAdditionsAfterRel6.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel5_BSSGP"); } boolean AccessCapAdditionsAfterRel5__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel5__BSSGP_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_downlinkDualCarrier, const BITSTRING& par_flexibleTimeslotAssignment, const BITSTRING& par_gANPSHandoverCapability, const BITSTRING& par_rLCNonPersistentMode, const BITSTRING& par_reducedLatencyEGPRSCapability, const BITSTRING& par_uplinkEGPRS2, const BITSTRING& par_downlinkEGPRS2) : field_dTMHandoverCapability(par_dTMHandoverCapability), field_presenceBitDownlinkDualCarrier(par_presenceBitDownlinkDualCarrier), field_downlinkDualCarrier(par_downlinkDualCarrier), field_flexibleTimeslotAssignment(par_flexibleTimeslotAssignment), field_gANPSHandoverCapability(par_gANPSHandoverCapability), field_rLCNonPersistentMode(par_rLCNonPersistentMode), field_reducedLatencyEGPRSCapability(par_reducedLatencyEGPRSCapability), field_uplinkEGPRS2(par_uplinkEGPRS2), field_downlinkEGPRS2(par_downlinkEGPRS2) { } AccessCapAdditionsRel7__BSSGP::AccessCapAdditionsRel7__BSSGP(const AccessCapAdditionsRel7__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); if (other_value.dTMHandoverCapability().is_bound()) field_dTMHandoverCapability = other_value.dTMHandoverCapability(); else field_dTMHandoverCapability.clean_up(); if (other_value.presenceBitDownlinkDualCarrier().is_bound()) field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier(); else field_presenceBitDownlinkDualCarrier.clean_up(); if (other_value.downlinkDualCarrier().is_bound()) field_downlinkDualCarrier = other_value.downlinkDualCarrier(); else field_downlinkDualCarrier.clean_up(); if (other_value.flexibleTimeslotAssignment().is_bound()) field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment(); else field_flexibleTimeslotAssignment.clean_up(); if (other_value.gANPSHandoverCapability().is_bound()) field_gANPSHandoverCapability = other_value.gANPSHandoverCapability(); else field_gANPSHandoverCapability.clean_up(); if (other_value.rLCNonPersistentMode().is_bound()) field_rLCNonPersistentMode = other_value.rLCNonPersistentMode(); else field_rLCNonPersistentMode.clean_up(); if (other_value.reducedLatencyEGPRSCapability().is_bound()) field_reducedLatencyEGPRSCapability = other_value.reducedLatencyEGPRSCapability(); else field_reducedLatencyEGPRSCapability.clean_up(); if (other_value.uplinkEGPRS2().is_bound()) field_uplinkEGPRS2 = other_value.uplinkEGPRS2(); else field_uplinkEGPRS2.clean_up(); if (other_value.downlinkEGPRS2().is_bound()) field_downlinkEGPRS2 = other_value.downlinkEGPRS2(); else field_downlinkEGPRS2.clean_up(); } void AccessCapAdditionsRel7__BSSGP::clean_up() { field_dTMHandoverCapability.clean_up(); field_presenceBitDownlinkDualCarrier.clean_up(); field_downlinkDualCarrier.clean_up(); field_flexibleTimeslotAssignment.clean_up(); field_gANPSHandoverCapability.clean_up(); field_rLCNonPersistentMode.clean_up(); field_reducedLatencyEGPRSCapability.clean_up(); field_uplinkEGPRS2.clean_up(); field_downlinkEGPRS2.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsRel7__BSSGP::get_descriptor() const { return &AccessCapAdditionsRel7__BSSGP_descr_; } AccessCapAdditionsRel7__BSSGP& AccessCapAdditionsRel7__BSSGP::operator=(const AccessCapAdditionsRel7__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); if (other_value.dTMHandoverCapability().is_bound()) field_dTMHandoverCapability = other_value.dTMHandoverCapability(); else field_dTMHandoverCapability.clean_up(); if (other_value.presenceBitDownlinkDualCarrier().is_bound()) field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier(); else field_presenceBitDownlinkDualCarrier.clean_up(); if (other_value.downlinkDualCarrier().is_bound()) field_downlinkDualCarrier = other_value.downlinkDualCarrier(); else field_downlinkDualCarrier.clean_up(); if (other_value.flexibleTimeslotAssignment().is_bound()) field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment(); else field_flexibleTimeslotAssignment.clean_up(); if (other_value.gANPSHandoverCapability().is_bound()) field_gANPSHandoverCapability = other_value.gANPSHandoverCapability(); else field_gANPSHandoverCapability.clean_up(); if (other_value.rLCNonPersistentMode().is_bound()) field_rLCNonPersistentMode = other_value.rLCNonPersistentMode(); else field_rLCNonPersistentMode.clean_up(); if (other_value.reducedLatencyEGPRSCapability().is_bound()) field_reducedLatencyEGPRSCapability = other_value.reducedLatencyEGPRSCapability(); else field_reducedLatencyEGPRSCapability.clean_up(); if (other_value.uplinkEGPRS2().is_bound()) field_uplinkEGPRS2 = other_value.uplinkEGPRS2(); else field_uplinkEGPRS2.clean_up(); if (other_value.downlinkEGPRS2().is_bound()) field_downlinkEGPRS2 = other_value.downlinkEGPRS2(); else field_downlinkEGPRS2.clean_up(); } return *this; } boolean AccessCapAdditionsRel7__BSSGP::operator==(const AccessCapAdditionsRel7__BSSGP& other_value) const { return field_dTMHandoverCapability==other_value.field_dTMHandoverCapability && field_presenceBitDownlinkDualCarrier==other_value.field_presenceBitDownlinkDualCarrier && field_downlinkDualCarrier==other_value.field_downlinkDualCarrier && field_flexibleTimeslotAssignment==other_value.field_flexibleTimeslotAssignment && field_gANPSHandoverCapability==other_value.field_gANPSHandoverCapability && field_rLCNonPersistentMode==other_value.field_rLCNonPersistentMode && field_reducedLatencyEGPRSCapability==other_value.field_reducedLatencyEGPRSCapability && field_uplinkEGPRS2==other_value.field_uplinkEGPRS2 && field_downlinkEGPRS2==other_value.field_downlinkEGPRS2; } boolean AccessCapAdditionsRel7__BSSGP::is_bound() const { return (field_dTMHandoverCapability.is_bound()) || (field_presenceBitDownlinkDualCarrier.is_bound()) || (OPTIONAL_OMIT == field_downlinkDualCarrier.get_selection() || field_downlinkDualCarrier.is_bound()) || (field_flexibleTimeslotAssignment.is_bound()) || (field_gANPSHandoverCapability.is_bound()) || (field_rLCNonPersistentMode.is_bound()) || (field_reducedLatencyEGPRSCapability.is_bound()) || (field_uplinkEGPRS2.is_bound()) || (field_downlinkEGPRS2.is_bound()); } boolean AccessCapAdditionsRel7__BSSGP::is_value() const { return field_dTMHandoverCapability.is_value() && field_presenceBitDownlinkDualCarrier.is_value() && (OPTIONAL_OMIT == field_downlinkDualCarrier.get_selection() || field_downlinkDualCarrier.is_value()) && field_flexibleTimeslotAssignment.is_value() && field_gANPSHandoverCapability.is_value() && field_rLCNonPersistentMode.is_value() && field_reducedLatencyEGPRSCapability.is_value() && field_uplinkEGPRS2.is_value() && field_downlinkEGPRS2.is_value(); } int AccessCapAdditionsRel7__BSSGP::size_of() const { int ret_val = 8; if (field_downlinkDualCarrier.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsRel7__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ dTMHandoverCapability := "); field_dTMHandoverCapability.log(); TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := "); field_presenceBitDownlinkDualCarrier.log(); TTCN_Logger::log_event_str(", downlinkDualCarrier := "); field_downlinkDualCarrier.log(); TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := "); field_flexibleTimeslotAssignment.log(); TTCN_Logger::log_event_str(", gANPSHandoverCapability := "); field_gANPSHandoverCapability.log(); TTCN_Logger::log_event_str(", rLCNonPersistentMode := "); field_rLCNonPersistentMode.log(); TTCN_Logger::log_event_str(", reducedLatencyEGPRSCapability := "); field_reducedLatencyEGPRSCapability.log(); TTCN_Logger::log_event_str(", uplinkEGPRS2 := "); field_uplinkEGPRS2.log(); TTCN_Logger::log_event_str(", downlinkEGPRS2 := "); field_downlinkEGPRS2.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsRel7__BSSGP::set_implicit_omit() { if (dTMHandoverCapability().is_bound()) dTMHandoverCapability().set_implicit_omit(); if (presenceBitDownlinkDualCarrier().is_bound()) presenceBitDownlinkDualCarrier().set_implicit_omit(); if (!downlinkDualCarrier().is_bound()) downlinkDualCarrier() = OMIT_VALUE; else downlinkDualCarrier().set_implicit_omit(); if (flexibleTimeslotAssignment().is_bound()) flexibleTimeslotAssignment().set_implicit_omit(); if (gANPSHandoverCapability().is_bound()) gANPSHandoverCapability().set_implicit_omit(); if (rLCNonPersistentMode().is_bound()) rLCNonPersistentMode().set_implicit_omit(); if (reducedLatencyEGPRSCapability().is_bound()) reducedLatencyEGPRSCapability().set_implicit_omit(); if (uplinkEGPRS2().is_bound()) uplinkEGPRS2().set_implicit_omit(); if (downlinkEGPRS2().is_bound()) downlinkEGPRS2().set_implicit_omit(); } void AccessCapAdditionsRel7__BSSGP::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 (90 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) dTMHandoverCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDownlinkDualCarrier().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrier().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) flexibleTimeslotAssignment().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gANPSHandoverCapability().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rLCNonPersistentMode().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) reducedLatencyEGPRSCapability().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) uplinkEGPRS2().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) downlinkEGPRS2().set_param(*param.get_elem(8)); 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(), "dTMHandoverCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMHandoverCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDownlinkDualCarrier")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDownlinkDualCarrier().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "downlinkDualCarrier")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { downlinkDualCarrier().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "flexibleTimeslotAssignment")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { flexibleTimeslotAssignment().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gANPSHandoverCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gANPSHandoverCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rLCNonPersistentMode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rLCNonPersistentMode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "reducedLatencyEGPRSCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { reducedLatencyEGPRSCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "uplinkEGPRS2")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { uplinkEGPRS2().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "downlinkEGPRS2")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { downlinkEGPRS2().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); } } void AccessCapAdditionsRel7__BSSGP::encode_text(Text_Buf& text_buf) const { field_dTMHandoverCapability.encode_text(text_buf); field_presenceBitDownlinkDualCarrier.encode_text(text_buf); field_downlinkDualCarrier.encode_text(text_buf); field_flexibleTimeslotAssignment.encode_text(text_buf); field_gANPSHandoverCapability.encode_text(text_buf); field_rLCNonPersistentMode.encode_text(text_buf); field_reducedLatencyEGPRSCapability.encode_text(text_buf); field_uplinkEGPRS2.encode_text(text_buf); field_downlinkEGPRS2.encode_text(text_buf); } void AccessCapAdditionsRel7__BSSGP::decode_text(Text_Buf& text_buf) { field_dTMHandoverCapability.decode_text(text_buf); field_presenceBitDownlinkDualCarrier.decode_text(text_buf); field_downlinkDualCarrier.decode_text(text_buf); field_flexibleTimeslotAssignment.decode_text(text_buf); field_gANPSHandoverCapability.decode_text(text_buf); field_rLCNonPersistentMode.decode_text(text_buf); field_reducedLatencyEGPRSCapability.decode_text(text_buf); field_uplinkEGPRS2.decode_text(text_buf); field_downlinkEGPRS2.decode_text(text_buf); } void AccessCapAdditionsRel7__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel7__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel7__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel7__BSSGP_dTMHandoverCapability_descr_.raw->forceomit); decoded_field_length = field_dTMHandoverCapability.RAW_decode(AccessCapAdditionsRel7__BSSGP_dTMHandoverCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel7__BSSGP_presenceBitDownlinkDualCarrier_descr_.raw->forceomit); decoded_field_length = field_presenceBitDownlinkDualCarrier.RAW_decode(AccessCapAdditionsRel7__BSSGP_presenceBitDownlinkDualCarrier_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitDownlinkDualCarrier == bs_0){ if (force_omit != NULL && (*force_omit)(2)) { field_downlinkDualCarrier = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel7__BSSGP_downlinkDualCarrier_descr_.raw->forceomit); decoded_field_length = field_downlinkDualCarrier().RAW_decode(AccessCapAdditionsRel7__BSSGP_downlinkDualCarrier_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 1) { field_downlinkDualCarrier = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_downlinkDualCarrier=OMIT_VALUE; RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel7__BSSGP_flexibleTimeslotAssignment_descr_.raw->forceomit); decoded_field_length = field_flexibleTimeslotAssignment.RAW_decode(AccessCapAdditionsRel7__BSSGP_flexibleTimeslotAssignment_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel7__BSSGP_gANPSHandoverCapability_descr_.raw->forceomit); decoded_field_length = field_gANPSHandoverCapability.RAW_decode(AccessCapAdditionsRel7__BSSGP_gANPSHandoverCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapAdditionsRel7__BSSGP_rLCNonPersistentMode_descr_.raw->forceomit); decoded_field_length = field_rLCNonPersistentMode.RAW_decode(AccessCapAdditionsRel7__BSSGP_rLCNonPersistentMode_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_6_force_omit(6, force_omit, AccessCapAdditionsRel7__BSSGP_reducedLatencyEGPRSCapability_descr_.raw->forceomit); decoded_field_length = field_reducedLatencyEGPRSCapability.RAW_decode(AccessCapAdditionsRel7__BSSGP_reducedLatencyEGPRSCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_6_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_7_force_omit(7, force_omit, AccessCapAdditionsRel7__BSSGP_uplinkEGPRS2_descr_.raw->forceomit); decoded_field_length = field_uplinkEGPRS2.RAW_decode(AccessCapAdditionsRel7__BSSGP_uplinkEGPRS2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_7_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_8_force_omit(8, force_omit, AccessCapAdditionsRel7__BSSGP_downlinkEGPRS2_descr_.raw->forceomit); decoded_field_length = field_downlinkEGPRS2.RAW_decode(AccessCapAdditionsRel7__BSSGP_downlinkEGPRS2_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_8_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel7__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 9; myleaf.body.node.nodes = init_nodes_of_enc_tree(9); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel7__BSSGP_dTMHandoverCapability_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel7__BSSGP_presenceBitDownlinkDualCarrier_descr_.raw); if (field_downlinkDualCarrier.ispresent()) { myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel7__BSSGP_downlinkDualCarrier_descr_.raw); } else myleaf.body.node.nodes[2] = NULL; myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel7__BSSGP_flexibleTimeslotAssignment_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel7__BSSGP_gANPSHandoverCapability_descr_.raw); myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel7__BSSGP_rLCNonPersistentMode_descr_.raw); myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, AccessCapAdditionsRel7__BSSGP_reducedLatencyEGPRSCapability_descr_.raw); myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, AccessCapAdditionsRel7__BSSGP_uplinkEGPRS2_descr_.raw); myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, AccessCapAdditionsRel7__BSSGP_downlinkEGPRS2_descr_.raw); encoded_length += field_dTMHandoverCapability.RAW_encode(AccessCapAdditionsRel7__BSSGP_dTMHandoverCapability_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_presenceBitDownlinkDualCarrier.RAW_encode(AccessCapAdditionsRel7__BSSGP_presenceBitDownlinkDualCarrier_descr_, *myleaf.body.node.nodes[1]); if (field_downlinkDualCarrier.ispresent()) { encoded_length += field_downlinkDualCarrier().RAW_encode(AccessCapAdditionsRel7__BSSGP_downlinkDualCarrier_descr_, *myleaf.body.node.nodes[2]); } encoded_length += field_flexibleTimeslotAssignment.RAW_encode(AccessCapAdditionsRel7__BSSGP_flexibleTimeslotAssignment_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_gANPSHandoverCapability.RAW_encode(AccessCapAdditionsRel7__BSSGP_gANPSHandoverCapability_descr_, *myleaf.body.node.nodes[4]); encoded_length += field_rLCNonPersistentMode.RAW_encode(AccessCapAdditionsRel7__BSSGP_rLCNonPersistentMode_descr_, *myleaf.body.node.nodes[5]); encoded_length += field_reducedLatencyEGPRSCapability.RAW_encode(AccessCapAdditionsRel7__BSSGP_reducedLatencyEGPRSCapability_descr_, *myleaf.body.node.nodes[6]); encoded_length += field_uplinkEGPRS2.RAW_encode(AccessCapAdditionsRel7__BSSGP_uplinkEGPRS2_descr_, *myleaf.body.node.nodes[7]); encoded_length += field_downlinkEGPRS2.RAW_encode(AccessCapAdditionsRel7__BSSGP_downlinkEGPRS2_descr_, *myleaf.body.node.nodes[8]); if (field_downlinkDualCarrier.ispresent() && (field_presenceBitDownlinkDualCarrier != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={1}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapAdditionsRel7__BSSGP_presenceBitDownlinkDualCarrier_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct AccessCapAdditionsRel7__BSSGP_template::single_value_struct { BITSTRING_template field_dTMHandoverCapability; BITSTRING_template field_presenceBitDownlinkDualCarrier; DownlinkDualCarrier__BSSGP_template field_downlinkDualCarrier; BITSTRING_template field_flexibleTimeslotAssignment; BITSTRING_template field_gANPSHandoverCapability; BITSTRING_template field_rLCNonPersistentMode; BITSTRING_template field_reducedLatencyEGPRSCapability; BITSTRING_template field_uplinkEGPRS2; BITSTRING_template field_downlinkEGPRS2; }; void AccessCapAdditionsRel7__BSSGP_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_dTMHandoverCapability = ANY_VALUE; single_value->field_presenceBitDownlinkDualCarrier = ANY_VALUE; single_value->field_downlinkDualCarrier = ANY_OR_OMIT; single_value->field_flexibleTimeslotAssignment = ANY_VALUE; single_value->field_gANPSHandoverCapability = ANY_VALUE; single_value->field_rLCNonPersistentMode = ANY_VALUE; single_value->field_reducedLatencyEGPRSCapability = ANY_VALUE; single_value->field_uplinkEGPRS2 = ANY_VALUE; single_value->field_downlinkEGPRS2 = ANY_VALUE; } } } void AccessCapAdditionsRel7__BSSGP_template::copy_value(const AccessCapAdditionsRel7__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.dTMHandoverCapability().is_bound()) { single_value->field_dTMHandoverCapability = other_value.dTMHandoverCapability(); } else { single_value->field_dTMHandoverCapability.clean_up(); } if (other_value.presenceBitDownlinkDualCarrier().is_bound()) { single_value->field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier(); } else { single_value->field_presenceBitDownlinkDualCarrier.clean_up(); } if (other_value.downlinkDualCarrier().is_bound()) { if (other_value.downlinkDualCarrier().ispresent()) single_value->field_downlinkDualCarrier = other_value.downlinkDualCarrier()(); else single_value->field_downlinkDualCarrier = OMIT_VALUE; } else { single_value->field_downlinkDualCarrier.clean_up(); } if (other_value.flexibleTimeslotAssignment().is_bound()) { single_value->field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment(); } else { single_value->field_flexibleTimeslotAssignment.clean_up(); } if (other_value.gANPSHandoverCapability().is_bound()) { single_value->field_gANPSHandoverCapability = other_value.gANPSHandoverCapability(); } else { single_value->field_gANPSHandoverCapability.clean_up(); } if (other_value.rLCNonPersistentMode().is_bound()) { single_value->field_rLCNonPersistentMode = other_value.rLCNonPersistentMode(); } else { single_value->field_rLCNonPersistentMode.clean_up(); } if (other_value.reducedLatencyEGPRSCapability().is_bound()) { single_value->field_reducedLatencyEGPRSCapability = other_value.reducedLatencyEGPRSCapability(); } else { single_value->field_reducedLatencyEGPRSCapability.clean_up(); } if (other_value.uplinkEGPRS2().is_bound()) { single_value->field_uplinkEGPRS2 = other_value.uplinkEGPRS2(); } else { single_value->field_uplinkEGPRS2.clean_up(); } if (other_value.downlinkEGPRS2().is_bound()) { single_value->field_downlinkEGPRS2 = other_value.downlinkEGPRS2(); } else { single_value->field_downlinkEGPRS2.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel7__BSSGP_template::copy_template(const AccessCapAdditionsRel7__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.dTMHandoverCapability().get_selection()) { single_value->field_dTMHandoverCapability = other_value.dTMHandoverCapability(); } else { single_value->field_dTMHandoverCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDownlinkDualCarrier().get_selection()) { single_value->field_presenceBitDownlinkDualCarrier = other_value.presenceBitDownlinkDualCarrier(); } else { single_value->field_presenceBitDownlinkDualCarrier.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.downlinkDualCarrier().get_selection()) { single_value->field_downlinkDualCarrier = other_value.downlinkDualCarrier(); } else { single_value->field_downlinkDualCarrier.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.flexibleTimeslotAssignment().get_selection()) { single_value->field_flexibleTimeslotAssignment = other_value.flexibleTimeslotAssignment(); } else { single_value->field_flexibleTimeslotAssignment.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gANPSHandoverCapability().get_selection()) { single_value->field_gANPSHandoverCapability = other_value.gANPSHandoverCapability(); } else { single_value->field_gANPSHandoverCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.rLCNonPersistentMode().get_selection()) { single_value->field_rLCNonPersistentMode = other_value.rLCNonPersistentMode(); } else { single_value->field_rLCNonPersistentMode.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.reducedLatencyEGPRSCapability().get_selection()) { single_value->field_reducedLatencyEGPRSCapability = other_value.reducedLatencyEGPRSCapability(); } else { single_value->field_reducedLatencyEGPRSCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.uplinkEGPRS2().get_selection()) { single_value->field_uplinkEGPRS2 = other_value.uplinkEGPRS2(); } else { single_value->field_uplinkEGPRS2.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.downlinkEGPRS2().get_selection()) { single_value->field_downlinkEGPRS2 = other_value.downlinkEGPRS2(); } else { single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7__BSSGP_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 AccessCapAdditionsRel7__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel7__BSSGP_template::AccessCapAdditionsRel7__BSSGP_template() { } AccessCapAdditionsRel7__BSSGP_template::AccessCapAdditionsRel7__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel7__BSSGP_template::AccessCapAdditionsRel7__BSSGP_template(const AccessCapAdditionsRel7__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel7__BSSGP_template::AccessCapAdditionsRel7__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel7__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel7__BSSGP_template::AccessCapAdditionsRel7__BSSGP_template(AccessCapAdditionsRel7__BSSGP_template* p_precondition, AccessCapAdditionsRel7__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel7__BSSGP_template::AccessCapAdditionsRel7__BSSGP_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; } AccessCapAdditionsRel7__BSSGP_template::AccessCapAdditionsRel7__BSSGP_template(const AccessCapAdditionsRel7__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel7__BSSGP_template::~AccessCapAdditionsRel7__BSSGP_template() { clean_up(); } AccessCapAdditionsRel7__BSSGP_template& AccessCapAdditionsRel7__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel7__BSSGP_template& AccessCapAdditionsRel7__BSSGP_template::operator=(const AccessCapAdditionsRel7__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel7__BSSGP_template& AccessCapAdditionsRel7__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel7__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); } return *this; } AccessCapAdditionsRel7__BSSGP_template& AccessCapAdditionsRel7__BSSGP_template::operator=(const AccessCapAdditionsRel7__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel7__BSSGP_template::match(const AccessCapAdditionsRel7__BSSGP& 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.dTMHandoverCapability().is_bound()) return FALSE; if(!single_value->field_dTMHandoverCapability.match(other_value.dTMHandoverCapability(), legacy))return FALSE; if(!other_value.presenceBitDownlinkDualCarrier().is_bound()) return FALSE; if(!single_value->field_presenceBitDownlinkDualCarrier.match(other_value.presenceBitDownlinkDualCarrier(), legacy))return FALSE; if(!other_value.downlinkDualCarrier().is_bound()) return FALSE; if((other_value.downlinkDualCarrier().ispresent() ? !single_value->field_downlinkDualCarrier.match((const DownlinkDualCarrier__BSSGP&)other_value.downlinkDualCarrier(), legacy) : !single_value->field_downlinkDualCarrier.match_omit(legacy)))return FALSE; if(!other_value.flexibleTimeslotAssignment().is_bound()) return FALSE; if(!single_value->field_flexibleTimeslotAssignment.match(other_value.flexibleTimeslotAssignment(), legacy))return FALSE; if(!other_value.gANPSHandoverCapability().is_bound()) return FALSE; if(!single_value->field_gANPSHandoverCapability.match(other_value.gANPSHandoverCapability(), legacy))return FALSE; if(!other_value.rLCNonPersistentMode().is_bound()) return FALSE; if(!single_value->field_rLCNonPersistentMode.match(other_value.rLCNonPersistentMode(), legacy))return FALSE; if(!other_value.reducedLatencyEGPRSCapability().is_bound()) return FALSE; if(!single_value->field_reducedLatencyEGPRSCapability.match(other_value.reducedLatencyEGPRSCapability(), legacy))return FALSE; if(!other_value.uplinkEGPRS2().is_bound()) return FALSE; if(!single_value->field_uplinkEGPRS2.match(other_value.uplinkEGPRS2(), legacy))return FALSE; if(!other_value.downlinkEGPRS2().is_bound()) return FALSE; if(!single_value->field_downlinkEGPRS2.match(other_value.downlinkEGPRS2(), 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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel7__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_dTMHandoverCapability.is_bound() || single_value->field_presenceBitDownlinkDualCarrier.is_bound() || (single_value->field_downlinkDualCarrier.is_omit() || single_value->field_downlinkDualCarrier.is_bound()) || single_value->field_flexibleTimeslotAssignment.is_bound() || single_value->field_gANPSHandoverCapability.is_bound() || single_value->field_rLCNonPersistentMode.is_bound() || single_value->field_reducedLatencyEGPRSCapability.is_bound() || single_value->field_uplinkEGPRS2.is_bound() || single_value->field_downlinkEGPRS2.is_bound(); } boolean AccessCapAdditionsRel7__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_dTMHandoverCapability.is_value() && single_value->field_presenceBitDownlinkDualCarrier.is_value() && (single_value->field_downlinkDualCarrier.is_omit() || single_value->field_downlinkDualCarrier.is_value()) && single_value->field_flexibleTimeslotAssignment.is_value() && single_value->field_gANPSHandoverCapability.is_value() && single_value->field_rLCNonPersistentMode.is_value() && single_value->field_reducedLatencyEGPRSCapability.is_value() && single_value->field_uplinkEGPRS2.is_value() && single_value->field_downlinkEGPRS2.is_value(); } void AccessCapAdditionsRel7__BSSGP_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; } AccessCapAdditionsRel7__BSSGP AccessCapAdditionsRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); AccessCapAdditionsRel7__BSSGP ret_val; if (single_value->field_dTMHandoverCapability.is_bound()) { ret_val.dTMHandoverCapability() = single_value->field_dTMHandoverCapability.valueof(); } if (single_value->field_presenceBitDownlinkDualCarrier.is_bound()) { ret_val.presenceBitDownlinkDualCarrier() = single_value->field_presenceBitDownlinkDualCarrier.valueof(); } if (single_value->field_downlinkDualCarrier.is_omit()) ret_val.downlinkDualCarrier() = OMIT_VALUE; else if (single_value->field_downlinkDualCarrier.is_bound()) { ret_val.downlinkDualCarrier() = single_value->field_downlinkDualCarrier.valueof(); } if (single_value->field_flexibleTimeslotAssignment.is_bound()) { ret_val.flexibleTimeslotAssignment() = single_value->field_flexibleTimeslotAssignment.valueof(); } if (single_value->field_gANPSHandoverCapability.is_bound()) { ret_val.gANPSHandoverCapability() = single_value->field_gANPSHandoverCapability.valueof(); } if (single_value->field_rLCNonPersistentMode.is_bound()) { ret_val.rLCNonPersistentMode() = single_value->field_rLCNonPersistentMode.valueof(); } if (single_value->field_reducedLatencyEGPRSCapability.is_bound()) { ret_val.reducedLatencyEGPRSCapability() = single_value->field_reducedLatencyEGPRSCapability.valueof(); } if (single_value->field_uplinkEGPRS2.is_bound()) { ret_val.uplinkEGPRS2() = single_value->field_uplinkEGPRS2.valueof(); } if (single_value->field_downlinkEGPRS2.is_bound()) { ret_val.downlinkEGPRS2() = single_value->field_downlinkEGPRS2.valueof(); } return ret_val; } void AccessCapAdditionsRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel7__BSSGP_template[list_length]; } AccessCapAdditionsRel7__BSSGP_template& AccessCapAdditionsRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::dTMHandoverCapability() { set_specific(); return single_value->field_dTMHandoverCapability; } const BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::dTMHandoverCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTMHandoverCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_dTMHandoverCapability; } BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::presenceBitDownlinkDualCarrier() { set_specific(); return single_value->field_presenceBitDownlinkDualCarrier; } const BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::presenceBitDownlinkDualCarrier() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitDownlinkDualCarrier of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_presenceBitDownlinkDualCarrier; } DownlinkDualCarrier__BSSGP_template& AccessCapAdditionsRel7__BSSGP_template::downlinkDualCarrier() { set_specific(); return single_value->field_downlinkDualCarrier; } const DownlinkDualCarrier__BSSGP_template& AccessCapAdditionsRel7__BSSGP_template::downlinkDualCarrier() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field downlinkDualCarrier of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_downlinkDualCarrier; } BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::flexibleTimeslotAssignment() { set_specific(); return single_value->field_flexibleTimeslotAssignment; } const BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::flexibleTimeslotAssignment() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field flexibleTimeslotAssignment of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_flexibleTimeslotAssignment; } BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::gANPSHandoverCapability() { set_specific(); return single_value->field_gANPSHandoverCapability; } const BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::gANPSHandoverCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gANPSHandoverCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_gANPSHandoverCapability; } BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::rLCNonPersistentMode() { set_specific(); return single_value->field_rLCNonPersistentMode; } const BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::rLCNonPersistentMode() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rLCNonPersistentMode of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_rLCNonPersistentMode; } BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::reducedLatencyEGPRSCapability() { set_specific(); return single_value->field_reducedLatencyEGPRSCapability; } const BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::reducedLatencyEGPRSCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field reducedLatencyEGPRSCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_reducedLatencyEGPRSCapability; } BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::uplinkEGPRS2() { set_specific(); return single_value->field_uplinkEGPRS2; } const BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::uplinkEGPRS2() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uplinkEGPRS2 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_uplinkEGPRS2; } BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::downlinkEGPRS2() { set_specific(); return single_value->field_downlinkEGPRS2; } const BITSTRING_template& AccessCapAdditionsRel7__BSSGP_template::downlinkEGPRS2() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field downlinkEGPRS2 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); return single_value->field_downlinkEGPRS2; } int AccessCapAdditionsRel7__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 8; if (single_value->field_downlinkDualCarrier.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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); } return 0; } void AccessCapAdditionsRel7__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ dTMHandoverCapability := "); single_value->field_dTMHandoverCapability.log(); TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := "); single_value->field_presenceBitDownlinkDualCarrier.log(); TTCN_Logger::log_event_str(", downlinkDualCarrier := "); single_value->field_downlinkDualCarrier.log(); TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := "); single_value->field_flexibleTimeslotAssignment.log(); TTCN_Logger::log_event_str(", gANPSHandoverCapability := "); single_value->field_gANPSHandoverCapability.log(); TTCN_Logger::log_event_str(", rLCNonPersistentMode := "); single_value->field_rLCNonPersistentMode.log(); TTCN_Logger::log_event_str(", reducedLatencyEGPRSCapability := "); single_value->field_reducedLatencyEGPRSCapability.log(); TTCN_Logger::log_event_str(", uplinkEGPRS2 := "); single_value->field_uplinkEGPRS2.log(); TTCN_Logger::log_event_str(", downlinkEGPRS2 := "); single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7__BSSGP_template::log_match(const AccessCapAdditionsRel7__BSSGP& 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_dTMHandoverCapability.match(match_value.dTMHandoverCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".dTMHandoverCapability"); single_value->field_dTMHandoverCapability.log_match(match_value.dTMHandoverCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitDownlinkDualCarrier.match(match_value.presenceBitDownlinkDualCarrier(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitDownlinkDualCarrier"); single_value->field_presenceBitDownlinkDualCarrier.log_match(match_value.presenceBitDownlinkDualCarrier(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.downlinkDualCarrier().ispresent()){ if(!single_value->field_downlinkDualCarrier.match(match_value.downlinkDualCarrier(), legacy)){ TTCN_Logger::log_logmatch_info(".downlinkDualCarrier"); single_value->field_downlinkDualCarrier.log_match(match_value.downlinkDualCarrier(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_downlinkDualCarrier.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".downlinkDualCarrier := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_downlinkDualCarrier.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_flexibleTimeslotAssignment.match(match_value.flexibleTimeslotAssignment(), legacy)){ TTCN_Logger::log_logmatch_info(".flexibleTimeslotAssignment"); single_value->field_flexibleTimeslotAssignment.log_match(match_value.flexibleTimeslotAssignment(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gANPSHandoverCapability.match(match_value.gANPSHandoverCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".gANPSHandoverCapability"); single_value->field_gANPSHandoverCapability.log_match(match_value.gANPSHandoverCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_rLCNonPersistentMode.match(match_value.rLCNonPersistentMode(), legacy)){ TTCN_Logger::log_logmatch_info(".rLCNonPersistentMode"); single_value->field_rLCNonPersistentMode.log_match(match_value.rLCNonPersistentMode(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_reducedLatencyEGPRSCapability.match(match_value.reducedLatencyEGPRSCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".reducedLatencyEGPRSCapability"); single_value->field_reducedLatencyEGPRSCapability.log_match(match_value.reducedLatencyEGPRSCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_uplinkEGPRS2.match(match_value.uplinkEGPRS2(), legacy)){ TTCN_Logger::log_logmatch_info(".uplinkEGPRS2"); single_value->field_uplinkEGPRS2.log_match(match_value.uplinkEGPRS2(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_downlinkEGPRS2.match(match_value.downlinkEGPRS2(), legacy)){ TTCN_Logger::log_logmatch_info(".downlinkEGPRS2"); single_value->field_downlinkEGPRS2.log_match(match_value.downlinkEGPRS2(), 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("{ dTMHandoverCapability := "); single_value->field_dTMHandoverCapability.log_match(match_value.dTMHandoverCapability(), legacy); TTCN_Logger::log_event_str(", presenceBitDownlinkDualCarrier := "); single_value->field_presenceBitDownlinkDualCarrier.log_match(match_value.presenceBitDownlinkDualCarrier(), legacy); TTCN_Logger::log_event_str(", downlinkDualCarrier := "); if (match_value.downlinkDualCarrier().ispresent()) { single_value->field_downlinkDualCarrier.log_match(match_value.downlinkDualCarrier(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_downlinkDualCarrier.log(); if (single_value->field_downlinkDualCarrier.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", flexibleTimeslotAssignment := "); single_value->field_flexibleTimeslotAssignment.log_match(match_value.flexibleTimeslotAssignment(), legacy); TTCN_Logger::log_event_str(", gANPSHandoverCapability := "); single_value->field_gANPSHandoverCapability.log_match(match_value.gANPSHandoverCapability(), legacy); TTCN_Logger::log_event_str(", rLCNonPersistentMode := "); single_value->field_rLCNonPersistentMode.log_match(match_value.rLCNonPersistentMode(), legacy); TTCN_Logger::log_event_str(", reducedLatencyEGPRSCapability := "); single_value->field_reducedLatencyEGPRSCapability.log_match(match_value.reducedLatencyEGPRSCapability(), legacy); TTCN_Logger::log_event_str(", uplinkEGPRS2 := "); single_value->field_uplinkEGPRS2.log_match(match_value.uplinkEGPRS2(), legacy); TTCN_Logger::log_event_str(", downlinkEGPRS2 := "); single_value->field_downlinkEGPRS2.log_match(match_value.downlinkEGPRS2(), 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 AccessCapAdditionsRel7__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_dTMHandoverCapability.encode_text(text_buf); single_value->field_presenceBitDownlinkDualCarrier.encode_text(text_buf); single_value->field_downlinkDualCarrier.encode_text(text_buf); single_value->field_flexibleTimeslotAssignment.encode_text(text_buf); single_value->field_gANPSHandoverCapability.encode_text(text_buf); single_value->field_rLCNonPersistentMode.encode_text(text_buf); single_value->field_reducedLatencyEGPRSCapability.encode_text(text_buf); single_value->field_uplinkEGPRS2.encode_text(text_buf); single_value->field_downlinkEGPRS2.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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); } } void AccessCapAdditionsRel7__BSSGP_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_dTMHandoverCapability.decode_text(text_buf); single_value->field_presenceBitDownlinkDualCarrier.decode_text(text_buf); single_value->field_downlinkDualCarrier.decode_text(text_buf); single_value->field_flexibleTimeslotAssignment.decode_text(text_buf); single_value->field_gANPSHandoverCapability.decode_text(text_buf); single_value->field_rLCNonPersistentMode.decode_text(text_buf); single_value->field_reducedLatencyEGPRSCapability.decode_text(text_buf); single_value->field_uplinkEGPRS2.decode_text(text_buf); single_value->field_downlinkEGPRS2.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 AccessCapAdditionsRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel7_BSSGP."); } } void AccessCapAdditionsRel7__BSSGP_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: { AccessCapAdditionsRel7__BSSGP_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) dTMHandoverCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitDownlinkDualCarrier().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrier().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) flexibleTimeslotAssignment().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) gANPSHandoverCapability().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) rLCNonPersistentMode().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) reducedLatencyEGPRSCapability().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) uplinkEGPRS2().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) downlinkEGPRS2().set_param(*param.get_elem(8)); 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(), "dTMHandoverCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTMHandoverCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDownlinkDualCarrier")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDownlinkDualCarrier().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "downlinkDualCarrier")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { downlinkDualCarrier().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "flexibleTimeslotAssignment")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { flexibleTimeslotAssignment().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gANPSHandoverCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gANPSHandoverCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "rLCNonPersistentMode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { rLCNonPersistentMode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "reducedLatencyEGPRSCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { reducedLatencyEGPRSCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "uplinkEGPRS2")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { uplinkEGPRS2().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "downlinkEGPRS2")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { downlinkEGPRS2().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel7_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel7__BSSGP_template* precondition = new AccessCapAdditionsRel7__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel7__BSSGP_template* implied_template = new AccessCapAdditionsRel7__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel7__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel7__BSSGP_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_dTMHandoverCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); single_value->field_presenceBitDownlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); single_value->field_downlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); single_value->field_flexibleTimeslotAssignment.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); single_value->field_gANPSHandoverCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); single_value->field_rLCNonPersistentMode.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); single_value->field_reducedLatencyEGPRSCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); single_value->field_uplinkEGPRS2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); single_value->field_downlinkEGPRS2.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel7_BSSGP"); } boolean AccessCapAdditionsRel7__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel7__BSSGP_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) multislotCapReductionforDownLinkDualCarrier().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrierforDTMCapability().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(), "multislotCapReductionforDownLinkDualCarrier")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCapReductionforDownLinkDualCarrier().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "downlinkDualCarrierforDTMCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { downlinkDualCarrierforDTMCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.DownlinkDualCarrier_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.DownlinkDualCarrier_BSSGP"); } } void DownlinkDualCarrier__BSSGP::encode_text(Text_Buf& text_buf) const { field_multislotCapReductionforDownLinkDualCarrier.encode_text(text_buf); field_downlinkDualCarrierforDTMCapability.encode_text(text_buf); } void DownlinkDualCarrier__BSSGP::decode_text(Text_Buf& text_buf) { field_multislotCapReductionforDownLinkDualCarrier.decode_text(text_buf); field_downlinkDualCarrierforDTMCapability.decode_text(text_buf); } void DownlinkDualCarrier__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void DownlinkDualCarrier__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int DownlinkDualCarrier__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, DownlinkDualCarrier__BSSGP_multislotCapReductionforDownLinkDualCarrier_descr_.raw->forceomit); decoded_field_length = field_multislotCapReductionforDownLinkDualCarrier.RAW_decode(DownlinkDualCarrier__BSSGP_multislotCapReductionforDownLinkDualCarrier_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, DownlinkDualCarrier__BSSGP_downlinkDualCarrierforDTMCapability_descr_.raw->forceomit); decoded_field_length = field_downlinkDualCarrierforDTMCapability.RAW_decode(DownlinkDualCarrier__BSSGP_downlinkDualCarrierforDTMCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int DownlinkDualCarrier__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, DownlinkDualCarrier__BSSGP_multislotCapReductionforDownLinkDualCarrier_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DownlinkDualCarrier__BSSGP_downlinkDualCarrierforDTMCapability_descr_.raw); encoded_length += field_multislotCapReductionforDownLinkDualCarrier.RAW_encode(DownlinkDualCarrier__BSSGP_multislotCapReductionforDownLinkDualCarrier_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_downlinkDualCarrierforDTMCapability.RAW_encode(DownlinkDualCarrier__BSSGP_downlinkDualCarrierforDTMCapability_descr_, *myleaf.body.node.nodes[1]); return myleaf.length = encoded_length; } struct DownlinkDualCarrier__BSSGP_template::single_value_struct { BITSTRING_template field_multislotCapReductionforDownLinkDualCarrier; BITSTRING_template field_downlinkDualCarrierforDTMCapability; }; void DownlinkDualCarrier__BSSGP_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_multislotCapReductionforDownLinkDualCarrier = ANY_VALUE; single_value->field_downlinkDualCarrierforDTMCapability = ANY_VALUE; } } } void DownlinkDualCarrier__BSSGP_template::copy_value(const DownlinkDualCarrier__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.multislotCapReductionforDownLinkDualCarrier().is_bound()) { single_value->field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier(); } else { single_value->field_multislotCapReductionforDownLinkDualCarrier.clean_up(); } if (other_value.downlinkDualCarrierforDTMCapability().is_bound()) { single_value->field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability(); } else { single_value->field_downlinkDualCarrierforDTMCapability.clean_up(); } set_selection(SPECIFIC_VALUE); } void DownlinkDualCarrier__BSSGP_template::copy_template(const DownlinkDualCarrier__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.multislotCapReductionforDownLinkDualCarrier().get_selection()) { single_value->field_multislotCapReductionforDownLinkDualCarrier = other_value.multislotCapReductionforDownLinkDualCarrier(); } else { single_value->field_multislotCapReductionforDownLinkDualCarrier.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.downlinkDualCarrierforDTMCapability().get_selection()) { single_value->field_downlinkDualCarrierforDTMCapability = other_value.downlinkDualCarrierforDTMCapability(); } else { single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier__BSSGP_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 DownlinkDualCarrier__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new DownlinkDualCarrier__BSSGP_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 @BSSGP_Types.DownlinkDualCarrier_BSSGP."); break; } set_selection(other_value); } DownlinkDualCarrier__BSSGP_template::DownlinkDualCarrier__BSSGP_template() { } DownlinkDualCarrier__BSSGP_template::DownlinkDualCarrier__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DownlinkDualCarrier__BSSGP_template::DownlinkDualCarrier__BSSGP_template(const DownlinkDualCarrier__BSSGP& other_value) { copy_value(other_value); } DownlinkDualCarrier__BSSGP_template::DownlinkDualCarrier__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DownlinkDualCarrier__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP from an unbound optional field."); } } DownlinkDualCarrier__BSSGP_template::DownlinkDualCarrier__BSSGP_template(DownlinkDualCarrier__BSSGP_template* p_precondition, DownlinkDualCarrier__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DownlinkDualCarrier__BSSGP_template::DownlinkDualCarrier__BSSGP_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; } DownlinkDualCarrier__BSSGP_template::DownlinkDualCarrier__BSSGP_template(const DownlinkDualCarrier__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } DownlinkDualCarrier__BSSGP_template::~DownlinkDualCarrier__BSSGP_template() { clean_up(); } DownlinkDualCarrier__BSSGP_template& DownlinkDualCarrier__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DownlinkDualCarrier__BSSGP_template& DownlinkDualCarrier__BSSGP_template::operator=(const DownlinkDualCarrier__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } DownlinkDualCarrier__BSSGP_template& DownlinkDualCarrier__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DownlinkDualCarrier__BSSGP&)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 @BSSGP_Types.DownlinkDualCarrier_BSSGP."); } return *this; } DownlinkDualCarrier__BSSGP_template& DownlinkDualCarrier__BSSGP_template::operator=(const DownlinkDualCarrier__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean DownlinkDualCarrier__BSSGP_template::match(const DownlinkDualCarrier__BSSGP& 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.multislotCapReductionforDownLinkDualCarrier().is_bound()) return FALSE; if(!single_value->field_multislotCapReductionforDownLinkDualCarrier.match(other_value.multislotCapReductionforDownLinkDualCarrier(), legacy))return FALSE; if(!other_value.downlinkDualCarrierforDTMCapability().is_bound()) return FALSE; if(!single_value->field_downlinkDualCarrierforDTMCapability.match(other_value.downlinkDualCarrierforDTMCapability(), 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 @BSSGP_Types.DownlinkDualCarrier_BSSGP."); } return FALSE; } boolean DownlinkDualCarrier__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_multislotCapReductionforDownLinkDualCarrier.is_bound() || single_value->field_downlinkDualCarrierforDTMCapability.is_bound(); } boolean DownlinkDualCarrier__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_multislotCapReductionforDownLinkDualCarrier.is_value() && single_value->field_downlinkDualCarrierforDTMCapability.is_value(); } void DownlinkDualCarrier__BSSGP_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; } DownlinkDualCarrier__BSSGP DownlinkDualCarrier__BSSGP_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 @BSSGP_Types.DownlinkDualCarrier_BSSGP."); DownlinkDualCarrier__BSSGP ret_val; if (single_value->field_multislotCapReductionforDownLinkDualCarrier.is_bound()) { ret_val.multislotCapReductionforDownLinkDualCarrier() = single_value->field_multislotCapReductionforDownLinkDualCarrier.valueof(); } if (single_value->field_downlinkDualCarrierforDTMCapability.is_bound()) { ret_val.downlinkDualCarrierforDTMCapability() = single_value->field_downlinkDualCarrierforDTMCapability.valueof(); } return ret_val; } void DownlinkDualCarrier__BSSGP_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 @BSSGP_Types.DownlinkDualCarrier_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DownlinkDualCarrier__BSSGP_template[list_length]; } DownlinkDualCarrier__BSSGP_template& DownlinkDualCarrier__BSSGP_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 @BSSGP_Types.DownlinkDualCarrier_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& DownlinkDualCarrier__BSSGP_template::multislotCapReductionforDownLinkDualCarrier() { set_specific(); return single_value->field_multislotCapReductionforDownLinkDualCarrier; } const BITSTRING_template& DownlinkDualCarrier__BSSGP_template::multislotCapReductionforDownLinkDualCarrier() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field multislotCapReductionforDownLinkDualCarrier of a non-specific template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP."); return single_value->field_multislotCapReductionforDownLinkDualCarrier; } BITSTRING_template& DownlinkDualCarrier__BSSGP_template::downlinkDualCarrierforDTMCapability() { set_specific(); return single_value->field_downlinkDualCarrierforDTMCapability; } const BITSTRING_template& DownlinkDualCarrier__BSSGP_template::downlinkDualCarrierforDTMCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field downlinkDualCarrierforDTMCapability of a non-specific template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP."); return single_value->field_downlinkDualCarrierforDTMCapability; } int DownlinkDualCarrier__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP 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 @BSSGP_Types.DownlinkDualCarrier_BSSGP 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 @BSSGP_Types.DownlinkDualCarrier_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.DownlinkDualCarrier_BSSGP."); } return 0; } void DownlinkDualCarrier__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ multislotCapReductionforDownLinkDualCarrier := "); single_value->field_multislotCapReductionforDownLinkDualCarrier.log(); TTCN_Logger::log_event_str(", downlinkDualCarrierforDTMCapability := "); single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier__BSSGP_template::log_match(const DownlinkDualCarrier__BSSGP& 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_multislotCapReductionforDownLinkDualCarrier.match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy)){ TTCN_Logger::log_logmatch_info(".multislotCapReductionforDownLinkDualCarrier"); single_value->field_multislotCapReductionforDownLinkDualCarrier.log_match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_downlinkDualCarrierforDTMCapability.match(match_value.downlinkDualCarrierforDTMCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".downlinkDualCarrierforDTMCapability"); single_value->field_downlinkDualCarrierforDTMCapability.log_match(match_value.downlinkDualCarrierforDTMCapability(), 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("{ multislotCapReductionforDownLinkDualCarrier := "); single_value->field_multislotCapReductionforDownLinkDualCarrier.log_match(match_value.multislotCapReductionforDownLinkDualCarrier(), legacy); TTCN_Logger::log_event_str(", downlinkDualCarrierforDTMCapability := "); single_value->field_downlinkDualCarrierforDTMCapability.log_match(match_value.downlinkDualCarrierforDTMCapability(), 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 DownlinkDualCarrier__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_multislotCapReductionforDownLinkDualCarrier.encode_text(text_buf); single_value->field_downlinkDualCarrierforDTMCapability.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 @BSSGP_Types.DownlinkDualCarrier_BSSGP."); } } void DownlinkDualCarrier__BSSGP_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_multislotCapReductionforDownLinkDualCarrier.decode_text(text_buf); single_value->field_downlinkDualCarrierforDTMCapability.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 DownlinkDualCarrier__BSSGP_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 @BSSGP_Types.DownlinkDualCarrier_BSSGP."); } } void DownlinkDualCarrier__BSSGP_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: { DownlinkDualCarrier__BSSGP_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) multislotCapReductionforDownLinkDualCarrier().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) downlinkDualCarrierforDTMCapability().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(), "multislotCapReductionforDownLinkDualCarrier")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { multislotCapReductionforDownLinkDualCarrier().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "downlinkDualCarrierforDTMCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { downlinkDualCarrierforDTMCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.DownlinkDualCarrier_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { DownlinkDualCarrier__BSSGP_template* precondition = new DownlinkDualCarrier__BSSGP_template; precondition->set_param(*param.get_elem(0)); DownlinkDualCarrier__BSSGP_template* implied_template = new DownlinkDualCarrier__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = DownlinkDualCarrier__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.DownlinkDualCarrier_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void DownlinkDualCarrier__BSSGP_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_multislotCapReductionforDownLinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DownlinkDualCarrier_BSSGP"); single_value->field_downlinkDualCarrierforDTMCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DownlinkDualCarrier_BSSGP"); 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 : "@BSSGP_Types.DownlinkDualCarrier_BSSGP"); } boolean DownlinkDualCarrier__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DownlinkDualCarrier__BSSGP_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_accessCapAdditionsAfterRel7) : field_accessCapAdditionsRel7(par_accessCapAdditionsRel7), field_accessCapAdditionsAfterRel7(par_accessCapAdditionsAfterRel7) { } AccessCapAdditionsAfterRel6__BSSGP::AccessCapAdditionsAfterRel6__BSSGP(const AccessCapAdditionsAfterRel6__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); if (other_value.accessCapAdditionsRel7().is_bound()) field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7(); else field_accessCapAdditionsRel7.clean_up(); if (other_value.accessCapAdditionsAfterRel7().is_bound()) field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7(); else field_accessCapAdditionsAfterRel7.clean_up(); } void AccessCapAdditionsAfterRel6__BSSGP::clean_up() { field_accessCapAdditionsRel7.clean_up(); field_accessCapAdditionsAfterRel7.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel6__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel6__BSSGP_descr_; } AccessCapAdditionsAfterRel6__BSSGP& AccessCapAdditionsAfterRel6__BSSGP::operator=(const AccessCapAdditionsAfterRel6__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); if (other_value.accessCapAdditionsRel7().is_bound()) field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7(); else field_accessCapAdditionsRel7.clean_up(); if (other_value.accessCapAdditionsAfterRel7().is_bound()) field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7(); else field_accessCapAdditionsAfterRel7.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel6__BSSGP::operator==(const AccessCapAdditionsAfterRel6__BSSGP& other_value) const { return field_accessCapAdditionsRel7==other_value.field_accessCapAdditionsRel7 && field_accessCapAdditionsAfterRel7==other_value.field_accessCapAdditionsAfterRel7; } boolean AccessCapAdditionsAfterRel6__BSSGP::is_bound() const { return (field_accessCapAdditionsRel7.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel7.get_selection() || field_accessCapAdditionsAfterRel7.is_bound()); } boolean AccessCapAdditionsAfterRel6__BSSGP::is_value() const { return field_accessCapAdditionsRel7.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel7.get_selection() || field_accessCapAdditionsAfterRel7.is_value()); } int AccessCapAdditionsAfterRel6__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel7.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel6__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel7 := "); field_accessCapAdditionsRel7.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := "); field_accessCapAdditionsAfterRel7.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel6__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel7().is_bound()) accessCapAdditionsRel7().set_implicit_omit(); if (!accessCapAdditionsAfterRel7().is_bound()) accessCapAdditionsAfterRel7() = OMIT_VALUE; else accessCapAdditionsAfterRel7().set_implicit_omit(); } void AccessCapAdditionsAfterRel6__BSSGP::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) accessCapAdditionsRel7().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel7().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(), "accessCapAdditionsRel7")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel7().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel7")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel7().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP"); } } void AccessCapAdditionsAfterRel6__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel7.encode_text(text_buf); field_accessCapAdditionsAfterRel7.encode_text(text_buf); } void AccessCapAdditionsAfterRel6__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel7.decode_text(text_buf); field_accessCapAdditionsAfterRel7.decode_text(text_buf); } void AccessCapAdditionsAfterRel6__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel6__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel6__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel6__BSSGP_accessCapAdditionsRel7_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel7.RAW_decode(AccessCapAdditionsAfterRel6__BSSGP_accessCapAdditionsRel7_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel7 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel6__BSSGP_accessCapAdditionsAfterRel7_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel7().RAW_decode(AccessCapAdditionsAfterRel6__BSSGP_accessCapAdditionsAfterRel7_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel7 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel7=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel6__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsAfterRel6__BSSGP_accessCapAdditionsRel7_descr_.raw); if (field_accessCapAdditionsAfterRel7.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel6__BSSGP_accessCapAdditionsAfterRel7_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel7.RAW_encode(AccessCapAdditionsAfterRel6__BSSGP_accessCapAdditionsRel7_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel7.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel7().RAW_encode(AccessCapAdditionsAfterRel6__BSSGP_accessCapAdditionsAfterRel7_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel6__BSSGP_template::single_value_struct { AccessCapAdditionsRel7__BSSGP_template field_accessCapAdditionsRel7; AccessCapAdditionsAfterRel7__BSSGP_template field_accessCapAdditionsAfterRel7; }; void AccessCapAdditionsAfterRel6__BSSGP_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_accessCapAdditionsRel7 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel7 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel6__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel6__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel7().is_bound()) { single_value->field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7(); } else { single_value->field_accessCapAdditionsRel7.clean_up(); } if (other_value.accessCapAdditionsAfterRel7().is_bound()) { if (other_value.accessCapAdditionsAfterRel7().ispresent()) single_value->field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7()(); else single_value->field_accessCapAdditionsAfterRel7 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel7.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel6__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel6__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel7().get_selection()) { single_value->field_accessCapAdditionsRel7 = other_value.accessCapAdditionsRel7(); } else { single_value->field_accessCapAdditionsRel7.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel7().get_selection()) { single_value->field_accessCapAdditionsAfterRel7 = other_value.accessCapAdditionsAfterRel7(); } else { single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6__BSSGP_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 AccessCapAdditionsAfterRel6__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel6__BSSGP_template::AccessCapAdditionsAfterRel6__BSSGP_template() { } AccessCapAdditionsAfterRel6__BSSGP_template::AccessCapAdditionsAfterRel6__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel6__BSSGP_template::AccessCapAdditionsAfterRel6__BSSGP_template(const AccessCapAdditionsAfterRel6__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel6__BSSGP_template::AccessCapAdditionsAfterRel6__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel6__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel6__BSSGP_template::AccessCapAdditionsAfterRel6__BSSGP_template(AccessCapAdditionsAfterRel6__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel6__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel6__BSSGP_template::AccessCapAdditionsAfterRel6__BSSGP_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; } AccessCapAdditionsAfterRel6__BSSGP_template::AccessCapAdditionsAfterRel6__BSSGP_template(const AccessCapAdditionsAfterRel6__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel6__BSSGP_template::~AccessCapAdditionsAfterRel6__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel6__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel6__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_template::operator=(const AccessCapAdditionsAfterRel6__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel6__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel6__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); } return *this; } AccessCapAdditionsAfterRel6__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_template::operator=(const AccessCapAdditionsAfterRel6__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel6__BSSGP_template::match(const AccessCapAdditionsAfterRel6__BSSGP& 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.accessCapAdditionsRel7().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel7.match(other_value.accessCapAdditionsRel7(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel7().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel7().ispresent() ? !single_value->field_accessCapAdditionsAfterRel7.match((const AccessCapAdditionsAfterRel7__BSSGP&)other_value.accessCapAdditionsAfterRel7(), legacy) : !single_value->field_accessCapAdditionsAfterRel7.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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel6__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel7.is_bound() || (single_value->field_accessCapAdditionsAfterRel7.is_omit() || single_value->field_accessCapAdditionsAfterRel7.is_bound()); } boolean AccessCapAdditionsAfterRel6__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel7.is_value() && (single_value->field_accessCapAdditionsAfterRel7.is_omit() || single_value->field_accessCapAdditionsAfterRel7.is_value()); } void AccessCapAdditionsAfterRel6__BSSGP_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; } AccessCapAdditionsAfterRel6__BSSGP AccessCapAdditionsAfterRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); AccessCapAdditionsAfterRel6__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel7.is_bound()) { ret_val.accessCapAdditionsRel7() = single_value->field_accessCapAdditionsRel7.valueof(); } if (single_value->field_accessCapAdditionsAfterRel7.is_omit()) ret_val.accessCapAdditionsAfterRel7() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel7.is_bound()) { ret_val.accessCapAdditionsAfterRel7() = single_value->field_accessCapAdditionsAfterRel7.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel6__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel6__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel7__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_template::accessCapAdditionsRel7() { set_specific(); return single_value->field_accessCapAdditionsRel7; } const AccessCapAdditionsRel7__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_template::accessCapAdditionsRel7() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel7 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); return single_value->field_accessCapAdditionsRel7; } AccessCapAdditionsAfterRel7__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_template::accessCapAdditionsAfterRel7() { set_specific(); return single_value->field_accessCapAdditionsAfterRel7; } const AccessCapAdditionsAfterRel7__BSSGP_template& AccessCapAdditionsAfterRel6__BSSGP_template::accessCapAdditionsAfterRel7() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel7 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); return single_value->field_accessCapAdditionsAfterRel7; } int AccessCapAdditionsAfterRel6__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel7.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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel6__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel7 := "); single_value->field_accessCapAdditionsRel7.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := "); single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6__BSSGP_template::log_match(const AccessCapAdditionsAfterRel6__BSSGP& 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_accessCapAdditionsRel7.match(match_value.accessCapAdditionsRel7(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel7"); single_value->field_accessCapAdditionsRel7.log_match(match_value.accessCapAdditionsRel7(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel7().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel7.match(match_value.accessCapAdditionsAfterRel7(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel7"); single_value->field_accessCapAdditionsAfterRel7.log_match(match_value.accessCapAdditionsAfterRel7(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel7.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel7 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel7.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("{ accessCapAdditionsRel7 := "); single_value->field_accessCapAdditionsRel7.log_match(match_value.accessCapAdditionsRel7(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel7 := "); if (match_value.accessCapAdditionsAfterRel7().ispresent()) { single_value->field_accessCapAdditionsAfterRel7.log_match(match_value.accessCapAdditionsAfterRel7(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel7.log(); if (single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel7.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel7.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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); } } void AccessCapAdditionsAfterRel6__BSSGP_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_accessCapAdditionsRel7.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel7.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 AccessCapAdditionsAfterRel6__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP."); } } void AccessCapAdditionsAfterRel6__BSSGP_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: { AccessCapAdditionsAfterRel6__BSSGP_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) accessCapAdditionsRel7().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel7().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(), "accessCapAdditionsRel7")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel7().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel7")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel7().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel6__BSSGP_template* precondition = new AccessCapAdditionsAfterRel6__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel6__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel6__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel6__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel6__BSSGP_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_accessCapAdditionsRel7.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP"); single_value->field_accessCapAdditionsAfterRel7.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel6_BSSGP"); } boolean AccessCapAdditionsAfterRel6__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel6__BSSGP_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) eUTRAFDDsupport().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRATDDsupport().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gERANToEUTRASupportInGERANPacketTransferMode().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) priorityBasedReselectionSupport().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(), "eUTRAFDDsupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRAFDDsupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eUTRATDDsupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRATDDsupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gERANToEUTRASupportInGERANPacketTransferMode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gERANToEUTRASupportInGERANPacketTransferMode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "priorityBasedReselectionSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { priorityBasedReselectionSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel8_BSSGP"); } } void AccessCapAdditionsRel8__BSSGP::encode_text(Text_Buf& text_buf) const { field_eUTRAFDDsupport.encode_text(text_buf); field_eUTRATDDsupport.encode_text(text_buf); field_gERANToEUTRASupportInGERANPacketTransferMode.encode_text(text_buf); field_priorityBasedReselectionSupport.encode_text(text_buf); } void AccessCapAdditionsRel8__BSSGP::decode_text(Text_Buf& text_buf) { field_eUTRAFDDsupport.decode_text(text_buf); field_eUTRATDDsupport.decode_text(text_buf); field_gERANToEUTRASupportInGERANPacketTransferMode.decode_text(text_buf); field_priorityBasedReselectionSupport.decode_text(text_buf); } void AccessCapAdditionsRel8__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel8__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel8__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel8__BSSGP_eUTRAFDDsupport_descr_.raw->forceomit); decoded_field_length = field_eUTRAFDDsupport.RAW_decode(AccessCapAdditionsRel8__BSSGP_eUTRAFDDsupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel8__BSSGP_eUTRATDDsupport_descr_.raw->forceomit); decoded_field_length = field_eUTRATDDsupport.RAW_decode(AccessCapAdditionsRel8__BSSGP_eUTRATDDsupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel8__BSSGP_gERANToEUTRASupportInGERANPacketTransferMode_descr_.raw->forceomit); decoded_field_length = field_gERANToEUTRASupportInGERANPacketTransferMode.RAW_decode(AccessCapAdditionsRel8__BSSGP_gERANToEUTRASupportInGERANPacketTransferMode_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel8__BSSGP_priorityBasedReselectionSupport_descr_.raw->forceomit); decoded_field_length = field_priorityBasedReselectionSupport.RAW_decode(AccessCapAdditionsRel8__BSSGP_priorityBasedReselectionSupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel8__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel8__BSSGP_eUTRAFDDsupport_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel8__BSSGP_eUTRATDDsupport_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel8__BSSGP_gERANToEUTRASupportInGERANPacketTransferMode_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel8__BSSGP_priorityBasedReselectionSupport_descr_.raw); encoded_length += field_eUTRAFDDsupport.RAW_encode(AccessCapAdditionsRel8__BSSGP_eUTRAFDDsupport_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_eUTRATDDsupport.RAW_encode(AccessCapAdditionsRel8__BSSGP_eUTRATDDsupport_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_gERANToEUTRASupportInGERANPacketTransferMode.RAW_encode(AccessCapAdditionsRel8__BSSGP_gERANToEUTRASupportInGERANPacketTransferMode_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_priorityBasedReselectionSupport.RAW_encode(AccessCapAdditionsRel8__BSSGP_priorityBasedReselectionSupport_descr_, *myleaf.body.node.nodes[3]); return myleaf.length = encoded_length; } struct AccessCapAdditionsRel8__BSSGP_template::single_value_struct { BITSTRING_template field_eUTRAFDDsupport; BITSTRING_template field_eUTRATDDsupport; BITSTRING_template field_gERANToEUTRASupportInGERANPacketTransferMode; BITSTRING_template field_priorityBasedReselectionSupport; }; void AccessCapAdditionsRel8__BSSGP_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_eUTRAFDDsupport = ANY_VALUE; single_value->field_eUTRATDDsupport = ANY_VALUE; single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = ANY_VALUE; single_value->field_priorityBasedReselectionSupport = ANY_VALUE; } } } void AccessCapAdditionsRel8__BSSGP_template::copy_value(const AccessCapAdditionsRel8__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.eUTRAFDDsupport().is_bound()) { single_value->field_eUTRAFDDsupport = other_value.eUTRAFDDsupport(); } else { single_value->field_eUTRAFDDsupport.clean_up(); } if (other_value.eUTRATDDsupport().is_bound()) { single_value->field_eUTRATDDsupport = other_value.eUTRATDDsupport(); } else { single_value->field_eUTRATDDsupport.clean_up(); } if (other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) { single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode(); } else { single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up(); } if (other_value.priorityBasedReselectionSupport().is_bound()) { single_value->field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport(); } else { single_value->field_priorityBasedReselectionSupport.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel8__BSSGP_template::copy_template(const AccessCapAdditionsRel8__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.eUTRAFDDsupport().get_selection()) { single_value->field_eUTRAFDDsupport = other_value.eUTRAFDDsupport(); } else { single_value->field_eUTRAFDDsupport.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eUTRATDDsupport().get_selection()) { single_value->field_eUTRATDDsupport = other_value.eUTRATDDsupport(); } else { single_value->field_eUTRATDDsupport.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gERANToEUTRASupportInGERANPacketTransferMode().get_selection()) { single_value->field_gERANToEUTRASupportInGERANPacketTransferMode = other_value.gERANToEUTRASupportInGERANPacketTransferMode(); } else { single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.priorityBasedReselectionSupport().get_selection()) { single_value->field_priorityBasedReselectionSupport = other_value.priorityBasedReselectionSupport(); } else { single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8__BSSGP_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 AccessCapAdditionsRel8__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel8__BSSGP_template::AccessCapAdditionsRel8__BSSGP_template() { } AccessCapAdditionsRel8__BSSGP_template::AccessCapAdditionsRel8__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel8__BSSGP_template::AccessCapAdditionsRel8__BSSGP_template(const AccessCapAdditionsRel8__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel8__BSSGP_template::AccessCapAdditionsRel8__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel8__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel8__BSSGP_template::AccessCapAdditionsRel8__BSSGP_template(AccessCapAdditionsRel8__BSSGP_template* p_precondition, AccessCapAdditionsRel8__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel8__BSSGP_template::AccessCapAdditionsRel8__BSSGP_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; } AccessCapAdditionsRel8__BSSGP_template::AccessCapAdditionsRel8__BSSGP_template(const AccessCapAdditionsRel8__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel8__BSSGP_template::~AccessCapAdditionsRel8__BSSGP_template() { clean_up(); } AccessCapAdditionsRel8__BSSGP_template& AccessCapAdditionsRel8__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel8__BSSGP_template& AccessCapAdditionsRel8__BSSGP_template::operator=(const AccessCapAdditionsRel8__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel8__BSSGP_template& AccessCapAdditionsRel8__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel8__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); } return *this; } AccessCapAdditionsRel8__BSSGP_template& AccessCapAdditionsRel8__BSSGP_template::operator=(const AccessCapAdditionsRel8__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel8__BSSGP_template::match(const AccessCapAdditionsRel8__BSSGP& 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.eUTRAFDDsupport().is_bound()) return FALSE; if(!single_value->field_eUTRAFDDsupport.match(other_value.eUTRAFDDsupport(), legacy))return FALSE; if(!other_value.eUTRATDDsupport().is_bound()) return FALSE; if(!single_value->field_eUTRATDDsupport.match(other_value.eUTRATDDsupport(), legacy))return FALSE; if(!other_value.gERANToEUTRASupportInGERANPacketTransferMode().is_bound()) return FALSE; if(!single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.match(other_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy))return FALSE; if(!other_value.priorityBasedReselectionSupport().is_bound()) return FALSE; if(!single_value->field_priorityBasedReselectionSupport.match(other_value.priorityBasedReselectionSupport(), 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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel8__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_eUTRAFDDsupport.is_bound() || single_value->field_eUTRATDDsupport.is_bound() || single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_bound() || single_value->field_priorityBasedReselectionSupport.is_bound(); } boolean AccessCapAdditionsRel8__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_eUTRAFDDsupport.is_value() && single_value->field_eUTRATDDsupport.is_value() && single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_value() && single_value->field_priorityBasedReselectionSupport.is_value(); } void AccessCapAdditionsRel8__BSSGP_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; } AccessCapAdditionsRel8__BSSGP AccessCapAdditionsRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); AccessCapAdditionsRel8__BSSGP ret_val; if (single_value->field_eUTRAFDDsupport.is_bound()) { ret_val.eUTRAFDDsupport() = single_value->field_eUTRAFDDsupport.valueof(); } if (single_value->field_eUTRATDDsupport.is_bound()) { ret_val.eUTRATDDsupport() = single_value->field_eUTRATDDsupport.valueof(); } if (single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.is_bound()) { ret_val.gERANToEUTRASupportInGERANPacketTransferMode() = single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.valueof(); } if (single_value->field_priorityBasedReselectionSupport.is_bound()) { ret_val.priorityBasedReselectionSupport() = single_value->field_priorityBasedReselectionSupport.valueof(); } return ret_val; } void AccessCapAdditionsRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel8__BSSGP_template[list_length]; } AccessCapAdditionsRel8__BSSGP_template& AccessCapAdditionsRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel8__BSSGP_template::eUTRAFDDsupport() { set_specific(); return single_value->field_eUTRAFDDsupport; } const BITSTRING_template& AccessCapAdditionsRel8__BSSGP_template::eUTRAFDDsupport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eUTRAFDDsupport of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); return single_value->field_eUTRAFDDsupport; } BITSTRING_template& AccessCapAdditionsRel8__BSSGP_template::eUTRATDDsupport() { set_specific(); return single_value->field_eUTRATDDsupport; } const BITSTRING_template& AccessCapAdditionsRel8__BSSGP_template::eUTRATDDsupport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eUTRATDDsupport of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); return single_value->field_eUTRATDDsupport; } BITSTRING_template& AccessCapAdditionsRel8__BSSGP_template::gERANToEUTRASupportInGERANPacketTransferMode() { set_specific(); return single_value->field_gERANToEUTRASupportInGERANPacketTransferMode; } const BITSTRING_template& AccessCapAdditionsRel8__BSSGP_template::gERANToEUTRASupportInGERANPacketTransferMode() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gERANToEUTRASupportInGERANPacketTransferMode of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); return single_value->field_gERANToEUTRASupportInGERANPacketTransferMode; } BITSTRING_template& AccessCapAdditionsRel8__BSSGP_template::priorityBasedReselectionSupport() { set_specific(); return single_value->field_priorityBasedReselectionSupport; } const BITSTRING_template& AccessCapAdditionsRel8__BSSGP_template::priorityBasedReselectionSupport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field priorityBasedReselectionSupport of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); return single_value->field_priorityBasedReselectionSupport; } int AccessCapAdditionsRel8__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); } return 0; } void AccessCapAdditionsRel8__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ eUTRAFDDsupport := "); single_value->field_eUTRAFDDsupport.log(); TTCN_Logger::log_event_str(", eUTRATDDsupport := "); single_value->field_eUTRATDDsupport.log(); TTCN_Logger::log_event_str(", gERANToEUTRASupportInGERANPacketTransferMode := "); single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log(); TTCN_Logger::log_event_str(", priorityBasedReselectionSupport := "); single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8__BSSGP_template::log_match(const AccessCapAdditionsRel8__BSSGP& 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_eUTRAFDDsupport.match(match_value.eUTRAFDDsupport(), legacy)){ TTCN_Logger::log_logmatch_info(".eUTRAFDDsupport"); single_value->field_eUTRAFDDsupport.log_match(match_value.eUTRAFDDsupport(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eUTRATDDsupport.match(match_value.eUTRATDDsupport(), legacy)){ TTCN_Logger::log_logmatch_info(".eUTRATDDsupport"); single_value->field_eUTRATDDsupport.log_match(match_value.eUTRATDDsupport(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy)){ TTCN_Logger::log_logmatch_info(".gERANToEUTRASupportInGERANPacketTransferMode"); single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log_match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_priorityBasedReselectionSupport.match(match_value.priorityBasedReselectionSupport(), legacy)){ TTCN_Logger::log_logmatch_info(".priorityBasedReselectionSupport"); single_value->field_priorityBasedReselectionSupport.log_match(match_value.priorityBasedReselectionSupport(), 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("{ eUTRAFDDsupport := "); single_value->field_eUTRAFDDsupport.log_match(match_value.eUTRAFDDsupport(), legacy); TTCN_Logger::log_event_str(", eUTRATDDsupport := "); single_value->field_eUTRATDDsupport.log_match(match_value.eUTRATDDsupport(), legacy); TTCN_Logger::log_event_str(", gERANToEUTRASupportInGERANPacketTransferMode := "); single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.log_match(match_value.gERANToEUTRASupportInGERANPacketTransferMode(), legacy); TTCN_Logger::log_event_str(", priorityBasedReselectionSupport := "); single_value->field_priorityBasedReselectionSupport.log_match(match_value.priorityBasedReselectionSupport(), 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 AccessCapAdditionsRel8__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_eUTRAFDDsupport.encode_text(text_buf); single_value->field_eUTRATDDsupport.encode_text(text_buf); single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.encode_text(text_buf); single_value->field_priorityBasedReselectionSupport.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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); } } void AccessCapAdditionsRel8__BSSGP_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_eUTRAFDDsupport.decode_text(text_buf); single_value->field_eUTRATDDsupport.decode_text(text_buf); single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.decode_text(text_buf); single_value->field_priorityBasedReselectionSupport.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 AccessCapAdditionsRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel8_BSSGP."); } } void AccessCapAdditionsRel8__BSSGP_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: { AccessCapAdditionsRel8__BSSGP_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) eUTRAFDDsupport().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRATDDsupport().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gERANToEUTRASupportInGERANPacketTransferMode().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) priorityBasedReselectionSupport().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(), "eUTRAFDDsupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRAFDDsupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eUTRATDDsupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRATDDsupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gERANToEUTRASupportInGERANPacketTransferMode")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gERANToEUTRASupportInGERANPacketTransferMode().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "priorityBasedReselectionSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { priorityBasedReselectionSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel8_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel8__BSSGP_template* precondition = new AccessCapAdditionsRel8__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel8__BSSGP_template* implied_template = new AccessCapAdditionsRel8__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel8__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel8_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel8__BSSGP_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_eUTRAFDDsupport.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel8_BSSGP"); single_value->field_eUTRATDDsupport.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel8_BSSGP"); single_value->field_gERANToEUTRASupportInGERANPacketTransferMode.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel8_BSSGP"); single_value->field_priorityBasedReselectionSupport.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel8_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel8_BSSGP"); } boolean AccessCapAdditionsRel8__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel8__BSSGP_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_accessCapAdditionsAfterRel8) : field_accessCapAdditionsRel8(par_accessCapAdditionsRel8), field_accessCapAdditionsAfterRel8(par_accessCapAdditionsAfterRel8) { } AccessCapAdditionsAfterRel7__BSSGP::AccessCapAdditionsAfterRel7__BSSGP(const AccessCapAdditionsAfterRel7__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); if (other_value.accessCapAdditionsRel8().is_bound()) field_accessCapAdditionsRel8 = other_value.accessCapAdditionsRel8(); else field_accessCapAdditionsRel8.clean_up(); if (other_value.accessCapAdditionsAfterRel8().is_bound()) field_accessCapAdditionsAfterRel8 = other_value.accessCapAdditionsAfterRel8(); else field_accessCapAdditionsAfterRel8.clean_up(); } void AccessCapAdditionsAfterRel7__BSSGP::clean_up() { field_accessCapAdditionsRel8.clean_up(); field_accessCapAdditionsAfterRel8.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel7__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel7__BSSGP_descr_; } AccessCapAdditionsAfterRel7__BSSGP& AccessCapAdditionsAfterRel7__BSSGP::operator=(const AccessCapAdditionsAfterRel7__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); if (other_value.accessCapAdditionsRel8().is_bound()) field_accessCapAdditionsRel8 = other_value.accessCapAdditionsRel8(); else field_accessCapAdditionsRel8.clean_up(); if (other_value.accessCapAdditionsAfterRel8().is_bound()) field_accessCapAdditionsAfterRel8 = other_value.accessCapAdditionsAfterRel8(); else field_accessCapAdditionsAfterRel8.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel7__BSSGP::operator==(const AccessCapAdditionsAfterRel7__BSSGP& other_value) const { return field_accessCapAdditionsRel8==other_value.field_accessCapAdditionsRel8 && field_accessCapAdditionsAfterRel8==other_value.field_accessCapAdditionsAfterRel8; } boolean AccessCapAdditionsAfterRel7__BSSGP::is_bound() const { return (field_accessCapAdditionsRel8.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel8.get_selection() || field_accessCapAdditionsAfterRel8.is_bound()); } boolean AccessCapAdditionsAfterRel7__BSSGP::is_value() const { return field_accessCapAdditionsRel8.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel8.get_selection() || field_accessCapAdditionsAfterRel8.is_value()); } int AccessCapAdditionsAfterRel7__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel8.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel7__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel8 := "); field_accessCapAdditionsRel8.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel8 := "); field_accessCapAdditionsAfterRel8.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel7__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel8().is_bound()) accessCapAdditionsRel8().set_implicit_omit(); if (!accessCapAdditionsAfterRel8().is_bound()) accessCapAdditionsAfterRel8() = OMIT_VALUE; else accessCapAdditionsAfterRel8().set_implicit_omit(); } void AccessCapAdditionsAfterRel7__BSSGP::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) accessCapAdditionsRel8().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel8().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(), "accessCapAdditionsRel8")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel8().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel8")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel8().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP"); } } void AccessCapAdditionsAfterRel7__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel8.encode_text(text_buf); field_accessCapAdditionsAfterRel8.encode_text(text_buf); } void AccessCapAdditionsAfterRel7__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel8.decode_text(text_buf); field_accessCapAdditionsAfterRel8.decode_text(text_buf); } void AccessCapAdditionsAfterRel7__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel7__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel7__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel8__BSSGP_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel8.RAW_decode(AccessCapAdditionsRel8__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel8 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel8__BSSGP_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel8().RAW_decode(AccessCapAdditionsAfterRel8__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel8 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel8=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel7__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel8__BSSGP_descr_.raw); if (field_accessCapAdditionsAfterRel8.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel8__BSSGP_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel8.RAW_encode(AccessCapAdditionsRel8__BSSGP_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel8.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel8().RAW_encode(AccessCapAdditionsAfterRel8__BSSGP_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel7__BSSGP_template::single_value_struct { AccessCapAdditionsRel8__BSSGP_template field_accessCapAdditionsRel8; AccessCapAdditionsAfterRel8__BSSGP_template field_accessCapAdditionsAfterRel8; }; void AccessCapAdditionsAfterRel7__BSSGP_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_accessCapAdditionsRel8 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel8 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel7__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel7__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel8().is_bound()) { single_value->field_accessCapAdditionsRel8 = other_value.accessCapAdditionsRel8(); } else { single_value->field_accessCapAdditionsRel8.clean_up(); } if (other_value.accessCapAdditionsAfterRel8().is_bound()) { if (other_value.accessCapAdditionsAfterRel8().ispresent()) single_value->field_accessCapAdditionsAfterRel8 = other_value.accessCapAdditionsAfterRel8()(); else single_value->field_accessCapAdditionsAfterRel8 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel8.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel7__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel7__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel8().get_selection()) { single_value->field_accessCapAdditionsRel8 = other_value.accessCapAdditionsRel8(); } else { single_value->field_accessCapAdditionsRel8.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel8().get_selection()) { single_value->field_accessCapAdditionsAfterRel8 = other_value.accessCapAdditionsAfterRel8(); } else { single_value->field_accessCapAdditionsAfterRel8.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 AccessCapAdditionsAfterRel7__BSSGP_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 AccessCapAdditionsAfterRel7__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel7__BSSGP_template::AccessCapAdditionsAfterRel7__BSSGP_template() { } AccessCapAdditionsAfterRel7__BSSGP_template::AccessCapAdditionsAfterRel7__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel7__BSSGP_template::AccessCapAdditionsAfterRel7__BSSGP_template(const AccessCapAdditionsAfterRel7__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel7__BSSGP_template::AccessCapAdditionsAfterRel7__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel7__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel7__BSSGP_template::AccessCapAdditionsAfterRel7__BSSGP_template(AccessCapAdditionsAfterRel7__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel7__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel7__BSSGP_template::AccessCapAdditionsAfterRel7__BSSGP_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; } AccessCapAdditionsAfterRel7__BSSGP_template::AccessCapAdditionsAfterRel7__BSSGP_template(const AccessCapAdditionsAfterRel7__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel7__BSSGP_template::~AccessCapAdditionsAfterRel7__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel7__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel7__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_template::operator=(const AccessCapAdditionsAfterRel7__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel7__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel7__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); } return *this; } AccessCapAdditionsAfterRel7__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_template::operator=(const AccessCapAdditionsAfterRel7__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel7__BSSGP_template::match(const AccessCapAdditionsAfterRel7__BSSGP& 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.accessCapAdditionsRel8().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel8.match(other_value.accessCapAdditionsRel8(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel8().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel8().ispresent() ? !single_value->field_accessCapAdditionsAfterRel8.match((const AccessCapAdditionsAfterRel8__BSSGP&)other_value.accessCapAdditionsAfterRel8(), legacy) : !single_value->field_accessCapAdditionsAfterRel8.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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel7__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel8.is_bound() || (single_value->field_accessCapAdditionsAfterRel8.is_omit() || single_value->field_accessCapAdditionsAfterRel8.is_bound()); } boolean AccessCapAdditionsAfterRel7__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel8.is_value() && (single_value->field_accessCapAdditionsAfterRel8.is_omit() || single_value->field_accessCapAdditionsAfterRel8.is_value()); } void AccessCapAdditionsAfterRel7__BSSGP_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; } AccessCapAdditionsAfterRel7__BSSGP AccessCapAdditionsAfterRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); AccessCapAdditionsAfterRel7__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel8.is_bound()) { ret_val.accessCapAdditionsRel8() = single_value->field_accessCapAdditionsRel8.valueof(); } if (single_value->field_accessCapAdditionsAfterRel8.is_omit()) ret_val.accessCapAdditionsAfterRel8() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel8.is_bound()) { ret_val.accessCapAdditionsAfterRel8() = single_value->field_accessCapAdditionsAfterRel8.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel7__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel7__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel8__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_template::accessCapAdditionsRel8() { set_specific(); return single_value->field_accessCapAdditionsRel8; } const AccessCapAdditionsRel8__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_template::accessCapAdditionsRel8() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel8 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); return single_value->field_accessCapAdditionsRel8; } AccessCapAdditionsAfterRel8__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_template::accessCapAdditionsAfterRel8() { set_specific(); return single_value->field_accessCapAdditionsAfterRel8; } const AccessCapAdditionsAfterRel8__BSSGP_template& AccessCapAdditionsAfterRel7__BSSGP_template::accessCapAdditionsAfterRel8() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel8 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); return single_value->field_accessCapAdditionsAfterRel8; } int AccessCapAdditionsAfterRel7__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel8.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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel7__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel8 := "); single_value->field_accessCapAdditionsRel8.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel8 := "); single_value->field_accessCapAdditionsAfterRel8.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 AccessCapAdditionsAfterRel7__BSSGP_template::log_match(const AccessCapAdditionsAfterRel7__BSSGP& 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_accessCapAdditionsRel8.match(match_value.accessCapAdditionsRel8(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel8"); single_value->field_accessCapAdditionsRel8.log_match(match_value.accessCapAdditionsRel8(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel8().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel8.match(match_value.accessCapAdditionsAfterRel8(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel8"); single_value->field_accessCapAdditionsAfterRel8.log_match(match_value.accessCapAdditionsAfterRel8(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel8.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel8 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel8.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("{ accessCapAdditionsRel8 := "); single_value->field_accessCapAdditionsRel8.log_match(match_value.accessCapAdditionsRel8(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel8 := "); if (match_value.accessCapAdditionsAfterRel8().ispresent()) { single_value->field_accessCapAdditionsAfterRel8.log_match(match_value.accessCapAdditionsAfterRel8(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel8.log(); if (single_value->field_accessCapAdditionsAfterRel8.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 AccessCapAdditionsAfterRel7__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel8.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel8.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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); } } void AccessCapAdditionsAfterRel7__BSSGP_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_accessCapAdditionsRel8.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel8.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 AccessCapAdditionsAfterRel7__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP."); } } void AccessCapAdditionsAfterRel7__BSSGP_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: { AccessCapAdditionsAfterRel7__BSSGP_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) accessCapAdditionsRel8().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel8().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(), "accessCapAdditionsRel8")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel8().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel8")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel8().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel7__BSSGP_template* precondition = new AccessCapAdditionsAfterRel7__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel7__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel7__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel7__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel7__BSSGP_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_accessCapAdditionsRel8.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP"); single_value->field_accessCapAdditionsAfterRel8.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel7_BSSGP"); } boolean AccessCapAdditionsAfterRel7__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel7__BSSGP_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) presenceBitalternativeEFTAMultislotClass().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) alternativeEFTAMultislotClass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eFTAMultislotCapabilityReductionforDownlinkDualCarrier().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(), "presenceBitalternativeEFTAMultislotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitalternativeEFTAMultislotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "alternativeEFTAMultislotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { alternativeEFTAMultislotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eFTAMultislotCapabilityReductionforDownlinkDualCarrier")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eFTAMultislotCapabilityReductionforDownlinkDualCarrier().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP"); } } void EnhancedFlexTimeslotAssignment__BSSGP::encode_text(Text_Buf& text_buf) const { field_presenceBitalternativeEFTAMultislotClass.encode_text(text_buf); field_alternativeEFTAMultislotClass.encode_text(text_buf); field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.encode_text(text_buf); } void EnhancedFlexTimeslotAssignment__BSSGP::decode_text(Text_Buf& text_buf) { field_presenceBitalternativeEFTAMultislotClass.decode_text(text_buf); field_alternativeEFTAMultislotClass.decode_text(text_buf); field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.decode_text(text_buf); } void EnhancedFlexTimeslotAssignment__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void EnhancedFlexTimeslotAssignment__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int EnhancedFlexTimeslotAssignment__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, EnhancedFlexTimeslotAssignment__BSSGP_presenceBitalternativeEFTAMultislotClass_descr_.raw->forceomit); decoded_field_length = field_presenceBitalternativeEFTAMultislotClass.RAW_decode(EnhancedFlexTimeslotAssignment__BSSGP_presenceBitalternativeEFTAMultislotClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, EnhancedFlexTimeslotAssignment__BSSGP_alternativeEFTAMultislotClass_descr_.raw->forceomit); decoded_field_length = field_alternativeEFTAMultislotClass.RAW_decode(EnhancedFlexTimeslotAssignment__BSSGP_alternativeEFTAMultislotClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, EnhancedFlexTimeslotAssignment__BSSGP_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_.raw->forceomit); decoded_field_length = field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.RAW_decode(EnhancedFlexTimeslotAssignment__BSSGP_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int EnhancedFlexTimeslotAssignment__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 3; myleaf.body.node.nodes = init_nodes_of_enc_tree(3); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, EnhancedFlexTimeslotAssignment__BSSGP_presenceBitalternativeEFTAMultislotClass_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, EnhancedFlexTimeslotAssignment__BSSGP_alternativeEFTAMultislotClass_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, EnhancedFlexTimeslotAssignment__BSSGP_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_.raw); encoded_length += field_presenceBitalternativeEFTAMultislotClass.RAW_encode(EnhancedFlexTimeslotAssignment__BSSGP_presenceBitalternativeEFTAMultislotClass_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_alternativeEFTAMultislotClass.RAW_encode(EnhancedFlexTimeslotAssignment__BSSGP_alternativeEFTAMultislotClass_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.RAW_encode(EnhancedFlexTimeslotAssignment__BSSGP_eFTAMultislotCapabilityReductionforDownlinkDualCarrier_descr_, *myleaf.body.node.nodes[2]); return myleaf.length = encoded_length; } struct EnhancedFlexTimeslotAssignment__BSSGP_template::single_value_struct { BITSTRING_template field_presenceBitalternativeEFTAMultislotClass; BITSTRING_template field_alternativeEFTAMultislotClass; BITSTRING_template field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier; }; void EnhancedFlexTimeslotAssignment__BSSGP_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_presenceBitalternativeEFTAMultislotClass = ANY_VALUE; single_value->field_alternativeEFTAMultislotClass = ANY_VALUE; single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = ANY_VALUE; } } } void EnhancedFlexTimeslotAssignment__BSSGP_template::copy_value(const EnhancedFlexTimeslotAssignment__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.presenceBitalternativeEFTAMultislotClass().is_bound()) { single_value->field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass(); } else { single_value->field_presenceBitalternativeEFTAMultislotClass.clean_up(); } if (other_value.alternativeEFTAMultislotClass().is_bound()) { single_value->field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass(); } else { single_value->field_alternativeEFTAMultislotClass.clean_up(); } if (other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) { single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(); } else { single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.clean_up(); } set_selection(SPECIFIC_VALUE); } void EnhancedFlexTimeslotAssignment__BSSGP_template::copy_template(const EnhancedFlexTimeslotAssignment__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.presenceBitalternativeEFTAMultislotClass().get_selection()) { single_value->field_presenceBitalternativeEFTAMultislotClass = other_value.presenceBitalternativeEFTAMultislotClass(); } else { single_value->field_presenceBitalternativeEFTAMultislotClass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.alternativeEFTAMultislotClass().get_selection()) { single_value->field_alternativeEFTAMultislotClass = other_value.alternativeEFTAMultislotClass(); } else { single_value->field_alternativeEFTAMultislotClass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().get_selection()) { single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier = other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(); } else { single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment__BSSGP_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 EnhancedFlexTimeslotAssignment__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new EnhancedFlexTimeslotAssignment__BSSGP_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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); break; } set_selection(other_value); } EnhancedFlexTimeslotAssignment__BSSGP_template::EnhancedFlexTimeslotAssignment__BSSGP_template() { } EnhancedFlexTimeslotAssignment__BSSGP_template::EnhancedFlexTimeslotAssignment__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } EnhancedFlexTimeslotAssignment__BSSGP_template::EnhancedFlexTimeslotAssignment__BSSGP_template(const EnhancedFlexTimeslotAssignment__BSSGP& other_value) { copy_value(other_value); } EnhancedFlexTimeslotAssignment__BSSGP_template::EnhancedFlexTimeslotAssignment__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const EnhancedFlexTimeslotAssignment__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP from an unbound optional field."); } } EnhancedFlexTimeslotAssignment__BSSGP_template::EnhancedFlexTimeslotAssignment__BSSGP_template(EnhancedFlexTimeslotAssignment__BSSGP_template* p_precondition, EnhancedFlexTimeslotAssignment__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } EnhancedFlexTimeslotAssignment__BSSGP_template::EnhancedFlexTimeslotAssignment__BSSGP_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; } EnhancedFlexTimeslotAssignment__BSSGP_template::EnhancedFlexTimeslotAssignment__BSSGP_template(const EnhancedFlexTimeslotAssignment__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } EnhancedFlexTimeslotAssignment__BSSGP_template::~EnhancedFlexTimeslotAssignment__BSSGP_template() { clean_up(); } EnhancedFlexTimeslotAssignment__BSSGP_template& EnhancedFlexTimeslotAssignment__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } EnhancedFlexTimeslotAssignment__BSSGP_template& EnhancedFlexTimeslotAssignment__BSSGP_template::operator=(const EnhancedFlexTimeslotAssignment__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } EnhancedFlexTimeslotAssignment__BSSGP_template& EnhancedFlexTimeslotAssignment__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const EnhancedFlexTimeslotAssignment__BSSGP&)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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); } return *this; } EnhancedFlexTimeslotAssignment__BSSGP_template& EnhancedFlexTimeslotAssignment__BSSGP_template::operator=(const EnhancedFlexTimeslotAssignment__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean EnhancedFlexTimeslotAssignment__BSSGP_template::match(const EnhancedFlexTimeslotAssignment__BSSGP& 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.presenceBitalternativeEFTAMultislotClass().is_bound()) return FALSE; if(!single_value->field_presenceBitalternativeEFTAMultislotClass.match(other_value.presenceBitalternativeEFTAMultislotClass(), legacy))return FALSE; if(!other_value.alternativeEFTAMultislotClass().is_bound()) return FALSE; if(!single_value->field_alternativeEFTAMultislotClass.match(other_value.alternativeEFTAMultislotClass(), legacy))return FALSE; if(!other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier().is_bound()) return FALSE; if(!single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.match(other_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); } return FALSE; } boolean EnhancedFlexTimeslotAssignment__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_presenceBitalternativeEFTAMultislotClass.is_bound() || single_value->field_alternativeEFTAMultislotClass.is_bound() || single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_bound(); } boolean EnhancedFlexTimeslotAssignment__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_presenceBitalternativeEFTAMultislotClass.is_value() && single_value->field_alternativeEFTAMultislotClass.is_value() && single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_value(); } void EnhancedFlexTimeslotAssignment__BSSGP_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; } EnhancedFlexTimeslotAssignment__BSSGP EnhancedFlexTimeslotAssignment__BSSGP_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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); EnhancedFlexTimeslotAssignment__BSSGP ret_val; if (single_value->field_presenceBitalternativeEFTAMultislotClass.is_bound()) { ret_val.presenceBitalternativeEFTAMultislotClass() = single_value->field_presenceBitalternativeEFTAMultislotClass.valueof(); } if (single_value->field_alternativeEFTAMultislotClass.is_bound()) { ret_val.alternativeEFTAMultislotClass() = single_value->field_alternativeEFTAMultislotClass.valueof(); } if (single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.is_bound()) { ret_val.eFTAMultislotCapabilityReductionforDownlinkDualCarrier() = single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.valueof(); } return ret_val; } void EnhancedFlexTimeslotAssignment__BSSGP_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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new EnhancedFlexTimeslotAssignment__BSSGP_template[list_length]; } EnhancedFlexTimeslotAssignment__BSSGP_template& EnhancedFlexTimeslotAssignment__BSSGP_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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& EnhancedFlexTimeslotAssignment__BSSGP_template::presenceBitalternativeEFTAMultislotClass() { set_specific(); return single_value->field_presenceBitalternativeEFTAMultislotClass; } const BITSTRING_template& EnhancedFlexTimeslotAssignment__BSSGP_template::presenceBitalternativeEFTAMultislotClass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitalternativeEFTAMultislotClass of a non-specific template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); return single_value->field_presenceBitalternativeEFTAMultislotClass; } BITSTRING_template& EnhancedFlexTimeslotAssignment__BSSGP_template::alternativeEFTAMultislotClass() { set_specific(); return single_value->field_alternativeEFTAMultislotClass; } const BITSTRING_template& EnhancedFlexTimeslotAssignment__BSSGP_template::alternativeEFTAMultislotClass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field alternativeEFTAMultislotClass of a non-specific template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); return single_value->field_alternativeEFTAMultislotClass; } BITSTRING_template& EnhancedFlexTimeslotAssignment__BSSGP_template::eFTAMultislotCapabilityReductionforDownlinkDualCarrier() { set_specific(); return single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier; } const BITSTRING_template& EnhancedFlexTimeslotAssignment__BSSGP_template::eFTAMultislotCapabilityReductionforDownlinkDualCarrier() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eFTAMultislotCapabilityReductionforDownlinkDualCarrier of a non-specific template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); return single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier; } int EnhancedFlexTimeslotAssignment__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP 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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP 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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); } return 0; } void EnhancedFlexTimeslotAssignment__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ presenceBitalternativeEFTAMultislotClass := "); single_value->field_presenceBitalternativeEFTAMultislotClass.log(); TTCN_Logger::log_event_str(", alternativeEFTAMultislotClass := "); single_value->field_alternativeEFTAMultislotClass.log(); TTCN_Logger::log_event_str(", eFTAMultislotCapabilityReductionforDownlinkDualCarrier := "); single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment__BSSGP_template::log_match(const EnhancedFlexTimeslotAssignment__BSSGP& 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_presenceBitalternativeEFTAMultislotClass.match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitalternativeEFTAMultislotClass"); single_value->field_presenceBitalternativeEFTAMultislotClass.log_match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_alternativeEFTAMultislotClass.match(match_value.alternativeEFTAMultislotClass(), legacy)){ TTCN_Logger::log_logmatch_info(".alternativeEFTAMultislotClass"); single_value->field_alternativeEFTAMultislotClass.log_match(match_value.alternativeEFTAMultislotClass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), legacy)){ TTCN_Logger::log_logmatch_info(".eFTAMultislotCapabilityReductionforDownlinkDualCarrier"); single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.log_match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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("{ presenceBitalternativeEFTAMultislotClass := "); single_value->field_presenceBitalternativeEFTAMultislotClass.log_match(match_value.presenceBitalternativeEFTAMultislotClass(), legacy); TTCN_Logger::log_event_str(", alternativeEFTAMultislotClass := "); single_value->field_alternativeEFTAMultislotClass.log_match(match_value.alternativeEFTAMultislotClass(), legacy); TTCN_Logger::log_event_str(", eFTAMultislotCapabilityReductionforDownlinkDualCarrier := "); single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.log_match(match_value.eFTAMultislotCapabilityReductionforDownlinkDualCarrier(), 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 EnhancedFlexTimeslotAssignment__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_presenceBitalternativeEFTAMultislotClass.encode_text(text_buf); single_value->field_alternativeEFTAMultislotClass.encode_text(text_buf); single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); } } void EnhancedFlexTimeslotAssignment__BSSGP_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_presenceBitalternativeEFTAMultislotClass.decode_text(text_buf); single_value->field_alternativeEFTAMultislotClass.decode_text(text_buf); single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.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 EnhancedFlexTimeslotAssignment__BSSGP_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 @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP."); } } void EnhancedFlexTimeslotAssignment__BSSGP_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: { EnhancedFlexTimeslotAssignment__BSSGP_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) presenceBitalternativeEFTAMultislotClass().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) alternativeEFTAMultislotClass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eFTAMultislotCapabilityReductionforDownlinkDualCarrier().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(), "presenceBitalternativeEFTAMultislotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitalternativeEFTAMultislotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "alternativeEFTAMultislotClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { alternativeEFTAMultislotClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eFTAMultislotCapabilityReductionforDownlinkDualCarrier")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eFTAMultislotCapabilityReductionforDownlinkDualCarrier().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { EnhancedFlexTimeslotAssignment__BSSGP_template* precondition = new EnhancedFlexTimeslotAssignment__BSSGP_template; precondition->set_param(*param.get_elem(0)); EnhancedFlexTimeslotAssignment__BSSGP_template* implied_template = new EnhancedFlexTimeslotAssignment__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = EnhancedFlexTimeslotAssignment__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void EnhancedFlexTimeslotAssignment__BSSGP_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_presenceBitalternativeEFTAMultislotClass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP"); single_value->field_alternativeEFTAMultislotClass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP"); single_value->field_eFTAMultislotCapabilityReductionforDownlinkDualCarrier.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP"); 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 : "@BSSGP_Types.EnhancedFlexTimeslotAssignment_BSSGP"); } boolean EnhancedFlexTimeslotAssignment__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean EnhancedFlexTimeslotAssignment__BSSGP_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) enhancedFlexTimeslotAssignment().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eMSTCapability().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mTTICapability().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uTRACSGCellsReporting().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eUTRACSGCellsReporting().set_param(*param.get_elem(5)); 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(), "enhancedFlexTimeslotAssignment")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { enhancedFlexTimeslotAssignment().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "indicationofUpperLayerPDUStartCapabilityforRLCUM")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eMSTCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eMSTCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mTTICapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mTTICapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "uTRACSGCellsReporting")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { uTRACSGCellsReporting().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eUTRACSGCellsReporting")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRACSGCellsReporting().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); } } void AccessCapAdditionsRel9__BSSGP::encode_text(Text_Buf& text_buf) const { field_enhancedFlexTimeslotAssignment.encode_text(text_buf); field_indicationofUpperLayerPDUStartCapabilityforRLCUM.encode_text(text_buf); field_eMSTCapability.encode_text(text_buf); field_mTTICapability.encode_text(text_buf); field_uTRACSGCellsReporting.encode_text(text_buf); field_eUTRACSGCellsReporting.encode_text(text_buf); } void AccessCapAdditionsRel9__BSSGP::decode_text(Text_Buf& text_buf) { field_enhancedFlexTimeslotAssignment.decode_text(text_buf); field_indicationofUpperLayerPDUStartCapabilityforRLCUM.decode_text(text_buf); field_eMSTCapability.decode_text(text_buf); field_mTTICapability.decode_text(text_buf); field_uTRACSGCellsReporting.decode_text(text_buf); field_eUTRACSGCellsReporting.decode_text(text_buf); } void AccessCapAdditionsRel9__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel9__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel9__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel9__BSSGP_enhancedFlexTimeslotAssignment_descr_.raw->forceomit); decoded_field_length = field_enhancedFlexTimeslotAssignment.RAW_decode(AccessCapAdditionsRel9__BSSGP_enhancedFlexTimeslotAssignment_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel9__BSSGP_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_.raw->forceomit); decoded_field_length = field_indicationofUpperLayerPDUStartCapabilityforRLCUM.RAW_decode(AccessCapAdditionsRel9__BSSGP_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel9__BSSGP_eMSTCapability_descr_.raw->forceomit); decoded_field_length = field_eMSTCapability.RAW_decode(AccessCapAdditionsRel9__BSSGP_eMSTCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel9__BSSGP_mTTICapability_descr_.raw->forceomit); decoded_field_length = field_mTTICapability.RAW_decode(AccessCapAdditionsRel9__BSSGP_mTTICapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel9__BSSGP_uTRACSGCellsReporting_descr_.raw->forceomit); decoded_field_length = field_uTRACSGCellsReporting.RAW_decode(AccessCapAdditionsRel9__BSSGP_uTRACSGCellsReporting_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_5_force_omit(5, force_omit, AccessCapAdditionsRel9__BSSGP_eUTRACSGCellsReporting_descr_.raw->forceomit); decoded_field_length = field_eUTRACSGCellsReporting.RAW_decode(AccessCapAdditionsRel9__BSSGP_eUTRACSGCellsReporting_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel9__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 6; myleaf.body.node.nodes = init_nodes_of_enc_tree(6); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel9__BSSGP_enhancedFlexTimeslotAssignment_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel9__BSSGP_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel9__BSSGP_eMSTCapability_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel9__BSSGP_mTTICapability_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel9__BSSGP_uTRACSGCellsReporting_descr_.raw); myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, AccessCapAdditionsRel9__BSSGP_eUTRACSGCellsReporting_descr_.raw); encoded_length += field_enhancedFlexTimeslotAssignment.RAW_encode(AccessCapAdditionsRel9__BSSGP_enhancedFlexTimeslotAssignment_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_indicationofUpperLayerPDUStartCapabilityforRLCUM.RAW_encode(AccessCapAdditionsRel9__BSSGP_indicationofUpperLayerPDUStartCapabilityforRLCUM_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_eMSTCapability.RAW_encode(AccessCapAdditionsRel9__BSSGP_eMSTCapability_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_mTTICapability.RAW_encode(AccessCapAdditionsRel9__BSSGP_mTTICapability_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_uTRACSGCellsReporting.RAW_encode(AccessCapAdditionsRel9__BSSGP_uTRACSGCellsReporting_descr_, *myleaf.body.node.nodes[4]); encoded_length += field_eUTRACSGCellsReporting.RAW_encode(AccessCapAdditionsRel9__BSSGP_eUTRACSGCellsReporting_descr_, *myleaf.body.node.nodes[5]); return myleaf.length = encoded_length; } struct AccessCapAdditionsRel9__BSSGP_template::single_value_struct { EnhancedFlexTimeslotAssignment__BSSGP_template field_enhancedFlexTimeslotAssignment; BITSTRING_template field_indicationofUpperLayerPDUStartCapabilityforRLCUM; BITSTRING_template field_eMSTCapability; BITSTRING_template field_mTTICapability; BITSTRING_template field_uTRACSGCellsReporting; BITSTRING_template field_eUTRACSGCellsReporting; }; void AccessCapAdditionsRel9__BSSGP_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_enhancedFlexTimeslotAssignment = ANY_VALUE; single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = ANY_VALUE; single_value->field_eMSTCapability = ANY_VALUE; single_value->field_mTTICapability = ANY_VALUE; single_value->field_uTRACSGCellsReporting = ANY_VALUE; single_value->field_eUTRACSGCellsReporting = ANY_VALUE; } } } void AccessCapAdditionsRel9__BSSGP_template::copy_value(const AccessCapAdditionsRel9__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.enhancedFlexTimeslotAssignment().is_bound()) { single_value->field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment(); } else { single_value->field_enhancedFlexTimeslotAssignment.clean_up(); } if (other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) { single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(); } else { single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up(); } if (other_value.eMSTCapability().is_bound()) { single_value->field_eMSTCapability = other_value.eMSTCapability(); } else { single_value->field_eMSTCapability.clean_up(); } if (other_value.mTTICapability().is_bound()) { single_value->field_mTTICapability = other_value.mTTICapability(); } else { single_value->field_mTTICapability.clean_up(); } if (other_value.uTRACSGCellsReporting().is_bound()) { single_value->field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting(); } else { single_value->field_uTRACSGCellsReporting.clean_up(); } if (other_value.eUTRACSGCellsReporting().is_bound()) { single_value->field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting(); } else { single_value->field_eUTRACSGCellsReporting.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel9__BSSGP_template::copy_template(const AccessCapAdditionsRel9__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.enhancedFlexTimeslotAssignment().get_selection()) { single_value->field_enhancedFlexTimeslotAssignment = other_value.enhancedFlexTimeslotAssignment(); } else { single_value->field_enhancedFlexTimeslotAssignment.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().get_selection()) { single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM = other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(); } else { single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eMSTCapability().get_selection()) { single_value->field_eMSTCapability = other_value.eMSTCapability(); } else { single_value->field_eMSTCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mTTICapability().get_selection()) { single_value->field_mTTICapability = other_value.mTTICapability(); } else { single_value->field_mTTICapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.uTRACSGCellsReporting().get_selection()) { single_value->field_uTRACSGCellsReporting = other_value.uTRACSGCellsReporting(); } else { single_value->field_uTRACSGCellsReporting.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eUTRACSGCellsReporting().get_selection()) { single_value->field_eUTRACSGCellsReporting = other_value.eUTRACSGCellsReporting(); } else { single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9__BSSGP_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 AccessCapAdditionsRel9__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel9__BSSGP_template::AccessCapAdditionsRel9__BSSGP_template() { } AccessCapAdditionsRel9__BSSGP_template::AccessCapAdditionsRel9__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel9__BSSGP_template::AccessCapAdditionsRel9__BSSGP_template(const AccessCapAdditionsRel9__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel9__BSSGP_template::AccessCapAdditionsRel9__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel9__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel9__BSSGP_template::AccessCapAdditionsRel9__BSSGP_template(AccessCapAdditionsRel9__BSSGP_template* p_precondition, AccessCapAdditionsRel9__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel9__BSSGP_template::AccessCapAdditionsRel9__BSSGP_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; } AccessCapAdditionsRel9__BSSGP_template::AccessCapAdditionsRel9__BSSGP_template(const AccessCapAdditionsRel9__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel9__BSSGP_template::~AccessCapAdditionsRel9__BSSGP_template() { clean_up(); } AccessCapAdditionsRel9__BSSGP_template& AccessCapAdditionsRel9__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel9__BSSGP_template& AccessCapAdditionsRel9__BSSGP_template::operator=(const AccessCapAdditionsRel9__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel9__BSSGP_template& AccessCapAdditionsRel9__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel9__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); } return *this; } AccessCapAdditionsRel9__BSSGP_template& AccessCapAdditionsRel9__BSSGP_template::operator=(const AccessCapAdditionsRel9__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel9__BSSGP_template::match(const AccessCapAdditionsRel9__BSSGP& 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.enhancedFlexTimeslotAssignment().is_bound()) return FALSE; if(!single_value->field_enhancedFlexTimeslotAssignment.match(other_value.enhancedFlexTimeslotAssignment(), legacy))return FALSE; if(!other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM().is_bound()) return FALSE; if(!single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.match(other_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy))return FALSE; if(!other_value.eMSTCapability().is_bound()) return FALSE; if(!single_value->field_eMSTCapability.match(other_value.eMSTCapability(), legacy))return FALSE; if(!other_value.mTTICapability().is_bound()) return FALSE; if(!single_value->field_mTTICapability.match(other_value.mTTICapability(), legacy))return FALSE; if(!other_value.uTRACSGCellsReporting().is_bound()) return FALSE; if(!single_value->field_uTRACSGCellsReporting.match(other_value.uTRACSGCellsReporting(), legacy))return FALSE; if(!other_value.eUTRACSGCellsReporting().is_bound()) return FALSE; if(!single_value->field_eUTRACSGCellsReporting.match(other_value.eUTRACSGCellsReporting(), 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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel9__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_enhancedFlexTimeslotAssignment.is_bound() || single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_bound() || single_value->field_eMSTCapability.is_bound() || single_value->field_mTTICapability.is_bound() || single_value->field_uTRACSGCellsReporting.is_bound() || single_value->field_eUTRACSGCellsReporting.is_bound(); } boolean AccessCapAdditionsRel9__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_enhancedFlexTimeslotAssignment.is_value() && single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_value() && single_value->field_eMSTCapability.is_value() && single_value->field_mTTICapability.is_value() && single_value->field_uTRACSGCellsReporting.is_value() && single_value->field_eUTRACSGCellsReporting.is_value(); } void AccessCapAdditionsRel9__BSSGP_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; } AccessCapAdditionsRel9__BSSGP AccessCapAdditionsRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); AccessCapAdditionsRel9__BSSGP ret_val; if (single_value->field_enhancedFlexTimeslotAssignment.is_bound()) { ret_val.enhancedFlexTimeslotAssignment() = single_value->field_enhancedFlexTimeslotAssignment.valueof(); } if (single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.is_bound()) { ret_val.indicationofUpperLayerPDUStartCapabilityforRLCUM() = single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.valueof(); } if (single_value->field_eMSTCapability.is_bound()) { ret_val.eMSTCapability() = single_value->field_eMSTCapability.valueof(); } if (single_value->field_mTTICapability.is_bound()) { ret_val.mTTICapability() = single_value->field_mTTICapability.valueof(); } if (single_value->field_uTRACSGCellsReporting.is_bound()) { ret_val.uTRACSGCellsReporting() = single_value->field_uTRACSGCellsReporting.valueof(); } if (single_value->field_eUTRACSGCellsReporting.is_bound()) { ret_val.eUTRACSGCellsReporting() = single_value->field_eUTRACSGCellsReporting.valueof(); } return ret_val; } void AccessCapAdditionsRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel9__BSSGP_template[list_length]; } AccessCapAdditionsRel9__BSSGP_template& AccessCapAdditionsRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); return value_list.list_value[list_index]; } EnhancedFlexTimeslotAssignment__BSSGP_template& AccessCapAdditionsRel9__BSSGP_template::enhancedFlexTimeslotAssignment() { set_specific(); return single_value->field_enhancedFlexTimeslotAssignment; } const EnhancedFlexTimeslotAssignment__BSSGP_template& AccessCapAdditionsRel9__BSSGP_template::enhancedFlexTimeslotAssignment() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field enhancedFlexTimeslotAssignment of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); return single_value->field_enhancedFlexTimeslotAssignment; } BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::indicationofUpperLayerPDUStartCapabilityforRLCUM() { set_specific(); return single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM; } const BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::indicationofUpperLayerPDUStartCapabilityforRLCUM() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field indicationofUpperLayerPDUStartCapabilityforRLCUM of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); return single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM; } BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::eMSTCapability() { set_specific(); return single_value->field_eMSTCapability; } const BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::eMSTCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eMSTCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); return single_value->field_eMSTCapability; } BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::mTTICapability() { set_specific(); return single_value->field_mTTICapability; } const BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::mTTICapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mTTICapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); return single_value->field_mTTICapability; } BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::uTRACSGCellsReporting() { set_specific(); return single_value->field_uTRACSGCellsReporting; } const BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::uTRACSGCellsReporting() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uTRACSGCellsReporting of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); return single_value->field_uTRACSGCellsReporting; } BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::eUTRACSGCellsReporting() { set_specific(); return single_value->field_eUTRACSGCellsReporting; } const BITSTRING_template& AccessCapAdditionsRel9__BSSGP_template::eUTRACSGCellsReporting() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eUTRACSGCellsReporting of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); return single_value->field_eUTRACSGCellsReporting; } int AccessCapAdditionsRel9__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 6; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); } return 0; } void AccessCapAdditionsRel9__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ enhancedFlexTimeslotAssignment := "); single_value->field_enhancedFlexTimeslotAssignment.log(); TTCN_Logger::log_event_str(", indicationofUpperLayerPDUStartCapabilityforRLCUM := "); single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log(); TTCN_Logger::log_event_str(", eMSTCapability := "); single_value->field_eMSTCapability.log(); TTCN_Logger::log_event_str(", mTTICapability := "); single_value->field_mTTICapability.log(); TTCN_Logger::log_event_str(", uTRACSGCellsReporting := "); single_value->field_uTRACSGCellsReporting.log(); TTCN_Logger::log_event_str(", eUTRACSGCellsReporting := "); single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9__BSSGP_template::log_match(const AccessCapAdditionsRel9__BSSGP& 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_enhancedFlexTimeslotAssignment.match(match_value.enhancedFlexTimeslotAssignment(), legacy)){ TTCN_Logger::log_logmatch_info(".enhancedFlexTimeslotAssignment"); single_value->field_enhancedFlexTimeslotAssignment.log_match(match_value.enhancedFlexTimeslotAssignment(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy)){ TTCN_Logger::log_logmatch_info(".indicationofUpperLayerPDUStartCapabilityforRLCUM"); single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log_match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eMSTCapability.match(match_value.eMSTCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".eMSTCapability"); single_value->field_eMSTCapability.log_match(match_value.eMSTCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_mTTICapability.match(match_value.mTTICapability(), legacy)){ TTCN_Logger::log_logmatch_info(".mTTICapability"); single_value->field_mTTICapability.log_match(match_value.mTTICapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_uTRACSGCellsReporting.match(match_value.uTRACSGCellsReporting(), legacy)){ TTCN_Logger::log_logmatch_info(".uTRACSGCellsReporting"); single_value->field_uTRACSGCellsReporting.log_match(match_value.uTRACSGCellsReporting(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eUTRACSGCellsReporting.match(match_value.eUTRACSGCellsReporting(), legacy)){ TTCN_Logger::log_logmatch_info(".eUTRACSGCellsReporting"); single_value->field_eUTRACSGCellsReporting.log_match(match_value.eUTRACSGCellsReporting(), 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("{ enhancedFlexTimeslotAssignment := "); single_value->field_enhancedFlexTimeslotAssignment.log_match(match_value.enhancedFlexTimeslotAssignment(), legacy); TTCN_Logger::log_event_str(", indicationofUpperLayerPDUStartCapabilityforRLCUM := "); single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.log_match(match_value.indicationofUpperLayerPDUStartCapabilityforRLCUM(), legacy); TTCN_Logger::log_event_str(", eMSTCapability := "); single_value->field_eMSTCapability.log_match(match_value.eMSTCapability(), legacy); TTCN_Logger::log_event_str(", mTTICapability := "); single_value->field_mTTICapability.log_match(match_value.mTTICapability(), legacy); TTCN_Logger::log_event_str(", uTRACSGCellsReporting := "); single_value->field_uTRACSGCellsReporting.log_match(match_value.uTRACSGCellsReporting(), legacy); TTCN_Logger::log_event_str(", eUTRACSGCellsReporting := "); single_value->field_eUTRACSGCellsReporting.log_match(match_value.eUTRACSGCellsReporting(), 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 AccessCapAdditionsRel9__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_enhancedFlexTimeslotAssignment.encode_text(text_buf); single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.encode_text(text_buf); single_value->field_eMSTCapability.encode_text(text_buf); single_value->field_mTTICapability.encode_text(text_buf); single_value->field_uTRACSGCellsReporting.encode_text(text_buf); single_value->field_eUTRACSGCellsReporting.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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); } } void AccessCapAdditionsRel9__BSSGP_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_enhancedFlexTimeslotAssignment.decode_text(text_buf); single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.decode_text(text_buf); single_value->field_eMSTCapability.decode_text(text_buf); single_value->field_mTTICapability.decode_text(text_buf); single_value->field_uTRACSGCellsReporting.decode_text(text_buf); single_value->field_eUTRACSGCellsReporting.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 AccessCapAdditionsRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel9_BSSGP."); } } void AccessCapAdditionsRel9__BSSGP_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: { AccessCapAdditionsRel9__BSSGP_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) enhancedFlexTimeslotAssignment().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eMSTCapability().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mTTICapability().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) uTRACSGCellsReporting().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) eUTRACSGCellsReporting().set_param(*param.get_elem(5)); 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(), "enhancedFlexTimeslotAssignment")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { enhancedFlexTimeslotAssignment().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "indicationofUpperLayerPDUStartCapabilityforRLCUM")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { indicationofUpperLayerPDUStartCapabilityforRLCUM().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eMSTCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eMSTCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mTTICapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mTTICapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "uTRACSGCellsReporting")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { uTRACSGCellsReporting().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eUTRACSGCellsReporting")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRACSGCellsReporting().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel9_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel9__BSSGP_template* precondition = new AccessCapAdditionsRel9__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel9__BSSGP_template* implied_template = new AccessCapAdditionsRel9__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel9__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel9__BSSGP_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_enhancedFlexTimeslotAssignment.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); single_value->field_indicationofUpperLayerPDUStartCapabilityforRLCUM.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); single_value->field_eMSTCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); single_value->field_mTTICapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); single_value->field_uTRACSGCellsReporting.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); single_value->field_eUTRACSGCellsReporting.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel9_BSSGP"); } boolean AccessCapAdditionsRel9__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel9__BSSGP_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_accessCapAdditionsAfterRel9) : field_accessCapAdditionsRel9(par_accessCapAdditionsRel9), field_accessCapAdditionsAfterRel9(par_accessCapAdditionsAfterRel9) { } AccessCapAdditionsAfterRel8__BSSGP::AccessCapAdditionsAfterRel8__BSSGP(const AccessCapAdditionsAfterRel8__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); if (other_value.accessCapAdditionsRel9().is_bound()) field_accessCapAdditionsRel9 = other_value.accessCapAdditionsRel9(); else field_accessCapAdditionsRel9.clean_up(); if (other_value.accessCapAdditionsAfterRel9().is_bound()) field_accessCapAdditionsAfterRel9 = other_value.accessCapAdditionsAfterRel9(); else field_accessCapAdditionsAfterRel9.clean_up(); } void AccessCapAdditionsAfterRel8__BSSGP::clean_up() { field_accessCapAdditionsRel9.clean_up(); field_accessCapAdditionsAfterRel9.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel8__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel8__BSSGP_descr_; } AccessCapAdditionsAfterRel8__BSSGP& AccessCapAdditionsAfterRel8__BSSGP::operator=(const AccessCapAdditionsAfterRel8__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); if (other_value.accessCapAdditionsRel9().is_bound()) field_accessCapAdditionsRel9 = other_value.accessCapAdditionsRel9(); else field_accessCapAdditionsRel9.clean_up(); if (other_value.accessCapAdditionsAfterRel9().is_bound()) field_accessCapAdditionsAfterRel9 = other_value.accessCapAdditionsAfterRel9(); else field_accessCapAdditionsAfterRel9.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel8__BSSGP::operator==(const AccessCapAdditionsAfterRel8__BSSGP& other_value) const { return field_accessCapAdditionsRel9==other_value.field_accessCapAdditionsRel9 && field_accessCapAdditionsAfterRel9==other_value.field_accessCapAdditionsAfterRel9; } boolean AccessCapAdditionsAfterRel8__BSSGP::is_bound() const { return (field_accessCapAdditionsRel9.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel9.get_selection() || field_accessCapAdditionsAfterRel9.is_bound()); } boolean AccessCapAdditionsAfterRel8__BSSGP::is_value() const { return field_accessCapAdditionsRel9.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel9.get_selection() || field_accessCapAdditionsAfterRel9.is_value()); } int AccessCapAdditionsAfterRel8__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel9.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel8__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel9 := "); field_accessCapAdditionsRel9.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel9 := "); field_accessCapAdditionsAfterRel9.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel8__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel9().is_bound()) accessCapAdditionsRel9().set_implicit_omit(); if (!accessCapAdditionsAfterRel9().is_bound()) accessCapAdditionsAfterRel9() = OMIT_VALUE; else accessCapAdditionsAfterRel9().set_implicit_omit(); } void AccessCapAdditionsAfterRel8__BSSGP::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) accessCapAdditionsRel9().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel9().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(), "accessCapAdditionsRel9")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel9().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel9")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel9().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP"); } } void AccessCapAdditionsAfterRel8__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel9.encode_text(text_buf); field_accessCapAdditionsAfterRel9.encode_text(text_buf); } void AccessCapAdditionsAfterRel8__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel9.decode_text(text_buf); field_accessCapAdditionsAfterRel9.decode_text(text_buf); } void AccessCapAdditionsAfterRel8__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel8__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel8__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel9__BSSGP_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel9.RAW_decode(AccessCapAdditionsRel9__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel9 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel9__BSSGP_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel9().RAW_decode(AccessCapAdditionsAfterRel9__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel9 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel9=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel8__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel9__BSSGP_descr_.raw); if (field_accessCapAdditionsAfterRel9.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel9__BSSGP_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel9.RAW_encode(AccessCapAdditionsRel9__BSSGP_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel9.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel9().RAW_encode(AccessCapAdditionsAfterRel9__BSSGP_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel8__BSSGP_template::single_value_struct { AccessCapAdditionsRel9__BSSGP_template field_accessCapAdditionsRel9; AccessCapAdditionsAfterRel9__BSSGP_template field_accessCapAdditionsAfterRel9; }; void AccessCapAdditionsAfterRel8__BSSGP_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_accessCapAdditionsRel9 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel9 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel8__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel8__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel9().is_bound()) { single_value->field_accessCapAdditionsRel9 = other_value.accessCapAdditionsRel9(); } else { single_value->field_accessCapAdditionsRel9.clean_up(); } if (other_value.accessCapAdditionsAfterRel9().is_bound()) { if (other_value.accessCapAdditionsAfterRel9().ispresent()) single_value->field_accessCapAdditionsAfterRel9 = other_value.accessCapAdditionsAfterRel9()(); else single_value->field_accessCapAdditionsAfterRel9 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel9.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel8__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel8__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel9().get_selection()) { single_value->field_accessCapAdditionsRel9 = other_value.accessCapAdditionsRel9(); } else { single_value->field_accessCapAdditionsRel9.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel9().get_selection()) { single_value->field_accessCapAdditionsAfterRel9 = other_value.accessCapAdditionsAfterRel9(); } else { single_value->field_accessCapAdditionsAfterRel9.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 AccessCapAdditionsAfterRel8__BSSGP_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 AccessCapAdditionsAfterRel8__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel8__BSSGP_template::AccessCapAdditionsAfterRel8__BSSGP_template() { } AccessCapAdditionsAfterRel8__BSSGP_template::AccessCapAdditionsAfterRel8__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel8__BSSGP_template::AccessCapAdditionsAfterRel8__BSSGP_template(const AccessCapAdditionsAfterRel8__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel8__BSSGP_template::AccessCapAdditionsAfterRel8__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel8__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel8__BSSGP_template::AccessCapAdditionsAfterRel8__BSSGP_template(AccessCapAdditionsAfterRel8__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel8__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel8__BSSGP_template::AccessCapAdditionsAfterRel8__BSSGP_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; } AccessCapAdditionsAfterRel8__BSSGP_template::AccessCapAdditionsAfterRel8__BSSGP_template(const AccessCapAdditionsAfterRel8__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel8__BSSGP_template::~AccessCapAdditionsAfterRel8__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel8__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel8__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_template::operator=(const AccessCapAdditionsAfterRel8__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel8__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel8__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); } return *this; } AccessCapAdditionsAfterRel8__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_template::operator=(const AccessCapAdditionsAfterRel8__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel8__BSSGP_template::match(const AccessCapAdditionsAfterRel8__BSSGP& 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.accessCapAdditionsRel9().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel9.match(other_value.accessCapAdditionsRel9(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel9().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel9().ispresent() ? !single_value->field_accessCapAdditionsAfterRel9.match((const AccessCapAdditionsAfterRel9__BSSGP&)other_value.accessCapAdditionsAfterRel9(), legacy) : !single_value->field_accessCapAdditionsAfterRel9.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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel8__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel9.is_bound() || (single_value->field_accessCapAdditionsAfterRel9.is_omit() || single_value->field_accessCapAdditionsAfterRel9.is_bound()); } boolean AccessCapAdditionsAfterRel8__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel9.is_value() && (single_value->field_accessCapAdditionsAfterRel9.is_omit() || single_value->field_accessCapAdditionsAfterRel9.is_value()); } void AccessCapAdditionsAfterRel8__BSSGP_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; } AccessCapAdditionsAfterRel8__BSSGP AccessCapAdditionsAfterRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); AccessCapAdditionsAfterRel8__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel9.is_bound()) { ret_val.accessCapAdditionsRel9() = single_value->field_accessCapAdditionsRel9.valueof(); } if (single_value->field_accessCapAdditionsAfterRel9.is_omit()) ret_val.accessCapAdditionsAfterRel9() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel9.is_bound()) { ret_val.accessCapAdditionsAfterRel9() = single_value->field_accessCapAdditionsAfterRel9.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel8__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel8__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel9__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_template::accessCapAdditionsRel9() { set_specific(); return single_value->field_accessCapAdditionsRel9; } const AccessCapAdditionsRel9__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_template::accessCapAdditionsRel9() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel9 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); return single_value->field_accessCapAdditionsRel9; } AccessCapAdditionsAfterRel9__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_template::accessCapAdditionsAfterRel9() { set_specific(); return single_value->field_accessCapAdditionsAfterRel9; } const AccessCapAdditionsAfterRel9__BSSGP_template& AccessCapAdditionsAfterRel8__BSSGP_template::accessCapAdditionsAfterRel9() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel9 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); return single_value->field_accessCapAdditionsAfterRel9; } int AccessCapAdditionsAfterRel8__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel9.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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel8__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel9 := "); single_value->field_accessCapAdditionsRel9.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel9 := "); single_value->field_accessCapAdditionsAfterRel9.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 AccessCapAdditionsAfterRel8__BSSGP_template::log_match(const AccessCapAdditionsAfterRel8__BSSGP& 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_accessCapAdditionsRel9.match(match_value.accessCapAdditionsRel9(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel9"); single_value->field_accessCapAdditionsRel9.log_match(match_value.accessCapAdditionsRel9(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel9().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel9.match(match_value.accessCapAdditionsAfterRel9(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel9"); single_value->field_accessCapAdditionsAfterRel9.log_match(match_value.accessCapAdditionsAfterRel9(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel9.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel9 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel9.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("{ accessCapAdditionsRel9 := "); single_value->field_accessCapAdditionsRel9.log_match(match_value.accessCapAdditionsRel9(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel9 := "); if (match_value.accessCapAdditionsAfterRel9().ispresent()) { single_value->field_accessCapAdditionsAfterRel9.log_match(match_value.accessCapAdditionsAfterRel9(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel9.log(); if (single_value->field_accessCapAdditionsAfterRel9.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 AccessCapAdditionsAfterRel8__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel9.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel9.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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); } } void AccessCapAdditionsAfterRel8__BSSGP_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_accessCapAdditionsRel9.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel9.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 AccessCapAdditionsAfterRel8__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP."); } } void AccessCapAdditionsAfterRel8__BSSGP_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: { AccessCapAdditionsAfterRel8__BSSGP_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) accessCapAdditionsRel9().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel9().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(), "accessCapAdditionsRel9")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel9().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel9")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel9().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel8__BSSGP_template* precondition = new AccessCapAdditionsAfterRel8__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel8__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel8__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel8__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel8__BSSGP_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_accessCapAdditionsRel9.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP"); single_value->field_accessCapAdditionsAfterRel9.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel8_BSSGP"); } boolean AccessCapAdditionsAfterRel8__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel8__BSSGP_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) dTRCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eMSRCapability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fastDownlinkFrequencySwitchingCapability().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tIGHTER__Capability().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(), "dTRCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTRCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eMSRCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eMSRCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fastDownlinkFrequencySwitchingCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fastDownlinkFrequencySwitchingCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tIGHTER_Capability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tIGHTER__Capability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel10_BSSGP"); } } void AccessCapAdditionsRel10__BSSGP::encode_text(Text_Buf& text_buf) const { field_dTRCapability.encode_text(text_buf); field_eMSRCapability.encode_text(text_buf); field_fastDownlinkFrequencySwitchingCapability.encode_text(text_buf); field_tIGHTER__Capability.encode_text(text_buf); } void AccessCapAdditionsRel10__BSSGP::decode_text(Text_Buf& text_buf) { field_dTRCapability.decode_text(text_buf); field_eMSRCapability.decode_text(text_buf); field_fastDownlinkFrequencySwitchingCapability.decode_text(text_buf); field_tIGHTER__Capability.decode_text(text_buf); } void AccessCapAdditionsRel10__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel10__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel10__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel10__BSSGP_dTRCapability_descr_.raw->forceomit); decoded_field_length = field_dTRCapability.RAW_decode(AccessCapAdditionsRel10__BSSGP_dTRCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel10__BSSGP_eMSRCapability_descr_.raw->forceomit); decoded_field_length = field_eMSRCapability.RAW_decode(AccessCapAdditionsRel10__BSSGP_eMSRCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel10__BSSGP_fastDownlinkFrequencySwitchingCapability_descr_.raw->forceomit); decoded_field_length = field_fastDownlinkFrequencySwitchingCapability.RAW_decode(AccessCapAdditionsRel10__BSSGP_fastDownlinkFrequencySwitchingCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel10__BSSGP_tIGHTER__Capability_descr_.raw->forceomit); decoded_field_length = field_tIGHTER__Capability.RAW_decode(AccessCapAdditionsRel10__BSSGP_tIGHTER__Capability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel10__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel10__BSSGP_dTRCapability_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel10__BSSGP_eMSRCapability_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel10__BSSGP_fastDownlinkFrequencySwitchingCapability_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel10__BSSGP_tIGHTER__Capability_descr_.raw); encoded_length += field_dTRCapability.RAW_encode(AccessCapAdditionsRel10__BSSGP_dTRCapability_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_eMSRCapability.RAW_encode(AccessCapAdditionsRel10__BSSGP_eMSRCapability_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_fastDownlinkFrequencySwitchingCapability.RAW_encode(AccessCapAdditionsRel10__BSSGP_fastDownlinkFrequencySwitchingCapability_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_tIGHTER__Capability.RAW_encode(AccessCapAdditionsRel10__BSSGP_tIGHTER__Capability_descr_, *myleaf.body.node.nodes[3]); return myleaf.length = encoded_length; } struct AccessCapAdditionsRel10__BSSGP_template::single_value_struct { BITSTRING_template field_dTRCapability; BITSTRING_template field_eMSRCapability; BITSTRING_template field_fastDownlinkFrequencySwitchingCapability; BITSTRING_template field_tIGHTER__Capability; }; void AccessCapAdditionsRel10__BSSGP_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_dTRCapability = ANY_VALUE; single_value->field_eMSRCapability = ANY_VALUE; single_value->field_fastDownlinkFrequencySwitchingCapability = ANY_VALUE; single_value->field_tIGHTER__Capability = ANY_VALUE; } } } void AccessCapAdditionsRel10__BSSGP_template::copy_value(const AccessCapAdditionsRel10__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.dTRCapability().is_bound()) { single_value->field_dTRCapability = other_value.dTRCapability(); } else { single_value->field_dTRCapability.clean_up(); } if (other_value.eMSRCapability().is_bound()) { single_value->field_eMSRCapability = other_value.eMSRCapability(); } else { single_value->field_eMSRCapability.clean_up(); } if (other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) { single_value->field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability(); } else { single_value->field_fastDownlinkFrequencySwitchingCapability.clean_up(); } if (other_value.tIGHTER__Capability().is_bound()) { single_value->field_tIGHTER__Capability = other_value.tIGHTER__Capability(); } else { single_value->field_tIGHTER__Capability.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel10__BSSGP_template::copy_template(const AccessCapAdditionsRel10__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.dTRCapability().get_selection()) { single_value->field_dTRCapability = other_value.dTRCapability(); } else { single_value->field_dTRCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eMSRCapability().get_selection()) { single_value->field_eMSRCapability = other_value.eMSRCapability(); } else { single_value->field_eMSRCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.fastDownlinkFrequencySwitchingCapability().get_selection()) { single_value->field_fastDownlinkFrequencySwitchingCapability = other_value.fastDownlinkFrequencySwitchingCapability(); } else { single_value->field_fastDownlinkFrequencySwitchingCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.tIGHTER__Capability().get_selection()) { single_value->field_tIGHTER__Capability = other_value.tIGHTER__Capability(); } else { single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10__BSSGP_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 AccessCapAdditionsRel10__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel10__BSSGP_template::AccessCapAdditionsRel10__BSSGP_template() { } AccessCapAdditionsRel10__BSSGP_template::AccessCapAdditionsRel10__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel10__BSSGP_template::AccessCapAdditionsRel10__BSSGP_template(const AccessCapAdditionsRel10__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel10__BSSGP_template::AccessCapAdditionsRel10__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel10__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel10__BSSGP_template::AccessCapAdditionsRel10__BSSGP_template(AccessCapAdditionsRel10__BSSGP_template* p_precondition, AccessCapAdditionsRel10__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel10__BSSGP_template::AccessCapAdditionsRel10__BSSGP_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; } AccessCapAdditionsRel10__BSSGP_template::AccessCapAdditionsRel10__BSSGP_template(const AccessCapAdditionsRel10__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel10__BSSGP_template::~AccessCapAdditionsRel10__BSSGP_template() { clean_up(); } AccessCapAdditionsRel10__BSSGP_template& AccessCapAdditionsRel10__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel10__BSSGP_template& AccessCapAdditionsRel10__BSSGP_template::operator=(const AccessCapAdditionsRel10__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel10__BSSGP_template& AccessCapAdditionsRel10__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel10__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); } return *this; } AccessCapAdditionsRel10__BSSGP_template& AccessCapAdditionsRel10__BSSGP_template::operator=(const AccessCapAdditionsRel10__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel10__BSSGP_template::match(const AccessCapAdditionsRel10__BSSGP& 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.dTRCapability().is_bound()) return FALSE; if(!single_value->field_dTRCapability.match(other_value.dTRCapability(), legacy))return FALSE; if(!other_value.eMSRCapability().is_bound()) return FALSE; if(!single_value->field_eMSRCapability.match(other_value.eMSRCapability(), legacy))return FALSE; if(!other_value.fastDownlinkFrequencySwitchingCapability().is_bound()) return FALSE; if(!single_value->field_fastDownlinkFrequencySwitchingCapability.match(other_value.fastDownlinkFrequencySwitchingCapability(), legacy))return FALSE; if(!other_value.tIGHTER__Capability().is_bound()) return FALSE; if(!single_value->field_tIGHTER__Capability.match(other_value.tIGHTER__Capability(), 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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel10__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_dTRCapability.is_bound() || single_value->field_eMSRCapability.is_bound() || single_value->field_fastDownlinkFrequencySwitchingCapability.is_bound() || single_value->field_tIGHTER__Capability.is_bound(); } boolean AccessCapAdditionsRel10__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_dTRCapability.is_value() && single_value->field_eMSRCapability.is_value() && single_value->field_fastDownlinkFrequencySwitchingCapability.is_value() && single_value->field_tIGHTER__Capability.is_value(); } void AccessCapAdditionsRel10__BSSGP_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; } AccessCapAdditionsRel10__BSSGP AccessCapAdditionsRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); AccessCapAdditionsRel10__BSSGP ret_val; if (single_value->field_dTRCapability.is_bound()) { ret_val.dTRCapability() = single_value->field_dTRCapability.valueof(); } if (single_value->field_eMSRCapability.is_bound()) { ret_val.eMSRCapability() = single_value->field_eMSRCapability.valueof(); } if (single_value->field_fastDownlinkFrequencySwitchingCapability.is_bound()) { ret_val.fastDownlinkFrequencySwitchingCapability() = single_value->field_fastDownlinkFrequencySwitchingCapability.valueof(); } if (single_value->field_tIGHTER__Capability.is_bound()) { ret_val.tIGHTER__Capability() = single_value->field_tIGHTER__Capability.valueof(); } return ret_val; } void AccessCapAdditionsRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel10__BSSGP_template[list_length]; } AccessCapAdditionsRel10__BSSGP_template& AccessCapAdditionsRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel10__BSSGP_template::dTRCapability() { set_specific(); return single_value->field_dTRCapability; } const BITSTRING_template& AccessCapAdditionsRel10__BSSGP_template::dTRCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dTRCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); return single_value->field_dTRCapability; } BITSTRING_template& AccessCapAdditionsRel10__BSSGP_template::eMSRCapability() { set_specific(); return single_value->field_eMSRCapability; } const BITSTRING_template& AccessCapAdditionsRel10__BSSGP_template::eMSRCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eMSRCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); return single_value->field_eMSRCapability; } BITSTRING_template& AccessCapAdditionsRel10__BSSGP_template::fastDownlinkFrequencySwitchingCapability() { set_specific(); return single_value->field_fastDownlinkFrequencySwitchingCapability; } const BITSTRING_template& AccessCapAdditionsRel10__BSSGP_template::fastDownlinkFrequencySwitchingCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field fastDownlinkFrequencySwitchingCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); return single_value->field_fastDownlinkFrequencySwitchingCapability; } BITSTRING_template& AccessCapAdditionsRel10__BSSGP_template::tIGHTER__Capability() { set_specific(); return single_value->field_tIGHTER__Capability; } const BITSTRING_template& AccessCapAdditionsRel10__BSSGP_template::tIGHTER__Capability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field tIGHTER_Capability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); return single_value->field_tIGHTER__Capability; } int AccessCapAdditionsRel10__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); } return 0; } void AccessCapAdditionsRel10__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ dTRCapability := "); single_value->field_dTRCapability.log(); TTCN_Logger::log_event_str(", eMSRCapability := "); single_value->field_eMSRCapability.log(); TTCN_Logger::log_event_str(", fastDownlinkFrequencySwitchingCapability := "); single_value->field_fastDownlinkFrequencySwitchingCapability.log(); TTCN_Logger::log_event_str(", tIGHTER_Capability := "); single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10__BSSGP_template::log_match(const AccessCapAdditionsRel10__BSSGP& 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_dTRCapability.match(match_value.dTRCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".dTRCapability"); single_value->field_dTRCapability.log_match(match_value.dTRCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eMSRCapability.match(match_value.eMSRCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".eMSRCapability"); single_value->field_eMSRCapability.log_match(match_value.eMSRCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_fastDownlinkFrequencySwitchingCapability.match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".fastDownlinkFrequencySwitchingCapability"); single_value->field_fastDownlinkFrequencySwitchingCapability.log_match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_tIGHTER__Capability.match(match_value.tIGHTER__Capability(), legacy)){ TTCN_Logger::log_logmatch_info(".tIGHTER_Capability"); single_value->field_tIGHTER__Capability.log_match(match_value.tIGHTER__Capability(), 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("{ dTRCapability := "); single_value->field_dTRCapability.log_match(match_value.dTRCapability(), legacy); TTCN_Logger::log_event_str(", eMSRCapability := "); single_value->field_eMSRCapability.log_match(match_value.eMSRCapability(), legacy); TTCN_Logger::log_event_str(", fastDownlinkFrequencySwitchingCapability := "); single_value->field_fastDownlinkFrequencySwitchingCapability.log_match(match_value.fastDownlinkFrequencySwitchingCapability(), legacy); TTCN_Logger::log_event_str(", tIGHTER_Capability := "); single_value->field_tIGHTER__Capability.log_match(match_value.tIGHTER__Capability(), 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 AccessCapAdditionsRel10__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_dTRCapability.encode_text(text_buf); single_value->field_eMSRCapability.encode_text(text_buf); single_value->field_fastDownlinkFrequencySwitchingCapability.encode_text(text_buf); single_value->field_tIGHTER__Capability.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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); } } void AccessCapAdditionsRel10__BSSGP_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_dTRCapability.decode_text(text_buf); single_value->field_eMSRCapability.decode_text(text_buf); single_value->field_fastDownlinkFrequencySwitchingCapability.decode_text(text_buf); single_value->field_tIGHTER__Capability.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 AccessCapAdditionsRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel10_BSSGP."); } } void AccessCapAdditionsRel10__BSSGP_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: { AccessCapAdditionsRel10__BSSGP_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) dTRCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eMSRCapability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) fastDownlinkFrequencySwitchingCapability().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) tIGHTER__Capability().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(), "dTRCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dTRCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eMSRCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eMSRCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "fastDownlinkFrequencySwitchingCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fastDownlinkFrequencySwitchingCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "tIGHTER_Capability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { tIGHTER__Capability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel10_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel10__BSSGP_template* precondition = new AccessCapAdditionsRel10__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel10__BSSGP_template* implied_template = new AccessCapAdditionsRel10__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel10__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel10_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel10__BSSGP_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_dTRCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel10_BSSGP"); single_value->field_eMSRCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel10_BSSGP"); single_value->field_fastDownlinkFrequencySwitchingCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel10_BSSGP"); single_value->field_tIGHTER__Capability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel10_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel10_BSSGP"); } boolean AccessCapAdditionsRel10__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel10__BSSGP_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_accessCapAdditionsAfterRel10) : field_accessCapAdditionsRel10(par_accessCapAdditionsRel10), field_accessCapAdditionsAfterRel10(par_accessCapAdditionsAfterRel10) { } AccessCapAdditionsAfterRel9__BSSGP::AccessCapAdditionsAfterRel9__BSSGP(const AccessCapAdditionsAfterRel9__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); if (other_value.accessCapAdditionsRel10().is_bound()) field_accessCapAdditionsRel10 = other_value.accessCapAdditionsRel10(); else field_accessCapAdditionsRel10.clean_up(); if (other_value.accessCapAdditionsAfterRel10().is_bound()) field_accessCapAdditionsAfterRel10 = other_value.accessCapAdditionsAfterRel10(); else field_accessCapAdditionsAfterRel10.clean_up(); } void AccessCapAdditionsAfterRel9__BSSGP::clean_up() { field_accessCapAdditionsRel10.clean_up(); field_accessCapAdditionsAfterRel10.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel9__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel9__BSSGP_descr_; } AccessCapAdditionsAfterRel9__BSSGP& AccessCapAdditionsAfterRel9__BSSGP::operator=(const AccessCapAdditionsAfterRel9__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); if (other_value.accessCapAdditionsRel10().is_bound()) field_accessCapAdditionsRel10 = other_value.accessCapAdditionsRel10(); else field_accessCapAdditionsRel10.clean_up(); if (other_value.accessCapAdditionsAfterRel10().is_bound()) field_accessCapAdditionsAfterRel10 = other_value.accessCapAdditionsAfterRel10(); else field_accessCapAdditionsAfterRel10.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel9__BSSGP::operator==(const AccessCapAdditionsAfterRel9__BSSGP& other_value) const { return field_accessCapAdditionsRel10==other_value.field_accessCapAdditionsRel10 && field_accessCapAdditionsAfterRel10==other_value.field_accessCapAdditionsAfterRel10; } boolean AccessCapAdditionsAfterRel9__BSSGP::is_bound() const { return (field_accessCapAdditionsRel10.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel10.get_selection() || field_accessCapAdditionsAfterRel10.is_bound()); } boolean AccessCapAdditionsAfterRel9__BSSGP::is_value() const { return field_accessCapAdditionsRel10.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel10.get_selection() || field_accessCapAdditionsAfterRel10.is_value()); } int AccessCapAdditionsAfterRel9__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel10.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel9__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel10 := "); field_accessCapAdditionsRel10.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel10 := "); field_accessCapAdditionsAfterRel10.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel9__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel10().is_bound()) accessCapAdditionsRel10().set_implicit_omit(); if (!accessCapAdditionsAfterRel10().is_bound()) accessCapAdditionsAfterRel10() = OMIT_VALUE; else accessCapAdditionsAfterRel10().set_implicit_omit(); } void AccessCapAdditionsAfterRel9__BSSGP::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) accessCapAdditionsRel10().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel10().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(), "accessCapAdditionsRel10")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel10().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel10")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel10().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP"); } } void AccessCapAdditionsAfterRel9__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel10.encode_text(text_buf); field_accessCapAdditionsAfterRel10.encode_text(text_buf); } void AccessCapAdditionsAfterRel9__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel10.decode_text(text_buf); field_accessCapAdditionsAfterRel10.decode_text(text_buf); } void AccessCapAdditionsAfterRel9__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel9__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel9__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel10__BSSGP_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel10.RAW_decode(AccessCapAdditionsRel10__BSSGP_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel10 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel10__BSSGP_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel10().RAW_decode(AccessCapAdditionsAfterRel10__BSSGP_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel10 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel10=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel9__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel10__BSSGP_descr_.raw); if (field_accessCapAdditionsAfterRel10.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel10__BSSGP_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel10.RAW_encode(AccessCapAdditionsRel10__BSSGP_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel10.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel10().RAW_encode(AccessCapAdditionsAfterRel10__BSSGP_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel9__BSSGP_template::single_value_struct { AccessCapAdditionsRel10__BSSGP_template field_accessCapAdditionsRel10; AccessCapAdditionsAfterRel10__BSSGP_template field_accessCapAdditionsAfterRel10; }; void AccessCapAdditionsAfterRel9__BSSGP_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_accessCapAdditionsRel10 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel10 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel9__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel9__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel10().is_bound()) { single_value->field_accessCapAdditionsRel10 = other_value.accessCapAdditionsRel10(); } else { single_value->field_accessCapAdditionsRel10.clean_up(); } if (other_value.accessCapAdditionsAfterRel10().is_bound()) { if (other_value.accessCapAdditionsAfterRel10().ispresent()) single_value->field_accessCapAdditionsAfterRel10 = other_value.accessCapAdditionsAfterRel10()(); else single_value->field_accessCapAdditionsAfterRel10 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel10.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel9__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel9__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel10().get_selection()) { single_value->field_accessCapAdditionsRel10 = other_value.accessCapAdditionsRel10(); } else { single_value->field_accessCapAdditionsRel10.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel10().get_selection()) { single_value->field_accessCapAdditionsAfterRel10 = other_value.accessCapAdditionsAfterRel10(); } else { single_value->field_accessCapAdditionsAfterRel10.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 AccessCapAdditionsAfterRel9__BSSGP_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 AccessCapAdditionsAfterRel9__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel9__BSSGP_template::AccessCapAdditionsAfterRel9__BSSGP_template() { } AccessCapAdditionsAfterRel9__BSSGP_template::AccessCapAdditionsAfterRel9__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel9__BSSGP_template::AccessCapAdditionsAfterRel9__BSSGP_template(const AccessCapAdditionsAfterRel9__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel9__BSSGP_template::AccessCapAdditionsAfterRel9__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel9__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel9__BSSGP_template::AccessCapAdditionsAfterRel9__BSSGP_template(AccessCapAdditionsAfterRel9__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel9__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel9__BSSGP_template::AccessCapAdditionsAfterRel9__BSSGP_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; } AccessCapAdditionsAfterRel9__BSSGP_template::AccessCapAdditionsAfterRel9__BSSGP_template(const AccessCapAdditionsAfterRel9__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel9__BSSGP_template::~AccessCapAdditionsAfterRel9__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel9__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel9__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_template::operator=(const AccessCapAdditionsAfterRel9__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel9__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel9__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); } return *this; } AccessCapAdditionsAfterRel9__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_template::operator=(const AccessCapAdditionsAfterRel9__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel9__BSSGP_template::match(const AccessCapAdditionsAfterRel9__BSSGP& 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.accessCapAdditionsRel10().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel10.match(other_value.accessCapAdditionsRel10(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel10().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel10().ispresent() ? !single_value->field_accessCapAdditionsAfterRel10.match((const AccessCapAdditionsAfterRel10__BSSGP&)other_value.accessCapAdditionsAfterRel10(), legacy) : !single_value->field_accessCapAdditionsAfterRel10.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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel9__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel10.is_bound() || (single_value->field_accessCapAdditionsAfterRel10.is_omit() || single_value->field_accessCapAdditionsAfterRel10.is_bound()); } boolean AccessCapAdditionsAfterRel9__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel10.is_value() && (single_value->field_accessCapAdditionsAfterRel10.is_omit() || single_value->field_accessCapAdditionsAfterRel10.is_value()); } void AccessCapAdditionsAfterRel9__BSSGP_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; } AccessCapAdditionsAfterRel9__BSSGP AccessCapAdditionsAfterRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); AccessCapAdditionsAfterRel9__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel10.is_bound()) { ret_val.accessCapAdditionsRel10() = single_value->field_accessCapAdditionsRel10.valueof(); } if (single_value->field_accessCapAdditionsAfterRel10.is_omit()) ret_val.accessCapAdditionsAfterRel10() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel10.is_bound()) { ret_val.accessCapAdditionsAfterRel10() = single_value->field_accessCapAdditionsAfterRel10.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel9__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel9__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel10__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_template::accessCapAdditionsRel10() { set_specific(); return single_value->field_accessCapAdditionsRel10; } const AccessCapAdditionsRel10__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_template::accessCapAdditionsRel10() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel10 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); return single_value->field_accessCapAdditionsRel10; } AccessCapAdditionsAfterRel10__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_template::accessCapAdditionsAfterRel10() { set_specific(); return single_value->field_accessCapAdditionsAfterRel10; } const AccessCapAdditionsAfterRel10__BSSGP_template& AccessCapAdditionsAfterRel9__BSSGP_template::accessCapAdditionsAfterRel10() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel10 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); return single_value->field_accessCapAdditionsAfterRel10; } int AccessCapAdditionsAfterRel9__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel10.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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel9__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel10 := "); single_value->field_accessCapAdditionsRel10.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel10 := "); single_value->field_accessCapAdditionsAfterRel10.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 AccessCapAdditionsAfterRel9__BSSGP_template::log_match(const AccessCapAdditionsAfterRel9__BSSGP& 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_accessCapAdditionsRel10.match(match_value.accessCapAdditionsRel10(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel10"); single_value->field_accessCapAdditionsRel10.log_match(match_value.accessCapAdditionsRel10(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel10().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel10.match(match_value.accessCapAdditionsAfterRel10(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel10"); single_value->field_accessCapAdditionsAfterRel10.log_match(match_value.accessCapAdditionsAfterRel10(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel10.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel10 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel10.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("{ accessCapAdditionsRel10 := "); single_value->field_accessCapAdditionsRel10.log_match(match_value.accessCapAdditionsRel10(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel10 := "); if (match_value.accessCapAdditionsAfterRel10().ispresent()) { single_value->field_accessCapAdditionsAfterRel10.log_match(match_value.accessCapAdditionsAfterRel10(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel10.log(); if (single_value->field_accessCapAdditionsAfterRel10.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 AccessCapAdditionsAfterRel9__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel10.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel10.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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); } } void AccessCapAdditionsAfterRel9__BSSGP_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_accessCapAdditionsRel10.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel10.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 AccessCapAdditionsAfterRel9__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP."); } } void AccessCapAdditionsAfterRel9__BSSGP_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: { AccessCapAdditionsAfterRel9__BSSGP_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) accessCapAdditionsRel10().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel10().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(), "accessCapAdditionsRel10")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel10().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel10")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel10().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel9__BSSGP_template* precondition = new AccessCapAdditionsAfterRel9__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel9__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel9__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel9__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel9__BSSGP_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_accessCapAdditionsRel10.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP"); single_value->field_accessCapAdditionsAfterRel10.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel9_BSSGP"); } boolean AccessCapAdditionsAfterRel9__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel9__BSSGP_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) fANRCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iPACapability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gERANNetworkSharingSupport().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) eUTRAWidebandRSRQMeasurementsSupport().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(), "fANRCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fANRCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iPACapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iPACapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gERANNetworkSharingSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gERANNetworkSharingSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eUTRAWidebandRSRQMeasurementsSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRAWidebandRSRQMeasurementsSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel11_BSSGP"); } } void AccessCapAdditionsRel11__BSSGP::encode_text(Text_Buf& text_buf) const { field_fANRCapability.encode_text(text_buf); field_iPACapability.encode_text(text_buf); field_gERANNetworkSharingSupport.encode_text(text_buf); field_eUTRAWidebandRSRQMeasurementsSupport.encode_text(text_buf); } void AccessCapAdditionsRel11__BSSGP::decode_text(Text_Buf& text_buf) { field_fANRCapability.decode_text(text_buf); field_iPACapability.decode_text(text_buf); field_gERANNetworkSharingSupport.decode_text(text_buf); field_eUTRAWidebandRSRQMeasurementsSupport.decode_text(text_buf); } void AccessCapAdditionsRel11__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel11__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel11__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel11__BSSGP_fANRCapability_descr_.raw->forceomit); decoded_field_length = field_fANRCapability.RAW_decode(AccessCapAdditionsRel11__BSSGP_fANRCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel11__BSSGP_iPACapability_descr_.raw->forceomit); decoded_field_length = field_iPACapability.RAW_decode(AccessCapAdditionsRel11__BSSGP_iPACapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel11__BSSGP_gERANNetworkSharingSupport_descr_.raw->forceomit); decoded_field_length = field_gERANNetworkSharingSupport.RAW_decode(AccessCapAdditionsRel11__BSSGP_gERANNetworkSharingSupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel11__BSSGP_eUTRAWidebandRSRQMeasurementsSupport_descr_.raw->forceomit); decoded_field_length = field_eUTRAWidebandRSRQMeasurementsSupport.RAW_decode(AccessCapAdditionsRel11__BSSGP_eUTRAWidebandRSRQMeasurementsSupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel11__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel11__BSSGP_fANRCapability_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel11__BSSGP_iPACapability_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel11__BSSGP_gERANNetworkSharingSupport_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel11__BSSGP_eUTRAWidebandRSRQMeasurementsSupport_descr_.raw); encoded_length += field_fANRCapability.RAW_encode(AccessCapAdditionsRel11__BSSGP_fANRCapability_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_iPACapability.RAW_encode(AccessCapAdditionsRel11__BSSGP_iPACapability_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_gERANNetworkSharingSupport.RAW_encode(AccessCapAdditionsRel11__BSSGP_gERANNetworkSharingSupport_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_eUTRAWidebandRSRQMeasurementsSupport.RAW_encode(AccessCapAdditionsRel11__BSSGP_eUTRAWidebandRSRQMeasurementsSupport_descr_, *myleaf.body.node.nodes[3]); return myleaf.length = encoded_length; } struct AccessCapAdditionsRel11__BSSGP_template::single_value_struct { BITSTRING_template field_fANRCapability; BITSTRING_template field_iPACapability; BITSTRING_template field_gERANNetworkSharingSupport; BITSTRING_template field_eUTRAWidebandRSRQMeasurementsSupport; }; void AccessCapAdditionsRel11__BSSGP_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_fANRCapability = ANY_VALUE; single_value->field_iPACapability = ANY_VALUE; single_value->field_gERANNetworkSharingSupport = ANY_VALUE; single_value->field_eUTRAWidebandRSRQMeasurementsSupport = ANY_VALUE; } } } void AccessCapAdditionsRel11__BSSGP_template::copy_value(const AccessCapAdditionsRel11__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.fANRCapability().is_bound()) { single_value->field_fANRCapability = other_value.fANRCapability(); } else { single_value->field_fANRCapability.clean_up(); } if (other_value.iPACapability().is_bound()) { single_value->field_iPACapability = other_value.iPACapability(); } else { single_value->field_iPACapability.clean_up(); } if (other_value.gERANNetworkSharingSupport().is_bound()) { single_value->field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport(); } else { single_value->field_gERANNetworkSharingSupport.clean_up(); } if (other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) { single_value->field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport(); } else { single_value->field_eUTRAWidebandRSRQMeasurementsSupport.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel11__BSSGP_template::copy_template(const AccessCapAdditionsRel11__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.fANRCapability().get_selection()) { single_value->field_fANRCapability = other_value.fANRCapability(); } else { single_value->field_fANRCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.iPACapability().get_selection()) { single_value->field_iPACapability = other_value.iPACapability(); } else { single_value->field_iPACapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gERANNetworkSharingSupport().get_selection()) { single_value->field_gERANNetworkSharingSupport = other_value.gERANNetworkSharingSupport(); } else { single_value->field_gERANNetworkSharingSupport.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eUTRAWidebandRSRQMeasurementsSupport().get_selection()) { single_value->field_eUTRAWidebandRSRQMeasurementsSupport = other_value.eUTRAWidebandRSRQMeasurementsSupport(); } else { single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11__BSSGP_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 AccessCapAdditionsRel11__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel11__BSSGP_template::AccessCapAdditionsRel11__BSSGP_template() { } AccessCapAdditionsRel11__BSSGP_template::AccessCapAdditionsRel11__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel11__BSSGP_template::AccessCapAdditionsRel11__BSSGP_template(const AccessCapAdditionsRel11__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel11__BSSGP_template::AccessCapAdditionsRel11__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel11__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel11__BSSGP_template::AccessCapAdditionsRel11__BSSGP_template(AccessCapAdditionsRel11__BSSGP_template* p_precondition, AccessCapAdditionsRel11__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel11__BSSGP_template::AccessCapAdditionsRel11__BSSGP_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; } AccessCapAdditionsRel11__BSSGP_template::AccessCapAdditionsRel11__BSSGP_template(const AccessCapAdditionsRel11__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel11__BSSGP_template::~AccessCapAdditionsRel11__BSSGP_template() { clean_up(); } AccessCapAdditionsRel11__BSSGP_template& AccessCapAdditionsRel11__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel11__BSSGP_template& AccessCapAdditionsRel11__BSSGP_template::operator=(const AccessCapAdditionsRel11__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel11__BSSGP_template& AccessCapAdditionsRel11__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel11__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); } return *this; } AccessCapAdditionsRel11__BSSGP_template& AccessCapAdditionsRel11__BSSGP_template::operator=(const AccessCapAdditionsRel11__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel11__BSSGP_template::match(const AccessCapAdditionsRel11__BSSGP& 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.fANRCapability().is_bound()) return FALSE; if(!single_value->field_fANRCapability.match(other_value.fANRCapability(), legacy))return FALSE; if(!other_value.iPACapability().is_bound()) return FALSE; if(!single_value->field_iPACapability.match(other_value.iPACapability(), legacy))return FALSE; if(!other_value.gERANNetworkSharingSupport().is_bound()) return FALSE; if(!single_value->field_gERANNetworkSharingSupport.match(other_value.gERANNetworkSharingSupport(), legacy))return FALSE; if(!other_value.eUTRAWidebandRSRQMeasurementsSupport().is_bound()) return FALSE; if(!single_value->field_eUTRAWidebandRSRQMeasurementsSupport.match(other_value.eUTRAWidebandRSRQMeasurementsSupport(), 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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel11__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_fANRCapability.is_bound() || single_value->field_iPACapability.is_bound() || single_value->field_gERANNetworkSharingSupport.is_bound() || single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_bound(); } boolean AccessCapAdditionsRel11__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_fANRCapability.is_value() && single_value->field_iPACapability.is_value() && single_value->field_gERANNetworkSharingSupport.is_value() && single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_value(); } void AccessCapAdditionsRel11__BSSGP_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; } AccessCapAdditionsRel11__BSSGP AccessCapAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); AccessCapAdditionsRel11__BSSGP ret_val; if (single_value->field_fANRCapability.is_bound()) { ret_val.fANRCapability() = single_value->field_fANRCapability.valueof(); } if (single_value->field_iPACapability.is_bound()) { ret_val.iPACapability() = single_value->field_iPACapability.valueof(); } if (single_value->field_gERANNetworkSharingSupport.is_bound()) { ret_val.gERANNetworkSharingSupport() = single_value->field_gERANNetworkSharingSupport.valueof(); } if (single_value->field_eUTRAWidebandRSRQMeasurementsSupport.is_bound()) { ret_val.eUTRAWidebandRSRQMeasurementsSupport() = single_value->field_eUTRAWidebandRSRQMeasurementsSupport.valueof(); } return ret_val; } void AccessCapAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel11__BSSGP_template[list_length]; } AccessCapAdditionsRel11__BSSGP_template& AccessCapAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel11__BSSGP_template::fANRCapability() { set_specific(); return single_value->field_fANRCapability; } const BITSTRING_template& AccessCapAdditionsRel11__BSSGP_template::fANRCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field fANRCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); return single_value->field_fANRCapability; } BITSTRING_template& AccessCapAdditionsRel11__BSSGP_template::iPACapability() { set_specific(); return single_value->field_iPACapability; } const BITSTRING_template& AccessCapAdditionsRel11__BSSGP_template::iPACapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iPACapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); return single_value->field_iPACapability; } BITSTRING_template& AccessCapAdditionsRel11__BSSGP_template::gERANNetworkSharingSupport() { set_specific(); return single_value->field_gERANNetworkSharingSupport; } const BITSTRING_template& AccessCapAdditionsRel11__BSSGP_template::gERANNetworkSharingSupport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gERANNetworkSharingSupport of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); return single_value->field_gERANNetworkSharingSupport; } BITSTRING_template& AccessCapAdditionsRel11__BSSGP_template::eUTRAWidebandRSRQMeasurementsSupport() { set_specific(); return single_value->field_eUTRAWidebandRSRQMeasurementsSupport; } const BITSTRING_template& AccessCapAdditionsRel11__BSSGP_template::eUTRAWidebandRSRQMeasurementsSupport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eUTRAWidebandRSRQMeasurementsSupport of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); return single_value->field_eUTRAWidebandRSRQMeasurementsSupport; } int AccessCapAdditionsRel11__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); } return 0; } void AccessCapAdditionsRel11__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ fANRCapability := "); single_value->field_fANRCapability.log(); TTCN_Logger::log_event_str(", iPACapability := "); single_value->field_iPACapability.log(); TTCN_Logger::log_event_str(", gERANNetworkSharingSupport := "); single_value->field_gERANNetworkSharingSupport.log(); TTCN_Logger::log_event_str(", eUTRAWidebandRSRQMeasurementsSupport := "); single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11__BSSGP_template::log_match(const AccessCapAdditionsRel11__BSSGP& 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_fANRCapability.match(match_value.fANRCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".fANRCapability"); single_value->field_fANRCapability.log_match(match_value.fANRCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_iPACapability.match(match_value.iPACapability(), legacy)){ TTCN_Logger::log_logmatch_info(".iPACapability"); single_value->field_iPACapability.log_match(match_value.iPACapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gERANNetworkSharingSupport.match(match_value.gERANNetworkSharingSupport(), legacy)){ TTCN_Logger::log_logmatch_info(".gERANNetworkSharingSupport"); single_value->field_gERANNetworkSharingSupport.log_match(match_value.gERANNetworkSharingSupport(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eUTRAWidebandRSRQMeasurementsSupport.match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), legacy)){ TTCN_Logger::log_logmatch_info(".eUTRAWidebandRSRQMeasurementsSupport"); single_value->field_eUTRAWidebandRSRQMeasurementsSupport.log_match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), 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("{ fANRCapability := "); single_value->field_fANRCapability.log_match(match_value.fANRCapability(), legacy); TTCN_Logger::log_event_str(", iPACapability := "); single_value->field_iPACapability.log_match(match_value.iPACapability(), legacy); TTCN_Logger::log_event_str(", gERANNetworkSharingSupport := "); single_value->field_gERANNetworkSharingSupport.log_match(match_value.gERANNetworkSharingSupport(), legacy); TTCN_Logger::log_event_str(", eUTRAWidebandRSRQMeasurementsSupport := "); single_value->field_eUTRAWidebandRSRQMeasurementsSupport.log_match(match_value.eUTRAWidebandRSRQMeasurementsSupport(), 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 AccessCapAdditionsRel11__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_fANRCapability.encode_text(text_buf); single_value->field_iPACapability.encode_text(text_buf); single_value->field_gERANNetworkSharingSupport.encode_text(text_buf); single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); } } void AccessCapAdditionsRel11__BSSGP_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_fANRCapability.decode_text(text_buf); single_value->field_iPACapability.decode_text(text_buf); single_value->field_gERANNetworkSharingSupport.decode_text(text_buf); single_value->field_eUTRAWidebandRSRQMeasurementsSupport.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 AccessCapAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel11_BSSGP."); } } void AccessCapAdditionsRel11__BSSGP_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: { AccessCapAdditionsRel11__BSSGP_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) fANRCapability().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) iPACapability().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gERANNetworkSharingSupport().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) eUTRAWidebandRSRQMeasurementsSupport().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(), "fANRCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { fANRCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "iPACapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iPACapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gERANNetworkSharingSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gERANNetworkSharingSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eUTRAWidebandRSRQMeasurementsSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRAWidebandRSRQMeasurementsSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel11_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel11__BSSGP_template* precondition = new AccessCapAdditionsRel11__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel11__BSSGP_template* implied_template = new AccessCapAdditionsRel11__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel11__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel11_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel11__BSSGP_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_fANRCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel11_BSSGP"); single_value->field_iPACapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel11_BSSGP"); single_value->field_gERANNetworkSharingSupport.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel11_BSSGP"); single_value->field_eUTRAWidebandRSRQMeasurementsSupport.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel11_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel11_BSSGP"); } boolean AccessCapAdditionsRel11__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel11__BSSGP_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_accessCapAdditionsAfterRel11) : field_accessCapAdditionsRel11(par_accessCapAdditionsRel11), field_accessCapAdditionsAfterRel11(par_accessCapAdditionsAfterRel11) { } AccessCapAdditionsAfterRel10__BSSGP::AccessCapAdditionsAfterRel10__BSSGP(const AccessCapAdditionsAfterRel10__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); if (other_value.accessCapAdditionsRel11().is_bound()) field_accessCapAdditionsRel11 = other_value.accessCapAdditionsRel11(); else field_accessCapAdditionsRel11.clean_up(); if (other_value.accessCapAdditionsAfterRel11().is_bound()) field_accessCapAdditionsAfterRel11 = other_value.accessCapAdditionsAfterRel11(); else field_accessCapAdditionsAfterRel11.clean_up(); } void AccessCapAdditionsAfterRel10__BSSGP::clean_up() { field_accessCapAdditionsRel11.clean_up(); field_accessCapAdditionsAfterRel11.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel10__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel10__BSSGP_descr_; } AccessCapAdditionsAfterRel10__BSSGP& AccessCapAdditionsAfterRel10__BSSGP::operator=(const AccessCapAdditionsAfterRel10__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); if (other_value.accessCapAdditionsRel11().is_bound()) field_accessCapAdditionsRel11 = other_value.accessCapAdditionsRel11(); else field_accessCapAdditionsRel11.clean_up(); if (other_value.accessCapAdditionsAfterRel11().is_bound()) field_accessCapAdditionsAfterRel11 = other_value.accessCapAdditionsAfterRel11(); else field_accessCapAdditionsAfterRel11.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel10__BSSGP::operator==(const AccessCapAdditionsAfterRel10__BSSGP& other_value) const { return field_accessCapAdditionsRel11==other_value.field_accessCapAdditionsRel11 && field_accessCapAdditionsAfterRel11==other_value.field_accessCapAdditionsAfterRel11; } boolean AccessCapAdditionsAfterRel10__BSSGP::is_bound() const { return (field_accessCapAdditionsRel11.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel11.get_selection() || field_accessCapAdditionsAfterRel11.is_bound()); } boolean AccessCapAdditionsAfterRel10__BSSGP::is_value() const { return field_accessCapAdditionsRel11.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel11.get_selection() || field_accessCapAdditionsAfterRel11.is_value()); } int AccessCapAdditionsAfterRel10__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel11.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel10__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel11 := "); field_accessCapAdditionsRel11.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel11 := "); field_accessCapAdditionsAfterRel11.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel10__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel11().is_bound()) accessCapAdditionsRel11().set_implicit_omit(); if (!accessCapAdditionsAfterRel11().is_bound()) accessCapAdditionsAfterRel11() = OMIT_VALUE; else accessCapAdditionsAfterRel11().set_implicit_omit(); } void AccessCapAdditionsAfterRel10__BSSGP::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) accessCapAdditionsRel11().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel11().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(), "accessCapAdditionsRel11")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel11().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel11")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel11().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP"); } } void AccessCapAdditionsAfterRel10__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel11.encode_text(text_buf); field_accessCapAdditionsAfterRel11.encode_text(text_buf); } void AccessCapAdditionsAfterRel10__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel11.decode_text(text_buf); field_accessCapAdditionsAfterRel11.decode_text(text_buf); } void AccessCapAdditionsAfterRel10__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel10__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel10__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel10__BSSGP_accessCapAdditionsRel11_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel11.RAW_decode(AccessCapAdditionsAfterRel10__BSSGP_accessCapAdditionsRel11_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel11 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel10__BSSGP_accessCapAdditionsAfterRel11_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel11().RAW_decode(AccessCapAdditionsAfterRel10__BSSGP_accessCapAdditionsAfterRel11_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel11 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel11=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel10__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsAfterRel10__BSSGP_accessCapAdditionsRel11_descr_.raw); if (field_accessCapAdditionsAfterRel11.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel10__BSSGP_accessCapAdditionsAfterRel11_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel11.RAW_encode(AccessCapAdditionsAfterRel10__BSSGP_accessCapAdditionsRel11_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel11.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel11().RAW_encode(AccessCapAdditionsAfterRel10__BSSGP_accessCapAdditionsAfterRel11_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel10__BSSGP_template::single_value_struct { AccessCapAdditionsRel11__BSSGP_template field_accessCapAdditionsRel11; AccessCapAdditionsAfterRel11__BSSGP_template field_accessCapAdditionsAfterRel11; }; void AccessCapAdditionsAfterRel10__BSSGP_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_accessCapAdditionsRel11 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel11 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel10__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel10__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel11().is_bound()) { single_value->field_accessCapAdditionsRel11 = other_value.accessCapAdditionsRel11(); } else { single_value->field_accessCapAdditionsRel11.clean_up(); } if (other_value.accessCapAdditionsAfterRel11().is_bound()) { if (other_value.accessCapAdditionsAfterRel11().ispresent()) single_value->field_accessCapAdditionsAfterRel11 = other_value.accessCapAdditionsAfterRel11()(); else single_value->field_accessCapAdditionsAfterRel11 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel11.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel10__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel10__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel11().get_selection()) { single_value->field_accessCapAdditionsRel11 = other_value.accessCapAdditionsRel11(); } else { single_value->field_accessCapAdditionsRel11.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel11().get_selection()) { single_value->field_accessCapAdditionsAfterRel11 = other_value.accessCapAdditionsAfterRel11(); } else { single_value->field_accessCapAdditionsAfterRel11.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 AccessCapAdditionsAfterRel10__BSSGP_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 AccessCapAdditionsAfterRel10__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel10__BSSGP_template::AccessCapAdditionsAfterRel10__BSSGP_template() { } AccessCapAdditionsAfterRel10__BSSGP_template::AccessCapAdditionsAfterRel10__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel10__BSSGP_template::AccessCapAdditionsAfterRel10__BSSGP_template(const AccessCapAdditionsAfterRel10__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel10__BSSGP_template::AccessCapAdditionsAfterRel10__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel10__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel10__BSSGP_template::AccessCapAdditionsAfterRel10__BSSGP_template(AccessCapAdditionsAfterRel10__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel10__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel10__BSSGP_template::AccessCapAdditionsAfterRel10__BSSGP_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; } AccessCapAdditionsAfterRel10__BSSGP_template::AccessCapAdditionsAfterRel10__BSSGP_template(const AccessCapAdditionsAfterRel10__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel10__BSSGP_template::~AccessCapAdditionsAfterRel10__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel10__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel10__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_template::operator=(const AccessCapAdditionsAfterRel10__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel10__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel10__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); } return *this; } AccessCapAdditionsAfterRel10__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_template::operator=(const AccessCapAdditionsAfterRel10__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel10__BSSGP_template::match(const AccessCapAdditionsAfterRel10__BSSGP& 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.accessCapAdditionsRel11().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel11.match(other_value.accessCapAdditionsRel11(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel11().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel11().ispresent() ? !single_value->field_accessCapAdditionsAfterRel11.match((const AccessCapAdditionsAfterRel11__BSSGP&)other_value.accessCapAdditionsAfterRel11(), legacy) : !single_value->field_accessCapAdditionsAfterRel11.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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel10__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel11.is_bound() || (single_value->field_accessCapAdditionsAfterRel11.is_omit() || single_value->field_accessCapAdditionsAfterRel11.is_bound()); } boolean AccessCapAdditionsAfterRel10__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel11.is_value() && (single_value->field_accessCapAdditionsAfterRel11.is_omit() || single_value->field_accessCapAdditionsAfterRel11.is_value()); } void AccessCapAdditionsAfterRel10__BSSGP_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; } AccessCapAdditionsAfterRel10__BSSGP AccessCapAdditionsAfterRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); AccessCapAdditionsAfterRel10__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel11.is_bound()) { ret_val.accessCapAdditionsRel11() = single_value->field_accessCapAdditionsRel11.valueof(); } if (single_value->field_accessCapAdditionsAfterRel11.is_omit()) ret_val.accessCapAdditionsAfterRel11() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel11.is_bound()) { ret_val.accessCapAdditionsAfterRel11() = single_value->field_accessCapAdditionsAfterRel11.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel10__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel10__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel11__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_template::accessCapAdditionsRel11() { set_specific(); return single_value->field_accessCapAdditionsRel11; } const AccessCapAdditionsRel11__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_template::accessCapAdditionsRel11() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel11 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); return single_value->field_accessCapAdditionsRel11; } AccessCapAdditionsAfterRel11__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_template::accessCapAdditionsAfterRel11() { set_specific(); return single_value->field_accessCapAdditionsAfterRel11; } const AccessCapAdditionsAfterRel11__BSSGP_template& AccessCapAdditionsAfterRel10__BSSGP_template::accessCapAdditionsAfterRel11() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel11 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); return single_value->field_accessCapAdditionsAfterRel11; } int AccessCapAdditionsAfterRel10__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel11.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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel10__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel11 := "); single_value->field_accessCapAdditionsRel11.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel11 := "); single_value->field_accessCapAdditionsAfterRel11.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 AccessCapAdditionsAfterRel10__BSSGP_template::log_match(const AccessCapAdditionsAfterRel10__BSSGP& 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_accessCapAdditionsRel11.match(match_value.accessCapAdditionsRel11(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel11"); single_value->field_accessCapAdditionsRel11.log_match(match_value.accessCapAdditionsRel11(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel11().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel11.match(match_value.accessCapAdditionsAfterRel11(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel11"); single_value->field_accessCapAdditionsAfterRel11.log_match(match_value.accessCapAdditionsAfterRel11(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel11.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel11 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel11.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("{ accessCapAdditionsRel11 := "); single_value->field_accessCapAdditionsRel11.log_match(match_value.accessCapAdditionsRel11(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel11 := "); if (match_value.accessCapAdditionsAfterRel11().ispresent()) { single_value->field_accessCapAdditionsAfterRel11.log_match(match_value.accessCapAdditionsAfterRel11(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel11.log(); if (single_value->field_accessCapAdditionsAfterRel11.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 AccessCapAdditionsAfterRel10__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel11.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel11.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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); } } void AccessCapAdditionsAfterRel10__BSSGP_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_accessCapAdditionsRel11.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel11.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 AccessCapAdditionsAfterRel10__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP."); } } void AccessCapAdditionsAfterRel10__BSSGP_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: { AccessCapAdditionsAfterRel10__BSSGP_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) accessCapAdditionsRel11().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel11().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(), "accessCapAdditionsRel11")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel11().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel11")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel11().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel10__BSSGP_template* precondition = new AccessCapAdditionsAfterRel10__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel10__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel10__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel10__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel10__BSSGP_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_accessCapAdditionsRel11.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP"); single_value->field_accessCapAdditionsAfterRel11.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel10_BSSGP"); } boolean AccessCapAdditionsAfterRel10__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel10__BSSGP_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_dLMCCapability, const BITSTRING& par_extendedTSCSetCapabilitySupport) : field_uTRAMultipleFrequencyBandIndicatorsSupport(par_uTRAMultipleFrequencyBandIndicatorsSupport), field_eUTRAMultipleFrequencyBandIndicatorsSupport(par_eUTRAMultipleFrequencyBandIndicatorsSupport), field_presenceBitDLMCCapability(par_presenceBitDLMCCapability), field_dLMCCapability(par_dLMCCapability), field_extendedTSCSetCapabilitySupport(par_extendedTSCSetCapabilitySupport) { } AccessCapAdditionsRel12__BSSGP::AccessCapAdditionsRel12__BSSGP(const AccessCapAdditionsRel12__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport(); else field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport(); else field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); if (other_value.presenceBitDLMCCapability().is_bound()) field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability(); else field_presenceBitDLMCCapability.clean_up(); if (other_value.dLMCCapability().is_bound()) field_dLMCCapability = other_value.dLMCCapability(); else field_dLMCCapability.clean_up(); if (other_value.extendedTSCSetCapabilitySupport().is_bound()) field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport(); else field_extendedTSCSetCapabilitySupport.clean_up(); } void AccessCapAdditionsRel12__BSSGP::clean_up() { field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); field_presenceBitDLMCCapability.clean_up(); field_dLMCCapability.clean_up(); field_extendedTSCSetCapabilitySupport.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsRel12__BSSGP::get_descriptor() const { return &AccessCapAdditionsRel12__BSSGP_descr_; } AccessCapAdditionsRel12__BSSGP& AccessCapAdditionsRel12__BSSGP::operator=(const AccessCapAdditionsRel12__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport(); else field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport(); else field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); if (other_value.presenceBitDLMCCapability().is_bound()) field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability(); else field_presenceBitDLMCCapability.clean_up(); if (other_value.dLMCCapability().is_bound()) field_dLMCCapability = other_value.dLMCCapability(); else field_dLMCCapability.clean_up(); if (other_value.extendedTSCSetCapabilitySupport().is_bound()) field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport(); else field_extendedTSCSetCapabilitySupport.clean_up(); } return *this; } boolean AccessCapAdditionsRel12__BSSGP::operator==(const AccessCapAdditionsRel12__BSSGP& other_value) const { return field_uTRAMultipleFrequencyBandIndicatorsSupport==other_value.field_uTRAMultipleFrequencyBandIndicatorsSupport && field_eUTRAMultipleFrequencyBandIndicatorsSupport==other_value.field_eUTRAMultipleFrequencyBandIndicatorsSupport && field_presenceBitDLMCCapability==other_value.field_presenceBitDLMCCapability && field_dLMCCapability==other_value.field_dLMCCapability && field_extendedTSCSetCapabilitySupport==other_value.field_extendedTSCSetCapabilitySupport; } boolean AccessCapAdditionsRel12__BSSGP::is_bound() const { return (field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound()) || (field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound()) || (field_presenceBitDLMCCapability.is_bound()) || (OPTIONAL_OMIT == field_dLMCCapability.get_selection() || field_dLMCCapability.is_bound()) || (field_extendedTSCSetCapabilitySupport.is_bound()); } boolean AccessCapAdditionsRel12__BSSGP::is_value() const { return field_uTRAMultipleFrequencyBandIndicatorsSupport.is_value() && field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_value() && field_presenceBitDLMCCapability.is_value() && (OPTIONAL_OMIT == field_dLMCCapability.get_selection() || field_dLMCCapability.is_value()) && field_extendedTSCSetCapabilitySupport.is_value(); } int AccessCapAdditionsRel12__BSSGP::size_of() const { int ret_val = 4; if (field_dLMCCapability.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsRel12__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ uTRAMultipleFrequencyBandIndicatorsSupport := "); field_uTRAMultipleFrequencyBandIndicatorsSupport.log(); TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := "); field_eUTRAMultipleFrequencyBandIndicatorsSupport.log(); TTCN_Logger::log_event_str(", presenceBitDLMCCapability := "); field_presenceBitDLMCCapability.log(); TTCN_Logger::log_event_str(", dLMCCapability := "); field_dLMCCapability.log(); TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := "); field_extendedTSCSetCapabilitySupport.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsRel12__BSSGP::set_implicit_omit() { if (uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) uTRAMultipleFrequencyBandIndicatorsSupport().set_implicit_omit(); if (eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) eUTRAMultipleFrequencyBandIndicatorsSupport().set_implicit_omit(); if (presenceBitDLMCCapability().is_bound()) presenceBitDLMCCapability().set_implicit_omit(); if (!dLMCCapability().is_bound()) dLMCCapability() = OMIT_VALUE; else dLMCCapability().set_implicit_omit(); if (extendedTSCSetCapabilitySupport().is_bound()) extendedTSCSetCapabilitySupport().set_implicit_omit(); } void AccessCapAdditionsRel12__BSSGP::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) uTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDLMCCapability().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCCapability().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSetCapabilitySupport().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(), "uTRAMultipleFrequencyBandIndicatorsSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { uTRAMultipleFrequencyBandIndicatorsSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eUTRAMultipleFrequencyBandIndicatorsSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRAMultipleFrequencyBandIndicatorsSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDLMCCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDLMCCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extendedTSCSetCapabilitySupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extendedTSCSetCapabilitySupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsRel12_BSSGP"); } } void AccessCapAdditionsRel12__BSSGP::encode_text(Text_Buf& text_buf) const { field_uTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf); field_eUTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf); field_presenceBitDLMCCapability.encode_text(text_buf); field_dLMCCapability.encode_text(text_buf); field_extendedTSCSetCapabilitySupport.encode_text(text_buf); } void AccessCapAdditionsRel12__BSSGP::decode_text(Text_Buf& text_buf) { field_uTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf); field_eUTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf); field_presenceBitDLMCCapability.decode_text(text_buf); field_dLMCCapability.decode_text(text_buf); field_extendedTSCSetCapabilitySupport.decode_text(text_buf); } void AccessCapAdditionsRel12__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsRel12__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsRel12__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsRel12__BSSGP_uTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw->forceomit); decoded_field_length = field_uTRAMultipleFrequencyBandIndicatorsSupport.RAW_decode(AccessCapAdditionsRel12__BSSGP_uTRAMultipleFrequencyBandIndicatorsSupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsRel12__BSSGP_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw->forceomit); decoded_field_length = field_eUTRAMultipleFrequencyBandIndicatorsSupport.RAW_decode(AccessCapAdditionsRel12__BSSGP_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapAdditionsRel12__BSSGP_presenceBitDLMCCapability_descr_.raw->forceomit); decoded_field_length = field_presenceBitDLMCCapability.RAW_decode(AccessCapAdditionsRel12__BSSGP_presenceBitDLMCCapability_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceBitDLMCCapability == bs_0){ if (force_omit != NULL && (*force_omit)(3)) { field_dLMCCapability = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_3_force_omit(3, force_omit, AccessCapAdditionsRel12__BSSGP_dLMCCapability_descr_.raw->forceomit); decoded_field_length = field_dLMCCapability().RAW_decode(AccessCapAdditionsRel12__BSSGP_dLMCCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 1) { field_dLMCCapability = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_dLMCCapability=OMIT_VALUE; RAW_Force_Omit field_4_force_omit(4, force_omit, AccessCapAdditionsRel12__BSSGP_extendedTSCSetCapabilitySupport_descr_.raw->forceomit); decoded_field_length = field_extendedTSCSetCapabilitySupport.RAW_decode(AccessCapAdditionsRel12__BSSGP_extendedTSCSetCapabilitySupport_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsRel12__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 5; myleaf.body.node.nodes = init_nodes_of_enc_tree(5); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsRel12__BSSGP_uTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsRel12__BSSGP_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapAdditionsRel12__BSSGP_presenceBitDLMCCapability_descr_.raw); if (field_dLMCCapability.ispresent()) { myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, AccessCapAdditionsRel12__BSSGP_dLMCCapability_descr_.raw); } else myleaf.body.node.nodes[3] = NULL; myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, AccessCapAdditionsRel12__BSSGP_extendedTSCSetCapabilitySupport_descr_.raw); encoded_length += field_uTRAMultipleFrequencyBandIndicatorsSupport.RAW_encode(AccessCapAdditionsRel12__BSSGP_uTRAMultipleFrequencyBandIndicatorsSupport_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_eUTRAMultipleFrequencyBandIndicatorsSupport.RAW_encode(AccessCapAdditionsRel12__BSSGP_eUTRAMultipleFrequencyBandIndicatorsSupport_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_presenceBitDLMCCapability.RAW_encode(AccessCapAdditionsRel12__BSSGP_presenceBitDLMCCapability_descr_, *myleaf.body.node.nodes[2]); if (field_dLMCCapability.ispresent()) { encoded_length += field_dLMCCapability().RAW_encode(AccessCapAdditionsRel12__BSSGP_dLMCCapability_descr_, *myleaf.body.node.nodes[3]); } encoded_length += field_extendedTSCSetCapabilitySupport.RAW_encode(AccessCapAdditionsRel12__BSSGP_extendedTSCSetCapabilitySupport_descr_, *myleaf.body.node.nodes[4]); if (field_dLMCCapability.ispresent() && (field_presenceBitDLMCCapability != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={2}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(AccessCapAdditionsRel12__BSSGP_presenceBitDLMCCapability_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct AccessCapAdditionsRel12__BSSGP_template::single_value_struct { BITSTRING_template field_uTRAMultipleFrequencyBandIndicatorsSupport; BITSTRING_template field_eUTRAMultipleFrequencyBandIndicatorsSupport; BITSTRING_template field_presenceBitDLMCCapability; DLMCCapability__BSSGP_template field_dLMCCapability; BITSTRING_template field_extendedTSCSetCapabilitySupport; }; void AccessCapAdditionsRel12__BSSGP_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_uTRAMultipleFrequencyBandIndicatorsSupport = ANY_VALUE; single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = ANY_VALUE; single_value->field_presenceBitDLMCCapability = ANY_VALUE; single_value->field_dLMCCapability = ANY_OR_OMIT; single_value->field_extendedTSCSetCapabilitySupport = ANY_VALUE; } } } void AccessCapAdditionsRel12__BSSGP_template::copy_value(const AccessCapAdditionsRel12__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) { single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport(); } else { single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); } if (other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) { single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport(); } else { single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); } if (other_value.presenceBitDLMCCapability().is_bound()) { single_value->field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability(); } else { single_value->field_presenceBitDLMCCapability.clean_up(); } if (other_value.dLMCCapability().is_bound()) { if (other_value.dLMCCapability().ispresent()) single_value->field_dLMCCapability = other_value.dLMCCapability()(); else single_value->field_dLMCCapability = OMIT_VALUE; } else { single_value->field_dLMCCapability.clean_up(); } if (other_value.extendedTSCSetCapabilitySupport().is_bound()) { single_value->field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport(); } else { single_value->field_extendedTSCSetCapabilitySupport.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsRel12__BSSGP_template::copy_template(const AccessCapAdditionsRel12__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.uTRAMultipleFrequencyBandIndicatorsSupport().get_selection()) { single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport = other_value.uTRAMultipleFrequencyBandIndicatorsSupport(); } else { single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().get_selection()) { single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport = other_value.eUTRAMultipleFrequencyBandIndicatorsSupport(); } else { single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitDLMCCapability().get_selection()) { single_value->field_presenceBitDLMCCapability = other_value.presenceBitDLMCCapability(); } else { single_value->field_presenceBitDLMCCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dLMCCapability().get_selection()) { single_value->field_dLMCCapability = other_value.dLMCCapability(); } else { single_value->field_dLMCCapability.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.extendedTSCSetCapabilitySupport().get_selection()) { single_value->field_extendedTSCSetCapabilitySupport = other_value.extendedTSCSetCapabilitySupport(); } else { single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12__BSSGP_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 AccessCapAdditionsRel12__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsRel12__BSSGP_template::AccessCapAdditionsRel12__BSSGP_template() { } AccessCapAdditionsRel12__BSSGP_template::AccessCapAdditionsRel12__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsRel12__BSSGP_template::AccessCapAdditionsRel12__BSSGP_template(const AccessCapAdditionsRel12__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsRel12__BSSGP_template::AccessCapAdditionsRel12__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel12__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP from an unbound optional field."); } } AccessCapAdditionsRel12__BSSGP_template::AccessCapAdditionsRel12__BSSGP_template(AccessCapAdditionsRel12__BSSGP_template* p_precondition, AccessCapAdditionsRel12__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsRel12__BSSGP_template::AccessCapAdditionsRel12__BSSGP_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; } AccessCapAdditionsRel12__BSSGP_template::AccessCapAdditionsRel12__BSSGP_template(const AccessCapAdditionsRel12__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsRel12__BSSGP_template::~AccessCapAdditionsRel12__BSSGP_template() { clean_up(); } AccessCapAdditionsRel12__BSSGP_template& AccessCapAdditionsRel12__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsRel12__BSSGP_template& AccessCapAdditionsRel12__BSSGP_template::operator=(const AccessCapAdditionsRel12__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsRel12__BSSGP_template& AccessCapAdditionsRel12__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsRel12__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); } return *this; } AccessCapAdditionsRel12__BSSGP_template& AccessCapAdditionsRel12__BSSGP_template::operator=(const AccessCapAdditionsRel12__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsRel12__BSSGP_template::match(const AccessCapAdditionsRel12__BSSGP& 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.uTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) return FALSE; if(!single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.match(other_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy))return FALSE; if(!other_value.eUTRAMultipleFrequencyBandIndicatorsSupport().is_bound()) return FALSE; if(!single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.match(other_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy))return FALSE; if(!other_value.presenceBitDLMCCapability().is_bound()) return FALSE; if(!single_value->field_presenceBitDLMCCapability.match(other_value.presenceBitDLMCCapability(), legacy))return FALSE; if(!other_value.dLMCCapability().is_bound()) return FALSE; if((other_value.dLMCCapability().ispresent() ? !single_value->field_dLMCCapability.match((const DLMCCapability__BSSGP&)other_value.dLMCCapability(), legacy) : !single_value->field_dLMCCapability.match_omit(legacy)))return FALSE; if(!other_value.extendedTSCSetCapabilitySupport().is_bound()) return FALSE; if(!single_value->field_extendedTSCSetCapabilitySupport.match(other_value.extendedTSCSetCapabilitySupport(), 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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); } return FALSE; } boolean AccessCapAdditionsRel12__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound() || single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound() || single_value->field_presenceBitDLMCCapability.is_bound() || (single_value->field_dLMCCapability.is_omit() || single_value->field_dLMCCapability.is_bound()) || single_value->field_extendedTSCSetCapabilitySupport.is_bound(); } boolean AccessCapAdditionsRel12__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_value() && single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_value() && single_value->field_presenceBitDLMCCapability.is_value() && (single_value->field_dLMCCapability.is_omit() || single_value->field_dLMCCapability.is_value()) && single_value->field_extendedTSCSetCapabilitySupport.is_value(); } void AccessCapAdditionsRel12__BSSGP_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; } AccessCapAdditionsRel12__BSSGP AccessCapAdditionsRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); AccessCapAdditionsRel12__BSSGP ret_val; if (single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.is_bound()) { ret_val.uTRAMultipleFrequencyBandIndicatorsSupport() = single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.valueof(); } if (single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.is_bound()) { ret_val.eUTRAMultipleFrequencyBandIndicatorsSupport() = single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.valueof(); } if (single_value->field_presenceBitDLMCCapability.is_bound()) { ret_val.presenceBitDLMCCapability() = single_value->field_presenceBitDLMCCapability.valueof(); } if (single_value->field_dLMCCapability.is_omit()) ret_val.dLMCCapability() = OMIT_VALUE; else if (single_value->field_dLMCCapability.is_bound()) { ret_val.dLMCCapability() = single_value->field_dLMCCapability.valueof(); } if (single_value->field_extendedTSCSetCapabilitySupport.is_bound()) { ret_val.extendedTSCSetCapabilitySupport() = single_value->field_extendedTSCSetCapabilitySupport.valueof(); } return ret_val; } void AccessCapAdditionsRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsRel12__BSSGP_template[list_length]; } AccessCapAdditionsRel12__BSSGP_template& AccessCapAdditionsRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapAdditionsRel12__BSSGP_template::uTRAMultipleFrequencyBandIndicatorsSupport() { set_specific(); return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport; } const BITSTRING_template& AccessCapAdditionsRel12__BSSGP_template::uTRAMultipleFrequencyBandIndicatorsSupport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field uTRAMultipleFrequencyBandIndicatorsSupport of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); return single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport; } BITSTRING_template& AccessCapAdditionsRel12__BSSGP_template::eUTRAMultipleFrequencyBandIndicatorsSupport() { set_specific(); return single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport; } const BITSTRING_template& AccessCapAdditionsRel12__BSSGP_template::eUTRAMultipleFrequencyBandIndicatorsSupport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field eUTRAMultipleFrequencyBandIndicatorsSupport of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); return single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport; } BITSTRING_template& AccessCapAdditionsRel12__BSSGP_template::presenceBitDLMCCapability() { set_specific(); return single_value->field_presenceBitDLMCCapability; } const BITSTRING_template& AccessCapAdditionsRel12__BSSGP_template::presenceBitDLMCCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitDLMCCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); return single_value->field_presenceBitDLMCCapability; } DLMCCapability__BSSGP_template& AccessCapAdditionsRel12__BSSGP_template::dLMCCapability() { set_specific(); return single_value->field_dLMCCapability; } const DLMCCapability__BSSGP_template& AccessCapAdditionsRel12__BSSGP_template::dLMCCapability() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dLMCCapability of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); return single_value->field_dLMCCapability; } BITSTRING_template& AccessCapAdditionsRel12__BSSGP_template::extendedTSCSetCapabilitySupport() { set_specific(); return single_value->field_extendedTSCSetCapabilitySupport; } const BITSTRING_template& AccessCapAdditionsRel12__BSSGP_template::extendedTSCSetCapabilitySupport() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extendedTSCSetCapabilitySupport of a non-specific template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); return single_value->field_extendedTSCSetCapabilitySupport; } int AccessCapAdditionsRel12__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; if (single_value->field_dLMCCapability.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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP 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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); } return 0; } void AccessCapAdditionsRel12__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ uTRAMultipleFrequencyBandIndicatorsSupport := "); single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log(); TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := "); single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log(); TTCN_Logger::log_event_str(", presenceBitDLMCCapability := "); single_value->field_presenceBitDLMCCapability.log(); TTCN_Logger::log_event_str(", dLMCCapability := "); single_value->field_dLMCCapability.log(); TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := "); single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12__BSSGP_template::log_match(const AccessCapAdditionsRel12__BSSGP& 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_uTRAMultipleFrequencyBandIndicatorsSupport.match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy)){ TTCN_Logger::log_logmatch_info(".uTRAMultipleFrequencyBandIndicatorsSupport"); single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy)){ TTCN_Logger::log_logmatch_info(".eUTRAMultipleFrequencyBandIndicatorsSupport"); single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitDLMCCapability.match(match_value.presenceBitDLMCCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitDLMCCapability"); single_value->field_presenceBitDLMCCapability.log_match(match_value.presenceBitDLMCCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.dLMCCapability().ispresent()){ if(!single_value->field_dLMCCapability.match(match_value.dLMCCapability(), legacy)){ TTCN_Logger::log_logmatch_info(".dLMCCapability"); single_value->field_dLMCCapability.log_match(match_value.dLMCCapability(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_dLMCCapability.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".dLMCCapability := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_dLMCCapability.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_extendedTSCSetCapabilitySupport.match(match_value.extendedTSCSetCapabilitySupport(), legacy)){ TTCN_Logger::log_logmatch_info(".extendedTSCSetCapabilitySupport"); single_value->field_extendedTSCSetCapabilitySupport.log_match(match_value.extendedTSCSetCapabilitySupport(), 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("{ uTRAMultipleFrequencyBandIndicatorsSupport := "); single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.uTRAMultipleFrequencyBandIndicatorsSupport(), legacy); TTCN_Logger::log_event_str(", eUTRAMultipleFrequencyBandIndicatorsSupport := "); single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.log_match(match_value.eUTRAMultipleFrequencyBandIndicatorsSupport(), legacy); TTCN_Logger::log_event_str(", presenceBitDLMCCapability := "); single_value->field_presenceBitDLMCCapability.log_match(match_value.presenceBitDLMCCapability(), legacy); TTCN_Logger::log_event_str(", dLMCCapability := "); if (match_value.dLMCCapability().ispresent()) { single_value->field_dLMCCapability.log_match(match_value.dLMCCapability(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_dLMCCapability.log(); if (single_value->field_dLMCCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", extendedTSCSetCapabilitySupport := "); single_value->field_extendedTSCSetCapabilitySupport.log_match(match_value.extendedTSCSetCapabilitySupport(), 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 AccessCapAdditionsRel12__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_uTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf); single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.encode_text(text_buf); single_value->field_presenceBitDLMCCapability.encode_text(text_buf); single_value->field_dLMCCapability.encode_text(text_buf); single_value->field_extendedTSCSetCapabilitySupport.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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); } } void AccessCapAdditionsRel12__BSSGP_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_uTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf); single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.decode_text(text_buf); single_value->field_presenceBitDLMCCapability.decode_text(text_buf); single_value->field_dLMCCapability.decode_text(text_buf); single_value->field_extendedTSCSetCapabilitySupport.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 AccessCapAdditionsRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsRel12_BSSGP."); } } void AccessCapAdditionsRel12__BSSGP_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: { AccessCapAdditionsRel12__BSSGP_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) uTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) eUTRAMultipleFrequencyBandIndicatorsSupport().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceBitDLMCCapability().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCCapability().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) extendedTSCSetCapabilitySupport().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(), "uTRAMultipleFrequencyBandIndicatorsSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { uTRAMultipleFrequencyBandIndicatorsSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "eUTRAMultipleFrequencyBandIndicatorsSupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { eUTRAMultipleFrequencyBandIndicatorsSupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitDLMCCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitDLMCCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCCapability")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCCapability().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extendedTSCSetCapabilitySupport")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extendedTSCSetCapabilitySupport().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsRel12_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsRel12__BSSGP_template* precondition = new AccessCapAdditionsRel12__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsRel12__BSSGP_template* implied_template = new AccessCapAdditionsRel12__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsRel12__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsRel12_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsRel12__BSSGP_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_uTRAMultipleFrequencyBandIndicatorsSupport.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel12_BSSGP"); single_value->field_eUTRAMultipleFrequencyBandIndicatorsSupport.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel12_BSSGP"); single_value->field_presenceBitDLMCCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel12_BSSGP"); single_value->field_dLMCCapability.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel12_BSSGP"); single_value->field_extendedTSCSetCapabilitySupport.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsRel12_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsRel12_BSSGP"); } boolean AccessCapAdditionsRel12__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsRel12__BSSGP_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_dLMCBandReception, const BITSTRING& par_dLMCMaxBandwidth, const BITSTRING& par_dLMCMaxNumOfDownlinkTimeslots, const BITSTRING& par_dLMCMaxNumOfDownlinkCarriers) : field_presenceDLMC(par_presenceDLMC), field_dLMCBandReception(par_dLMCBandReception), field_dLMCMaxBandwidth(par_dLMCMaxBandwidth), field_dLMCMaxNumOfDownlinkTimeslots(par_dLMCMaxNumOfDownlinkTimeslots), field_dLMCMaxNumOfDownlinkCarriers(par_dLMCMaxNumOfDownlinkCarriers) { } DLMCCapability__BSSGP::DLMCCapability__BSSGP(const DLMCCapability__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.DLMCCapability_BSSGP."); if (other_value.presenceDLMC().is_bound()) field_presenceDLMC = other_value.presenceDLMC(); else field_presenceDLMC.clean_up(); if (other_value.dLMCBandReception().is_bound()) field_dLMCBandReception = other_value.dLMCBandReception(); else field_dLMCBandReception.clean_up(); if (other_value.dLMCMaxBandwidth().is_bound()) field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth(); else field_dLMCMaxBandwidth.clean_up(); if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots(); else field_dLMCMaxNumOfDownlinkTimeslots.clean_up(); if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers(); else field_dLMCMaxNumOfDownlinkCarriers.clean_up(); } void DLMCCapability__BSSGP::clean_up() { field_presenceDLMC.clean_up(); field_dLMCBandReception.clean_up(); field_dLMCMaxBandwidth.clean_up(); field_dLMCMaxNumOfDownlinkTimeslots.clean_up(); field_dLMCMaxNumOfDownlinkCarriers.clean_up(); } const TTCN_Typedescriptor_t* DLMCCapability__BSSGP::get_descriptor() const { return &DLMCCapability__BSSGP_descr_; } DLMCCapability__BSSGP& DLMCCapability__BSSGP::operator=(const DLMCCapability__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.DLMCCapability_BSSGP."); if (other_value.presenceDLMC().is_bound()) field_presenceDLMC = other_value.presenceDLMC(); else field_presenceDLMC.clean_up(); if (other_value.dLMCBandReception().is_bound()) field_dLMCBandReception = other_value.dLMCBandReception(); else field_dLMCBandReception.clean_up(); if (other_value.dLMCMaxBandwidth().is_bound()) field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth(); else field_dLMCMaxBandwidth.clean_up(); if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots(); else field_dLMCMaxNumOfDownlinkTimeslots.clean_up(); if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers(); else field_dLMCMaxNumOfDownlinkCarriers.clean_up(); } return *this; } boolean DLMCCapability__BSSGP::operator==(const DLMCCapability__BSSGP& other_value) const { return field_presenceDLMC==other_value.field_presenceDLMC && field_dLMCBandReception==other_value.field_dLMCBandReception && field_dLMCMaxBandwidth==other_value.field_dLMCMaxBandwidth && field_dLMCMaxNumOfDownlinkTimeslots==other_value.field_dLMCMaxNumOfDownlinkTimeslots && field_dLMCMaxNumOfDownlinkCarriers==other_value.field_dLMCMaxNumOfDownlinkCarriers; } boolean DLMCCapability__BSSGP::is_bound() const { return (field_presenceDLMC.is_bound()) || (OPTIONAL_OMIT == field_dLMCBandReception.get_selection() || field_dLMCBandReception.is_bound()) || (field_dLMCMaxBandwidth.is_bound()) || (field_dLMCMaxNumOfDownlinkTimeslots.is_bound()) || (field_dLMCMaxNumOfDownlinkCarriers.is_bound()); } boolean DLMCCapability__BSSGP::is_value() const { return field_presenceDLMC.is_value() && (OPTIONAL_OMIT == field_dLMCBandReception.get_selection() || field_dLMCBandReception.is_value()) && field_dLMCMaxBandwidth.is_value() && field_dLMCMaxNumOfDownlinkTimeslots.is_value() && field_dLMCMaxNumOfDownlinkCarriers.is_value(); } int DLMCCapability__BSSGP::size_of() const { int ret_val = 4; if (field_dLMCBandReception.ispresent()) ret_val++; return ret_val; } void DLMCCapability__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ presenceDLMC := "); field_presenceDLMC.log(); TTCN_Logger::log_event_str(", dLMCBandReception := "); field_dLMCBandReception.log(); TTCN_Logger::log_event_str(", dLMCMaxBandwidth := "); field_dLMCMaxBandwidth.log(); TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := "); field_dLMCMaxNumOfDownlinkTimeslots.log(); TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := "); field_dLMCMaxNumOfDownlinkCarriers.log(); TTCN_Logger::log_event_str(" }"); } void DLMCCapability__BSSGP::set_implicit_omit() { if (presenceDLMC().is_bound()) presenceDLMC().set_implicit_omit(); if (!dLMCBandReception().is_bound()) dLMCBandReception() = OMIT_VALUE; else dLMCBandReception().set_implicit_omit(); if (dLMCMaxBandwidth().is_bound()) dLMCMaxBandwidth().set_implicit_omit(); if (dLMCMaxNumOfDownlinkTimeslots().is_bound()) dLMCMaxNumOfDownlinkTimeslots().set_implicit_omit(); if (dLMCMaxNumOfDownlinkCarriers().is_bound()) dLMCMaxNumOfDownlinkCarriers().set_implicit_omit(); } void DLMCCapability__BSSGP::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) presenceDLMC().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCBandReception().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxBandwidth().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkTimeslots().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkCarriers().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(), "presenceDLMC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceDLMC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCBandReception")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCBandReception().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCMaxBandwidth")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCMaxBandwidth().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCMaxNumOfDownlinkTimeslots")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCMaxNumOfDownlinkTimeslots().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCMaxNumOfDownlinkCarriers")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCMaxNumOfDownlinkCarriers().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.DLMCCapability_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.DLMCCapability_BSSGP"); } } void DLMCCapability__BSSGP::encode_text(Text_Buf& text_buf) const { field_presenceDLMC.encode_text(text_buf); field_dLMCBandReception.encode_text(text_buf); field_dLMCMaxBandwidth.encode_text(text_buf); field_dLMCMaxNumOfDownlinkTimeslots.encode_text(text_buf); field_dLMCMaxNumOfDownlinkCarriers.encode_text(text_buf); } void DLMCCapability__BSSGP::decode_text(Text_Buf& text_buf) { field_presenceDLMC.decode_text(text_buf); field_dLMCBandReception.decode_text(text_buf); field_dLMCMaxBandwidth.decode_text(text_buf); field_dLMCMaxNumOfDownlinkTimeslots.decode_text(text_buf); field_dLMCMaxNumOfDownlinkCarriers.decode_text(text_buf); } void DLMCCapability__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void DLMCCapability__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int DLMCCapability__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, DLMCCapability__BSSGP_presenceDLMC_descr_.raw->forceomit); decoded_field_length = field_presenceDLMC.RAW_decode(DLMCCapability__BSSGP_presenceDLMC_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0 && field_presenceDLMC == bs_0){ if (force_omit != NULL && (*force_omit)(1)) { field_dLMCBandReception = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, DLMCCapability__BSSGP_dLMCBandReception_descr_.raw->forceomit); decoded_field_length = field_dLMCBandReception().RAW_decode(DLMCCapability__BSSGP_dLMCBandReception_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_dLMCBandReception = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_dLMCBandReception=OMIT_VALUE; RAW_Force_Omit field_2_force_omit(2, force_omit, DLMCCapability__BSSGP_dLMCMaxBandwidth_descr_.raw->forceomit); decoded_field_length = field_dLMCMaxBandwidth.RAW_decode(DLMCCapability__BSSGP_dLMCMaxBandwidth_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_3_force_omit(3, force_omit, DLMCCapability__BSSGP_dLMCMaxNumOfDownlinkTimeslots_descr_.raw->forceomit); decoded_field_length = field_dLMCMaxNumOfDownlinkTimeslots.RAW_decode(DLMCCapability__BSSGP_dLMCMaxNumOfDownlinkTimeslots_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_4_force_omit(4, force_omit, DLMCCapability__BSSGP_dLMCMaxNumOfDownlinkCarriers_descr_.raw->forceomit); decoded_field_length = field_dLMCMaxNumOfDownlinkCarriers.RAW_decode(DLMCCapability__BSSGP_dLMCMaxNumOfDownlinkCarriers_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int DLMCCapability__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 5; myleaf.body.node.nodes = init_nodes_of_enc_tree(5); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, DLMCCapability__BSSGP_presenceDLMC_descr_.raw); if (field_dLMCBandReception.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DLMCCapability__BSSGP_dLMCBandReception_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, DLMCCapability__BSSGP_dLMCMaxBandwidth_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, DLMCCapability__BSSGP_dLMCMaxNumOfDownlinkTimeslots_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, DLMCCapability__BSSGP_dLMCMaxNumOfDownlinkCarriers_descr_.raw); encoded_length += field_presenceDLMC.RAW_encode(DLMCCapability__BSSGP_presenceDLMC_descr_, *myleaf.body.node.nodes[0]); if (field_dLMCBandReception.ispresent()) { encoded_length += field_dLMCBandReception().RAW_encode(DLMCCapability__BSSGP_dLMCBandReception_descr_, *myleaf.body.node.nodes[1]); } encoded_length += field_dLMCMaxBandwidth.RAW_encode(DLMCCapability__BSSGP_dLMCMaxBandwidth_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_dLMCMaxNumOfDownlinkTimeslots.RAW_encode(DLMCCapability__BSSGP_dLMCMaxNumOfDownlinkTimeslots_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_dLMCMaxNumOfDownlinkCarriers.RAW_encode(DLMCCapability__BSSGP_dLMCMaxNumOfDownlinkCarriers_descr_, *myleaf.body.node.nodes[4]); if (field_dLMCBandReception.ispresent() && (field_presenceDLMC != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(DLMCCapability__BSSGP_presenceDLMC_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct DLMCCapability__BSSGP_template::single_value_struct { BITSTRING_template field_presenceDLMC; DLMCBandReception__BSSGP_template field_dLMCBandReception; BITSTRING_template field_dLMCMaxBandwidth; BITSTRING_template field_dLMCMaxNumOfDownlinkTimeslots; BITSTRING_template field_dLMCMaxNumOfDownlinkCarriers; }; void DLMCCapability__BSSGP_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_presenceDLMC = ANY_VALUE; single_value->field_dLMCBandReception = ANY_OR_OMIT; single_value->field_dLMCMaxBandwidth = ANY_VALUE; single_value->field_dLMCMaxNumOfDownlinkTimeslots = ANY_VALUE; single_value->field_dLMCMaxNumOfDownlinkCarriers = ANY_VALUE; } } } void DLMCCapability__BSSGP_template::copy_value(const DLMCCapability__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.presenceDLMC().is_bound()) { single_value->field_presenceDLMC = other_value.presenceDLMC(); } else { single_value->field_presenceDLMC.clean_up(); } if (other_value.dLMCBandReception().is_bound()) { if (other_value.dLMCBandReception().ispresent()) single_value->field_dLMCBandReception = other_value.dLMCBandReception()(); else single_value->field_dLMCBandReception = OMIT_VALUE; } else { single_value->field_dLMCBandReception.clean_up(); } if (other_value.dLMCMaxBandwidth().is_bound()) { single_value->field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth(); } else { single_value->field_dLMCMaxBandwidth.clean_up(); } if (other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) { single_value->field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots(); } else { single_value->field_dLMCMaxNumOfDownlinkTimeslots.clean_up(); } if (other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) { single_value->field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers(); } else { single_value->field_dLMCMaxNumOfDownlinkCarriers.clean_up(); } set_selection(SPECIFIC_VALUE); } void DLMCCapability__BSSGP_template::copy_template(const DLMCCapability__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.presenceDLMC().get_selection()) { single_value->field_presenceDLMC = other_value.presenceDLMC(); } else { single_value->field_presenceDLMC.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dLMCBandReception().get_selection()) { single_value->field_dLMCBandReception = other_value.dLMCBandReception(); } else { single_value->field_dLMCBandReception.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxBandwidth().get_selection()) { single_value->field_dLMCMaxBandwidth = other_value.dLMCMaxBandwidth(); } else { single_value->field_dLMCMaxBandwidth.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxNumOfDownlinkTimeslots().get_selection()) { single_value->field_dLMCMaxNumOfDownlinkTimeslots = other_value.dLMCMaxNumOfDownlinkTimeslots(); } else { single_value->field_dLMCMaxNumOfDownlinkTimeslots.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dLMCMaxNumOfDownlinkCarriers().get_selection()) { single_value->field_dLMCMaxNumOfDownlinkCarriers = other_value.dLMCMaxNumOfDownlinkCarriers(); } else { single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability__BSSGP_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 DLMCCapability__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new DLMCCapability__BSSGP_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 @BSSGP_Types.DLMCCapability_BSSGP."); break; } set_selection(other_value); } DLMCCapability__BSSGP_template::DLMCCapability__BSSGP_template() { } DLMCCapability__BSSGP_template::DLMCCapability__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DLMCCapability__BSSGP_template::DLMCCapability__BSSGP_template(const DLMCCapability__BSSGP& other_value) { copy_value(other_value); } DLMCCapability__BSSGP_template::DLMCCapability__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DLMCCapability__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.DLMCCapability_BSSGP from an unbound optional field."); } } DLMCCapability__BSSGP_template::DLMCCapability__BSSGP_template(DLMCCapability__BSSGP_template* p_precondition, DLMCCapability__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DLMCCapability__BSSGP_template::DLMCCapability__BSSGP_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; } DLMCCapability__BSSGP_template::DLMCCapability__BSSGP_template(const DLMCCapability__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } DLMCCapability__BSSGP_template::~DLMCCapability__BSSGP_template() { clean_up(); } DLMCCapability__BSSGP_template& DLMCCapability__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DLMCCapability__BSSGP_template& DLMCCapability__BSSGP_template::operator=(const DLMCCapability__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } DLMCCapability__BSSGP_template& DLMCCapability__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DLMCCapability__BSSGP&)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 @BSSGP_Types.DLMCCapability_BSSGP."); } return *this; } DLMCCapability__BSSGP_template& DLMCCapability__BSSGP_template::operator=(const DLMCCapability__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean DLMCCapability__BSSGP_template::match(const DLMCCapability__BSSGP& 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.presenceDLMC().is_bound()) return FALSE; if(!single_value->field_presenceDLMC.match(other_value.presenceDLMC(), legacy))return FALSE; if(!other_value.dLMCBandReception().is_bound()) return FALSE; if((other_value.dLMCBandReception().ispresent() ? !single_value->field_dLMCBandReception.match((const DLMCBandReception__BSSGP&)other_value.dLMCBandReception(), legacy) : !single_value->field_dLMCBandReception.match_omit(legacy)))return FALSE; if(!other_value.dLMCMaxBandwidth().is_bound()) return FALSE; if(!single_value->field_dLMCMaxBandwidth.match(other_value.dLMCMaxBandwidth(), legacy))return FALSE; if(!other_value.dLMCMaxNumOfDownlinkTimeslots().is_bound()) return FALSE; if(!single_value->field_dLMCMaxNumOfDownlinkTimeslots.match(other_value.dLMCMaxNumOfDownlinkTimeslots(), legacy))return FALSE; if(!other_value.dLMCMaxNumOfDownlinkCarriers().is_bound()) return FALSE; if(!single_value->field_dLMCMaxNumOfDownlinkCarriers.match(other_value.dLMCMaxNumOfDownlinkCarriers(), 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 @BSSGP_Types.DLMCCapability_BSSGP."); } return FALSE; } boolean DLMCCapability__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_presenceDLMC.is_bound() || (single_value->field_dLMCBandReception.is_omit() || single_value->field_dLMCBandReception.is_bound()) || single_value->field_dLMCMaxBandwidth.is_bound() || single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_bound() || single_value->field_dLMCMaxNumOfDownlinkCarriers.is_bound(); } boolean DLMCCapability__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_presenceDLMC.is_value() && (single_value->field_dLMCBandReception.is_omit() || single_value->field_dLMCBandReception.is_value()) && single_value->field_dLMCMaxBandwidth.is_value() && single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_value() && single_value->field_dLMCMaxNumOfDownlinkCarriers.is_value(); } void DLMCCapability__BSSGP_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; } DLMCCapability__BSSGP DLMCCapability__BSSGP_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 @BSSGP_Types.DLMCCapability_BSSGP."); DLMCCapability__BSSGP ret_val; if (single_value->field_presenceDLMC.is_bound()) { ret_val.presenceDLMC() = single_value->field_presenceDLMC.valueof(); } if (single_value->field_dLMCBandReception.is_omit()) ret_val.dLMCBandReception() = OMIT_VALUE; else if (single_value->field_dLMCBandReception.is_bound()) { ret_val.dLMCBandReception() = single_value->field_dLMCBandReception.valueof(); } if (single_value->field_dLMCMaxBandwidth.is_bound()) { ret_val.dLMCMaxBandwidth() = single_value->field_dLMCMaxBandwidth.valueof(); } if (single_value->field_dLMCMaxNumOfDownlinkTimeslots.is_bound()) { ret_val.dLMCMaxNumOfDownlinkTimeslots() = single_value->field_dLMCMaxNumOfDownlinkTimeslots.valueof(); } if (single_value->field_dLMCMaxNumOfDownlinkCarriers.is_bound()) { ret_val.dLMCMaxNumOfDownlinkCarriers() = single_value->field_dLMCMaxNumOfDownlinkCarriers.valueof(); } return ret_val; } void DLMCCapability__BSSGP_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 @BSSGP_Types.DLMCCapability_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DLMCCapability__BSSGP_template[list_length]; } DLMCCapability__BSSGP_template& DLMCCapability__BSSGP_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 @BSSGP_Types.DLMCCapability_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.DLMCCapability_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& DLMCCapability__BSSGP_template::presenceDLMC() { set_specific(); return single_value->field_presenceDLMC; } const BITSTRING_template& DLMCCapability__BSSGP_template::presenceDLMC() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceDLMC of a non-specific template of type @BSSGP_Types.DLMCCapability_BSSGP."); return single_value->field_presenceDLMC; } DLMCBandReception__BSSGP_template& DLMCCapability__BSSGP_template::dLMCBandReception() { set_specific(); return single_value->field_dLMCBandReception; } const DLMCBandReception__BSSGP_template& DLMCCapability__BSSGP_template::dLMCBandReception() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dLMCBandReception of a non-specific template of type @BSSGP_Types.DLMCCapability_BSSGP."); return single_value->field_dLMCBandReception; } BITSTRING_template& DLMCCapability__BSSGP_template::dLMCMaxBandwidth() { set_specific(); return single_value->field_dLMCMaxBandwidth; } const BITSTRING_template& DLMCCapability__BSSGP_template::dLMCMaxBandwidth() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dLMCMaxBandwidth of a non-specific template of type @BSSGP_Types.DLMCCapability_BSSGP."); return single_value->field_dLMCMaxBandwidth; } BITSTRING_template& DLMCCapability__BSSGP_template::dLMCMaxNumOfDownlinkTimeslots() { set_specific(); return single_value->field_dLMCMaxNumOfDownlinkTimeslots; } const BITSTRING_template& DLMCCapability__BSSGP_template::dLMCMaxNumOfDownlinkTimeslots() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dLMCMaxNumOfDownlinkTimeslots of a non-specific template of type @BSSGP_Types.DLMCCapability_BSSGP."); return single_value->field_dLMCMaxNumOfDownlinkTimeslots; } BITSTRING_template& DLMCCapability__BSSGP_template::dLMCMaxNumOfDownlinkCarriers() { set_specific(); return single_value->field_dLMCMaxNumOfDownlinkCarriers; } const BITSTRING_template& DLMCCapability__BSSGP_template::dLMCMaxNumOfDownlinkCarriers() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dLMCMaxNumOfDownlinkCarriers of a non-specific template of type @BSSGP_Types.DLMCCapability_BSSGP."); return single_value->field_dLMCMaxNumOfDownlinkCarriers; } int DLMCCapability__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCCapability_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; if (single_value->field_dLMCBandReception.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 @BSSGP_Types.DLMCCapability_BSSGP 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 @BSSGP_Types.DLMCCapability_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCCapability_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCCapability_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCCapability_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCCapability_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCCapability_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCCapability_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.DLMCCapability_BSSGP."); } return 0; } void DLMCCapability__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ presenceDLMC := "); single_value->field_presenceDLMC.log(); TTCN_Logger::log_event_str(", dLMCBandReception := "); single_value->field_dLMCBandReception.log(); TTCN_Logger::log_event_str(", dLMCMaxBandwidth := "); single_value->field_dLMCMaxBandwidth.log(); TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := "); single_value->field_dLMCMaxNumOfDownlinkTimeslots.log(); TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := "); single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability__BSSGP_template::log_match(const DLMCCapability__BSSGP& 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_presenceDLMC.match(match_value.presenceDLMC(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceDLMC"); single_value->field_presenceDLMC.log_match(match_value.presenceDLMC(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.dLMCBandReception().ispresent()){ if(!single_value->field_dLMCBandReception.match(match_value.dLMCBandReception(), legacy)){ TTCN_Logger::log_logmatch_info(".dLMCBandReception"); single_value->field_dLMCBandReception.log_match(match_value.dLMCBandReception(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_dLMCBandReception.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".dLMCBandReception := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_dLMCBandReception.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_dLMCMaxBandwidth.match(match_value.dLMCMaxBandwidth(), legacy)){ TTCN_Logger::log_logmatch_info(".dLMCMaxBandwidth"); single_value->field_dLMCMaxBandwidth.log_match(match_value.dLMCMaxBandwidth(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_dLMCMaxNumOfDownlinkTimeslots.match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy)){ TTCN_Logger::log_logmatch_info(".dLMCMaxNumOfDownlinkTimeslots"); single_value->field_dLMCMaxNumOfDownlinkTimeslots.log_match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_dLMCMaxNumOfDownlinkCarriers.match(match_value.dLMCMaxNumOfDownlinkCarriers(), legacy)){ TTCN_Logger::log_logmatch_info(".dLMCMaxNumOfDownlinkCarriers"); single_value->field_dLMCMaxNumOfDownlinkCarriers.log_match(match_value.dLMCMaxNumOfDownlinkCarriers(), 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("{ presenceDLMC := "); single_value->field_presenceDLMC.log_match(match_value.presenceDLMC(), legacy); TTCN_Logger::log_event_str(", dLMCBandReception := "); if (match_value.dLMCBandReception().ispresent()) { single_value->field_dLMCBandReception.log_match(match_value.dLMCBandReception(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_dLMCBandReception.log(); if (single_value->field_dLMCBandReception.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", dLMCMaxBandwidth := "); single_value->field_dLMCMaxBandwidth.log_match(match_value.dLMCMaxBandwidth(), legacy); TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkTimeslots := "); single_value->field_dLMCMaxNumOfDownlinkTimeslots.log_match(match_value.dLMCMaxNumOfDownlinkTimeslots(), legacy); TTCN_Logger::log_event_str(", dLMCMaxNumOfDownlinkCarriers := "); single_value->field_dLMCMaxNumOfDownlinkCarriers.log_match(match_value.dLMCMaxNumOfDownlinkCarriers(), 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 DLMCCapability__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_presenceDLMC.encode_text(text_buf); single_value->field_dLMCBandReception.encode_text(text_buf); single_value->field_dLMCMaxBandwidth.encode_text(text_buf); single_value->field_dLMCMaxNumOfDownlinkTimeslots.encode_text(text_buf); single_value->field_dLMCMaxNumOfDownlinkCarriers.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 @BSSGP_Types.DLMCCapability_BSSGP."); } } void DLMCCapability__BSSGP_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_presenceDLMC.decode_text(text_buf); single_value->field_dLMCBandReception.decode_text(text_buf); single_value->field_dLMCMaxBandwidth.decode_text(text_buf); single_value->field_dLMCMaxNumOfDownlinkTimeslots.decode_text(text_buf); single_value->field_dLMCMaxNumOfDownlinkCarriers.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 DLMCCapability__BSSGP_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 @BSSGP_Types.DLMCCapability_BSSGP."); } } void DLMCCapability__BSSGP_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: { DLMCCapability__BSSGP_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) presenceDLMC().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCBandReception().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxBandwidth().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkTimeslots().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) dLMCMaxNumOfDownlinkCarriers().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(), "presenceDLMC")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceDLMC().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCBandReception")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCBandReception().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCMaxBandwidth")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCMaxBandwidth().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCMaxNumOfDownlinkTimeslots")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCMaxNumOfDownlinkTimeslots().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCMaxNumOfDownlinkCarriers")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCMaxNumOfDownlinkCarriers().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.DLMCCapability_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { DLMCCapability__BSSGP_template* precondition = new DLMCCapability__BSSGP_template; precondition->set_param(*param.get_elem(0)); DLMCCapability__BSSGP_template* implied_template = new DLMCCapability__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = DLMCCapability__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.DLMCCapability_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void DLMCCapability__BSSGP_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_presenceDLMC.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DLMCCapability_BSSGP"); single_value->field_dLMCBandReception.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DLMCCapability_BSSGP"); single_value->field_dLMCMaxBandwidth.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DLMCCapability_BSSGP"); single_value->field_dLMCMaxNumOfDownlinkTimeslots.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DLMCCapability_BSSGP"); single_value->field_dLMCMaxNumOfDownlinkCarriers.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DLMCCapability_BSSGP"); 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 : "@BSSGP_Types.DLMCCapability_BSSGP"); } boolean DLMCCapability__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DLMCCapability__BSSGP_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) dLMCNonContiguousIntraBandReception().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCInterBandReception().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(), "dLMCNonContiguousIntraBandReception")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCNonContiguousIntraBandReception().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCInterBandReception")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCInterBandReception().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.DLMCBandReception_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.DLMCBandReception_BSSGP"); } } void DLMCBandReception__BSSGP::encode_text(Text_Buf& text_buf) const { field_dLMCNonContiguousIntraBandReception.encode_text(text_buf); field_dLMCInterBandReception.encode_text(text_buf); } void DLMCBandReception__BSSGP::decode_text(Text_Buf& text_buf) { field_dLMCNonContiguousIntraBandReception.decode_text(text_buf); field_dLMCInterBandReception.decode_text(text_buf); } void DLMCBandReception__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void DLMCBandReception__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int DLMCBandReception__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, DLMCBandReception__BSSGP_dLMCNonContiguousIntraBandReception_descr_.raw->forceomit); decoded_field_length = field_dLMCNonContiguousIntraBandReception.RAW_decode(DLMCBandReception__BSSGP_dLMCNonContiguousIntraBandReception_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, DLMCBandReception__BSSGP_dLMCInterBandReception_descr_.raw->forceomit); decoded_field_length = field_dLMCInterBandReception.RAW_decode(DLMCBandReception__BSSGP_dLMCInterBandReception_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int DLMCBandReception__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, DLMCBandReception__BSSGP_dLMCNonContiguousIntraBandReception_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DLMCBandReception__BSSGP_dLMCInterBandReception_descr_.raw); encoded_length += field_dLMCNonContiguousIntraBandReception.RAW_encode(DLMCBandReception__BSSGP_dLMCNonContiguousIntraBandReception_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_dLMCInterBandReception.RAW_encode(DLMCBandReception__BSSGP_dLMCInterBandReception_descr_, *myleaf.body.node.nodes[1]); return myleaf.length = encoded_length; } struct DLMCBandReception__BSSGP_template::single_value_struct { BITSTRING_template field_dLMCNonContiguousIntraBandReception; BITSTRING_template field_dLMCInterBandReception; }; void DLMCBandReception__BSSGP_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_dLMCNonContiguousIntraBandReception = ANY_VALUE; single_value->field_dLMCInterBandReception = ANY_VALUE; } } } void DLMCBandReception__BSSGP_template::copy_value(const DLMCBandReception__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.dLMCNonContiguousIntraBandReception().is_bound()) { single_value->field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception(); } else { single_value->field_dLMCNonContiguousIntraBandReception.clean_up(); } if (other_value.dLMCInterBandReception().is_bound()) { single_value->field_dLMCInterBandReception = other_value.dLMCInterBandReception(); } else { single_value->field_dLMCInterBandReception.clean_up(); } set_selection(SPECIFIC_VALUE); } void DLMCBandReception__BSSGP_template::copy_template(const DLMCBandReception__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.dLMCNonContiguousIntraBandReception().get_selection()) { single_value->field_dLMCNonContiguousIntraBandReception = other_value.dLMCNonContiguousIntraBandReception(); } else { single_value->field_dLMCNonContiguousIntraBandReception.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.dLMCInterBandReception().get_selection()) { single_value->field_dLMCInterBandReception = other_value.dLMCInterBandReception(); } else { single_value->field_dLMCInterBandReception.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 DLMCBandReception__BSSGP_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 DLMCBandReception__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new DLMCBandReception__BSSGP_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 @BSSGP_Types.DLMCBandReception_BSSGP."); break; } set_selection(other_value); } DLMCBandReception__BSSGP_template::DLMCBandReception__BSSGP_template() { } DLMCBandReception__BSSGP_template::DLMCBandReception__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } DLMCBandReception__BSSGP_template::DLMCBandReception__BSSGP_template(const DLMCBandReception__BSSGP& other_value) { copy_value(other_value); } DLMCBandReception__BSSGP_template::DLMCBandReception__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DLMCBandReception__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.DLMCBandReception_BSSGP from an unbound optional field."); } } DLMCBandReception__BSSGP_template::DLMCBandReception__BSSGP_template(DLMCBandReception__BSSGP_template* p_precondition, DLMCBandReception__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } DLMCBandReception__BSSGP_template::DLMCBandReception__BSSGP_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; } DLMCBandReception__BSSGP_template::DLMCBandReception__BSSGP_template(const DLMCBandReception__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } DLMCBandReception__BSSGP_template::~DLMCBandReception__BSSGP_template() { clean_up(); } DLMCBandReception__BSSGP_template& DLMCBandReception__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } DLMCBandReception__BSSGP_template& DLMCBandReception__BSSGP_template::operator=(const DLMCBandReception__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } DLMCBandReception__BSSGP_template& DLMCBandReception__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const DLMCBandReception__BSSGP&)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 @BSSGP_Types.DLMCBandReception_BSSGP."); } return *this; } DLMCBandReception__BSSGP_template& DLMCBandReception__BSSGP_template::operator=(const DLMCBandReception__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean DLMCBandReception__BSSGP_template::match(const DLMCBandReception__BSSGP& 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.dLMCNonContiguousIntraBandReception().is_bound()) return FALSE; if(!single_value->field_dLMCNonContiguousIntraBandReception.match(other_value.dLMCNonContiguousIntraBandReception(), legacy))return FALSE; if(!other_value.dLMCInterBandReception().is_bound()) return FALSE; if(!single_value->field_dLMCInterBandReception.match(other_value.dLMCInterBandReception(), 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 @BSSGP_Types.DLMCBandReception_BSSGP."); } return FALSE; } boolean DLMCBandReception__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_dLMCNonContiguousIntraBandReception.is_bound() || single_value->field_dLMCInterBandReception.is_bound(); } boolean DLMCBandReception__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_dLMCNonContiguousIntraBandReception.is_value() && single_value->field_dLMCInterBandReception.is_value(); } void DLMCBandReception__BSSGP_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; } DLMCBandReception__BSSGP DLMCBandReception__BSSGP_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 @BSSGP_Types.DLMCBandReception_BSSGP."); DLMCBandReception__BSSGP ret_val; if (single_value->field_dLMCNonContiguousIntraBandReception.is_bound()) { ret_val.dLMCNonContiguousIntraBandReception() = single_value->field_dLMCNonContiguousIntraBandReception.valueof(); } if (single_value->field_dLMCInterBandReception.is_bound()) { ret_val.dLMCInterBandReception() = single_value->field_dLMCInterBandReception.valueof(); } return ret_val; } void DLMCBandReception__BSSGP_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 @BSSGP_Types.DLMCBandReception_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new DLMCBandReception__BSSGP_template[list_length]; } DLMCBandReception__BSSGP_template& DLMCBandReception__BSSGP_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 @BSSGP_Types.DLMCBandReception_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.DLMCBandReception_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& DLMCBandReception__BSSGP_template::dLMCNonContiguousIntraBandReception() { set_specific(); return single_value->field_dLMCNonContiguousIntraBandReception; } const BITSTRING_template& DLMCBandReception__BSSGP_template::dLMCNonContiguousIntraBandReception() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dLMCNonContiguousIntraBandReception of a non-specific template of type @BSSGP_Types.DLMCBandReception_BSSGP."); return single_value->field_dLMCNonContiguousIntraBandReception; } BITSTRING_template& DLMCBandReception__BSSGP_template::dLMCInterBandReception() { set_specific(); return single_value->field_dLMCInterBandReception; } const BITSTRING_template& DLMCBandReception__BSSGP_template::dLMCInterBandReception() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field dLMCInterBandReception of a non-specific template of type @BSSGP_Types.DLMCBandReception_BSSGP."); return single_value->field_dLMCInterBandReception; } int DLMCBandReception__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCBandReception_BSSGP 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 @BSSGP_Types.DLMCBandReception_BSSGP 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 @BSSGP_Types.DLMCBandReception_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCBandReception_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCBandReception_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCBandReception_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCBandReception_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCBandReception_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.DLMCBandReception_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.DLMCBandReception_BSSGP."); } return 0; } void DLMCBandReception__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ dLMCNonContiguousIntraBandReception := "); single_value->field_dLMCNonContiguousIntraBandReception.log(); TTCN_Logger::log_event_str(", dLMCInterBandReception := "); single_value->field_dLMCInterBandReception.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 DLMCBandReception__BSSGP_template::log_match(const DLMCBandReception__BSSGP& 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_dLMCNonContiguousIntraBandReception.match(match_value.dLMCNonContiguousIntraBandReception(), legacy)){ TTCN_Logger::log_logmatch_info(".dLMCNonContiguousIntraBandReception"); single_value->field_dLMCNonContiguousIntraBandReception.log_match(match_value.dLMCNonContiguousIntraBandReception(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_dLMCInterBandReception.match(match_value.dLMCInterBandReception(), legacy)){ TTCN_Logger::log_logmatch_info(".dLMCInterBandReception"); single_value->field_dLMCInterBandReception.log_match(match_value.dLMCInterBandReception(), 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("{ dLMCNonContiguousIntraBandReception := "); single_value->field_dLMCNonContiguousIntraBandReception.log_match(match_value.dLMCNonContiguousIntraBandReception(), legacy); TTCN_Logger::log_event_str(", dLMCInterBandReception := "); single_value->field_dLMCInterBandReception.log_match(match_value.dLMCInterBandReception(), 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 DLMCBandReception__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_dLMCNonContiguousIntraBandReception.encode_text(text_buf); single_value->field_dLMCInterBandReception.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 @BSSGP_Types.DLMCBandReception_BSSGP."); } } void DLMCBandReception__BSSGP_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_dLMCNonContiguousIntraBandReception.decode_text(text_buf); single_value->field_dLMCInterBandReception.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 DLMCBandReception__BSSGP_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 @BSSGP_Types.DLMCBandReception_BSSGP."); } } void DLMCBandReception__BSSGP_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: { DLMCBandReception__BSSGP_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) dLMCNonContiguousIntraBandReception().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) dLMCInterBandReception().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(), "dLMCNonContiguousIntraBandReception")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCNonContiguousIntraBandReception().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "dLMCInterBandReception")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { dLMCInterBandReception().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.DLMCBandReception_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { DLMCBandReception__BSSGP_template* precondition = new DLMCBandReception__BSSGP_template; precondition->set_param(*param.get_elem(0)); DLMCBandReception__BSSGP_template* implied_template = new DLMCBandReception__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = DLMCBandReception__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.DLMCBandReception_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void DLMCBandReception__BSSGP_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_dLMCNonContiguousIntraBandReception.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DLMCBandReception_BSSGP"); single_value->field_dLMCInterBandReception.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.DLMCBandReception_BSSGP"); 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 : "@BSSGP_Types.DLMCBandReception_BSSGP"); } boolean DLMCBandReception__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean DLMCBandReception__BSSGP_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_accessCapAdditionsAfterRel12) : field_accessCapAdditionsRel12(par_accessCapAdditionsRel12), field_accessCapAdditionsAfterRel12(par_accessCapAdditionsAfterRel12) { } AccessCapAdditionsAfterRel11__BSSGP::AccessCapAdditionsAfterRel11__BSSGP(const AccessCapAdditionsAfterRel11__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); if (other_value.accessCapAdditionsRel12().is_bound()) field_accessCapAdditionsRel12 = other_value.accessCapAdditionsRel12(); else field_accessCapAdditionsRel12.clean_up(); if (other_value.accessCapAdditionsAfterRel12().is_bound()) field_accessCapAdditionsAfterRel12 = other_value.accessCapAdditionsAfterRel12(); else field_accessCapAdditionsAfterRel12.clean_up(); } void AccessCapAdditionsAfterRel11__BSSGP::clean_up() { field_accessCapAdditionsRel12.clean_up(); field_accessCapAdditionsAfterRel12.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel11__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel11__BSSGP_descr_; } AccessCapAdditionsAfterRel11__BSSGP& AccessCapAdditionsAfterRel11__BSSGP::operator=(const AccessCapAdditionsAfterRel11__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); if (other_value.accessCapAdditionsRel12().is_bound()) field_accessCapAdditionsRel12 = other_value.accessCapAdditionsRel12(); else field_accessCapAdditionsRel12.clean_up(); if (other_value.accessCapAdditionsAfterRel12().is_bound()) field_accessCapAdditionsAfterRel12 = other_value.accessCapAdditionsAfterRel12(); else field_accessCapAdditionsAfterRel12.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel11__BSSGP::operator==(const AccessCapAdditionsAfterRel11__BSSGP& other_value) const { return field_accessCapAdditionsRel12==other_value.field_accessCapAdditionsRel12 && field_accessCapAdditionsAfterRel12==other_value.field_accessCapAdditionsAfterRel12; } boolean AccessCapAdditionsAfterRel11__BSSGP::is_bound() const { return (field_accessCapAdditionsRel12.is_bound()) || (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel12.get_selection() || field_accessCapAdditionsAfterRel12.is_bound()); } boolean AccessCapAdditionsAfterRel11__BSSGP::is_value() const { return field_accessCapAdditionsRel12.is_value() && (OPTIONAL_OMIT == field_accessCapAdditionsAfterRel12.get_selection() || field_accessCapAdditionsAfterRel12.is_value()); } int AccessCapAdditionsAfterRel11__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapAdditionsAfterRel12.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel11__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapAdditionsRel12 := "); field_accessCapAdditionsRel12.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel12 := "); field_accessCapAdditionsAfterRel12.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel11__BSSGP::set_implicit_omit() { if (accessCapAdditionsRel12().is_bound()) accessCapAdditionsRel12().set_implicit_omit(); if (!accessCapAdditionsAfterRel12().is_bound()) accessCapAdditionsAfterRel12() = OMIT_VALUE; else accessCapAdditionsAfterRel12().set_implicit_omit(); } void AccessCapAdditionsAfterRel11__BSSGP::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) accessCapAdditionsRel12().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel12().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(), "accessCapAdditionsRel12")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel12().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel12")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel12().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP"); } } void AccessCapAdditionsAfterRel11__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapAdditionsRel12.encode_text(text_buf); field_accessCapAdditionsAfterRel12.encode_text(text_buf); } void AccessCapAdditionsAfterRel11__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapAdditionsRel12.decode_text(text_buf); field_accessCapAdditionsAfterRel12.decode_text(text_buf); } void AccessCapAdditionsAfterRel11__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel11__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel11__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel11__BSSGP_accessCapAdditionsRel12_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsRel12.RAW_decode(AccessCapAdditionsAfterRel11__BSSGP_accessCapAdditionsRel12_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapAdditionsAfterRel12 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel11__BSSGP_accessCapAdditionsAfterRel12_descr_.raw->forceomit); decoded_field_length = field_accessCapAdditionsAfterRel12().RAW_decode(AccessCapAdditionsAfterRel11__BSSGP_accessCapAdditionsAfterRel12_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapAdditionsAfterRel12 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapAdditionsAfterRel12=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel11__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsAfterRel11__BSSGP_accessCapAdditionsRel12_descr_.raw); if (field_accessCapAdditionsAfterRel12.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel11__BSSGP_accessCapAdditionsAfterRel12_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapAdditionsRel12.RAW_encode(AccessCapAdditionsAfterRel11__BSSGP_accessCapAdditionsRel12_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapAdditionsAfterRel12.ispresent()) { encoded_length += field_accessCapAdditionsAfterRel12().RAW_encode(AccessCapAdditionsAfterRel11__BSSGP_accessCapAdditionsAfterRel12_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel11__BSSGP_template::single_value_struct { AccessCapAdditionsRel12__BSSGP_template field_accessCapAdditionsRel12; AccessCapAdditionsAfterRel12__BSSGP_template field_accessCapAdditionsAfterRel12; }; void AccessCapAdditionsAfterRel11__BSSGP_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_accessCapAdditionsRel12 = ANY_VALUE; single_value->field_accessCapAdditionsAfterRel12 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel11__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel11__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapAdditionsRel12().is_bound()) { single_value->field_accessCapAdditionsRel12 = other_value.accessCapAdditionsRel12(); } else { single_value->field_accessCapAdditionsRel12.clean_up(); } if (other_value.accessCapAdditionsAfterRel12().is_bound()) { if (other_value.accessCapAdditionsAfterRel12().ispresent()) single_value->field_accessCapAdditionsAfterRel12 = other_value.accessCapAdditionsAfterRel12()(); else single_value->field_accessCapAdditionsAfterRel12 = OMIT_VALUE; } else { single_value->field_accessCapAdditionsAfterRel12.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel11__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel11__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsRel12().get_selection()) { single_value->field_accessCapAdditionsRel12 = other_value.accessCapAdditionsRel12(); } else { single_value->field_accessCapAdditionsRel12.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapAdditionsAfterRel12().get_selection()) { single_value->field_accessCapAdditionsAfterRel12 = other_value.accessCapAdditionsAfterRel12(); } else { single_value->field_accessCapAdditionsAfterRel12.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 AccessCapAdditionsAfterRel11__BSSGP_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 AccessCapAdditionsAfterRel11__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel11__BSSGP_template::AccessCapAdditionsAfterRel11__BSSGP_template() { } AccessCapAdditionsAfterRel11__BSSGP_template::AccessCapAdditionsAfterRel11__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel11__BSSGP_template::AccessCapAdditionsAfterRel11__BSSGP_template(const AccessCapAdditionsAfterRel11__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel11__BSSGP_template::AccessCapAdditionsAfterRel11__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel11__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel11__BSSGP_template::AccessCapAdditionsAfterRel11__BSSGP_template(AccessCapAdditionsAfterRel11__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel11__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel11__BSSGP_template::AccessCapAdditionsAfterRel11__BSSGP_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; } AccessCapAdditionsAfterRel11__BSSGP_template::AccessCapAdditionsAfterRel11__BSSGP_template(const AccessCapAdditionsAfterRel11__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel11__BSSGP_template::~AccessCapAdditionsAfterRel11__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel11__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel11__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_template::operator=(const AccessCapAdditionsAfterRel11__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel11__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel11__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); } return *this; } AccessCapAdditionsAfterRel11__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_template::operator=(const AccessCapAdditionsAfterRel11__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel11__BSSGP_template::match(const AccessCapAdditionsAfterRel11__BSSGP& 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.accessCapAdditionsRel12().is_bound()) return FALSE; if(!single_value->field_accessCapAdditionsRel12.match(other_value.accessCapAdditionsRel12(), legacy))return FALSE; if(!other_value.accessCapAdditionsAfterRel12().is_bound()) return FALSE; if((other_value.accessCapAdditionsAfterRel12().ispresent() ? !single_value->field_accessCapAdditionsAfterRel12.match((const AccessCapAdditionsAfterRel12__BSSGP&)other_value.accessCapAdditionsAfterRel12(), legacy) : !single_value->field_accessCapAdditionsAfterRel12.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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel11__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapAdditionsRel12.is_bound() || (single_value->field_accessCapAdditionsAfterRel12.is_omit() || single_value->field_accessCapAdditionsAfterRel12.is_bound()); } boolean AccessCapAdditionsAfterRel11__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapAdditionsRel12.is_value() && (single_value->field_accessCapAdditionsAfterRel12.is_omit() || single_value->field_accessCapAdditionsAfterRel12.is_value()); } void AccessCapAdditionsAfterRel11__BSSGP_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; } AccessCapAdditionsAfterRel11__BSSGP AccessCapAdditionsAfterRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); AccessCapAdditionsAfterRel11__BSSGP ret_val; if (single_value->field_accessCapAdditionsRel12.is_bound()) { ret_val.accessCapAdditionsRel12() = single_value->field_accessCapAdditionsRel12.valueof(); } if (single_value->field_accessCapAdditionsAfterRel12.is_omit()) ret_val.accessCapAdditionsAfterRel12() = OMIT_VALUE; else if (single_value->field_accessCapAdditionsAfterRel12.is_bound()) { ret_val.accessCapAdditionsAfterRel12() = single_value->field_accessCapAdditionsAfterRel12.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel11__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel11__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); return value_list.list_value[list_index]; } AccessCapAdditionsRel12__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_template::accessCapAdditionsRel12() { set_specific(); return single_value->field_accessCapAdditionsRel12; } const AccessCapAdditionsRel12__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_template::accessCapAdditionsRel12() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsRel12 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); return single_value->field_accessCapAdditionsRel12; } AccessCapAdditionsAfterRel12__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_template::accessCapAdditionsAfterRel12() { set_specific(); return single_value->field_accessCapAdditionsAfterRel12; } const AccessCapAdditionsAfterRel12__BSSGP_template& AccessCapAdditionsAfterRel11__BSSGP_template::accessCapAdditionsAfterRel12() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapAdditionsAfterRel12 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); return single_value->field_accessCapAdditionsAfterRel12; } int AccessCapAdditionsAfterRel11__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapAdditionsAfterRel12.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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel11__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapAdditionsRel12 := "); single_value->field_accessCapAdditionsRel12.log(); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel12 := "); single_value->field_accessCapAdditionsAfterRel12.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 AccessCapAdditionsAfterRel11__BSSGP_template::log_match(const AccessCapAdditionsAfterRel11__BSSGP& 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_accessCapAdditionsRel12.match(match_value.accessCapAdditionsRel12(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsRel12"); single_value->field_accessCapAdditionsRel12.log_match(match_value.accessCapAdditionsRel12(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapAdditionsAfterRel12().ispresent()){ if(!single_value->field_accessCapAdditionsAfterRel12.match(match_value.accessCapAdditionsAfterRel12(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel12"); single_value->field_accessCapAdditionsAfterRel12.log_match(match_value.accessCapAdditionsAfterRel12(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapAdditionsAfterRel12.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapAdditionsAfterRel12 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapAdditionsAfterRel12.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("{ accessCapAdditionsRel12 := "); single_value->field_accessCapAdditionsRel12.log_match(match_value.accessCapAdditionsRel12(), legacy); TTCN_Logger::log_event_str(", accessCapAdditionsAfterRel12 := "); if (match_value.accessCapAdditionsAfterRel12().ispresent()) { single_value->field_accessCapAdditionsAfterRel12.log_match(match_value.accessCapAdditionsAfterRel12(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapAdditionsAfterRel12.log(); if (single_value->field_accessCapAdditionsAfterRel12.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 AccessCapAdditionsAfterRel11__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapAdditionsRel12.encode_text(text_buf); single_value->field_accessCapAdditionsAfterRel12.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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); } } void AccessCapAdditionsAfterRel11__BSSGP_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_accessCapAdditionsRel12.decode_text(text_buf); single_value->field_accessCapAdditionsAfterRel12.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 AccessCapAdditionsAfterRel11__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP."); } } void AccessCapAdditionsAfterRel11__BSSGP_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: { AccessCapAdditionsAfterRel11__BSSGP_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) accessCapAdditionsRel12().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapAdditionsAfterRel12().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(), "accessCapAdditionsRel12")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsRel12().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapAdditionsAfterRel12")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapAdditionsAfterRel12().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel11__BSSGP_template* precondition = new AccessCapAdditionsAfterRel11__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel11__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel11__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel11__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel11__BSSGP_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_accessCapAdditionsRel12.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP"); single_value->field_accessCapAdditionsAfterRel12.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel11_BSSGP"); } boolean AccessCapAdditionsAfterRel11__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel11__BSSGP_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) extendedEARFCNValueRange().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "extendedEARFCNValueRange")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extendedEARFCNValueRange().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP"); } } void AccessCapLateAdditionsRel11__BSSGP::encode_text(Text_Buf& text_buf) const { field_extendedEARFCNValueRange.encode_text(text_buf); } void AccessCapLateAdditionsRel11__BSSGP::decode_text(Text_Buf& text_buf) { field_extendedEARFCNValueRange.decode_text(text_buf); } void AccessCapLateAdditionsRel11__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapLateAdditionsRel11__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapLateAdditionsRel11__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::BIT1_descr_.raw->forceomit); decoded_field_length = field_extendedEARFCNValueRange.RAW_decode(General__Types::BIT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapLateAdditionsRel11__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 1; myleaf.body.node.nodes = init_nodes_of_enc_tree(1); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT1_descr_.raw); encoded_length += field_extendedEARFCNValueRange.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[0]); return myleaf.length = encoded_length; } struct AccessCapLateAdditionsRel11__BSSGP_template::single_value_struct { BITSTRING_template field_extendedEARFCNValueRange; }; void AccessCapLateAdditionsRel11__BSSGP_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_extendedEARFCNValueRange = ANY_VALUE; } } } void AccessCapLateAdditionsRel11__BSSGP_template::copy_value(const AccessCapLateAdditionsRel11__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.extendedEARFCNValueRange().is_bound()) { single_value->field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange(); } else { single_value->field_extendedEARFCNValueRange.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapLateAdditionsRel11__BSSGP_template::copy_template(const AccessCapLateAdditionsRel11__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.extendedEARFCNValueRange().get_selection()) { single_value->field_extendedEARFCNValueRange = other_value.extendedEARFCNValueRange(); } else { single_value->field_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11__BSSGP_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 AccessCapLateAdditionsRel11__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapLateAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); break; } set_selection(other_value); } AccessCapLateAdditionsRel11__BSSGP_template::AccessCapLateAdditionsRel11__BSSGP_template() { } AccessCapLateAdditionsRel11__BSSGP_template::AccessCapLateAdditionsRel11__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapLateAdditionsRel11__BSSGP_template::AccessCapLateAdditionsRel11__BSSGP_template(const AccessCapLateAdditionsRel11__BSSGP& other_value) { copy_value(other_value); } AccessCapLateAdditionsRel11__BSSGP_template::AccessCapLateAdditionsRel11__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapLateAdditionsRel11__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP from an unbound optional field."); } } AccessCapLateAdditionsRel11__BSSGP_template::AccessCapLateAdditionsRel11__BSSGP_template(AccessCapLateAdditionsRel11__BSSGP_template* p_precondition, AccessCapLateAdditionsRel11__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapLateAdditionsRel11__BSSGP_template::AccessCapLateAdditionsRel11__BSSGP_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; } AccessCapLateAdditionsRel11__BSSGP_template::AccessCapLateAdditionsRel11__BSSGP_template(const AccessCapLateAdditionsRel11__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapLateAdditionsRel11__BSSGP_template::~AccessCapLateAdditionsRel11__BSSGP_template() { clean_up(); } AccessCapLateAdditionsRel11__BSSGP_template& AccessCapLateAdditionsRel11__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapLateAdditionsRel11__BSSGP_template& AccessCapLateAdditionsRel11__BSSGP_template::operator=(const AccessCapLateAdditionsRel11__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapLateAdditionsRel11__BSSGP_template& AccessCapLateAdditionsRel11__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapLateAdditionsRel11__BSSGP&)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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); } return *this; } AccessCapLateAdditionsRel11__BSSGP_template& AccessCapLateAdditionsRel11__BSSGP_template::operator=(const AccessCapLateAdditionsRel11__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapLateAdditionsRel11__BSSGP_template::match(const AccessCapLateAdditionsRel11__BSSGP& 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.extendedEARFCNValueRange().is_bound()) return FALSE; if(!single_value->field_extendedEARFCNValueRange.match(other_value.extendedEARFCNValueRange(), 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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); } return FALSE; } boolean AccessCapLateAdditionsRel11__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_extendedEARFCNValueRange.is_bound(); } boolean AccessCapLateAdditionsRel11__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_extendedEARFCNValueRange.is_value(); } void AccessCapLateAdditionsRel11__BSSGP_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; } AccessCapLateAdditionsRel11__BSSGP AccessCapLateAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); AccessCapLateAdditionsRel11__BSSGP ret_val; if (single_value->field_extendedEARFCNValueRange.is_bound()) { ret_val.extendedEARFCNValueRange() = single_value->field_extendedEARFCNValueRange.valueof(); } return ret_val; } void AccessCapLateAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapLateAdditionsRel11__BSSGP_template[list_length]; } AccessCapLateAdditionsRel11__BSSGP_template& AccessCapLateAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AccessCapLateAdditionsRel11__BSSGP_template::extendedEARFCNValueRange() { set_specific(); return single_value->field_extendedEARFCNValueRange; } const BITSTRING_template& AccessCapLateAdditionsRel11__BSSGP_template::extendedEARFCNValueRange() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extendedEARFCNValueRange of a non-specific template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); return single_value->field_extendedEARFCNValueRange; } int AccessCapLateAdditionsRel11__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 1; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP 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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); } return 0; } void AccessCapLateAdditionsRel11__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ extendedEARFCNValueRange := "); single_value->field_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11__BSSGP_template::log_match(const AccessCapLateAdditionsRel11__BSSGP& 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_extendedEARFCNValueRange.match(match_value.extendedEARFCNValueRange(), legacy)){ TTCN_Logger::log_logmatch_info(".extendedEARFCNValueRange"); single_value->field_extendedEARFCNValueRange.log_match(match_value.extendedEARFCNValueRange(), 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("{ extendedEARFCNValueRange := "); single_value->field_extendedEARFCNValueRange.log_match(match_value.extendedEARFCNValueRange(), 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 AccessCapLateAdditionsRel11__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_extendedEARFCNValueRange.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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); } } void AccessCapLateAdditionsRel11__BSSGP_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_extendedEARFCNValueRange.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 AccessCapLateAdditionsRel11__BSSGP_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 @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP."); } } void AccessCapLateAdditionsRel11__BSSGP_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: { AccessCapLateAdditionsRel11__BSSGP_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) extendedEARFCNValueRange().set_param(*param.get_elem(0)); break; case Module_Param::MP_Assignment_List: { Vector value_used(param.get_size()); value_used.resize(param.get_size(), FALSE); for (size_t val_idx=0; val_idxget_id()->get_name(), "extendedEARFCNValueRange")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extendedEARFCNValueRange().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapLateAdditionsRel11__BSSGP_template* precondition = new AccessCapLateAdditionsRel11__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapLateAdditionsRel11__BSSGP_template* implied_template = new AccessCapLateAdditionsRel11__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapLateAdditionsRel11__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapLateAdditionsRel11__BSSGP_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_extendedEARFCNValueRange.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP"); 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 : "@BSSGP_Types.AccessCapLateAdditionsRel11_BSSGP"); } boolean AccessCapLateAdditionsRel11__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapLateAdditionsRel11__BSSGP_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_accessCapLateAdditionsAfterRel11) : field_accessCapLateAdditionsRel11(par_accessCapLateAdditionsRel11), field_accessCapLateAdditionsAfterRel11(par_accessCapLateAdditionsAfterRel11) { } AccessCapAdditionsAfterRel12__BSSGP::AccessCapAdditionsAfterRel12__BSSGP(const AccessCapAdditionsAfterRel12__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); if (other_value.accessCapLateAdditionsRel11().is_bound()) field_accessCapLateAdditionsRel11 = other_value.accessCapLateAdditionsRel11(); else field_accessCapLateAdditionsRel11.clean_up(); if (other_value.accessCapLateAdditionsAfterRel11().is_bound()) field_accessCapLateAdditionsAfterRel11 = other_value.accessCapLateAdditionsAfterRel11(); else field_accessCapLateAdditionsAfterRel11.clean_up(); } void AccessCapAdditionsAfterRel12__BSSGP::clean_up() { field_accessCapLateAdditionsRel11.clean_up(); field_accessCapLateAdditionsAfterRel11.clean_up(); } const TTCN_Typedescriptor_t* AccessCapAdditionsAfterRel12__BSSGP::get_descriptor() const { return &AccessCapAdditionsAfterRel12__BSSGP_descr_; } AccessCapAdditionsAfterRel12__BSSGP& AccessCapAdditionsAfterRel12__BSSGP::operator=(const AccessCapAdditionsAfterRel12__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); if (other_value.accessCapLateAdditionsRel11().is_bound()) field_accessCapLateAdditionsRel11 = other_value.accessCapLateAdditionsRel11(); else field_accessCapLateAdditionsRel11.clean_up(); if (other_value.accessCapLateAdditionsAfterRel11().is_bound()) field_accessCapLateAdditionsAfterRel11 = other_value.accessCapLateAdditionsAfterRel11(); else field_accessCapLateAdditionsAfterRel11.clean_up(); } return *this; } boolean AccessCapAdditionsAfterRel12__BSSGP::operator==(const AccessCapAdditionsAfterRel12__BSSGP& other_value) const { return field_accessCapLateAdditionsRel11==other_value.field_accessCapLateAdditionsRel11 && field_accessCapLateAdditionsAfterRel11==other_value.field_accessCapLateAdditionsAfterRel11; } boolean AccessCapAdditionsAfterRel12__BSSGP::is_bound() const { return (field_accessCapLateAdditionsRel11.is_bound()) || (OPTIONAL_OMIT == field_accessCapLateAdditionsAfterRel11.get_selection() || field_accessCapLateAdditionsAfterRel11.is_bound()); } boolean AccessCapAdditionsAfterRel12__BSSGP::is_value() const { return field_accessCapLateAdditionsRel11.is_value() && (OPTIONAL_OMIT == field_accessCapLateAdditionsAfterRel11.get_selection() || field_accessCapLateAdditionsAfterRel11.is_value()); } int AccessCapAdditionsAfterRel12__BSSGP::size_of() const { int ret_val = 1; if (field_accessCapLateAdditionsAfterRel11.ispresent()) ret_val++; return ret_val; } void AccessCapAdditionsAfterRel12__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessCapLateAdditionsRel11 := "); field_accessCapLateAdditionsRel11.log(); TTCN_Logger::log_event_str(", accessCapLateAdditionsAfterRel11 := "); field_accessCapLateAdditionsAfterRel11.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapAdditionsAfterRel12__BSSGP::set_implicit_omit() { if (accessCapLateAdditionsRel11().is_bound()) accessCapLateAdditionsRel11().set_implicit_omit(); if (!accessCapLateAdditionsAfterRel11().is_bound()) accessCapLateAdditionsAfterRel11() = OMIT_VALUE; else accessCapLateAdditionsAfterRel11().set_implicit_omit(); } void AccessCapAdditionsAfterRel12__BSSGP::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) accessCapLateAdditionsRel11().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapLateAdditionsAfterRel11().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(), "accessCapLateAdditionsRel11")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapLateAdditionsRel11().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapLateAdditionsAfterRel11")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapLateAdditionsAfterRel11().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP"); } } void AccessCapAdditionsAfterRel12__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessCapLateAdditionsRel11.encode_text(text_buf); field_accessCapLateAdditionsAfterRel11.encode_text(text_buf); } void AccessCapAdditionsAfterRel12__BSSGP::decode_text(Text_Buf& text_buf) { field_accessCapLateAdditionsRel11.decode_text(text_buf); field_accessCapLateAdditionsAfterRel11.decode_text(text_buf); } void AccessCapAdditionsAfterRel12__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapAdditionsAfterRel12__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapAdditionsAfterRel12__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapAdditionsAfterRel12__BSSGP_accessCapLateAdditionsRel11_descr_.raw->forceomit); decoded_field_length = field_accessCapLateAdditionsRel11.RAW_decode(AccessCapAdditionsAfterRel12__BSSGP_accessCapLateAdditionsRel11_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (limit > 0){ if (force_omit != NULL && (*force_omit)(1)) { field_accessCapLateAdditionsAfterRel11 = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapAdditionsAfterRel12__BSSGP_accessCapLateAdditionsAfterRel11_descr_.raw->forceomit); decoded_field_length = field_accessCapLateAdditionsAfterRel11().RAW_decode(AccessCapAdditionsAfterRel12__BSSGP_accessCapLateAdditionsAfterRel11_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 1) { field_accessCapLateAdditionsAfterRel11 = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); } } } else field_accessCapLateAdditionsAfterRel11=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapAdditionsAfterRel12__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapAdditionsAfterRel12__BSSGP_accessCapLateAdditionsRel11_descr_.raw); if (field_accessCapLateAdditionsAfterRel11.ispresent()) { myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapAdditionsAfterRel12__BSSGP_accessCapLateAdditionsAfterRel11_descr_.raw); } else myleaf.body.node.nodes[1] = NULL; encoded_length += field_accessCapLateAdditionsRel11.RAW_encode(AccessCapAdditionsAfterRel12__BSSGP_accessCapLateAdditionsRel11_descr_, *myleaf.body.node.nodes[0]); if (field_accessCapLateAdditionsAfterRel11.ispresent()) { encoded_length += field_accessCapLateAdditionsAfterRel11().RAW_encode(AccessCapAdditionsAfterRel12__BSSGP_accessCapLateAdditionsAfterRel11_descr_, *myleaf.body.node.nodes[1]); } return myleaf.length = encoded_length; } struct AccessCapAdditionsAfterRel12__BSSGP_template::single_value_struct { AccessCapLateAdditionsRel11__BSSGP_template field_accessCapLateAdditionsRel11; OCTETSTRING_template field_accessCapLateAdditionsAfterRel11; }; void AccessCapAdditionsAfterRel12__BSSGP_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_accessCapLateAdditionsRel11 = ANY_VALUE; single_value->field_accessCapLateAdditionsAfterRel11 = ANY_OR_OMIT; } } } void AccessCapAdditionsAfterRel12__BSSGP_template::copy_value(const AccessCapAdditionsAfterRel12__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessCapLateAdditionsRel11().is_bound()) { single_value->field_accessCapLateAdditionsRel11 = other_value.accessCapLateAdditionsRel11(); } else { single_value->field_accessCapLateAdditionsRel11.clean_up(); } if (other_value.accessCapLateAdditionsAfterRel11().is_bound()) { if (other_value.accessCapLateAdditionsAfterRel11().ispresent()) single_value->field_accessCapLateAdditionsAfterRel11 = other_value.accessCapLateAdditionsAfterRel11()(); else single_value->field_accessCapLateAdditionsAfterRel11 = OMIT_VALUE; } else { single_value->field_accessCapLateAdditionsAfterRel11.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapAdditionsAfterRel12__BSSGP_template::copy_template(const AccessCapAdditionsAfterRel12__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessCapLateAdditionsRel11().get_selection()) { single_value->field_accessCapLateAdditionsRel11 = other_value.accessCapLateAdditionsRel11(); } else { single_value->field_accessCapLateAdditionsRel11.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapLateAdditionsAfterRel11().get_selection()) { single_value->field_accessCapLateAdditionsAfterRel11 = other_value.accessCapLateAdditionsAfterRel11(); } else { single_value->field_accessCapLateAdditionsAfterRel11.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 AccessCapAdditionsAfterRel12__BSSGP_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 AccessCapAdditionsAfterRel12__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapAdditionsAfterRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); break; } set_selection(other_value); } AccessCapAdditionsAfterRel12__BSSGP_template::AccessCapAdditionsAfterRel12__BSSGP_template() { } AccessCapAdditionsAfterRel12__BSSGP_template::AccessCapAdditionsAfterRel12__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapAdditionsAfterRel12__BSSGP_template::AccessCapAdditionsAfterRel12__BSSGP_template(const AccessCapAdditionsAfterRel12__BSSGP& other_value) { copy_value(other_value); } AccessCapAdditionsAfterRel12__BSSGP_template::AccessCapAdditionsAfterRel12__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel12__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP from an unbound optional field."); } } AccessCapAdditionsAfterRel12__BSSGP_template::AccessCapAdditionsAfterRel12__BSSGP_template(AccessCapAdditionsAfterRel12__BSSGP_template* p_precondition, AccessCapAdditionsAfterRel12__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapAdditionsAfterRel12__BSSGP_template::AccessCapAdditionsAfterRel12__BSSGP_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; } AccessCapAdditionsAfterRel12__BSSGP_template::AccessCapAdditionsAfterRel12__BSSGP_template(const AccessCapAdditionsAfterRel12__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapAdditionsAfterRel12__BSSGP_template::~AccessCapAdditionsAfterRel12__BSSGP_template() { clean_up(); } AccessCapAdditionsAfterRel12__BSSGP_template& AccessCapAdditionsAfterRel12__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapAdditionsAfterRel12__BSSGP_template& AccessCapAdditionsAfterRel12__BSSGP_template::operator=(const AccessCapAdditionsAfterRel12__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapAdditionsAfterRel12__BSSGP_template& AccessCapAdditionsAfterRel12__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapAdditionsAfterRel12__BSSGP&)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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); } return *this; } AccessCapAdditionsAfterRel12__BSSGP_template& AccessCapAdditionsAfterRel12__BSSGP_template::operator=(const AccessCapAdditionsAfterRel12__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapAdditionsAfterRel12__BSSGP_template::match(const AccessCapAdditionsAfterRel12__BSSGP& 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.accessCapLateAdditionsRel11().is_bound()) return FALSE; if(!single_value->field_accessCapLateAdditionsRel11.match(other_value.accessCapLateAdditionsRel11(), legacy))return FALSE; if(!other_value.accessCapLateAdditionsAfterRel11().is_bound()) return FALSE; if((other_value.accessCapLateAdditionsAfterRel11().ispresent() ? !single_value->field_accessCapLateAdditionsAfterRel11.match((const OCTETSTRING&)other_value.accessCapLateAdditionsAfterRel11(), legacy) : !single_value->field_accessCapLateAdditionsAfterRel11.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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); } return FALSE; } boolean AccessCapAdditionsAfterRel12__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessCapLateAdditionsRel11.is_bound() || (single_value->field_accessCapLateAdditionsAfterRel11.is_omit() || single_value->field_accessCapLateAdditionsAfterRel11.is_bound()); } boolean AccessCapAdditionsAfterRel12__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessCapLateAdditionsRel11.is_value() && (single_value->field_accessCapLateAdditionsAfterRel11.is_omit() || single_value->field_accessCapLateAdditionsAfterRel11.is_value()); } void AccessCapAdditionsAfterRel12__BSSGP_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; } AccessCapAdditionsAfterRel12__BSSGP AccessCapAdditionsAfterRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); AccessCapAdditionsAfterRel12__BSSGP ret_val; if (single_value->field_accessCapLateAdditionsRel11.is_bound()) { ret_val.accessCapLateAdditionsRel11() = single_value->field_accessCapLateAdditionsRel11.valueof(); } if (single_value->field_accessCapLateAdditionsAfterRel11.is_omit()) ret_val.accessCapLateAdditionsAfterRel11() = OMIT_VALUE; else if (single_value->field_accessCapLateAdditionsAfterRel11.is_bound()) { ret_val.accessCapLateAdditionsAfterRel11() = single_value->field_accessCapLateAdditionsAfterRel11.valueof(); } return ret_val; } void AccessCapAdditionsAfterRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapAdditionsAfterRel12__BSSGP_template[list_length]; } AccessCapAdditionsAfterRel12__BSSGP_template& AccessCapAdditionsAfterRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); return value_list.list_value[list_index]; } AccessCapLateAdditionsRel11__BSSGP_template& AccessCapAdditionsAfterRel12__BSSGP_template::accessCapLateAdditionsRel11() { set_specific(); return single_value->field_accessCapLateAdditionsRel11; } const AccessCapLateAdditionsRel11__BSSGP_template& AccessCapAdditionsAfterRel12__BSSGP_template::accessCapLateAdditionsRel11() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapLateAdditionsRel11 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); return single_value->field_accessCapLateAdditionsRel11; } OCTETSTRING_template& AccessCapAdditionsAfterRel12__BSSGP_template::accessCapLateAdditionsAfterRel11() { set_specific(); return single_value->field_accessCapLateAdditionsAfterRel11; } const OCTETSTRING_template& AccessCapAdditionsAfterRel12__BSSGP_template::accessCapLateAdditionsAfterRel11() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapLateAdditionsAfterRel11 of a non-specific template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); return single_value->field_accessCapLateAdditionsAfterRel11; } int AccessCapAdditionsAfterRel12__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 1; if (single_value->field_accessCapLateAdditionsAfterRel11.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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP 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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); } return 0; } void AccessCapAdditionsAfterRel12__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessCapLateAdditionsRel11 := "); single_value->field_accessCapLateAdditionsRel11.log(); TTCN_Logger::log_event_str(", accessCapLateAdditionsAfterRel11 := "); single_value->field_accessCapLateAdditionsAfterRel11.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 AccessCapAdditionsAfterRel12__BSSGP_template::log_match(const AccessCapAdditionsAfterRel12__BSSGP& 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_accessCapLateAdditionsRel11.match(match_value.accessCapLateAdditionsRel11(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapLateAdditionsRel11"); single_value->field_accessCapLateAdditionsRel11.log_match(match_value.accessCapLateAdditionsRel11(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.accessCapLateAdditionsAfterRel11().ispresent()){ if(!single_value->field_accessCapLateAdditionsAfterRel11.match(match_value.accessCapLateAdditionsAfterRel11(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapLateAdditionsAfterRel11"); single_value->field_accessCapLateAdditionsAfterRel11.log_match(match_value.accessCapLateAdditionsAfterRel11(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_accessCapLateAdditionsAfterRel11.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".accessCapLateAdditionsAfterRel11 := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_accessCapLateAdditionsAfterRel11.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("{ accessCapLateAdditionsRel11 := "); single_value->field_accessCapLateAdditionsRel11.log_match(match_value.accessCapLateAdditionsRel11(), legacy); TTCN_Logger::log_event_str(", accessCapLateAdditionsAfterRel11 := "); if (match_value.accessCapLateAdditionsAfterRel11().ispresent()) { single_value->field_accessCapLateAdditionsAfterRel11.log_match(match_value.accessCapLateAdditionsAfterRel11(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_accessCapLateAdditionsAfterRel11.log(); if (single_value->field_accessCapLateAdditionsAfterRel11.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 AccessCapAdditionsAfterRel12__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessCapLateAdditionsRel11.encode_text(text_buf); single_value->field_accessCapLateAdditionsAfterRel11.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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); } } void AccessCapAdditionsAfterRel12__BSSGP_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_accessCapLateAdditionsRel11.decode_text(text_buf); single_value->field_accessCapLateAdditionsAfterRel11.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 AccessCapAdditionsAfterRel12__BSSGP_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 @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP."); } } void AccessCapAdditionsAfterRel12__BSSGP_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: { AccessCapAdditionsAfterRel12__BSSGP_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) accessCapLateAdditionsRel11().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapLateAdditionsAfterRel11().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(), "accessCapLateAdditionsRel11")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapLateAdditionsRel11().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapLateAdditionsAfterRel11")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapLateAdditionsAfterRel11().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapAdditionsAfterRel12__BSSGP_template* precondition = new AccessCapAdditionsAfterRel12__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapAdditionsAfterRel12__BSSGP_template* implied_template = new AccessCapAdditionsAfterRel12__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapAdditionsAfterRel12__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapAdditionsAfterRel12__BSSGP_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_accessCapLateAdditionsRel11.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP"); single_value->field_accessCapLateAdditionsAfterRel11.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP"); 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 : "@BSSGP_Types.AccessCapAdditionsAfterRel12_BSSGP"); } boolean AccessCapAdditionsAfterRel12__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapAdditionsAfterRel12__BSSGP_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_spare__bits) : field_lengthIndicator(par_lengthIndicator), field_accessCapabilities(par_accessCapabilities), field_spare__bits(par_spare__bits) { } AccessCapabilitiesStruct__BSSGP::AccessCapabilitiesStruct__BSSGP(const AccessCapabilitiesStruct__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator(); else field_lengthIndicator.clean_up(); if (other_value.accessCapabilities().is_bound()) field_accessCapabilities = other_value.accessCapabilities(); else field_accessCapabilities.clean_up(); if (other_value.spare__bits().is_bound()) field_spare__bits = other_value.spare__bits(); else field_spare__bits.clean_up(); } void AccessCapabilitiesStruct__BSSGP::clean_up() { field_lengthIndicator.clean_up(); field_accessCapabilities.clean_up(); field_spare__bits.clean_up(); } const TTCN_Typedescriptor_t* AccessCapabilitiesStruct__BSSGP::get_descriptor() const { return &AccessCapabilitiesStruct__BSSGP_descr_; } AccessCapabilitiesStruct__BSSGP& AccessCapabilitiesStruct__BSSGP::operator=(const AccessCapabilitiesStruct__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator(); else field_lengthIndicator.clean_up(); if (other_value.accessCapabilities().is_bound()) field_accessCapabilities = other_value.accessCapabilities(); else field_accessCapabilities.clean_up(); if (other_value.spare__bits().is_bound()) field_spare__bits = other_value.spare__bits(); else field_spare__bits.clean_up(); } return *this; } boolean AccessCapabilitiesStruct__BSSGP::operator==(const AccessCapabilitiesStruct__BSSGP& other_value) const { return field_lengthIndicator==other_value.field_lengthIndicator && field_accessCapabilities==other_value.field_accessCapabilities && field_spare__bits==other_value.field_spare__bits; } boolean AccessCapabilitiesStruct__BSSGP::is_bound() const { return (field_lengthIndicator.is_bound()) || (field_accessCapabilities.is_bound()) || (OPTIONAL_OMIT == field_spare__bits.get_selection() || field_spare__bits.is_bound()); } boolean AccessCapabilitiesStruct__BSSGP::is_value() const { return field_lengthIndicator.is_value() && field_accessCapabilities.is_value() && (OPTIONAL_OMIT == field_spare__bits.get_selection() || field_spare__bits.is_value()); } int AccessCapabilitiesStruct__BSSGP::size_of() const { int ret_val = 2; if (field_spare__bits.ispresent()) ret_val++; return ret_val; } void AccessCapabilitiesStruct__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ lengthIndicator := "); field_lengthIndicator.log(); TTCN_Logger::log_event_str(", accessCapabilities := "); field_accessCapabilities.log(); TTCN_Logger::log_event_str(", spare_bits := "); field_spare__bits.log(); TTCN_Logger::log_event_str(" }"); } void AccessCapabilitiesStruct__BSSGP::set_implicit_omit() { if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit(); if (accessCapabilities().is_bound()) accessCapabilities().set_implicit_omit(); if (!spare__bits().is_bound()) spare__bits() = OMIT_VALUE; else spare__bits().set_implicit_omit(); } void AccessCapabilitiesStruct__BSSGP::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) lengthIndicator().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapabilities().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare__bits().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(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapabilities")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapabilities().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "spare_bits")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { spare__bits().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AccessCapabilitiesStruct_BSSGP"); } } void AccessCapabilitiesStruct__BSSGP::encode_text(Text_Buf& text_buf) const { field_lengthIndicator.encode_text(text_buf); field_accessCapabilities.encode_text(text_buf); field_spare__bits.encode_text(text_buf); } void AccessCapabilitiesStruct__BSSGP::decode_text(Text_Buf& text_buf) { field_lengthIndicator.decode_text(text_buf); field_accessCapabilities.decode_text(text_buf); field_spare__bits.decode_text(text_buf); } void AccessCapabilitiesStruct__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AccessCapabilitiesStruct__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AccessCapabilitiesStruct__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field0 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, AccessCapabilitiesStruct__BSSGP_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(AccessCapabilitiesStruct__BSSGP_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); INTEGER tmp0 = field_lengthIndicator.convert_to_Integer(AccessCapabilitiesStruct__BSSGP_lengthIndicator_descr_); field_lengthIndicator = tmp0; value_of_length_field0 += tmp0.get_long_long_val() * 1; RAW_Force_Omit field_1_force_omit(1, force_omit, AccessCapabilitiesStruct__BSSGP_accessCapabilities_descr_.raw->forceomit); decoded_field_length = field_accessCapabilities.RAW_decode(AccessCapabilitiesStruct__BSSGP_accessCapabilities_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field0 -= decoded_field_length; if (limit > 0 && value_of_length_field0 > 0){ if (force_omit != NULL && (*force_omit)(2)) { field_spare__bits = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_2_force_omit(2, force_omit, AccessCapabilitiesStruct__BSSGP_spare__bits_descr_.raw->forceomit); decoded_field_length = field_spare__bits().RAW_decode(AccessCapabilitiesStruct__BSSGP_spare__bits_descr_, p_buf, min_of_ints(2, limit, value_of_length_field0), local_top_order, TRUE, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 1) { field_spare__bits = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field0 -= decoded_field_length; } } } else field_spare__bits=OMIT_VALUE; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AccessCapabilitiesStruct__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 3; myleaf.body.node.nodes = init_nodes_of_enc_tree(3); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AccessCapabilitiesStruct__BSSGP_lengthIndicator_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AccessCapabilitiesStruct__BSSGP_accessCapabilities_descr_.raw); if (field_spare__bits.ispresent()) { myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AccessCapabilitiesStruct__BSSGP_spare__bits_descr_.raw); } else myleaf.body.node.nodes[2] = NULL; encoded_length += 7; myleaf.body.node.nodes[0]->calc = CALC_LENGTH; myleaf.body.node.nodes[0]->coding_descr = &AccessCapabilitiesStruct__BSSGP_lengthIndicator_descr_; myleaf.body.node.nodes[0]->calcof.lengthto.num_of_fields = 2; myleaf.body.node.nodes[0]->calcof.lengthto.unit = 1; myleaf.body.node.nodes[0]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[0]->calcof.lengthto.fields = init_lengthto_fields_list(2); myleaf.body.node.nodes[0]->length = 7; myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[1]->curr_pos.level; myleaf.body.node.nodes[0]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[1]->curr_pos.pos; if (field_spare__bits.ispresent()) { myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[2]->curr_pos.level; myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[2]->curr_pos.pos; } else { myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].level = 0; myleaf.body.node.nodes[0]->calcof.lengthto.fields[1].pos = 0; } encoded_length += field_accessCapabilities.RAW_encode(AccessCapabilitiesStruct__BSSGP_accessCapabilities_descr_, *myleaf.body.node.nodes[1]); if (field_spare__bits.ispresent()) { encoded_length += field_spare__bits().RAW_encode(AccessCapabilitiesStruct__BSSGP_spare__bits_descr_, *myleaf.body.node.nodes[2]); } return myleaf.length = encoded_length; } struct AccessCapabilitiesStruct__BSSGP_template::single_value_struct { INTEGER_template field_lengthIndicator; AccessCapabilities__BSSGP_template field_accessCapabilities; BITSTRING_template field_spare__bits; }; void AccessCapabilitiesStruct__BSSGP_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_lengthIndicator = ANY_VALUE; single_value->field_accessCapabilities = ANY_VALUE; single_value->field_spare__bits = ANY_OR_OMIT; } } } void AccessCapabilitiesStruct__BSSGP_template::copy_value(const AccessCapabilitiesStruct__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.accessCapabilities().is_bound()) { single_value->field_accessCapabilities = other_value.accessCapabilities(); } else { single_value->field_accessCapabilities.clean_up(); } if (other_value.spare__bits().is_bound()) { if (other_value.spare__bits().ispresent()) single_value->field_spare__bits = other_value.spare__bits()(); else single_value->field_spare__bits = OMIT_VALUE; } else { single_value->field_spare__bits.clean_up(); } set_selection(SPECIFIC_VALUE); } void AccessCapabilitiesStruct__BSSGP_template::copy_template(const AccessCapabilitiesStruct__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapabilities().get_selection()) { single_value->field_accessCapabilities = other_value.accessCapabilities(); } else { single_value->field_accessCapabilities.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.spare__bits().get_selection()) { single_value->field_spare__bits = other_value.spare__bits(); } else { single_value->field_spare__bits.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 AccessCapabilitiesStruct__BSSGP_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 AccessCapabilitiesStruct__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AccessCapabilitiesStruct__BSSGP_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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); break; } set_selection(other_value); } AccessCapabilitiesStruct__BSSGP_template::AccessCapabilitiesStruct__BSSGP_template() { } AccessCapabilitiesStruct__BSSGP_template::AccessCapabilitiesStruct__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AccessCapabilitiesStruct__BSSGP_template::AccessCapabilitiesStruct__BSSGP_template(const AccessCapabilitiesStruct__BSSGP& other_value) { copy_value(other_value); } AccessCapabilitiesStruct__BSSGP_template::AccessCapabilitiesStruct__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapabilitiesStruct__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP from an unbound optional field."); } } AccessCapabilitiesStruct__BSSGP_template::AccessCapabilitiesStruct__BSSGP_template(AccessCapabilitiesStruct__BSSGP_template* p_precondition, AccessCapabilitiesStruct__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AccessCapabilitiesStruct__BSSGP_template::AccessCapabilitiesStruct__BSSGP_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; } AccessCapabilitiesStruct__BSSGP_template::AccessCapabilitiesStruct__BSSGP_template(const AccessCapabilitiesStruct__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AccessCapabilitiesStruct__BSSGP_template::~AccessCapabilitiesStruct__BSSGP_template() { clean_up(); } AccessCapabilitiesStruct__BSSGP_template& AccessCapabilitiesStruct__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AccessCapabilitiesStruct__BSSGP_template& AccessCapabilitiesStruct__BSSGP_template::operator=(const AccessCapabilitiesStruct__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AccessCapabilitiesStruct__BSSGP_template& AccessCapabilitiesStruct__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AccessCapabilitiesStruct__BSSGP&)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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); } return *this; } AccessCapabilitiesStruct__BSSGP_template& AccessCapabilitiesStruct__BSSGP_template::operator=(const AccessCapabilitiesStruct__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AccessCapabilitiesStruct__BSSGP_template::match(const AccessCapabilitiesStruct__BSSGP& 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.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.accessCapabilities().is_bound()) return FALSE; if(!single_value->field_accessCapabilities.match(other_value.accessCapabilities(), legacy))return FALSE; if(!other_value.spare__bits().is_bound()) return FALSE; if((other_value.spare__bits().ispresent() ? !single_value->field_spare__bits.match((const BITSTRING&)other_value.spare__bits(), legacy) : !single_value->field_spare__bits.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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); } return FALSE; } boolean AccessCapabilitiesStruct__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_lengthIndicator.is_bound() || single_value->field_accessCapabilities.is_bound() || (single_value->field_spare__bits.is_omit() || single_value->field_spare__bits.is_bound()); } boolean AccessCapabilitiesStruct__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_lengthIndicator.is_value() && single_value->field_accessCapabilities.is_value() && (single_value->field_spare__bits.is_omit() || single_value->field_spare__bits.is_value()); } void AccessCapabilitiesStruct__BSSGP_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; } AccessCapabilitiesStruct__BSSGP AccessCapabilitiesStruct__BSSGP_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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); AccessCapabilitiesStruct__BSSGP ret_val; if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_accessCapabilities.is_bound()) { ret_val.accessCapabilities() = single_value->field_accessCapabilities.valueof(); } if (single_value->field_spare__bits.is_omit()) ret_val.spare__bits() = OMIT_VALUE; else if (single_value->field_spare__bits.is_bound()) { ret_val.spare__bits() = single_value->field_spare__bits.valueof(); } return ret_val; } void AccessCapabilitiesStruct__BSSGP_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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AccessCapabilitiesStruct__BSSGP_template[list_length]; } AccessCapabilitiesStruct__BSSGP_template& AccessCapabilitiesStruct__BSSGP_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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); return value_list.list_value[list_index]; } INTEGER_template& AccessCapabilitiesStruct__BSSGP_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const INTEGER_template& AccessCapabilitiesStruct__BSSGP_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); return single_value->field_lengthIndicator; } AccessCapabilities__BSSGP_template& AccessCapabilitiesStruct__BSSGP_template::accessCapabilities() { set_specific(); return single_value->field_accessCapabilities; } const AccessCapabilities__BSSGP_template& AccessCapabilitiesStruct__BSSGP_template::accessCapabilities() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapabilities of a non-specific template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); return single_value->field_accessCapabilities; } BITSTRING_template& AccessCapabilitiesStruct__BSSGP_template::spare__bits() { set_specific(); return single_value->field_spare__bits; } const BITSTRING_template& AccessCapabilitiesStruct__BSSGP_template::spare__bits() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field spare_bits of a non-specific template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); return single_value->field_spare__bits; } int AccessCapabilitiesStruct__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 2; if (single_value->field_spare__bits.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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP 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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); } return 0; } void AccessCapabilitiesStruct__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", accessCapabilities := "); single_value->field_accessCapabilities.log(); TTCN_Logger::log_event_str(", spare_bits := "); single_value->field_spare__bits.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 AccessCapabilitiesStruct__BSSGP_template::log_match(const AccessCapabilitiesStruct__BSSGP& 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_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_accessCapabilities.match(match_value.accessCapabilities(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapabilities"); single_value->field_accessCapabilities.log_match(match_value.accessCapabilities(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.spare__bits().ispresent()){ if(!single_value->field_spare__bits.match(match_value.spare__bits(), legacy)){ TTCN_Logger::log_logmatch_info(".spare_bits"); single_value->field_spare__bits.log_match(match_value.spare__bits(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_spare__bits.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".spare_bits := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_spare__bits.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("{ lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", accessCapabilities := "); single_value->field_accessCapabilities.log_match(match_value.accessCapabilities(), legacy); TTCN_Logger::log_event_str(", spare_bits := "); if (match_value.spare__bits().ispresent()) { single_value->field_spare__bits.log_match(match_value.spare__bits(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_spare__bits.log(); if (single_value->field_spare__bits.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 AccessCapabilitiesStruct__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_accessCapabilities.encode_text(text_buf); single_value->field_spare__bits.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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); } } void AccessCapabilitiesStruct__BSSGP_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_lengthIndicator.decode_text(text_buf); single_value->field_accessCapabilities.decode_text(text_buf); single_value->field_spare__bits.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 AccessCapabilitiesStruct__BSSGP_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 @BSSGP_Types.AccessCapabilitiesStruct_BSSGP."); } } void AccessCapabilitiesStruct__BSSGP_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: { AccessCapabilitiesStruct__BSSGP_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) lengthIndicator().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapabilities().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare__bits().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(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapabilities")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapabilities().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "spare_bits")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { spare__bits().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AccessCapabilitiesStruct_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AccessCapabilitiesStruct__BSSGP_template* precondition = new AccessCapabilitiesStruct__BSSGP_template; precondition->set_param(*param.get_elem(0)); AccessCapabilitiesStruct__BSSGP_template* implied_template = new AccessCapabilitiesStruct__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AccessCapabilitiesStruct__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AccessCapabilitiesStruct_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AccessCapabilitiesStruct__BSSGP_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_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilitiesStruct_BSSGP"); single_value->field_accessCapabilities.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilitiesStruct_BSSGP"); single_value->field_spare__bits.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AccessCapabilitiesStruct_BSSGP"); 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 : "@BSSGP_Types.AccessCapabilitiesStruct_BSSGP"); } boolean AccessCapabilitiesStruct__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AccessCapabilitiesStruct__BSSGP_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) accessTechnType().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapabilities().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(), "accessTechnType")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessTechnType().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapabilities")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapabilities().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP"); } } void MSRACapabilityValuesExclude1111__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessTechnType.encode_text(text_buf); field_accessCapabilities.encode_text(text_buf); } void MSRACapabilityValuesExclude1111__BSSGP::decode_text(Text_Buf& text_buf) { field_accessTechnType.decode_text(text_buf); field_accessCapabilities.decode_text(text_buf); } void MSRACapabilityValuesExclude1111__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MSRACapabilityValuesExclude1111__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MSRACapabilityValuesExclude1111__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_.raw->forceomit); decoded_field_length = field_accessTechnType.RAW_decode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MSRACapabilityValuesExclude1111__BSSGP_accessCapabilities_descr_.raw->forceomit); decoded_field_length = field_accessCapabilities.RAW_decode(MSRACapabilityValuesExclude1111__BSSGP_accessCapabilities_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_accessTechnType != bs_2 && field_accessTechnType != bs_3 && field_accessTechnType != bs_4 && field_accessTechnType != bs_5 && field_accessTechnType != bs_6 && field_accessTechnType != bs_7 && field_accessTechnType != bs_8 && field_accessTechnType != bs_9 && field_accessTechnType != bs_10 && field_accessTechnType != bs_11 && field_accessTechnType != bs_12 && field_accessTechnType != bs_13) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MSRACapabilityValuesExclude1111__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MSRACapabilityValuesExclude1111__BSSGP_accessCapabilities_descr_.raw); encoded_length += field_accessTechnType.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_accessCapabilities.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessCapabilities_descr_, *myleaf.body.node.nodes[1]); if (field_accessTechnType != bs_2 && field_accessTechnType != bs_3 && field_accessTechnType != bs_4 && field_accessTechnType != bs_5 && field_accessTechnType != bs_6 && field_accessTechnType != bs_7 && field_accessTechnType != bs_8 && field_accessTechnType != bs_9 && field_accessTechnType != bs_10 && field_accessTechnType != bs_11 && field_accessTechnType != bs_12 && field_accessTechnType != bs_13) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_2.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos1; pr_pos1.level=myleaf.curr_pos.level+1; int new_pos1[]={0}; pr_pos1.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos1); temp_leaf = myleaf.get_node(pr_pos1); if(temp_leaf != NULL){ bs_3.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos2; pr_pos2.level=myleaf.curr_pos.level+1; int new_pos2[]={0}; pr_pos2.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos2); temp_leaf = myleaf.get_node(pr_pos2); if(temp_leaf != NULL){ bs_4.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos3; pr_pos3.level=myleaf.curr_pos.level+1; int new_pos3[]={0}; pr_pos3.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos3); temp_leaf = myleaf.get_node(pr_pos3); if(temp_leaf != NULL){ bs_5.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos4; pr_pos4.level=myleaf.curr_pos.level+1; int new_pos4[]={0}; pr_pos4.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos4); temp_leaf = myleaf.get_node(pr_pos4); if(temp_leaf != NULL){ bs_6.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos5; pr_pos5.level=myleaf.curr_pos.level+1; int new_pos5[]={0}; pr_pos5.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos5); temp_leaf = myleaf.get_node(pr_pos5); if(temp_leaf != NULL){ bs_7.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos6; pr_pos6.level=myleaf.curr_pos.level+1; int new_pos6[]={0}; pr_pos6.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos6); temp_leaf = myleaf.get_node(pr_pos6); if(temp_leaf != NULL){ bs_8.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos7; pr_pos7.level=myleaf.curr_pos.level+1; int new_pos7[]={0}; pr_pos7.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos7); temp_leaf = myleaf.get_node(pr_pos7); if(temp_leaf != NULL){ bs_9.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos8; pr_pos8.level=myleaf.curr_pos.level+1; int new_pos8[]={0}; pr_pos8.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos8); temp_leaf = myleaf.get_node(pr_pos8); if(temp_leaf != NULL){ bs_10.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos9; pr_pos9.level=myleaf.curr_pos.level+1; int new_pos9[]={0}; pr_pos9.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos9); temp_leaf = myleaf.get_node(pr_pos9); if(temp_leaf != NULL){ bs_11.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos10; pr_pos10.level=myleaf.curr_pos.level+1; int new_pos10[]={0}; pr_pos10.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos10); temp_leaf = myleaf.get_node(pr_pos10); if(temp_leaf != NULL){ bs_12.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { RAW_enc_tr_pos pr_pos11; pr_pos11.level=myleaf.curr_pos.level+1; int new_pos11[]={0}; pr_pos11.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos11); temp_leaf = myleaf.get_node(pr_pos11); if(temp_leaf != NULL){ bs_13.RAW_encode(MSRACapabilityValuesExclude1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos11.pos); } free_tree_pos(pr_pos10.pos); } free_tree_pos(pr_pos9.pos); } free_tree_pos(pr_pos8.pos); } free_tree_pos(pr_pos7.pos); } free_tree_pos(pr_pos6.pos); } free_tree_pos(pr_pos5.pos); } free_tree_pos(pr_pos4.pos); } free_tree_pos(pr_pos3.pos); } free_tree_pos(pr_pos2.pos); } free_tree_pos(pr_pos1.pos); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct MSRACapabilityValuesExclude1111__BSSGP_template::single_value_struct { BITSTRING_template field_accessTechnType; AccessCapabilitiesStruct__BSSGP_template field_accessCapabilities; }; void MSRACapabilityValuesExclude1111__BSSGP_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_accessTechnType = ANY_VALUE; single_value->field_accessCapabilities = ANY_VALUE; } } } void MSRACapabilityValuesExclude1111__BSSGP_template::copy_value(const MSRACapabilityValuesExclude1111__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessTechnType().is_bound()) { single_value->field_accessTechnType = other_value.accessTechnType(); } else { single_value->field_accessTechnType.clean_up(); } if (other_value.accessCapabilities().is_bound()) { single_value->field_accessCapabilities = other_value.accessCapabilities(); } else { single_value->field_accessCapabilities.clean_up(); } set_selection(SPECIFIC_VALUE); } void MSRACapabilityValuesExclude1111__BSSGP_template::copy_template(const MSRACapabilityValuesExclude1111__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessTechnType().get_selection()) { single_value->field_accessTechnType = other_value.accessTechnType(); } else { single_value->field_accessTechnType.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.accessCapabilities().get_selection()) { single_value->field_accessCapabilities = other_value.accessCapabilities(); } else { single_value->field_accessCapabilities.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 MSRACapabilityValuesExclude1111__BSSGP_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 MSRACapabilityValuesExclude1111__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MSRACapabilityValuesExclude1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); break; } set_selection(other_value); } MSRACapabilityValuesExclude1111__BSSGP_template::MSRACapabilityValuesExclude1111__BSSGP_template() { } MSRACapabilityValuesExclude1111__BSSGP_template::MSRACapabilityValuesExclude1111__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MSRACapabilityValuesExclude1111__BSSGP_template::MSRACapabilityValuesExclude1111__BSSGP_template(const MSRACapabilityValuesExclude1111__BSSGP& other_value) { copy_value(other_value); } MSRACapabilityValuesExclude1111__BSSGP_template::MSRACapabilityValuesExclude1111__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRACapabilityValuesExclude1111__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP from an unbound optional field."); } } MSRACapabilityValuesExclude1111__BSSGP_template::MSRACapabilityValuesExclude1111__BSSGP_template(MSRACapabilityValuesExclude1111__BSSGP_template* p_precondition, MSRACapabilityValuesExclude1111__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MSRACapabilityValuesExclude1111__BSSGP_template::MSRACapabilityValuesExclude1111__BSSGP_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; } MSRACapabilityValuesExclude1111__BSSGP_template::MSRACapabilityValuesExclude1111__BSSGP_template(const MSRACapabilityValuesExclude1111__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MSRACapabilityValuesExclude1111__BSSGP_template::~MSRACapabilityValuesExclude1111__BSSGP_template() { clean_up(); } MSRACapabilityValuesExclude1111__BSSGP_template& MSRACapabilityValuesExclude1111__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MSRACapabilityValuesExclude1111__BSSGP_template& MSRACapabilityValuesExclude1111__BSSGP_template::operator=(const MSRACapabilityValuesExclude1111__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MSRACapabilityValuesExclude1111__BSSGP_template& MSRACapabilityValuesExclude1111__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRACapabilityValuesExclude1111__BSSGP&)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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); } return *this; } MSRACapabilityValuesExclude1111__BSSGP_template& MSRACapabilityValuesExclude1111__BSSGP_template::operator=(const MSRACapabilityValuesExclude1111__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MSRACapabilityValuesExclude1111__BSSGP_template::match(const MSRACapabilityValuesExclude1111__BSSGP& 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.accessTechnType().is_bound()) return FALSE; if(!single_value->field_accessTechnType.match(other_value.accessTechnType(), legacy))return FALSE; if(!other_value.accessCapabilities().is_bound()) return FALSE; if(!single_value->field_accessCapabilities.match(other_value.accessCapabilities(), 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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); } return FALSE; } boolean MSRACapabilityValuesExclude1111__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessTechnType.is_bound() || single_value->field_accessCapabilities.is_bound(); } boolean MSRACapabilityValuesExclude1111__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessTechnType.is_value() && single_value->field_accessCapabilities.is_value(); } void MSRACapabilityValuesExclude1111__BSSGP_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; } MSRACapabilityValuesExclude1111__BSSGP MSRACapabilityValuesExclude1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); MSRACapabilityValuesExclude1111__BSSGP ret_val; if (single_value->field_accessTechnType.is_bound()) { ret_val.accessTechnType() = single_value->field_accessTechnType.valueof(); } if (single_value->field_accessCapabilities.is_bound()) { ret_val.accessCapabilities() = single_value->field_accessCapabilities.valueof(); } return ret_val; } void MSRACapabilityValuesExclude1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MSRACapabilityValuesExclude1111__BSSGP_template[list_length]; } MSRACapabilityValuesExclude1111__BSSGP_template& MSRACapabilityValuesExclude1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& MSRACapabilityValuesExclude1111__BSSGP_template::accessTechnType() { set_specific(); return single_value->field_accessTechnType; } const BITSTRING_template& MSRACapabilityValuesExclude1111__BSSGP_template::accessTechnType() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessTechnType of a non-specific template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); return single_value->field_accessTechnType; } AccessCapabilitiesStruct__BSSGP_template& MSRACapabilityValuesExclude1111__BSSGP_template::accessCapabilities() { set_specific(); return single_value->field_accessCapabilities; } const AccessCapabilitiesStruct__BSSGP_template& MSRACapabilityValuesExclude1111__BSSGP_template::accessCapabilities() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessCapabilities of a non-specific template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); return single_value->field_accessCapabilities; } int MSRACapabilityValuesExclude1111__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP 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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP 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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); } return 0; } void MSRACapabilityValuesExclude1111__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessTechnType := "); single_value->field_accessTechnType.log(); TTCN_Logger::log_event_str(", accessCapabilities := "); single_value->field_accessCapabilities.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 MSRACapabilityValuesExclude1111__BSSGP_template::log_match(const MSRACapabilityValuesExclude1111__BSSGP& 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_accessTechnType.match(match_value.accessTechnType(), legacy)){ TTCN_Logger::log_logmatch_info(".accessTechnType"); single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_accessCapabilities.match(match_value.accessCapabilities(), legacy)){ TTCN_Logger::log_logmatch_info(".accessCapabilities"); single_value->field_accessCapabilities.log_match(match_value.accessCapabilities(), 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("{ accessTechnType := "); single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy); TTCN_Logger::log_event_str(", accessCapabilities := "); single_value->field_accessCapabilities.log_match(match_value.accessCapabilities(), 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 MSRACapabilityValuesExclude1111__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessTechnType.encode_text(text_buf); single_value->field_accessCapabilities.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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); } } void MSRACapabilityValuesExclude1111__BSSGP_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_accessTechnType.decode_text(text_buf); single_value->field_accessCapabilities.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 MSRACapabilityValuesExclude1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP."); } } void MSRACapabilityValuesExclude1111__BSSGP_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: { MSRACapabilityValuesExclude1111__BSSGP_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) accessTechnType().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) accessCapabilities().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(), "accessTechnType")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessTechnType().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "accessCapabilities")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessCapabilities().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MSRACapabilityValuesExclude1111__BSSGP_template* precondition = new MSRACapabilityValuesExclude1111__BSSGP_template; precondition->set_param(*param.get_elem(0)); MSRACapabilityValuesExclude1111__BSSGP_template* implied_template = new MSRACapabilityValuesExclude1111__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MSRACapabilityValuesExclude1111__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MSRACapabilityValuesExclude1111__BSSGP_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_accessTechnType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP"); single_value->field_accessCapabilities.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP"); 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 : "@BSSGP_Types.MSRACapabilityValuesExclude1111_BSSGP"); } boolean MSRACapabilityValuesExclude1111__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MSRACapabilityValuesExclude1111__BSSGP_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_additionalAccessTechnologiesRepetition, const BITSTRING& par_spare__bits) : field_accessTechnType(par_accessTechnType), field_lengthIndicator(par_lengthIndicator), field_presenceIndicator__AdditionalAccessTechnologiesRepetition(par_presenceIndicator__AdditionalAccessTechnologiesRepetition), field_additionalAccessTechnologiesRepetition(par_additionalAccessTechnologiesRepetition), field_spare__bits(par_spare__bits) { } MSRACapabilityValues1111__BSSGP::MSRACapabilityValues1111__BSSGP(const MSRACapabilityValues1111__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType(); else field_accessTechnType.clean_up(); if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator(); else field_lengthIndicator.clean_up(); if (other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) field_presenceIndicator__AdditionalAccessTechnologiesRepetition = other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(); else field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up(); if (other_value.additionalAccessTechnologiesRepetition().is_bound()) field_additionalAccessTechnologiesRepetition = other_value.additionalAccessTechnologiesRepetition(); else field_additionalAccessTechnologiesRepetition.clean_up(); if (other_value.spare__bits().is_bound()) field_spare__bits = other_value.spare__bits(); else field_spare__bits.clean_up(); } void MSRACapabilityValues1111__BSSGP::clean_up() { field_accessTechnType.clean_up(); field_lengthIndicator.clean_up(); field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up(); field_additionalAccessTechnologiesRepetition.clean_up(); field_spare__bits.clean_up(); } const TTCN_Typedescriptor_t* MSRACapabilityValues1111__BSSGP::get_descriptor() const { return &MSRACapabilityValues1111__BSSGP_descr_; } MSRACapabilityValues1111__BSSGP& MSRACapabilityValues1111__BSSGP::operator=(const MSRACapabilityValues1111__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType(); else field_accessTechnType.clean_up(); if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator(); else field_lengthIndicator.clean_up(); if (other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) field_presenceIndicator__AdditionalAccessTechnologiesRepetition = other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(); else field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up(); if (other_value.additionalAccessTechnologiesRepetition().is_bound()) field_additionalAccessTechnologiesRepetition = other_value.additionalAccessTechnologiesRepetition(); else field_additionalAccessTechnologiesRepetition.clean_up(); if (other_value.spare__bits().is_bound()) field_spare__bits = other_value.spare__bits(); else field_spare__bits.clean_up(); } return *this; } boolean MSRACapabilityValues1111__BSSGP::operator==(const MSRACapabilityValues1111__BSSGP& other_value) const { return field_accessTechnType==other_value.field_accessTechnType && field_lengthIndicator==other_value.field_lengthIndicator && field_presenceIndicator__AdditionalAccessTechnologiesRepetition==other_value.field_presenceIndicator__AdditionalAccessTechnologiesRepetition && field_additionalAccessTechnologiesRepetition==other_value.field_additionalAccessTechnologiesRepetition && field_spare__bits==other_value.field_spare__bits; } boolean MSRACapabilityValues1111__BSSGP::is_bound() const { return (field_accessTechnType.is_bound()) || (field_lengthIndicator.is_bound()) || (field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_bound()) || (OPTIONAL_OMIT == field_additionalAccessTechnologiesRepetition.get_selection() || field_additionalAccessTechnologiesRepetition.is_bound()) || (field_spare__bits.is_bound()); } boolean MSRACapabilityValues1111__BSSGP::is_value() const { return field_accessTechnType.is_value() && field_lengthIndicator.is_value() && field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_value() && (OPTIONAL_OMIT == field_additionalAccessTechnologiesRepetition.get_selection() || field_additionalAccessTechnologiesRepetition.is_value()) && field_spare__bits.is_value(); } int MSRACapabilityValues1111__BSSGP::size_of() const { int ret_val = 4; if (field_additionalAccessTechnologiesRepetition.ispresent()) ret_val++; return ret_val; } void MSRACapabilityValues1111__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessTechnType := "); field_accessTechnType.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); field_lengthIndicator.log(); TTCN_Logger::log_event_str(", presenceIndicator_AdditionalAccessTechnologiesRepetition := "); field_presenceIndicator__AdditionalAccessTechnologiesRepetition.log(); TTCN_Logger::log_event_str(", additionalAccessTechnologiesRepetition := "); field_additionalAccessTechnologiesRepetition.log(); TTCN_Logger::log_event_str(", spare_bits := "); field_spare__bits.log(); TTCN_Logger::log_event_str(" }"); } void MSRACapabilityValues1111__BSSGP::set_implicit_omit() { if (accessTechnType().is_bound()) accessTechnType().set_implicit_omit(); if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit(); if (presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) presenceIndicator__AdditionalAccessTechnologiesRepetition().set_implicit_omit(); if (!additionalAccessTechnologiesRepetition().is_bound()) additionalAccessTechnologiesRepetition() = OMIT_VALUE; else additionalAccessTechnologiesRepetition().set_implicit_omit(); if (spare__bits().is_bound()) spare__bits().set_implicit_omit(); } void MSRACapabilityValues1111__BSSGP::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) accessTechnType().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceIndicator__AdditionalAccessTechnologiesRepetition().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) additionalAccessTechnologiesRepetition().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare__bits().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(), "accessTechnType")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessTechnType().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceIndicator_AdditionalAccessTechnologiesRepetition")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceIndicator__AdditionalAccessTechnologiesRepetition().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "additionalAccessTechnologiesRepetition")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { additionalAccessTechnologiesRepetition().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "spare_bits")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { spare__bits().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MSRACapabilityValues1111_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MSRACapabilityValues1111_BSSGP"); } } void MSRACapabilityValues1111__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessTechnType.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_presenceIndicator__AdditionalAccessTechnologiesRepetition.encode_text(text_buf); field_additionalAccessTechnologiesRepetition.encode_text(text_buf); field_spare__bits.encode_text(text_buf); } void MSRACapabilityValues1111__BSSGP::decode_text(Text_Buf& text_buf) { field_accessTechnType.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_presenceIndicator__AdditionalAccessTechnologiesRepetition.decode_text(text_buf); field_additionalAccessTechnologiesRepetition.decode_text(text_buf); field_spare__bits.decode_text(text_buf); } void MSRACapabilityValues1111__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MSRACapabilityValues1111__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MSRACapabilityValues1111__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field1 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, MSRACapabilityValues1111__BSSGP_accessTechnType_descr_.raw->forceomit); decoded_field_length = field_accessTechnType.RAW_decode(MSRACapabilityValues1111__BSSGP_accessTechnType_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MSRACapabilityValues1111__BSSGP_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(MSRACapabilityValues1111__BSSGP_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); INTEGER tmp1 = field_lengthIndicator.convert_to_Integer(MSRACapabilityValues1111__BSSGP_lengthIndicator_descr_); field_lengthIndicator = tmp1; value_of_length_field1 += tmp1.get_long_long_val() * 1; RAW_Force_Omit field_2_force_omit(2, force_omit, MSRACapabilityValues1111__BSSGP_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_.raw->forceomit); decoded_field_length = field_presenceIndicator__AdditionalAccessTechnologiesRepetition.RAW_decode(MSRACapabilityValues1111__BSSGP_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field1 -= decoded_field_length; if (limit > 0 && value_of_length_field1 > 0 && field_presenceIndicator__AdditionalAccessTechnologiesRepetition == bs_0){ if (force_omit != NULL && (*force_omit)(3)) { field_additionalAccessTechnologiesRepetition = OMIT_VALUE; } else { size_t fl_start_pos = p_buf.get_pos_bit(); RAW_Force_Omit field_3_force_omit(3, force_omit, MSRACapabilityValues1111__BSSGP_additionalAccessTechnologiesRepetition_descr_.raw->forceomit); decoded_field_length = field_additionalAccessTechnologiesRepetition().RAW_decode(MSRACapabilityValues1111__BSSGP_additionalAccessTechnologiesRepetition_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, TRUE, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 1) { field_additionalAccessTechnologiesRepetition = OMIT_VALUE; p_buf.set_pos_bit(fl_start_pos); } else { decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field1 -= decoded_field_length; } } } else field_additionalAccessTechnologiesRepetition=OMIT_VALUE; RAW_Force_Omit field_4_force_omit(4, force_omit, MSRACapabilityValues1111__BSSGP_spare__bits_descr_.raw->forceomit); decoded_field_length = field_spare__bits.RAW_decode(MSRACapabilityValues1111__BSSGP_spare__bits_descr_, p_buf, min_of_ints(2, limit, value_of_length_field1), local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field1 -= decoded_field_length; if (field_accessTechnType != bs_14) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MSRACapabilityValues1111__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 5; myleaf.body.node.nodes = init_nodes_of_enc_tree(5); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MSRACapabilityValues1111__BSSGP_accessTechnType_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MSRACapabilityValues1111__BSSGP_lengthIndicator_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MSRACapabilityValues1111__BSSGP_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_.raw); if (field_additionalAccessTechnologiesRepetition.ispresent()) { myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MSRACapabilityValues1111__BSSGP_additionalAccessTechnologiesRepetition_descr_.raw); } else myleaf.body.node.nodes[3] = NULL; myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MSRACapabilityValues1111__BSSGP_spare__bits_descr_.raw); encoded_length += field_accessTechnType.RAW_encode(MSRACapabilityValues1111__BSSGP_accessTechnType_descr_, *myleaf.body.node.nodes[0]); encoded_length += 7; myleaf.body.node.nodes[1]->calc = CALC_LENGTH; myleaf.body.node.nodes[1]->coding_descr = &MSRACapabilityValues1111__BSSGP_lengthIndicator_descr_; myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 3; myleaf.body.node.nodes[1]->calcof.lengthto.unit = 1; myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(3); myleaf.body.node.nodes[1]->length = 7; myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[2]->curr_pos.level; myleaf.body.node.nodes[1]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[2]->curr_pos.pos; if (field_additionalAccessTechnologiesRepetition.ispresent()) { myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[3]->curr_pos.pos; } else { myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].level = 0; myleaf.body.node.nodes[1]->calcof.lengthto.fields[1].pos = 0; } myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[4]->curr_pos.level; myleaf.body.node.nodes[1]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[4]->curr_pos.pos; encoded_length += field_presenceIndicator__AdditionalAccessTechnologiesRepetition.RAW_encode(MSRACapabilityValues1111__BSSGP_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_, *myleaf.body.node.nodes[2]); if (field_additionalAccessTechnologiesRepetition.ispresent()) { encoded_length += field_additionalAccessTechnologiesRepetition().RAW_encode(MSRACapabilityValues1111__BSSGP_additionalAccessTechnologiesRepetition_descr_, *myleaf.body.node.nodes[3]); } encoded_length += field_spare__bits.RAW_encode(MSRACapabilityValues1111__BSSGP_spare__bits_descr_, *myleaf.body.node.nodes[4]); if (field_additionalAccessTechnologiesRepetition.ispresent() && (field_presenceIndicator__AdditionalAccessTechnologiesRepetition != bs_0)) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={2}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_0.RAW_encode(MSRACapabilityValues1111__BSSGP_presenceIndicator__AdditionalAccessTechnologiesRepetition_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } if (field_accessTechnType != bs_14) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ bs_14.RAW_encode(MSRACapabilityValues1111__BSSGP_accessTechnType_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct MSRACapabilityValues1111__BSSGP_template::single_value_struct { BITSTRING_template field_accessTechnType; INTEGER_template field_lengthIndicator; BITSTRING_template field_presenceIndicator__AdditionalAccessTechnologiesRepetition; AdditionalAccessTechnologiesRepetition__BSSGP_template field_additionalAccessTechnologiesRepetition; BITSTRING_template field_spare__bits; }; void MSRACapabilityValues1111__BSSGP_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_accessTechnType = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition = ANY_VALUE; single_value->field_additionalAccessTechnologiesRepetition = ANY_OR_OMIT; single_value->field_spare__bits = ANY_VALUE; } } } void MSRACapabilityValues1111__BSSGP_template::copy_value(const MSRACapabilityValues1111__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessTechnType().is_bound()) { single_value->field_accessTechnType = other_value.accessTechnType(); } else { single_value->field_accessTechnType.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) { single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition = other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(); } else { single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up(); } if (other_value.additionalAccessTechnologiesRepetition().is_bound()) { if (other_value.additionalAccessTechnologiesRepetition().ispresent()) single_value->field_additionalAccessTechnologiesRepetition = other_value.additionalAccessTechnologiesRepetition()(); else single_value->field_additionalAccessTechnologiesRepetition = OMIT_VALUE; } else { single_value->field_additionalAccessTechnologiesRepetition.clean_up(); } if (other_value.spare__bits().is_bound()) { single_value->field_spare__bits = other_value.spare__bits(); } else { single_value->field_spare__bits.clean_up(); } set_selection(SPECIFIC_VALUE); } void MSRACapabilityValues1111__BSSGP_template::copy_template(const MSRACapabilityValues1111__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessTechnType().get_selection()) { single_value->field_accessTechnType = other_value.accessTechnType(); } else { single_value->field_accessTechnType.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().get_selection()) { single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition = other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(); } else { single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.additionalAccessTechnologiesRepetition().get_selection()) { single_value->field_additionalAccessTechnologiesRepetition = other_value.additionalAccessTechnologiesRepetition(); } else { single_value->field_additionalAccessTechnologiesRepetition.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.spare__bits().get_selection()) { single_value->field_spare__bits = other_value.spare__bits(); } else { single_value->field_spare__bits.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 MSRACapabilityValues1111__BSSGP_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 MSRACapabilityValues1111__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MSRACapabilityValues1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); break; } set_selection(other_value); } MSRACapabilityValues1111__BSSGP_template::MSRACapabilityValues1111__BSSGP_template() { } MSRACapabilityValues1111__BSSGP_template::MSRACapabilityValues1111__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MSRACapabilityValues1111__BSSGP_template::MSRACapabilityValues1111__BSSGP_template(const MSRACapabilityValues1111__BSSGP& other_value) { copy_value(other_value); } MSRACapabilityValues1111__BSSGP_template::MSRACapabilityValues1111__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRACapabilityValues1111__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP from an unbound optional field."); } } MSRACapabilityValues1111__BSSGP_template::MSRACapabilityValues1111__BSSGP_template(MSRACapabilityValues1111__BSSGP_template* p_precondition, MSRACapabilityValues1111__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MSRACapabilityValues1111__BSSGP_template::MSRACapabilityValues1111__BSSGP_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; } MSRACapabilityValues1111__BSSGP_template::MSRACapabilityValues1111__BSSGP_template(const MSRACapabilityValues1111__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MSRACapabilityValues1111__BSSGP_template::~MSRACapabilityValues1111__BSSGP_template() { clean_up(); } MSRACapabilityValues1111__BSSGP_template& MSRACapabilityValues1111__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MSRACapabilityValues1111__BSSGP_template& MSRACapabilityValues1111__BSSGP_template::operator=(const MSRACapabilityValues1111__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MSRACapabilityValues1111__BSSGP_template& MSRACapabilityValues1111__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRACapabilityValues1111__BSSGP&)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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); } return *this; } MSRACapabilityValues1111__BSSGP_template& MSRACapabilityValues1111__BSSGP_template::operator=(const MSRACapabilityValues1111__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MSRACapabilityValues1111__BSSGP_template::match(const MSRACapabilityValues1111__BSSGP& 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.accessTechnType().is_bound()) return FALSE; if(!single_value->field_accessTechnType.match(other_value.accessTechnType(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition().is_bound()) return FALSE; if(!single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.match(other_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(), legacy))return FALSE; if(!other_value.additionalAccessTechnologiesRepetition().is_bound()) return FALSE; if((other_value.additionalAccessTechnologiesRepetition().ispresent() ? !single_value->field_additionalAccessTechnologiesRepetition.match((const AdditionalAccessTechnologiesRepetition__BSSGP&)other_value.additionalAccessTechnologiesRepetition(), legacy) : !single_value->field_additionalAccessTechnologiesRepetition.match_omit(legacy)))return FALSE; if(!other_value.spare__bits().is_bound()) return FALSE; if(!single_value->field_spare__bits.match(other_value.spare__bits(), 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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); } return FALSE; } boolean MSRACapabilityValues1111__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessTechnType.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_bound() || (single_value->field_additionalAccessTechnologiesRepetition.is_omit() || single_value->field_additionalAccessTechnologiesRepetition.is_bound()) || single_value->field_spare__bits.is_bound(); } boolean MSRACapabilityValues1111__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessTechnType.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_value() && (single_value->field_additionalAccessTechnologiesRepetition.is_omit() || single_value->field_additionalAccessTechnologiesRepetition.is_value()) && single_value->field_spare__bits.is_value(); } void MSRACapabilityValues1111__BSSGP_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; } MSRACapabilityValues1111__BSSGP MSRACapabilityValues1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); MSRACapabilityValues1111__BSSGP ret_val; if (single_value->field_accessTechnType.is_bound()) { ret_val.accessTechnType() = single_value->field_accessTechnType.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.is_bound()) { ret_val.presenceIndicator__AdditionalAccessTechnologiesRepetition() = single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.valueof(); } if (single_value->field_additionalAccessTechnologiesRepetition.is_omit()) ret_val.additionalAccessTechnologiesRepetition() = OMIT_VALUE; else if (single_value->field_additionalAccessTechnologiesRepetition.is_bound()) { ret_val.additionalAccessTechnologiesRepetition() = single_value->field_additionalAccessTechnologiesRepetition.valueof(); } if (single_value->field_spare__bits.is_bound()) { ret_val.spare__bits() = single_value->field_spare__bits.valueof(); } return ret_val; } void MSRACapabilityValues1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MSRACapabilityValues1111__BSSGP_template[list_length]; } MSRACapabilityValues1111__BSSGP_template& MSRACapabilityValues1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& MSRACapabilityValues1111__BSSGP_template::accessTechnType() { set_specific(); return single_value->field_accessTechnType; } const BITSTRING_template& MSRACapabilityValues1111__BSSGP_template::accessTechnType() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessTechnType of a non-specific template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); return single_value->field_accessTechnType; } INTEGER_template& MSRACapabilityValues1111__BSSGP_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const INTEGER_template& MSRACapabilityValues1111__BSSGP_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); return single_value->field_lengthIndicator; } BITSTRING_template& MSRACapabilityValues1111__BSSGP_template::presenceIndicator__AdditionalAccessTechnologiesRepetition() { set_specific(); return single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition; } const BITSTRING_template& MSRACapabilityValues1111__BSSGP_template::presenceIndicator__AdditionalAccessTechnologiesRepetition() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceIndicator_AdditionalAccessTechnologiesRepetition of a non-specific template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); return single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition; } AdditionalAccessTechnologiesRepetition__BSSGP_template& MSRACapabilityValues1111__BSSGP_template::additionalAccessTechnologiesRepetition() { set_specific(); return single_value->field_additionalAccessTechnologiesRepetition; } const AdditionalAccessTechnologiesRepetition__BSSGP_template& MSRACapabilityValues1111__BSSGP_template::additionalAccessTechnologiesRepetition() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field additionalAccessTechnologiesRepetition of a non-specific template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); return single_value->field_additionalAccessTechnologiesRepetition; } BITSTRING_template& MSRACapabilityValues1111__BSSGP_template::spare__bits() { set_specific(); return single_value->field_spare__bits; } const BITSTRING_template& MSRACapabilityValues1111__BSSGP_template::spare__bits() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field spare_bits of a non-specific template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); return single_value->field_spare__bits; } int MSRACapabilityValues1111__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: { int ret_val = 4; if (single_value->field_additionalAccessTechnologiesRepetition.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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP 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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); } return 0; } void MSRACapabilityValues1111__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessTechnType := "); single_value->field_accessTechnType.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", presenceIndicator_AdditionalAccessTechnologiesRepetition := "); single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.log(); TTCN_Logger::log_event_str(", additionalAccessTechnologiesRepetition := "); single_value->field_additionalAccessTechnologiesRepetition.log(); TTCN_Logger::log_event_str(", spare_bits := "); single_value->field_spare__bits.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 MSRACapabilityValues1111__BSSGP_template::log_match(const MSRACapabilityValues1111__BSSGP& 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_accessTechnType.match(match_value.accessTechnType(), legacy)){ TTCN_Logger::log_logmatch_info(".accessTechnType"); single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.match(match_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceIndicator_AdditionalAccessTechnologiesRepetition"); single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.log_match(match_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if (match_value.additionalAccessTechnologiesRepetition().ispresent()){ if(!single_value->field_additionalAccessTechnologiesRepetition.match(match_value.additionalAccessTechnologiesRepetition(), legacy)){ TTCN_Logger::log_logmatch_info(".additionalAccessTechnologiesRepetition"); single_value->field_additionalAccessTechnologiesRepetition.log_match(match_value.additionalAccessTechnologiesRepetition(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } else { if (!single_value->field_additionalAccessTechnologiesRepetition.match_omit(legacy)){ TTCN_Logger::log_logmatch_info(".additionalAccessTechnologiesRepetition := omit with "); TTCN_Logger::print_logmatch_buffer(); single_value->field_additionalAccessTechnologiesRepetition.log(); TTCN_Logger::log_event_str(" unmatched"); TTCN_Logger::set_logmatch_buffer_len(previous_size); } } if(!single_value->field_spare__bits.match(match_value.spare__bits(), legacy)){ TTCN_Logger::log_logmatch_info(".spare_bits"); single_value->field_spare__bits.log_match(match_value.spare__bits(), 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("{ accessTechnType := "); single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", presenceIndicator_AdditionalAccessTechnologiesRepetition := "); single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.log_match(match_value.presenceIndicator__AdditionalAccessTechnologiesRepetition(), legacy); TTCN_Logger::log_event_str(", additionalAccessTechnologiesRepetition := "); if (match_value.additionalAccessTechnologiesRepetition().ispresent()) { single_value->field_additionalAccessTechnologiesRepetition.log_match(match_value.additionalAccessTechnologiesRepetition(), legacy); } else { TTCN_Logger::log_event_str("omit with "); single_value->field_additionalAccessTechnologiesRepetition.log(); if (single_value->field_additionalAccessTechnologiesRepetition.match_omit(legacy)) TTCN_Logger::log_event_str(" matched"); else TTCN_Logger::log_event_str(" unmatched"); } TTCN_Logger::log_event_str(", spare_bits := "); single_value->field_spare__bits.log_match(match_value.spare__bits(), 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 MSRACapabilityValues1111__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessTechnType.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.encode_text(text_buf); single_value->field_additionalAccessTechnologiesRepetition.encode_text(text_buf); single_value->field_spare__bits.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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); } } void MSRACapabilityValues1111__BSSGP_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_accessTechnType.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.decode_text(text_buf); single_value->field_additionalAccessTechnologiesRepetition.decode_text(text_buf); single_value->field_spare__bits.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 MSRACapabilityValues1111__BSSGP_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 @BSSGP_Types.MSRACapabilityValues1111_BSSGP."); } } void MSRACapabilityValues1111__BSSGP_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: { MSRACapabilityValues1111__BSSGP_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) accessTechnType().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) presenceIndicator__AdditionalAccessTechnologiesRepetition().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) additionalAccessTechnologiesRepetition().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare__bits().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(), "accessTechnType")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessTechnType().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceIndicator_AdditionalAccessTechnologiesRepetition")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceIndicator__AdditionalAccessTechnologiesRepetition().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "additionalAccessTechnologiesRepetition")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { additionalAccessTechnologiesRepetition().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "spare_bits")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { spare__bits().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MSRACapabilityValues1111_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MSRACapabilityValues1111__BSSGP_template* precondition = new MSRACapabilityValues1111__BSSGP_template; precondition->set_param(*param.get_elem(0)); MSRACapabilityValues1111__BSSGP_template* implied_template = new MSRACapabilityValues1111__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MSRACapabilityValues1111__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MSRACapabilityValues1111_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MSRACapabilityValues1111__BSSGP_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_accessTechnType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValues1111_BSSGP"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValues1111_BSSGP"); single_value->field_presenceIndicator__AdditionalAccessTechnologiesRepetition.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValues1111_BSSGP"); single_value->field_additionalAccessTechnologiesRepetition.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValues1111_BSSGP"); single_value->field_spare__bits.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValues1111_BSSGP"); 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 : "@BSSGP_Types.MSRACapabilityValues1111_BSSGP"); } boolean MSRACapabilityValues1111__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MSRACapabilityValues1111__BSSGP_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; } AdditionalAccessTechnologiesRepetition__BSSGP::AdditionalAccessTechnologiesRepetition__BSSGP(const AdditionalAccessTechnologiesRepetition__BSSGP& other_value) { if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } AdditionalAccessTechnologiesRepetition__BSSGP::~AdditionalAccessTechnologiesRepetition__BSSGP() { clean_up(); if (val_ptr != NULL) val_ptr = NULL; } void AdditionalAccessTechnologiesRepetition__BSSGP::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."); } } AdditionalAccessTechnologiesRepetition__BSSGP& AdditionalAccessTechnologiesRepetition__BSSGP::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; } AdditionalAccessTechnologiesRepetition__BSSGP& AdditionalAccessTechnologiesRepetition__BSSGP::operator=(const AdditionalAccessTechnologiesRepetition__BSSGP& other_value) { if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); if (this != &other_value) { clean_up(); val_ptr = other_value.val_ptr; val_ptr->ref_count++; } return *this; } boolean AdditionalAccessTechnologiesRepetition__BSSGP::operator==(null_type) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); return val_ptr->n_elements == 0 ; } boolean AdditionalAccessTechnologiesRepetition__BSSGP::operator==(const AdditionalAccessTechnologiesRepetition__BSSGP& other_value) const { if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); 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; } AdditionalAccessTechnologiesRecord__BSSGP& AdditionalAccessTechnologiesRepetition__BSSGP::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP 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 = (AdditionalAccessTechnologiesRecord__BSSGP**)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 AdditionalAccessTechnologiesRecord__BSSGP(*(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 AdditionalAccessTechnologiesRecord__BSSGP; } return *val_ptr->value_elements[index_value]; } AdditionalAccessTechnologiesRecord__BSSGP& AdditionalAccessTechnologiesRepetition__BSSGP::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); return (*this)[(int)index_value]; } const AdditionalAccessTechnologiesRecord__BSSGP& AdditionalAccessTechnologiesRepetition__BSSGP::operator[](int index_value) const { if (val_ptr == NULL) TTCN_error("Accessing an element in an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); if (index_value < 0) TTCN_error("Accessing an element of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP using a negative index: %d.", index_value); if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP: 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 AdditionalAccessTechnologiesRecord__BSSGP& AdditionalAccessTechnologiesRepetition__BSSGP::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); return (*this)[(int)index_value]; } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP::operator<<=(int rotate_count) const { return *this >>= (-rotate_count); } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP::operator<<=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate left operator."); return *this >>= (int)(-rotate_count); } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP::operator>>=(const INTEGER& rotate_count) const { rotate_count.must_bound("Unbound integer operand of rotate right operator."); return *this >>= (int)rotate_count; } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP::operator>>=(int rotate_count) const { if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); 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; AdditionalAccessTechnologiesRepetition__BSSGP 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 AdditionalAccessTechnologiesRecord__BSSGP(*val_ptr->value_elements[i]); } } return ret_val; } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP::operator+(const AdditionalAccessTechnologiesRepetition__BSSGP& other_value) const { if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP concatenation."); if (val_ptr->n_elements == 0) return other_value; if (other_value.val_ptr->n_elements == 0) return *this; AdditionalAccessTechnologiesRepetition__BSSGP 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 AdditionalAccessTechnologiesRecord__BSSGP(*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 AdditionalAccessTechnologiesRecord__BSSGP(*other_value.val_ptr->value_elements[i]); } } return ret_val; } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP::substr(int index, int returncount) const { if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); check_substr_arguments(val_ptr->n_elements, index, returncount, "@BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP","element"); AdditionalAccessTechnologiesRepetition__BSSGP ret_val; ret_val.set_size(returncount); for (int i=0; ivalue_elements[i+index] != NULL) { ret_val.val_ptr->value_elements[i] = new AdditionalAccessTechnologiesRecord__BSSGP(*val_ptr->value_elements[i+index]); } } return ret_val; } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP::replace(int index, int len, const AdditionalAccessTechnologiesRepetition__BSSGP& repl) const { if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); check_replace_arguments(val_ptr->n_elements, index, len, "@BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP","element"); AdditionalAccessTechnologiesRepetition__BSSGP 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 AdditionalAccessTechnologiesRecord__BSSGP(*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 AdditionalAccessTechnologiesRecord__BSSGP(*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 AdditionalAccessTechnologiesRecord__BSSGP(*val_ptr->value_elements[index+i+len]); } } return ret_val; } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP::replace(int index, int len, const AdditionalAccessTechnologiesRepetition__BSSGP_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 AdditionalAccessTechnologiesRepetition__BSSGP::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); 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 = (AdditionalAccessTechnologiesRecord__BSSGP**)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 AdditionalAccessTechnologiesRecord__BSSGP(*(val_ptr->value_elements[elem_count])); } } clean_up(); val_ptr = new_val_ptr; } if (new_size > val_ptr->n_elements) { val_ptr->value_elements = (AdditionalAccessTechnologiesRecord__BSSGP**)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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP: %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 = (AdditionalAccessTechnologiesRecord__BSSGP**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size); val_ptr->n_elements = new_size; } } boolean AdditionalAccessTechnologiesRepetition__BSSGP::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 AdditionalAccessTechnologiesRepetition__BSSGP::size_of() const { if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); return val_ptr->n_elements; } int AdditionalAccessTechnologiesRepetition__BSSGP::lengthof() const { if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); 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 AdditionalAccessTechnologiesRepetition__BSSGP::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 AdditionalAccessTechnologiesRepetition__BSSGP::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 AdditionalAccessTechnologiesRepetition__BSSGP::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", "@BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP"); } 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", "@BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP"); } break; default: TTCN_error("Internal error: Unknown operation type."); } } void AdditionalAccessTechnologiesRepetition__BSSGP::encode_text(Text_Buf& text_buf) const { if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); 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 AdditionalAccessTechnologiesRepetition__BSSGP::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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); val_ptr->value_elements = (AdditionalAccessTechnologiesRecord__BSSGP**)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 AdditionalAccessTechnologiesRecord__BSSGP; val_ptr->value_elements[elem_count]->decode_text(text_buf); } } void AdditionalAccessTechnologiesRepetition__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AdditionalAccessTechnologiesRepetition__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AdditionalAccessTechnologiesRepetition__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean /*no_err*/, int sel_field, boolean first_call, const RAW_Force_Omit*){ int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; int decoded_length=0; int decoded_field_length=0; size_t start_of_field=0; if(first_call) { clean_up(); val_ptr=new recordof_setof_struct; val_ptr->ref_count=1; val_ptr->n_elements=0; val_ptr->value_elements=NULL; } int start_field=val_ptr->n_elements; if(p_td.raw->fieldlength || sel_field!=-1){ int a=0; if(sel_field==-1) sel_field=p_td.raw->fieldlength; start_of_field=p_buf.get_pos_bit(); for(a=0;a=0){ delete &(*this)[a+start_field]; a--; val_ptr->n_elements--; } p_buf.set_pos_bit(start_of_field); return decoded_field_length; } decoded_length+=decoded_field_length; limit-=decoded_field_length; } if(a==0) val_ptr->n_elements=0; } else { if(limit==0){ if(!first_call) return -1; val_ptr->n_elements=0; return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength; } int a=start_field; while(limit>0){ start_of_field=p_buf.get_pos_bit(); decoded_field_length=(*this)[a].RAW_decode(*p_td.oftype_descr,p_buf,limit,top_bit_ord,TRUE); if(decoded_field_length < 0){ delete &(*this)[a]; val_ptr->n_elements--; p_buf.set_pos_bit(start_of_field); if(a>start_field){ return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength; } else return -1; } decoded_length+=decoded_field_length; limit-=decoded_field_length; a++; if (!p_buf.get_last_bit()) return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength; } } return decoded_length+p_buf.increase_pos_padd(p_td.raw->padding)+prepaddlength; } int AdditionalAccessTechnologiesRepetition__BSSGP::RAW_encode(const TTCN_Typedescriptor_t& p_td,RAW_enc_tree& myleaf) const{ int encoded_length=0; int encoded_num_of_records=p_td.raw->fieldlength?smaller(val_ptr->n_elements, p_td.raw->fieldlength):val_ptr->n_elements; myleaf.isleaf=FALSE; myleaf.rec_of=TRUE; myleaf.body.node.num_of_nodes=encoded_num_of_records; myleaf.body.node.nodes=init_nodes_of_enc_tree(encoded_num_of_records); for(int a=0;araw); encoded_length+=(*this)[a].RAW_encode(*p_td.oftype_descr,*myleaf.body.node.nodes[a]); } return myleaf.length=encoded_length; } void AdditionalAccessTechnologiesRepetition__BSSGP_template::copy_value(const AdditionalAccessTechnologiesRepetition__BSSGP& other_value) { if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP with an unbound value."); single_value.n_elements = other_value.size_of(); single_value.value_elements = (AdditionalAccessTechnologiesRecord__BSSGP_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 AdditionalAccessTechnologiesRecord__BSSGP_template(other_value[elem_count]); } else { single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord__BSSGP_template; } } set_selection(SPECIFIC_VALUE); } void AdditionalAccessTechnologiesRepetition__BSSGP_template::copy_template(const AdditionalAccessTechnologiesRepetition__BSSGP_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 = (AdditionalAccessTechnologiesRecord__BSSGP_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 AdditionalAccessTechnologiesRecord__BSSGP_template(*other_value.single_value.value_elements[elem_count]); } else { single_value.value_elements[elem_count] = new AdditionalAccessTechnologiesRecord__BSSGP_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 AdditionalAccessTechnologiesRepetition__BSSGP_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 AdditionalAccessTechnologiesRepetition__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AdditionalAccessTechnologiesRepetition__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); break; } set_selection(other_value); } boolean AdditionalAccessTechnologiesRepetition__BSSGP_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 AdditionalAccessTechnologiesRepetition__BSSGP_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const AdditionalAccessTechnologiesRepetition__BSSGP*)value_ptr)[value_index], legacy); else return ((const AdditionalAccessTechnologiesRepetition__BSSGP_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit(); } AdditionalAccessTechnologiesRepetition__BSSGP_template::AdditionalAccessTechnologiesRepetition__BSSGP_template() { } AdditionalAccessTechnologiesRepetition__BSSGP_template::AdditionalAccessTechnologiesRepetition__BSSGP_template(template_sel other_value) : Base_Record_Of_Template(other_value) { check_single_selection(other_value); } AdditionalAccessTechnologiesRepetition__BSSGP_template::AdditionalAccessTechnologiesRepetition__BSSGP_template(null_type) : Base_Record_Of_Template(SPECIFIC_VALUE) { single_value.n_elements = 0; single_value.value_elements = NULL; } AdditionalAccessTechnologiesRepetition__BSSGP_template::AdditionalAccessTechnologiesRepetition__BSSGP_template(const AdditionalAccessTechnologiesRepetition__BSSGP& other_value) { copy_value(other_value); } AdditionalAccessTechnologiesRepetition__BSSGP_template::AdditionalAccessTechnologiesRepetition__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AdditionalAccessTechnologiesRepetition__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP from an unbound optional field."); } } AdditionalAccessTechnologiesRepetition__BSSGP_template::AdditionalAccessTechnologiesRepetition__BSSGP_template(AdditionalAccessTechnologiesRepetition__BSSGP_template* p_precondition, AdditionalAccessTechnologiesRepetition__BSSGP_template* p_implied_template) : Base_Record_Of_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AdditionalAccessTechnologiesRepetition__BSSGP_template::AdditionalAccessTechnologiesRepetition__BSSGP_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; } AdditionalAccessTechnologiesRepetition__BSSGP_template::AdditionalAccessTechnologiesRepetition__BSSGP_template(const AdditionalAccessTechnologiesRepetition__BSSGP_template& other_value) : Base_Record_Of_Template() { copy_template(other_value); } AdditionalAccessTechnologiesRepetition__BSSGP_template::~AdditionalAccessTechnologiesRepetition__BSSGP_template() { clean_up(); } void AdditionalAccessTechnologiesRepetition__BSSGP_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; } AdditionalAccessTechnologiesRepetition__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AdditionalAccessTechnologiesRepetition__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator=(null_type) { clean_up(); set_selection(SPECIFIC_VALUE); single_value.n_elements = 0; single_value.value_elements = NULL; return *this; } AdditionalAccessTechnologiesRepetition__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator=(const AdditionalAccessTechnologiesRepetition__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AdditionalAccessTechnologiesRepetition__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AdditionalAccessTechnologiesRepetition__BSSGP&)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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); } return *this; } AdditionalAccessTechnologiesRepetition__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator=(const AdditionalAccessTechnologiesRepetition__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator[](int index_value) { if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); break; } return *single_value.value_elements[index_value]; } AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator[](const INTEGER& index_value) { index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); return (*this)[(int)index_value]; } const AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator[](int index_value) const { if (index_value < 0) TTCN_error("Accessing an element of a template for type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP using a negative index: %d.", index_value); if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP: 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 AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_template::operator[](const INTEGER& index_value) const { index_value.must_bound("Using an unbound integer value for indexing a template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); return (*this)[(int)index_value]; } void AdditionalAccessTechnologiesRepetition__BSSGP_template::set_size(int new_size) { if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); 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 = (AdditionalAccessTechnologiesRecord__BSSGP_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 AdditionalAccessTechnologiesRecord__BSSGP_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 AdditionalAccessTechnologiesRecord__BSSGP_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 = (AdditionalAccessTechnologiesRecord__BSSGP_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size); single_value.n_elements = new_size; } } int AdditionalAccessTechnologiesRepetition__BSSGP_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 AdditionalAccessTechnologiesRepetition__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP containing complemented list.", op_name); default: TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP.", op_name); } return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP"); } boolean AdditionalAccessTechnologiesRepetition__BSSGP_template::match(const AdditionalAccessTechnologiesRepetition__BSSGP& 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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); } return FALSE; } boolean AdditionalAccessTechnologiesRepetition__BSSGP_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; } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); AdditionalAccessTechnologiesRepetition__BSSGP 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; } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP_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); } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP_template::replace(int index, int len, const AdditionalAccessTechnologiesRepetition__BSSGP_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()); } AdditionalAccessTechnologiesRepetition__BSSGP AdditionalAccessTechnologiesRepetition__BSSGP_template::replace(int index, int len, const AdditionalAccessTechnologiesRepetition__BSSGP& 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 AdditionalAccessTechnologiesRepetition__BSSGP_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 AdditionalAccessTechnologiesRepetition__BSSGP_template[list_length]; break; default: TTCN_error("Internal error: Setting an invalid type for a template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); } set_selection(template_type); } AdditionalAccessTechnologiesRepetition__BSSGP_template& AdditionalAccessTechnologiesRepetition__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); return value_list.list_value[list_index]; } void AdditionalAccessTechnologiesRepetition__BSSGP_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 AdditionalAccessTechnologiesRepetition__BSSGP_template::log_match(const AdditionalAccessTechnologiesRepetition__BSSGP& 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 AdditionalAccessTechnologiesRepetition__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); } } void AdditionalAccessTechnologiesRepetition__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); single_value.value_elements = (AdditionalAccessTechnologiesRecord__BSSGP_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 AdditionalAccessTechnologiesRecord__BSSGP_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 AdditionalAccessTechnologiesRepetition__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP."); } } boolean AdditionalAccessTechnologiesRepetition__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AdditionalAccessTechnologiesRepetition__BSSGP_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_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: { AdditionalAccessTechnologiesRepetition__BSSGP_template* precondition = new AdditionalAccessTechnologiesRepetition__BSSGP_template; precondition->set_param(*param.get_elem(0)); AdditionalAccessTechnologiesRepetition__BSSGP_template* implied_template = new AdditionalAccessTechnologiesRepetition__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AdditionalAccessTechnologiesRepetition__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record of template", "@BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP"); } is_ifpresent = param.get_ifpresent(); set_length_range(param); } void AdditionalAccessTechnologiesRepetition__BSSGP_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 : "@BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP"); 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 : "@BSSGP_Types.AdditionalAccessTechnologiesRepetition_BSSGP"); } boolean AdditionalAccessTechnologiesRepetition__BSSGP_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); } } AdditionalAccessTechnologies__BSSGP::AdditionalAccessTechnologies__BSSGP() { } AdditionalAccessTechnologies__BSSGP::AdditionalAccessTechnologies__BSSGP(const BITSTRING& par_accessTechnType, const BITSTRING& par_gMSKPowerClass, const BITSTRING& par_psk8PowerClass) : field_accessTechnType(par_accessTechnType), field_gMSKPowerClass(par_gMSKPowerClass), field_psk8PowerClass(par_psk8PowerClass) { } AdditionalAccessTechnologies__BSSGP::AdditionalAccessTechnologies__BSSGP(const AdditionalAccessTechnologies__BSSGP& other_value) { if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType(); else field_accessTechnType.clean_up(); if (other_value.gMSKPowerClass().is_bound()) field_gMSKPowerClass = other_value.gMSKPowerClass(); else field_gMSKPowerClass.clean_up(); if (other_value.psk8PowerClass().is_bound()) field_psk8PowerClass = other_value.psk8PowerClass(); else field_psk8PowerClass.clean_up(); } void AdditionalAccessTechnologies__BSSGP::clean_up() { field_accessTechnType.clean_up(); field_gMSKPowerClass.clean_up(); field_psk8PowerClass.clean_up(); } const TTCN_Typedescriptor_t* AdditionalAccessTechnologies__BSSGP::get_descriptor() const { return &AdditionalAccessTechnologies__BSSGP_descr_; } AdditionalAccessTechnologies__BSSGP& AdditionalAccessTechnologies__BSSGP::operator=(const AdditionalAccessTechnologies__BSSGP& other_value) { if (this != &other_value) { if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); if (other_value.accessTechnType().is_bound()) field_accessTechnType = other_value.accessTechnType(); else field_accessTechnType.clean_up(); if (other_value.gMSKPowerClass().is_bound()) field_gMSKPowerClass = other_value.gMSKPowerClass(); else field_gMSKPowerClass.clean_up(); if (other_value.psk8PowerClass().is_bound()) field_psk8PowerClass = other_value.psk8PowerClass(); else field_psk8PowerClass.clean_up(); } return *this; } boolean AdditionalAccessTechnologies__BSSGP::operator==(const AdditionalAccessTechnologies__BSSGP& other_value) const { return field_accessTechnType==other_value.field_accessTechnType && field_gMSKPowerClass==other_value.field_gMSKPowerClass && field_psk8PowerClass==other_value.field_psk8PowerClass; } boolean AdditionalAccessTechnologies__BSSGP::is_bound() const { return (field_accessTechnType.is_bound()) || (field_gMSKPowerClass.is_bound()) || (field_psk8PowerClass.is_bound()); } boolean AdditionalAccessTechnologies__BSSGP::is_value() const { return field_accessTechnType.is_value() && field_gMSKPowerClass.is_value() && field_psk8PowerClass.is_value(); } void AdditionalAccessTechnologies__BSSGP::log() const { if (!is_bound()) { TTCN_Logger::log_event_unbound(); return; } TTCN_Logger::log_event_str("{ accessTechnType := "); field_accessTechnType.log(); TTCN_Logger::log_event_str(", gMSKPowerClass := "); field_gMSKPowerClass.log(); TTCN_Logger::log_event_str(", psk8PowerClass := "); field_psk8PowerClass.log(); TTCN_Logger::log_event_str(" }"); } void AdditionalAccessTechnologies__BSSGP::set_implicit_omit() { if (accessTechnType().is_bound()) accessTechnType().set_implicit_omit(); if (gMSKPowerClass().is_bound()) gMSKPowerClass().set_implicit_omit(); if (psk8PowerClass().is_bound()) psk8PowerClass().set_implicit_omit(); } void AdditionalAccessTechnologies__BSSGP::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) accessTechnType().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gMSKPowerClass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) psk8PowerClass().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(), "accessTechnType")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessTechnType().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gMSKPowerClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gMSKPowerClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "psk8PowerClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { psk8PowerClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AdditionalAccessTechnologies_BSSGP"); } } void AdditionalAccessTechnologies__BSSGP::encode_text(Text_Buf& text_buf) const { field_accessTechnType.encode_text(text_buf); field_gMSKPowerClass.encode_text(text_buf); field_psk8PowerClass.encode_text(text_buf); } void AdditionalAccessTechnologies__BSSGP::decode_text(Text_Buf& text_buf) { field_accessTechnType.decode_text(text_buf); field_gMSKPowerClass.decode_text(text_buf); field_psk8PowerClass.decode_text(text_buf); } void AdditionalAccessTechnologies__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AdditionalAccessTechnologies__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AdditionalAccessTechnologies__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AdditionalAccessTechnologies__BSSGP_accessTechnType_descr_.raw->forceomit); decoded_field_length = field_accessTechnType.RAW_decode(AdditionalAccessTechnologies__BSSGP_accessTechnType_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AdditionalAccessTechnologies__BSSGP_gMSKPowerClass_descr_.raw->forceomit); decoded_field_length = field_gMSKPowerClass.RAW_decode(AdditionalAccessTechnologies__BSSGP_gMSKPowerClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_2_force_omit(2, force_omit, AdditionalAccessTechnologies__BSSGP_psk8PowerClass_descr_.raw->forceomit); decoded_field_length = field_psk8PowerClass.RAW_decode(AdditionalAccessTechnologies__BSSGP_psk8PowerClass_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AdditionalAccessTechnologies__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 3; myleaf.body.node.nodes = init_nodes_of_enc_tree(3); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AdditionalAccessTechnologies__BSSGP_accessTechnType_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AdditionalAccessTechnologies__BSSGP_gMSKPowerClass_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AdditionalAccessTechnologies__BSSGP_psk8PowerClass_descr_.raw); encoded_length += field_accessTechnType.RAW_encode(AdditionalAccessTechnologies__BSSGP_accessTechnType_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_gMSKPowerClass.RAW_encode(AdditionalAccessTechnologies__BSSGP_gMSKPowerClass_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_psk8PowerClass.RAW_encode(AdditionalAccessTechnologies__BSSGP_psk8PowerClass_descr_, *myleaf.body.node.nodes[2]); return myleaf.length = encoded_length; } struct AdditionalAccessTechnologies__BSSGP_template::single_value_struct { BITSTRING_template field_accessTechnType; BITSTRING_template field_gMSKPowerClass; BITSTRING_template field_psk8PowerClass; }; void AdditionalAccessTechnologies__BSSGP_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_accessTechnType = ANY_VALUE; single_value->field_gMSKPowerClass = ANY_VALUE; single_value->field_psk8PowerClass = ANY_VALUE; } } } void AdditionalAccessTechnologies__BSSGP_template::copy_value(const AdditionalAccessTechnologies__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.accessTechnType().is_bound()) { single_value->field_accessTechnType = other_value.accessTechnType(); } else { single_value->field_accessTechnType.clean_up(); } if (other_value.gMSKPowerClass().is_bound()) { single_value->field_gMSKPowerClass = other_value.gMSKPowerClass(); } else { single_value->field_gMSKPowerClass.clean_up(); } if (other_value.psk8PowerClass().is_bound()) { single_value->field_psk8PowerClass = other_value.psk8PowerClass(); } else { single_value->field_psk8PowerClass.clean_up(); } set_selection(SPECIFIC_VALUE); } void AdditionalAccessTechnologies__BSSGP_template::copy_template(const AdditionalAccessTechnologies__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.accessTechnType().get_selection()) { single_value->field_accessTechnType = other_value.accessTechnType(); } else { single_value->field_accessTechnType.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.gMSKPowerClass().get_selection()) { single_value->field_gMSKPowerClass = other_value.gMSKPowerClass(); } else { single_value->field_gMSKPowerClass.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.psk8PowerClass().get_selection()) { single_value->field_psk8PowerClass = other_value.psk8PowerClass(); } else { single_value->field_psk8PowerClass.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 AdditionalAccessTechnologies__BSSGP_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 AdditionalAccessTechnologies__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AdditionalAccessTechnologies__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); break; } set_selection(other_value); } AdditionalAccessTechnologies__BSSGP_template::AdditionalAccessTechnologies__BSSGP_template() { } AdditionalAccessTechnologies__BSSGP_template::AdditionalAccessTechnologies__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AdditionalAccessTechnologies__BSSGP_template::AdditionalAccessTechnologies__BSSGP_template(const AdditionalAccessTechnologies__BSSGP& other_value) { copy_value(other_value); } AdditionalAccessTechnologies__BSSGP_template::AdditionalAccessTechnologies__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AdditionalAccessTechnologies__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP from an unbound optional field."); } } AdditionalAccessTechnologies__BSSGP_template::AdditionalAccessTechnologies__BSSGP_template(AdditionalAccessTechnologies__BSSGP_template* p_precondition, AdditionalAccessTechnologies__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AdditionalAccessTechnologies__BSSGP_template::AdditionalAccessTechnologies__BSSGP_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; } AdditionalAccessTechnologies__BSSGP_template::AdditionalAccessTechnologies__BSSGP_template(const AdditionalAccessTechnologies__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AdditionalAccessTechnologies__BSSGP_template::~AdditionalAccessTechnologies__BSSGP_template() { clean_up(); } AdditionalAccessTechnologies__BSSGP_template& AdditionalAccessTechnologies__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AdditionalAccessTechnologies__BSSGP_template& AdditionalAccessTechnologies__BSSGP_template::operator=(const AdditionalAccessTechnologies__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AdditionalAccessTechnologies__BSSGP_template& AdditionalAccessTechnologies__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AdditionalAccessTechnologies__BSSGP&)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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); } return *this; } AdditionalAccessTechnologies__BSSGP_template& AdditionalAccessTechnologies__BSSGP_template::operator=(const AdditionalAccessTechnologies__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AdditionalAccessTechnologies__BSSGP_template::match(const AdditionalAccessTechnologies__BSSGP& 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.accessTechnType().is_bound()) return FALSE; if(!single_value->field_accessTechnType.match(other_value.accessTechnType(), legacy))return FALSE; if(!other_value.gMSKPowerClass().is_bound()) return FALSE; if(!single_value->field_gMSKPowerClass.match(other_value.gMSKPowerClass(), legacy))return FALSE; if(!other_value.psk8PowerClass().is_bound()) return FALSE; if(!single_value->field_psk8PowerClass.match(other_value.psk8PowerClass(), 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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); } return FALSE; } boolean AdditionalAccessTechnologies__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_accessTechnType.is_bound() || single_value->field_gMSKPowerClass.is_bound() || single_value->field_psk8PowerClass.is_bound(); } boolean AdditionalAccessTechnologies__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_accessTechnType.is_value() && single_value->field_gMSKPowerClass.is_value() && single_value->field_psk8PowerClass.is_value(); } void AdditionalAccessTechnologies__BSSGP_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; } AdditionalAccessTechnologies__BSSGP AdditionalAccessTechnologies__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); AdditionalAccessTechnologies__BSSGP ret_val; if (single_value->field_accessTechnType.is_bound()) { ret_val.accessTechnType() = single_value->field_accessTechnType.valueof(); } if (single_value->field_gMSKPowerClass.is_bound()) { ret_val.gMSKPowerClass() = single_value->field_gMSKPowerClass.valueof(); } if (single_value->field_psk8PowerClass.is_bound()) { ret_val.psk8PowerClass() = single_value->field_psk8PowerClass.valueof(); } return ret_val; } void AdditionalAccessTechnologies__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AdditionalAccessTechnologies__BSSGP_template[list_length]; } AdditionalAccessTechnologies__BSSGP_template& AdditionalAccessTechnologies__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); return value_list.list_value[list_index]; } BITSTRING_template& AdditionalAccessTechnologies__BSSGP_template::accessTechnType() { set_specific(); return single_value->field_accessTechnType; } const BITSTRING_template& AdditionalAccessTechnologies__BSSGP_template::accessTechnType() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field accessTechnType of a non-specific template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); return single_value->field_accessTechnType; } BITSTRING_template& AdditionalAccessTechnologies__BSSGP_template::gMSKPowerClass() { set_specific(); return single_value->field_gMSKPowerClass; } const BITSTRING_template& AdditionalAccessTechnologies__BSSGP_template::gMSKPowerClass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field gMSKPowerClass of a non-specific template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); return single_value->field_gMSKPowerClass; } BITSTRING_template& AdditionalAccessTechnologies__BSSGP_template::psk8PowerClass() { set_specific(); return single_value->field_psk8PowerClass; } const BITSTRING_template& AdditionalAccessTechnologies__BSSGP_template::psk8PowerClass() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field psk8PowerClass of a non-specific template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); return single_value->field_psk8PowerClass; } int AdditionalAccessTechnologies__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); } return 0; } void AdditionalAccessTechnologies__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ accessTechnType := "); single_value->field_accessTechnType.log(); TTCN_Logger::log_event_str(", gMSKPowerClass := "); single_value->field_gMSKPowerClass.log(); TTCN_Logger::log_event_str(", psk8PowerClass := "); single_value->field_psk8PowerClass.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 AdditionalAccessTechnologies__BSSGP_template::log_match(const AdditionalAccessTechnologies__BSSGP& 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_accessTechnType.match(match_value.accessTechnType(), legacy)){ TTCN_Logger::log_logmatch_info(".accessTechnType"); single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_gMSKPowerClass.match(match_value.gMSKPowerClass(), legacy)){ TTCN_Logger::log_logmatch_info(".gMSKPowerClass"); single_value->field_gMSKPowerClass.log_match(match_value.gMSKPowerClass(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_psk8PowerClass.match(match_value.psk8PowerClass(), legacy)){ TTCN_Logger::log_logmatch_info(".psk8PowerClass"); single_value->field_psk8PowerClass.log_match(match_value.psk8PowerClass(), 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("{ accessTechnType := "); single_value->field_accessTechnType.log_match(match_value.accessTechnType(), legacy); TTCN_Logger::log_event_str(", gMSKPowerClass := "); single_value->field_gMSKPowerClass.log_match(match_value.gMSKPowerClass(), legacy); TTCN_Logger::log_event_str(", psk8PowerClass := "); single_value->field_psk8PowerClass.log_match(match_value.psk8PowerClass(), 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 AdditionalAccessTechnologies__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_accessTechnType.encode_text(text_buf); single_value->field_gMSKPowerClass.encode_text(text_buf); single_value->field_psk8PowerClass.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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); } } void AdditionalAccessTechnologies__BSSGP_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_accessTechnType.decode_text(text_buf); single_value->field_gMSKPowerClass.decode_text(text_buf); single_value->field_psk8PowerClass.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 AdditionalAccessTechnologies__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologies_BSSGP."); } } void AdditionalAccessTechnologies__BSSGP_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: { AdditionalAccessTechnologies__BSSGP_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) accessTechnType().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gMSKPowerClass().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) psk8PowerClass().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(), "accessTechnType")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { accessTechnType().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "gMSKPowerClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { gMSKPowerClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "psk8PowerClass")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { psk8PowerClass().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AdditionalAccessTechnologies_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AdditionalAccessTechnologies__BSSGP_template* precondition = new AdditionalAccessTechnologies__BSSGP_template; precondition->set_param(*param.get_elem(0)); AdditionalAccessTechnologies__BSSGP_template* implied_template = new AdditionalAccessTechnologies__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AdditionalAccessTechnologies__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AdditionalAccessTechnologies_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AdditionalAccessTechnologies__BSSGP_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_accessTechnType.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AdditionalAccessTechnologies_BSSGP"); single_value->field_gMSKPowerClass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AdditionalAccessTechnologies_BSSGP"); single_value->field_psk8PowerClass.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AdditionalAccessTechnologies_BSSGP"); 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 : "@BSSGP_Types.AdditionalAccessTechnologies_BSSGP"); } boolean AdditionalAccessTechnologies__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AdditionalAccessTechnologies__BSSGP_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) additionalAccessTechnologies().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) extensionBit().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(), "additionalAccessTechnologies")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { additionalAccessTechnologies().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extensionBit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extensionBit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP"); } } void AdditionalAccessTechnologiesRecord__BSSGP::encode_text(Text_Buf& text_buf) const { field_additionalAccessTechnologies.encode_text(text_buf); field_extensionBit.encode_text(text_buf); } void AdditionalAccessTechnologiesRecord__BSSGP::decode_text(Text_Buf& text_buf) { field_additionalAccessTechnologies.decode_text(text_buf); field_extensionBit.decode_text(text_buf); } void AdditionalAccessTechnologiesRecord__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void AdditionalAccessTechnologiesRecord__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int AdditionalAccessTechnologiesRecord__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, AdditionalAccessTechnologiesRecord__BSSGP_additionalAccessTechnologies_descr_.raw->forceomit); decoded_field_length = field_additionalAccessTechnologies.RAW_decode(AdditionalAccessTechnologiesRecord__BSSGP_additionalAccessTechnologies_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, AdditionalAccessTechnologiesRecord__BSSGP_extensionBit_descr_.raw->forceomit); decoded_field_length = field_extensionBit.RAW_decode(AdditionalAccessTechnologiesRecord__BSSGP_extensionBit_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int AdditionalAccessTechnologiesRecord__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, AdditionalAccessTechnologiesRecord__BSSGP_additionalAccessTechnologies_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AdditionalAccessTechnologiesRecord__BSSGP_extensionBit_descr_.raw); encoded_length += field_additionalAccessTechnologies.RAW_encode(AdditionalAccessTechnologiesRecord__BSSGP_additionalAccessTechnologies_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_extensionBit.RAW_encode(AdditionalAccessTechnologiesRecord__BSSGP_extensionBit_descr_, *myleaf.body.node.nodes[1]); return myleaf.length = encoded_length; } struct AdditionalAccessTechnologiesRecord__BSSGP_template::single_value_struct { AdditionalAccessTechnologies__BSSGP_template field_additionalAccessTechnologies; BITSTRING_template field_extensionBit; }; void AdditionalAccessTechnologiesRecord__BSSGP_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_additionalAccessTechnologies = ANY_VALUE; single_value->field_extensionBit = ANY_VALUE; } } } void AdditionalAccessTechnologiesRecord__BSSGP_template::copy_value(const AdditionalAccessTechnologiesRecord__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.additionalAccessTechnologies().is_bound()) { single_value->field_additionalAccessTechnologies = other_value.additionalAccessTechnologies(); } else { single_value->field_additionalAccessTechnologies.clean_up(); } if (other_value.extensionBit().is_bound()) { single_value->field_extensionBit = other_value.extensionBit(); } else { single_value->field_extensionBit.clean_up(); } set_selection(SPECIFIC_VALUE); } void AdditionalAccessTechnologiesRecord__BSSGP_template::copy_template(const AdditionalAccessTechnologiesRecord__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.additionalAccessTechnologies().get_selection()) { single_value->field_additionalAccessTechnologies = other_value.additionalAccessTechnologies(); } else { single_value->field_additionalAccessTechnologies.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.extensionBit().get_selection()) { single_value->field_extensionBit = other_value.extensionBit(); } else { single_value->field_extensionBit.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 AdditionalAccessTechnologiesRecord__BSSGP_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 AdditionalAccessTechnologiesRecord__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new AdditionalAccessTechnologiesRecord__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); break; } set_selection(other_value); } AdditionalAccessTechnologiesRecord__BSSGP_template::AdditionalAccessTechnologiesRecord__BSSGP_template() { } AdditionalAccessTechnologiesRecord__BSSGP_template::AdditionalAccessTechnologiesRecord__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } AdditionalAccessTechnologiesRecord__BSSGP_template::AdditionalAccessTechnologiesRecord__BSSGP_template(const AdditionalAccessTechnologiesRecord__BSSGP& other_value) { copy_value(other_value); } AdditionalAccessTechnologiesRecord__BSSGP_template::AdditionalAccessTechnologiesRecord__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AdditionalAccessTechnologiesRecord__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP from an unbound optional field."); } } AdditionalAccessTechnologiesRecord__BSSGP_template::AdditionalAccessTechnologiesRecord__BSSGP_template(AdditionalAccessTechnologiesRecord__BSSGP_template* p_precondition, AdditionalAccessTechnologiesRecord__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } AdditionalAccessTechnologiesRecord__BSSGP_template::AdditionalAccessTechnologiesRecord__BSSGP_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; } AdditionalAccessTechnologiesRecord__BSSGP_template::AdditionalAccessTechnologiesRecord__BSSGP_template(const AdditionalAccessTechnologiesRecord__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } AdditionalAccessTechnologiesRecord__BSSGP_template::~AdditionalAccessTechnologiesRecord__BSSGP_template() { clean_up(); } AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRecord__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRecord__BSSGP_template::operator=(const AdditionalAccessTechnologiesRecord__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRecord__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const AdditionalAccessTechnologiesRecord__BSSGP&)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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); } return *this; } AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRecord__BSSGP_template::operator=(const AdditionalAccessTechnologiesRecord__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean AdditionalAccessTechnologiesRecord__BSSGP_template::match(const AdditionalAccessTechnologiesRecord__BSSGP& 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.additionalAccessTechnologies().is_bound()) return FALSE; if(!single_value->field_additionalAccessTechnologies.match(other_value.additionalAccessTechnologies(), legacy))return FALSE; if(!other_value.extensionBit().is_bound()) return FALSE; if(!single_value->field_extensionBit.match(other_value.extensionBit(), 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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); } return FALSE; } boolean AdditionalAccessTechnologiesRecord__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_additionalAccessTechnologies.is_bound() || single_value->field_extensionBit.is_bound(); } boolean AdditionalAccessTechnologiesRecord__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_additionalAccessTechnologies.is_value() && single_value->field_extensionBit.is_value(); } void AdditionalAccessTechnologiesRecord__BSSGP_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; } AdditionalAccessTechnologiesRecord__BSSGP AdditionalAccessTechnologiesRecord__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); AdditionalAccessTechnologiesRecord__BSSGP ret_val; if (single_value->field_additionalAccessTechnologies.is_bound()) { ret_val.additionalAccessTechnologies() = single_value->field_additionalAccessTechnologies.valueof(); } if (single_value->field_extensionBit.is_bound()) { ret_val.extensionBit() = single_value->field_extensionBit.valueof(); } return ret_val; } void AdditionalAccessTechnologiesRecord__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new AdditionalAccessTechnologiesRecord__BSSGP_template[list_length]; } AdditionalAccessTechnologiesRecord__BSSGP_template& AdditionalAccessTechnologiesRecord__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); return value_list.list_value[list_index]; } AdditionalAccessTechnologies__BSSGP_template& AdditionalAccessTechnologiesRecord__BSSGP_template::additionalAccessTechnologies() { set_specific(); return single_value->field_additionalAccessTechnologies; } const AdditionalAccessTechnologies__BSSGP_template& AdditionalAccessTechnologiesRecord__BSSGP_template::additionalAccessTechnologies() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field additionalAccessTechnologies of a non-specific template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); return single_value->field_additionalAccessTechnologies; } BITSTRING_template& AdditionalAccessTechnologiesRecord__BSSGP_template::extensionBit() { set_specific(); return single_value->field_extensionBit; } const BITSTRING_template& AdditionalAccessTechnologiesRecord__BSSGP_template::extensionBit() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field extensionBit of a non-specific template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); return single_value->field_extensionBit; } int AdditionalAccessTechnologiesRecord__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP 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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); } return 0; } void AdditionalAccessTechnologiesRecord__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ additionalAccessTechnologies := "); single_value->field_additionalAccessTechnologies.log(); TTCN_Logger::log_event_str(", extensionBit := "); single_value->field_extensionBit.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 AdditionalAccessTechnologiesRecord__BSSGP_template::log_match(const AdditionalAccessTechnologiesRecord__BSSGP& 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_additionalAccessTechnologies.match(match_value.additionalAccessTechnologies(), legacy)){ TTCN_Logger::log_logmatch_info(".additionalAccessTechnologies"); single_value->field_additionalAccessTechnologies.log_match(match_value.additionalAccessTechnologies(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_extensionBit.match(match_value.extensionBit(), legacy)){ TTCN_Logger::log_logmatch_info(".extensionBit"); single_value->field_extensionBit.log_match(match_value.extensionBit(), 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("{ additionalAccessTechnologies := "); single_value->field_additionalAccessTechnologies.log_match(match_value.additionalAccessTechnologies(), legacy); TTCN_Logger::log_event_str(", extensionBit := "); single_value->field_extensionBit.log_match(match_value.extensionBit(), 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 AdditionalAccessTechnologiesRecord__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_additionalAccessTechnologies.encode_text(text_buf); single_value->field_extensionBit.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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); } } void AdditionalAccessTechnologiesRecord__BSSGP_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_additionalAccessTechnologies.decode_text(text_buf); single_value->field_extensionBit.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 AdditionalAccessTechnologiesRecord__BSSGP_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 @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP."); } } void AdditionalAccessTechnologiesRecord__BSSGP_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: { AdditionalAccessTechnologiesRecord__BSSGP_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) additionalAccessTechnologies().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) extensionBit().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(), "additionalAccessTechnologies")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { additionalAccessTechnologies().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "extensionBit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { extensionBit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { AdditionalAccessTechnologiesRecord__BSSGP_template* precondition = new AdditionalAccessTechnologiesRecord__BSSGP_template; precondition->set_param(*param.get_elem(0)); AdditionalAccessTechnologiesRecord__BSSGP_template* implied_template = new AdditionalAccessTechnologiesRecord__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = AdditionalAccessTechnologiesRecord__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void AdditionalAccessTechnologiesRecord__BSSGP_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_additionalAccessTechnologies.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP"); single_value->field_extensionBit.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP"); 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 : "@BSSGP_Types.AdditionalAccessTechnologiesRecord_BSSGP"); } boolean AdditionalAccessTechnologiesRecord__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean AdditionalAccessTechnologiesRecord__BSSGP_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) mSRACapabilityValues().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitMSRACap().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(), "mSRACapabilityValues")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mSRACapabilityValues().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitMSRACap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitMSRACap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MSRACapabilityValuesRecord_BSSGP"); } } void MSRACapabilityValuesRecord__BSSGP::encode_text(Text_Buf& text_buf) const { field_mSRACapabilityValues.encode_text(text_buf); field_presenceBitMSRACap.encode_text(text_buf); } void MSRACapabilityValuesRecord__BSSGP::decode_text(Text_Buf& text_buf) { field_mSRACapabilityValues.decode_text(text_buf); field_presenceBitMSRACap.decode_text(text_buf); } void MSRACapabilityValuesRecord__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MSRACapabilityValuesRecord__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MSRACapabilityValuesRecord__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; RAW_Force_Omit field_0_force_omit(0, force_omit, MSRACapabilityValuesRecord__BSSGP_mSRACapabilityValues_descr_.raw->forceomit); decoded_field_length = field_mSRACapabilityValues.RAW_decode(MSRACapabilityValuesRecord__BSSGP_mSRACapabilityValues_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MSRACapabilityValuesRecord__BSSGP_presenceBitMSRACap_descr_.raw->forceomit); decoded_field_length = field_presenceBitMSRACap.RAW_decode(MSRACapabilityValuesRecord__BSSGP_presenceBitMSRACap_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MSRACapabilityValuesRecord__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 2; myleaf.body.node.nodes = init_nodes_of_enc_tree(2); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MSRACapabilityValuesRecord__BSSGP_mSRACapabilityValues_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MSRACapabilityValuesRecord__BSSGP_presenceBitMSRACap_descr_.raw); encoded_length += field_mSRACapabilityValues.RAW_encode(MSRACapabilityValuesRecord__BSSGP_mSRACapabilityValues_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_presenceBitMSRACap.RAW_encode(MSRACapabilityValuesRecord__BSSGP_presenceBitMSRACap_descr_, *myleaf.body.node.nodes[1]); return myleaf.length = encoded_length; } struct MSRACapabilityValuesRecord__BSSGP_template::single_value_struct { MSRACapabilityValues__BSSGP_template field_mSRACapabilityValues; BITSTRING_template field_presenceBitMSRACap; }; void MSRACapabilityValuesRecord__BSSGP_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_mSRACapabilityValues = ANY_VALUE; single_value->field_presenceBitMSRACap = ANY_VALUE; } } } void MSRACapabilityValuesRecord__BSSGP_template::copy_value(const MSRACapabilityValuesRecord__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.mSRACapabilityValues().is_bound()) { single_value->field_mSRACapabilityValues = other_value.mSRACapabilityValues(); } else { single_value->field_mSRACapabilityValues.clean_up(); } if (other_value.presenceBitMSRACap().is_bound()) { single_value->field_presenceBitMSRACap = other_value.presenceBitMSRACap(); } else { single_value->field_presenceBitMSRACap.clean_up(); } set_selection(SPECIFIC_VALUE); } void MSRACapabilityValuesRecord__BSSGP_template::copy_template(const MSRACapabilityValuesRecord__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.mSRACapabilityValues().get_selection()) { single_value->field_mSRACapabilityValues = other_value.mSRACapabilityValues(); } else { single_value->field_mSRACapabilityValues.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.presenceBitMSRACap().get_selection()) { single_value->field_presenceBitMSRACap = other_value.presenceBitMSRACap(); } else { single_value->field_presenceBitMSRACap.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 MSRACapabilityValuesRecord__BSSGP_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 MSRACapabilityValuesRecord__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new MSRACapabilityValuesRecord__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); break; } set_selection(other_value); } MSRACapabilityValuesRecord__BSSGP_template::MSRACapabilityValuesRecord__BSSGP_template() { } MSRACapabilityValuesRecord__BSSGP_template::MSRACapabilityValuesRecord__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MSRACapabilityValuesRecord__BSSGP_template::MSRACapabilityValuesRecord__BSSGP_template(const MSRACapabilityValuesRecord__BSSGP& other_value) { copy_value(other_value); } MSRACapabilityValuesRecord__BSSGP_template::MSRACapabilityValuesRecord__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRACapabilityValuesRecord__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP from an unbound optional field."); } } MSRACapabilityValuesRecord__BSSGP_template::MSRACapabilityValuesRecord__BSSGP_template(MSRACapabilityValuesRecord__BSSGP_template* p_precondition, MSRACapabilityValuesRecord__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MSRACapabilityValuesRecord__BSSGP_template::MSRACapabilityValuesRecord__BSSGP_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; } MSRACapabilityValuesRecord__BSSGP_template::MSRACapabilityValuesRecord__BSSGP_template(const MSRACapabilityValuesRecord__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } MSRACapabilityValuesRecord__BSSGP_template::~MSRACapabilityValuesRecord__BSSGP_template() { clean_up(); } MSRACapabilityValuesRecord__BSSGP_template& MSRACapabilityValuesRecord__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MSRACapabilityValuesRecord__BSSGP_template& MSRACapabilityValuesRecord__BSSGP_template::operator=(const MSRACapabilityValuesRecord__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } MSRACapabilityValuesRecord__BSSGP_template& MSRACapabilityValuesRecord__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MSRACapabilityValuesRecord__BSSGP&)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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); } return *this; } MSRACapabilityValuesRecord__BSSGP_template& MSRACapabilityValuesRecord__BSSGP_template::operator=(const MSRACapabilityValuesRecord__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MSRACapabilityValuesRecord__BSSGP_template::match(const MSRACapabilityValuesRecord__BSSGP& 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.mSRACapabilityValues().is_bound()) return FALSE; if(!single_value->field_mSRACapabilityValues.match(other_value.mSRACapabilityValues(), legacy))return FALSE; if(!other_value.presenceBitMSRACap().is_bound()) return FALSE; if(!single_value->field_presenceBitMSRACap.match(other_value.presenceBitMSRACap(), 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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); } return FALSE; } boolean MSRACapabilityValuesRecord__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_mSRACapabilityValues.is_bound() || single_value->field_presenceBitMSRACap.is_bound(); } boolean MSRACapabilityValuesRecord__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_mSRACapabilityValues.is_value() && single_value->field_presenceBitMSRACap.is_value(); } void MSRACapabilityValuesRecord__BSSGP_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; } MSRACapabilityValuesRecord__BSSGP MSRACapabilityValuesRecord__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); MSRACapabilityValuesRecord__BSSGP ret_val; if (single_value->field_mSRACapabilityValues.is_bound()) { ret_val.mSRACapabilityValues() = single_value->field_mSRACapabilityValues.valueof(); } if (single_value->field_presenceBitMSRACap.is_bound()) { ret_val.presenceBitMSRACap() = single_value->field_presenceBitMSRACap.valueof(); } return ret_val; } void MSRACapabilityValuesRecord__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MSRACapabilityValuesRecord__BSSGP_template[list_length]; } MSRACapabilityValuesRecord__BSSGP_template& MSRACapabilityValuesRecord__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); return value_list.list_value[list_index]; } MSRACapabilityValues__BSSGP_template& MSRACapabilityValuesRecord__BSSGP_template::mSRACapabilityValues() { set_specific(); return single_value->field_mSRACapabilityValues; } const MSRACapabilityValues__BSSGP_template& MSRACapabilityValuesRecord__BSSGP_template::mSRACapabilityValues() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mSRACapabilityValues of a non-specific template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); return single_value->field_mSRACapabilityValues; } BITSTRING_template& MSRACapabilityValuesRecord__BSSGP_template::presenceBitMSRACap() { set_specific(); return single_value->field_presenceBitMSRACap; } const BITSTRING_template& MSRACapabilityValuesRecord__BSSGP_template::presenceBitMSRACap() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field presenceBitMSRACap of a non-specific template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); return single_value->field_presenceBitMSRACap; } int MSRACapabilityValuesRecord__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP 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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP 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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); } return 0; } void MSRACapabilityValuesRecord__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ mSRACapabilityValues := "); single_value->field_mSRACapabilityValues.log(); TTCN_Logger::log_event_str(", presenceBitMSRACap := "); single_value->field_presenceBitMSRACap.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 MSRACapabilityValuesRecord__BSSGP_template::log_match(const MSRACapabilityValuesRecord__BSSGP& 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_mSRACapabilityValues.match(match_value.mSRACapabilityValues(), legacy)){ TTCN_Logger::log_logmatch_info(".mSRACapabilityValues"); single_value->field_mSRACapabilityValues.log_match(match_value.mSRACapabilityValues(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_presenceBitMSRACap.match(match_value.presenceBitMSRACap(), legacy)){ TTCN_Logger::log_logmatch_info(".presenceBitMSRACap"); single_value->field_presenceBitMSRACap.log_match(match_value.presenceBitMSRACap(), 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("{ mSRACapabilityValues := "); single_value->field_mSRACapabilityValues.log_match(match_value.mSRACapabilityValues(), legacy); TTCN_Logger::log_event_str(", presenceBitMSRACap := "); single_value->field_presenceBitMSRACap.log_match(match_value.presenceBitMSRACap(), 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 MSRACapabilityValuesRecord__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_mSRACapabilityValues.encode_text(text_buf); single_value->field_presenceBitMSRACap.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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); } } void MSRACapabilityValuesRecord__BSSGP_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_mSRACapabilityValues.decode_text(text_buf); single_value->field_presenceBitMSRACap.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 MSRACapabilityValuesRecord__BSSGP_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 @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP."); } } void MSRACapabilityValuesRecord__BSSGP_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: { MSRACapabilityValuesRecord__BSSGP_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) mSRACapabilityValues().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) presenceBitMSRACap().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(), "mSRACapabilityValues")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mSRACapabilityValues().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "presenceBitMSRACap")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { presenceBitMSRACap().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MSRACapabilityValuesRecord_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MSRACapabilityValuesRecord__BSSGP_template* precondition = new MSRACapabilityValuesRecord__BSSGP_template; precondition->set_param(*param.get_elem(0)); MSRACapabilityValuesRecord__BSSGP_template* implied_template = new MSRACapabilityValuesRecord__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = MSRACapabilityValuesRecord__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MSRACapabilityValuesRecord_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void MSRACapabilityValuesRecord__BSSGP_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_mSRACapabilityValues.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValuesRecord_BSSGP"); single_value->field_presenceBitMSRACap.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MSRACapabilityValuesRecord_BSSGP"); 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 : "@BSSGP_Types.MSRACapabilityValuesRecord_BSSGP"); } boolean MSRACapabilityValuesRecord__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MSRACapabilityValuesRecord__BSSGP_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mSRadioAccessCapabilityV__BSSGP().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mSRadioAccessCapabilityV_BSSGP")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mSRadioAccessCapabilityV__BSSGP().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MS_Radio_Access_Capability: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.MS_Radio_Access_Capability"); } } void MS__Radio__Access__Capability::encode_text(Text_Buf& text_buf) const { field_iEI.encode_text(text_buf); field_ext.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_mSRadioAccessCapabilityV__BSSGP.encode_text(text_buf); } void MS__Radio__Access__Capability::decode_text(Text_Buf& text_buf) { field_iEI.decode_text(text_buf); field_ext.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_mSRadioAccessCapabilityV__BSSGP.decode_text(text_buf); } void MS__Radio__Access__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(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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void MS__Radio__Access__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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int MS__Radio__Access__Capability::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; int selected_field = -1; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field2 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, MS__Radio__Access__Capability_iEI_descr_.raw->forceomit); decoded_field_length = field_iEI.RAW_decode(MS__Radio__Access__Capability_iEI_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, MS__Radio__Access__Capability_ext_descr_.raw->forceomit); decoded_field_length = field_ext.RAW_decode(MS__Radio__Access__Capability_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_ext == bs_0) selected_field = 0; else if (field_ext == bs_1) selected_field = 1; else selected_field = -1; RAW_Force_Omit field_2_force_omit(2, force_omit, MS__Radio__Access__Capability_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(MS__Radio__Access__Capability_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: { INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_); field_lengthIndicator.length1() = tmp1; value_of_length_field2 += tmp1.get_long_long_val() * 8; break; } case LIN2__2a::ALT_length2: { INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_); field_lengthIndicator.length2() = tmp2; value_of_length_field2 += tmp2.get_long_long_val() * 8; break; } default: value_of_length_field2 = 0; } RAW_Force_Omit field_3_force_omit(3, force_omit, MS__Radio__Access__Capability_mSRadioAccessCapabilityV__BSSGP_descr_.raw->forceomit); decoded_field_length = field_mSRadioAccessCapabilityV__BSSGP.RAW_decode(MS__Radio__Access__Capability_mSRadioAccessCapabilityV__BSSGP_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; if (field_iEI != os_1) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int MS__Radio__Access__Capability::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, MS__Radio__Access__Capability_iEI_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MS__Radio__Access__Capability_ext_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MS__Radio__Access__Capability_lengthIndicator_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MS__Radio__Access__Capability_mSRadioAccessCapabilityV__BSSGP_descr_.raw); encoded_length += field_iEI.RAW_encode(MS__Radio__Access__Capability_iEI_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ext.RAW_encode(MS__Radio__Access__Capability_ext_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_lengthIndicator.RAW_encode(MS__Radio__Access__Capability_lengthIndicator_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_mSRadioAccessCapabilityV__BSSGP.RAW_encode(MS__Radio__Access__Capability_mSRadioAccessCapabilityV__BSSGP_descr_, *myleaf.body.node.nodes[3]); { int sel_field = 0; while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; } const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr; int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length; delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field]; myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos; } switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: if (field_ext != bs_0) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_0.RAW_encode(MS__Radio__Access__Capability_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; case LIN2__2a::ALT_length2: if (field_ext != bs_1) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_1.RAW_encode(MS__Radio__Access__Capability_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; default:; } if (field_iEI != os_1) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ os_1.RAW_encode(MS__Radio__Access__Capability_iEI_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct MS__Radio__Access__Capability_template::single_value_struct { OCTETSTRING_template field_iEI; BITSTRING_template field_ext; LIN2__2a_template field_lengthIndicator; MSRadioAccessCapabilityV__BSSGP_template field_mSRadioAccessCapabilityV__BSSGP; }; void MS__Radio__Access__Capability_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_iEI = ANY_VALUE; single_value->field_ext = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_mSRadioAccessCapabilityV__BSSGP = ANY_VALUE; } } } void MS__Radio__Access__Capability_template::copy_value(const MS__Radio__Access__Capability& other_value) { single_value = new single_value_struct; if (other_value.iEI().is_bound()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (other_value.ext().is_bound()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.mSRadioAccessCapabilityV__BSSGP().is_bound()) { single_value->field_mSRadioAccessCapabilityV__BSSGP = other_value.mSRadioAccessCapabilityV__BSSGP(); } else { single_value->field_mSRadioAccessCapabilityV__BSSGP.clean_up(); } set_selection(SPECIFIC_VALUE); } void MS__Radio__Access__Capability_template::copy_template(const MS__Radio__Access__Capability_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.mSRadioAccessCapabilityV__BSSGP().get_selection()) { single_value->field_mSRadioAccessCapabilityV__BSSGP = other_value.mSRadioAccessCapabilityV__BSSGP(); } else { single_value->field_mSRadioAccessCapabilityV__BSSGP.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 MS__Radio__Access__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 MS__Radio__Access__Capability_template(*other_value.implication_.precondition); implication_.implied_template = new MS__Radio__Access__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 type @BSSGP_Types.MS_Radio_Access_Capability."); break; } set_selection(other_value); } MS__Radio__Access__Capability_template::MS__Radio__Access__Capability_template() { } MS__Radio__Access__Capability_template::MS__Radio__Access__Capability_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } MS__Radio__Access__Capability_template::MS__Radio__Access__Capability_template(const MS__Radio__Access__Capability& other_value) { copy_value(other_value); } MS__Radio__Access__Capability_template::MS__Radio__Access__Capability_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MS__Radio__Access__Capability&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.MS_Radio_Access_Capability from an unbound optional field."); } } MS__Radio__Access__Capability_template::MS__Radio__Access__Capability_template(MS__Radio__Access__Capability_template* p_precondition, MS__Radio__Access__Capability_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } MS__Radio__Access__Capability_template::MS__Radio__Access__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; } MS__Radio__Access__Capability_template::MS__Radio__Access__Capability_template(const MS__Radio__Access__Capability_template& other_value) : Base_Template() { copy_template(other_value); } MS__Radio__Access__Capability_template::~MS__Radio__Access__Capability_template() { clean_up(); } MS__Radio__Access__Capability_template& MS__Radio__Access__Capability_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } MS__Radio__Access__Capability_template& MS__Radio__Access__Capability_template::operator=(const MS__Radio__Access__Capability& other_value) { clean_up(); copy_value(other_value); return *this; } MS__Radio__Access__Capability_template& MS__Radio__Access__Capability_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const MS__Radio__Access__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 type @BSSGP_Types.MS_Radio_Access_Capability."); } return *this; } MS__Radio__Access__Capability_template& MS__Radio__Access__Capability_template::operator=(const MS__Radio__Access__Capability_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean MS__Radio__Access__Capability_template::match(const MS__Radio__Access__Capability& 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.iEI().is_bound()) return FALSE; if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE; if(!other_value.ext().is_bound()) return FALSE; if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.mSRadioAccessCapabilityV__BSSGP().is_bound()) return FALSE; if(!single_value->field_mSRadioAccessCapabilityV__BSSGP.match(other_value.mSRadioAccessCapabilityV__BSSGP(), 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 @BSSGP_Types.MS_Radio_Access_Capability."); } return FALSE; } boolean MS__Radio__Access__Capability_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iEI.is_bound() || single_value->field_ext.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_mSRadioAccessCapabilityV__BSSGP.is_bound(); } boolean MS__Radio__Access__Capability_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iEI.is_value() && single_value->field_ext.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_mSRadioAccessCapabilityV__BSSGP.is_value(); } void MS__Radio__Access__Capability_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; } MS__Radio__Access__Capability MS__Radio__Access__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 type @BSSGP_Types.MS_Radio_Access_Capability."); MS__Radio__Access__Capability ret_val; if (single_value->field_iEI.is_bound()) { ret_val.iEI() = single_value->field_iEI.valueof(); } if (single_value->field_ext.is_bound()) { ret_val.ext() = single_value->field_ext.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_mSRadioAccessCapabilityV__BSSGP.is_bound()) { ret_val.mSRadioAccessCapabilityV__BSSGP() = single_value->field_mSRadioAccessCapabilityV__BSSGP.valueof(); } return ret_val; } void MS__Radio__Access__Capability_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 @BSSGP_Types.MS_Radio_Access_Capability."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new MS__Radio__Access__Capability_template[list_length]; } MS__Radio__Access__Capability_template& MS__Radio__Access__Capability_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 @BSSGP_Types.MS_Radio_Access_Capability."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.MS_Radio_Access_Capability."); return value_list.list_value[list_index]; } OCTETSTRING_template& MS__Radio__Access__Capability_template::iEI() { set_specific(); return single_value->field_iEI; } const OCTETSTRING_template& MS__Radio__Access__Capability_template::iEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.MS_Radio_Access_Capability."); return single_value->field_iEI; } BITSTRING_template& MS__Radio__Access__Capability_template::ext() { set_specific(); return single_value->field_ext; } const BITSTRING_template& MS__Radio__Access__Capability_template::ext() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.MS_Radio_Access_Capability."); return single_value->field_ext; } LIN2__2a_template& MS__Radio__Access__Capability_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const LIN2__2a_template& MS__Radio__Access__Capability_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.MS_Radio_Access_Capability."); return single_value->field_lengthIndicator; } MSRadioAccessCapabilityV__BSSGP_template& MS__Radio__Access__Capability_template::mSRadioAccessCapabilityV__BSSGP() { set_specific(); return single_value->field_mSRadioAccessCapabilityV__BSSGP; } const MSRadioAccessCapabilityV__BSSGP_template& MS__Radio__Access__Capability_template::mSRadioAccessCapabilityV__BSSGP() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field mSRadioAccessCapabilityV_BSSGP of a non-specific template of type @BSSGP_Types.MS_Radio_Access_Capability."); return single_value->field_mSRadioAccessCapabilityV__BSSGP; } int MS__Radio__Access__Capability_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Radio_Access_Capability which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.MS_Radio_Access_Capability 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 @BSSGP_Types.MS_Radio_Access_Capability containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Radio_Access_Capability containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Radio_Access_Capability containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Radio_Access_Capability containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Radio_Access_Capability containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Radio_Access_Capability containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.MS_Radio_Access_Capability containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.MS_Radio_Access_Capability."); } return 0; } void MS__Radio__Access__Capability_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iEI := "); single_value->field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", mSRadioAccessCapabilityV_BSSGP := "); single_value->field_mSRadioAccessCapabilityV__BSSGP.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 MS__Radio__Access__Capability_template::log_match(const MS__Radio__Access__Capability& 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_iEI.match(match_value.iEI(), legacy)){ TTCN_Logger::log_logmatch_info(".iEI"); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ext.match(match_value.ext(), legacy)){ TTCN_Logger::log_logmatch_info(".ext"); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_mSRadioAccessCapabilityV__BSSGP.match(match_value.mSRadioAccessCapabilityV__BSSGP(), legacy)){ TTCN_Logger::log_logmatch_info(".mSRadioAccessCapabilityV_BSSGP"); single_value->field_mSRadioAccessCapabilityV__BSSGP.log_match(match_value.mSRadioAccessCapabilityV__BSSGP(), 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("{ iEI := "); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", mSRadioAccessCapabilityV_BSSGP := "); single_value->field_mSRadioAccessCapabilityV__BSSGP.log_match(match_value.mSRadioAccessCapabilityV__BSSGP(), 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 MS__Radio__Access__Capability_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iEI.encode_text(text_buf); single_value->field_ext.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_mSRadioAccessCapabilityV__BSSGP.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 @BSSGP_Types.MS_Radio_Access_Capability."); } } void MS__Radio__Access__Capability_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_iEI.decode_text(text_buf); single_value->field_ext.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_mSRadioAccessCapabilityV__BSSGP.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 MS__Radio__Access__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].decode_text(text_buf); break; default: TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BSSGP_Types.MS_Radio_Access_Capability."); } } void MS__Radio__Access__Capability_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: { MS__Radio__Access__Capability_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mSRadioAccessCapabilityV__BSSGP().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "mSRadioAccessCapabilityV_BSSGP")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { mSRadioAccessCapabilityV__BSSGP().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.MS_Radio_Access_Capability: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { MS__Radio__Access__Capability_template* precondition = new MS__Radio__Access__Capability_template; precondition->set_param(*param.get_elem(0)); MS__Radio__Access__Capability_template* implied_template = new MS__Radio__Access__Capability_template; implied_template->set_param(*param.get_elem(1)); *this = MS__Radio__Access__Capability_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.MS_Radio_Access_Capability"); } is_ifpresent = param.get_ifpresent(); } void MS__Radio__Access__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_OMIT: if (template_selection==OMIT_VALUE) return; case TR_VALUE: if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break; single_value->field_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MS_Radio_Access_Capability"); single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MS_Radio_Access_Capability"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MS_Radio_Access_Capability"); single_value->field_mSRadioAccessCapabilityV__BSSGP.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.MS_Radio_Access_Capability"); 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 : "@BSSGP_Types.MS_Radio_Access_Capability"); } boolean MS__Radio__Access__Capability_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean MS__Radio__Access__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 l_idx=0; l_idx0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) oMC__Identity().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "oMC_Identity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { oMC__Identity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.OMC_Id_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.OMC_Id_BSSGP"); } } void OMC__Id__BSSGP::encode_text(Text_Buf& text_buf) const { field_iEI.encode_text(text_buf); field_ext.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_oMC__Identity.encode_text(text_buf); } void OMC__Id__BSSGP::decode_text(Text_Buf& text_buf) { field_iEI.decode_text(text_buf); field_ext.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_oMC__Identity.decode_text(text_buf); } void OMC__Id__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void OMC__Id__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int OMC__Id__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; int selected_field = -1; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field2 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit); decoded_field_length = field_iEI.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, OMC__Id__BSSGP_ext_descr_.raw->forceomit); decoded_field_length = field_ext.RAW_decode(OMC__Id__BSSGP_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_ext == bs_0) selected_field = 0; else if (field_ext == bs_1) selected_field = 1; else selected_field = -1; RAW_Force_Omit field_2_force_omit(2, force_omit, OMC__Id__BSSGP_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(OMC__Id__BSSGP_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: { INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_); field_lengthIndicator.length1() = tmp1; value_of_length_field2 += tmp1.get_long_long_val() * 8; break; } case LIN2__2a::ALT_length2: { INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_); field_lengthIndicator.length2() = tmp2; value_of_length_field2 += tmp2.get_long_long_val() * 8; break; } default: value_of_length_field2 = 0; } RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT20_descr_.raw->forceomit); decoded_field_length = field_oMC__Identity.RAW_decode(General__Types::OCT20_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; if (field_iEI != os_53) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int OMC__Id__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, OMC__Id__BSSGP_ext_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OMC__Id__BSSGP_lengthIndicator_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT20_descr_.raw); encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ext.RAW_encode(OMC__Id__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_lengthIndicator.RAW_encode(OMC__Id__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_oMC__Identity.RAW_encode(General__Types::OCT20_descr_, *myleaf.body.node.nodes[3]); { int sel_field = 0; while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; } const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr; int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length; delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field]; myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos; } switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: if (field_ext != bs_0) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_0.RAW_encode(OMC__Id__BSSGP_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; case LIN2__2a::ALT_length2: if (field_ext != bs_1) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_1.RAW_encode(OMC__Id__BSSGP_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; default:; } if (field_iEI != os_53) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ os_53.RAW_encode(General__Types::OCT1_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct OMC__Id__BSSGP_template::single_value_struct { OCTETSTRING_template field_iEI; BITSTRING_template field_ext; LIN2__2a_template field_lengthIndicator; OCTETSTRING_template field_oMC__Identity; }; void OMC__Id__BSSGP_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_iEI = ANY_VALUE; single_value->field_ext = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_oMC__Identity = ANY_VALUE; } } } void OMC__Id__BSSGP_template::copy_value(const OMC__Id__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.iEI().is_bound()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (other_value.ext().is_bound()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.oMC__Identity().is_bound()) { single_value->field_oMC__Identity = other_value.oMC__Identity(); } else { single_value->field_oMC__Identity.clean_up(); } set_selection(SPECIFIC_VALUE); } void OMC__Id__BSSGP_template::copy_template(const OMC__Id__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.oMC__Identity().get_selection()) { single_value->field_oMC__Identity = other_value.oMC__Identity(); } else { single_value->field_oMC__Identity.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 OMC__Id__BSSGP_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 OMC__Id__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new OMC__Id__BSSGP_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 @BSSGP_Types.OMC_Id_BSSGP."); break; } set_selection(other_value); } OMC__Id__BSSGP_template::OMC__Id__BSSGP_template() { } OMC__Id__BSSGP_template::OMC__Id__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } OMC__Id__BSSGP_template::OMC__Id__BSSGP_template(const OMC__Id__BSSGP& other_value) { copy_value(other_value); } OMC__Id__BSSGP_template::OMC__Id__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const OMC__Id__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.OMC_Id_BSSGP from an unbound optional field."); } } OMC__Id__BSSGP_template::OMC__Id__BSSGP_template(OMC__Id__BSSGP_template* p_precondition, OMC__Id__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } OMC__Id__BSSGP_template::OMC__Id__BSSGP_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; } OMC__Id__BSSGP_template::OMC__Id__BSSGP_template(const OMC__Id__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } OMC__Id__BSSGP_template::~OMC__Id__BSSGP_template() { clean_up(); } OMC__Id__BSSGP_template& OMC__Id__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } OMC__Id__BSSGP_template& OMC__Id__BSSGP_template::operator=(const OMC__Id__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } OMC__Id__BSSGP_template& OMC__Id__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const OMC__Id__BSSGP&)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 @BSSGP_Types.OMC_Id_BSSGP."); } return *this; } OMC__Id__BSSGP_template& OMC__Id__BSSGP_template::operator=(const OMC__Id__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean OMC__Id__BSSGP_template::match(const OMC__Id__BSSGP& 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.iEI().is_bound()) return FALSE; if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE; if(!other_value.ext().is_bound()) return FALSE; if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.oMC__Identity().is_bound()) return FALSE; if(!single_value->field_oMC__Identity.match(other_value.oMC__Identity(), 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 @BSSGP_Types.OMC_Id_BSSGP."); } return FALSE; } boolean OMC__Id__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iEI.is_bound() || single_value->field_ext.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_oMC__Identity.is_bound(); } boolean OMC__Id__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iEI.is_value() && single_value->field_ext.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_oMC__Identity.is_value(); } void OMC__Id__BSSGP_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; } OMC__Id__BSSGP OMC__Id__BSSGP_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 @BSSGP_Types.OMC_Id_BSSGP."); OMC__Id__BSSGP ret_val; if (single_value->field_iEI.is_bound()) { ret_val.iEI() = single_value->field_iEI.valueof(); } if (single_value->field_ext.is_bound()) { ret_val.ext() = single_value->field_ext.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_oMC__Identity.is_bound()) { ret_val.oMC__Identity() = single_value->field_oMC__Identity.valueof(); } return ret_val; } void OMC__Id__BSSGP_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 @BSSGP_Types.OMC_Id_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new OMC__Id__BSSGP_template[list_length]; } OMC__Id__BSSGP_template& OMC__Id__BSSGP_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 @BSSGP_Types.OMC_Id_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.OMC_Id_BSSGP."); return value_list.list_value[list_index]; } OCTETSTRING_template& OMC__Id__BSSGP_template::iEI() { set_specific(); return single_value->field_iEI; } const OCTETSTRING_template& OMC__Id__BSSGP_template::iEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.OMC_Id_BSSGP."); return single_value->field_iEI; } BITSTRING_template& OMC__Id__BSSGP_template::ext() { set_specific(); return single_value->field_ext; } const BITSTRING_template& OMC__Id__BSSGP_template::ext() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.OMC_Id_BSSGP."); return single_value->field_ext; } LIN2__2a_template& OMC__Id__BSSGP_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const LIN2__2a_template& OMC__Id__BSSGP_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.OMC_Id_BSSGP."); return single_value->field_lengthIndicator; } OCTETSTRING_template& OMC__Id__BSSGP_template::oMC__Identity() { set_specific(); return single_value->field_oMC__Identity; } const OCTETSTRING_template& OMC__Id__BSSGP_template::oMC__Identity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field oMC_Identity of a non-specific template of type @BSSGP_Types.OMC_Id_BSSGP."); return single_value->field_oMC__Identity; } int OMC__Id__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.OMC_Id_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.OMC_Id_BSSGP 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 @BSSGP_Types.OMC_Id_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.OMC_Id_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.OMC_Id_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.OMC_Id_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.OMC_Id_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.OMC_Id_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.OMC_Id_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.OMC_Id_BSSGP."); } return 0; } void OMC__Id__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iEI := "); single_value->field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", oMC_Identity := "); single_value->field_oMC__Identity.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 OMC__Id__BSSGP_template::log_match(const OMC__Id__BSSGP& 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_iEI.match(match_value.iEI(), legacy)){ TTCN_Logger::log_logmatch_info(".iEI"); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ext.match(match_value.ext(), legacy)){ TTCN_Logger::log_logmatch_info(".ext"); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_oMC__Identity.match(match_value.oMC__Identity(), legacy)){ TTCN_Logger::log_logmatch_info(".oMC_Identity"); single_value->field_oMC__Identity.log_match(match_value.oMC__Identity(), 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("{ iEI := "); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", oMC_Identity := "); single_value->field_oMC__Identity.log_match(match_value.oMC__Identity(), 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 OMC__Id__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iEI.encode_text(text_buf); single_value->field_ext.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_oMC__Identity.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 @BSSGP_Types.OMC_Id_BSSGP."); } } void OMC__Id__BSSGP_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_iEI.decode_text(text_buf); single_value->field_ext.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_oMC__Identity.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 OMC__Id__BSSGP_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 @BSSGP_Types.OMC_Id_BSSGP."); } } void OMC__Id__BSSGP_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: { OMC__Id__BSSGP_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) oMC__Identity().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "oMC_Identity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { oMC__Identity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.OMC_Id_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { OMC__Id__BSSGP_template* precondition = new OMC__Id__BSSGP_template; precondition->set_param(*param.get_elem(0)); OMC__Id__BSSGP_template* implied_template = new OMC__Id__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = OMC__Id__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.OMC_Id_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void OMC__Id__BSSGP_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.OMC_Id_BSSGP"); single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.OMC_Id_BSSGP"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.OMC_Id_BSSGP"); single_value->field_oMC__Identity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.OMC_Id_BSSGP"); 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 : "@BSSGP_Types.OMC_Id_BSSGP"); } boolean OMC__Id__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean OMC__Id__BSSGP_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) erroneous__BSSGP__PDU().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "erroneous_BSSGP_PDU")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { erroneous__BSSGP__PDU().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.PDU_in_Error: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.PDU_in_Error"); } } void PDU__in__Error::encode_text(Text_Buf& text_buf) const { field_iEI.encode_text(text_buf); field_ext.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_erroneous__BSSGP__PDU.encode_text(text_buf); } void PDU__in__Error::decode_text(Text_Buf& text_buf) { field_iEI.decode_text(text_buf); field_ext.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_erroneous__BSSGP__PDU.decode_text(text_buf); } void PDU__in__Error::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void PDU__in__Error::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int PDU__in__Error::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; int selected_field = -1; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field2 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit); decoded_field_length = field_iEI.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, PDU__in__Error_ext_descr_.raw->forceomit); decoded_field_length = field_ext.RAW_decode(PDU__in__Error_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_ext == bs_0) selected_field = 0; else if (field_ext == bs_1) selected_field = 1; else selected_field = -1; RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__in__Error_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(PDU__in__Error_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: { INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_); field_lengthIndicator.length1() = tmp1; value_of_length_field2 += tmp1.get_long_long_val() * 8; break; } case LIN2__2a::ALT_length2: { INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_); field_lengthIndicator.length2() = tmp2; value_of_length_field2 += tmp2.get_long_long_val() * 8; break; } default: value_of_length_field2 = 0; } RAW_Force_Omit field_3_force_omit(3, force_omit, OCTETSTRING_descr_.raw->forceomit); decoded_field_length = field_erroneous__BSSGP__PDU.RAW_decode(OCTETSTRING_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; if (field_iEI != os_51) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int PDU__in__Error::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__in__Error_ext_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__in__Error_lengthIndicator_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, OCTETSTRING_descr_.raw); encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ext.RAW_encode(PDU__in__Error_ext_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_lengthIndicator.RAW_encode(PDU__in__Error_lengthIndicator_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_erroneous__BSSGP__PDU.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[3]); { int sel_field = 0; while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; } const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr; int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length; delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field]; myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos; } switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: if (field_ext != bs_0) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_0.RAW_encode(PDU__in__Error_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; case LIN2__2a::ALT_length2: if (field_ext != bs_1) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_1.RAW_encode(PDU__in__Error_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; default:; } if (field_iEI != os_51) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ os_51.RAW_encode(General__Types::OCT1_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct PDU__in__Error_template::single_value_struct { OCTETSTRING_template field_iEI; BITSTRING_template field_ext; LIN2__2a_template field_lengthIndicator; OCTETSTRING_template field_erroneous__BSSGP__PDU; }; void PDU__in__Error_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_iEI = ANY_VALUE; single_value->field_ext = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_erroneous__BSSGP__PDU = ANY_VALUE; } } } void PDU__in__Error_template::copy_value(const PDU__in__Error& other_value) { single_value = new single_value_struct; if (other_value.iEI().is_bound()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (other_value.ext().is_bound()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.erroneous__BSSGP__PDU().is_bound()) { single_value->field_erroneous__BSSGP__PDU = other_value.erroneous__BSSGP__PDU(); } else { single_value->field_erroneous__BSSGP__PDU.clean_up(); } set_selection(SPECIFIC_VALUE); } void PDU__in__Error_template::copy_template(const PDU__in__Error_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.erroneous__BSSGP__PDU().get_selection()) { single_value->field_erroneous__BSSGP__PDU = other_value.erroneous__BSSGP__PDU(); } else { single_value->field_erroneous__BSSGP__PDU.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 PDU__in__Error_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 PDU__in__Error_template(*other_value.implication_.precondition); implication_.implied_template = new PDU__in__Error_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 @BSSGP_Types.PDU_in_Error."); break; } set_selection(other_value); } PDU__in__Error_template::PDU__in__Error_template() { } PDU__in__Error_template::PDU__in__Error_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } PDU__in__Error_template::PDU__in__Error_template(const PDU__in__Error& other_value) { copy_value(other_value); } PDU__in__Error_template::PDU__in__Error_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PDU__in__Error&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.PDU_in_Error from an unbound optional field."); } } PDU__in__Error_template::PDU__in__Error_template(PDU__in__Error_template* p_precondition, PDU__in__Error_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PDU__in__Error_template::PDU__in__Error_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; } PDU__in__Error_template::PDU__in__Error_template(const PDU__in__Error_template& other_value) : Base_Template() { copy_template(other_value); } PDU__in__Error_template::~PDU__in__Error_template() { clean_up(); } PDU__in__Error_template& PDU__in__Error_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PDU__in__Error_template& PDU__in__Error_template::operator=(const PDU__in__Error& other_value) { clean_up(); copy_value(other_value); return *this; } PDU__in__Error_template& PDU__in__Error_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PDU__in__Error&)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 @BSSGP_Types.PDU_in_Error."); } return *this; } PDU__in__Error_template& PDU__in__Error_template::operator=(const PDU__in__Error_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean PDU__in__Error_template::match(const PDU__in__Error& 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.iEI().is_bound()) return FALSE; if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE; if(!other_value.ext().is_bound()) return FALSE; if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.erroneous__BSSGP__PDU().is_bound()) return FALSE; if(!single_value->field_erroneous__BSSGP__PDU.match(other_value.erroneous__BSSGP__PDU(), 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 @BSSGP_Types.PDU_in_Error."); } return FALSE; } boolean PDU__in__Error_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iEI.is_bound() || single_value->field_ext.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_erroneous__BSSGP__PDU.is_bound(); } boolean PDU__in__Error_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iEI.is_value() && single_value->field_ext.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_erroneous__BSSGP__PDU.is_value(); } void PDU__in__Error_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; } PDU__in__Error PDU__in__Error_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 @BSSGP_Types.PDU_in_Error."); PDU__in__Error ret_val; if (single_value->field_iEI.is_bound()) { ret_val.iEI() = single_value->field_iEI.valueof(); } if (single_value->field_ext.is_bound()) { ret_val.ext() = single_value->field_ext.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_erroneous__BSSGP__PDU.is_bound()) { ret_val.erroneous__BSSGP__PDU() = single_value->field_erroneous__BSSGP__PDU.valueof(); } return ret_val; } void PDU__in__Error_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 @BSSGP_Types.PDU_in_Error."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new PDU__in__Error_template[list_length]; } PDU__in__Error_template& PDU__in__Error_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 @BSSGP_Types.PDU_in_Error."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_in_Error."); return value_list.list_value[list_index]; } OCTETSTRING_template& PDU__in__Error_template::iEI() { set_specific(); return single_value->field_iEI; } const OCTETSTRING_template& PDU__in__Error_template::iEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.PDU_in_Error."); return single_value->field_iEI; } BITSTRING_template& PDU__in__Error_template::ext() { set_specific(); return single_value->field_ext; } const BITSTRING_template& PDU__in__Error_template::ext() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.PDU_in_Error."); return single_value->field_ext; } LIN2__2a_template& PDU__in__Error_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const LIN2__2a_template& PDU__in__Error_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.PDU_in_Error."); return single_value->field_lengthIndicator; } OCTETSTRING_template& PDU__in__Error_template::erroneous__BSSGP__PDU() { set_specific(); return single_value->field_erroneous__BSSGP__PDU; } const OCTETSTRING_template& PDU__in__Error_template::erroneous__BSSGP__PDU() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field erroneous_BSSGP_PDU of a non-specific template of type @BSSGP_Types.PDU_in_Error."); return single_value->field_erroneous__BSSGP__PDU; } int PDU__in__Error_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_in_Error which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_in_Error 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 @BSSGP_Types.PDU_in_Error containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_in_Error containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_in_Error containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_in_Error containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_in_Error containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_in_Error containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_in_Error containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_in_Error."); } return 0; } void PDU__in__Error_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iEI := "); single_value->field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", erroneous_BSSGP_PDU := "); single_value->field_erroneous__BSSGP__PDU.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 PDU__in__Error_template::log_match(const PDU__in__Error& 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_iEI.match(match_value.iEI(), legacy)){ TTCN_Logger::log_logmatch_info(".iEI"); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ext.match(match_value.ext(), legacy)){ TTCN_Logger::log_logmatch_info(".ext"); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_erroneous__BSSGP__PDU.match(match_value.erroneous__BSSGP__PDU(), legacy)){ TTCN_Logger::log_logmatch_info(".erroneous_BSSGP_PDU"); single_value->field_erroneous__BSSGP__PDU.log_match(match_value.erroneous__BSSGP__PDU(), 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("{ iEI := "); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", erroneous_BSSGP_PDU := "); single_value->field_erroneous__BSSGP__PDU.log_match(match_value.erroneous__BSSGP__PDU(), 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 PDU__in__Error_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iEI.encode_text(text_buf); single_value->field_ext.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_erroneous__BSSGP__PDU.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 @BSSGP_Types.PDU_in_Error."); } } void PDU__in__Error_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_iEI.decode_text(text_buf); single_value->field_ext.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_erroneous__BSSGP__PDU.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 PDU__in__Error_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 @BSSGP_Types.PDU_in_Error."); } } void PDU__in__Error_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: { PDU__in__Error_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) erroneous__BSSGP__PDU().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "erroneous_BSSGP_PDU")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { erroneous__BSSGP__PDU().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.PDU_in_Error: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { PDU__in__Error_template* precondition = new PDU__in__Error_template; precondition->set_param(*param.get_elem(0)); PDU__in__Error_template* implied_template = new PDU__in__Error_template; implied_template->set_param(*param.get_elem(1)); *this = PDU__in__Error_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.PDU_in_Error"); } is_ifpresent = param.get_ifpresent(); } void PDU__in__Error_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_in_Error"); single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_in_Error"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_in_Error"); single_value->field_erroneous__BSSGP__PDU.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_in_Error"); 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 : "@BSSGP_Types.PDU_in_Error"); } boolean PDU__in__Error_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PDU__in__Error_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) delay__Value().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "delay_Value")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { delay__Value().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.PDU_Lifetime: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.PDU_Lifetime"); } } void PDU__Lifetime::encode_text(Text_Buf& text_buf) const { field_iEI.encode_text(text_buf); field_ext.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_delay__Value.encode_text(text_buf); } void PDU__Lifetime::decode_text(Text_Buf& text_buf) { field_iEI.decode_text(text_buf); field_ext.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_delay__Value.decode_text(text_buf); } void PDU__Lifetime::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void PDU__Lifetime::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int PDU__Lifetime::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; int selected_field = -1; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field2 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit); decoded_field_length = field_iEI.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, PDU__Lifetime_ext_descr_.raw->forceomit); decoded_field_length = field_ext.RAW_decode(PDU__Lifetime_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_ext == bs_0) selected_field = 0; else if (field_ext == bs_1) selected_field = 1; else selected_field = -1; RAW_Force_Omit field_2_force_omit(2, force_omit, PDU__Lifetime_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(PDU__Lifetime_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: { INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_); field_lengthIndicator.length1() = tmp1; value_of_length_field2 += tmp1.get_long_long_val() * 8; break; } case LIN2__2a::ALT_length2: { INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_); field_lengthIndicator.length2() = tmp2; value_of_length_field2 += tmp2.get_long_long_val() * 8; break; } default: value_of_length_field2 = 0; } RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT2_descr_.raw->forceomit); decoded_field_length = field_delay__Value.RAW_decode(General__Types::OCT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; if (field_iEI != os_0) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int PDU__Lifetime::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 4; myleaf.body.node.nodes = init_nodes_of_enc_tree(4); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, PDU__Lifetime_ext_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, PDU__Lifetime_lengthIndicator_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT2_descr_.raw); encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ext.RAW_encode(PDU__Lifetime_ext_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_lengthIndicator.RAW_encode(PDU__Lifetime_lengthIndicator_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_delay__Value.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[3]); { int sel_field = 0; while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; } const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr; int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length; delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field]; myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 1; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(1); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos; } switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: if (field_ext != bs_0) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_0.RAW_encode(PDU__Lifetime_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; case LIN2__2a::ALT_length2: if (field_ext != bs_1) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_1.RAW_encode(PDU__Lifetime_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; default:; } if (field_iEI != os_0) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ os_0.RAW_encode(General__Types::OCT1_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct PDU__Lifetime_template::single_value_struct { OCTETSTRING_template field_iEI; BITSTRING_template field_ext; LIN2__2a_template field_lengthIndicator; OCTETSTRING_template field_delay__Value; }; void PDU__Lifetime_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_iEI = ANY_VALUE; single_value->field_ext = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_delay__Value = ANY_VALUE; } } } void PDU__Lifetime_template::copy_value(const PDU__Lifetime& other_value) { single_value = new single_value_struct; if (other_value.iEI().is_bound()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (other_value.ext().is_bound()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.delay__Value().is_bound()) { single_value->field_delay__Value = other_value.delay__Value(); } else { single_value->field_delay__Value.clean_up(); } set_selection(SPECIFIC_VALUE); } void PDU__Lifetime_template::copy_template(const PDU__Lifetime_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.delay__Value().get_selection()) { single_value->field_delay__Value = other_value.delay__Value(); } else { single_value->field_delay__Value.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 PDU__Lifetime_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 PDU__Lifetime_template(*other_value.implication_.precondition); implication_.implied_template = new PDU__Lifetime_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 @BSSGP_Types.PDU_Lifetime."); break; } set_selection(other_value); } PDU__Lifetime_template::PDU__Lifetime_template() { } PDU__Lifetime_template::PDU__Lifetime_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } PDU__Lifetime_template::PDU__Lifetime_template(const PDU__Lifetime& other_value) { copy_value(other_value); } PDU__Lifetime_template::PDU__Lifetime_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PDU__Lifetime&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.PDU_Lifetime from an unbound optional field."); } } PDU__Lifetime_template::PDU__Lifetime_template(PDU__Lifetime_template* p_precondition, PDU__Lifetime_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } PDU__Lifetime_template::PDU__Lifetime_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; } PDU__Lifetime_template::PDU__Lifetime_template(const PDU__Lifetime_template& other_value) : Base_Template() { copy_template(other_value); } PDU__Lifetime_template::~PDU__Lifetime_template() { clean_up(); } PDU__Lifetime_template& PDU__Lifetime_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } PDU__Lifetime_template& PDU__Lifetime_template::operator=(const PDU__Lifetime& other_value) { clean_up(); copy_value(other_value); return *this; } PDU__Lifetime_template& PDU__Lifetime_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const PDU__Lifetime&)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 @BSSGP_Types.PDU_Lifetime."); } return *this; } PDU__Lifetime_template& PDU__Lifetime_template::operator=(const PDU__Lifetime_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean PDU__Lifetime_template::match(const PDU__Lifetime& 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.iEI().is_bound()) return FALSE; if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE; if(!other_value.ext().is_bound()) return FALSE; if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.delay__Value().is_bound()) return FALSE; if(!single_value->field_delay__Value.match(other_value.delay__Value(), 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 @BSSGP_Types.PDU_Lifetime."); } return FALSE; } boolean PDU__Lifetime_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iEI.is_bound() || single_value->field_ext.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_delay__Value.is_bound(); } boolean PDU__Lifetime_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iEI.is_value() && single_value->field_ext.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_delay__Value.is_value(); } void PDU__Lifetime_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; } PDU__Lifetime PDU__Lifetime_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 @BSSGP_Types.PDU_Lifetime."); PDU__Lifetime ret_val; if (single_value->field_iEI.is_bound()) { ret_val.iEI() = single_value->field_iEI.valueof(); } if (single_value->field_ext.is_bound()) { ret_val.ext() = single_value->field_ext.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_delay__Value.is_bound()) { ret_val.delay__Value() = single_value->field_delay__Value.valueof(); } return ret_val; } void PDU__Lifetime_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 @BSSGP_Types.PDU_Lifetime."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new PDU__Lifetime_template[list_length]; } PDU__Lifetime_template& PDU__Lifetime_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 @BSSGP_Types.PDU_Lifetime."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.PDU_Lifetime."); return value_list.list_value[list_index]; } OCTETSTRING_template& PDU__Lifetime_template::iEI() { set_specific(); return single_value->field_iEI; } const OCTETSTRING_template& PDU__Lifetime_template::iEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.PDU_Lifetime."); return single_value->field_iEI; } BITSTRING_template& PDU__Lifetime_template::ext() { set_specific(); return single_value->field_ext; } const BITSTRING_template& PDU__Lifetime_template::ext() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.PDU_Lifetime."); return single_value->field_ext; } LIN2__2a_template& PDU__Lifetime_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const LIN2__2a_template& PDU__Lifetime_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.PDU_Lifetime."); return single_value->field_lengthIndicator; } OCTETSTRING_template& PDU__Lifetime_template::delay__Value() { set_specific(); return single_value->field_delay__Value; } const OCTETSTRING_template& PDU__Lifetime_template::delay__Value() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field delay_Value of a non-specific template of type @BSSGP_Types.PDU_Lifetime."); return single_value->field_delay__Value; } int PDU__Lifetime_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_Lifetime which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 4; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.PDU_Lifetime 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 @BSSGP_Types.PDU_Lifetime containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_Lifetime containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_Lifetime containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_Lifetime containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_Lifetime containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_Lifetime containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.PDU_Lifetime containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.PDU_Lifetime."); } return 0; } void PDU__Lifetime_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iEI := "); single_value->field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", delay_Value := "); single_value->field_delay__Value.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 PDU__Lifetime_template::log_match(const PDU__Lifetime& 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_iEI.match(match_value.iEI(), legacy)){ TTCN_Logger::log_logmatch_info(".iEI"); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ext.match(match_value.ext(), legacy)){ TTCN_Logger::log_logmatch_info(".ext"); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_delay__Value.match(match_value.delay__Value(), legacy)){ TTCN_Logger::log_logmatch_info(".delay_Value"); single_value->field_delay__Value.log_match(match_value.delay__Value(), 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("{ iEI := "); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", delay_Value := "); single_value->field_delay__Value.log_match(match_value.delay__Value(), 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 PDU__Lifetime_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iEI.encode_text(text_buf); single_value->field_ext.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_delay__Value.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 @BSSGP_Types.PDU_Lifetime."); } } void PDU__Lifetime_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_iEI.decode_text(text_buf); single_value->field_ext.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_delay__Value.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 PDU__Lifetime_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 @BSSGP_Types.PDU_Lifetime."); } } void PDU__Lifetime_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: { PDU__Lifetime_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) delay__Value().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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "delay_Value")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { delay__Value().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.PDU_Lifetime: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { PDU__Lifetime_template* precondition = new PDU__Lifetime_template; precondition->set_param(*param.get_elem(0)); PDU__Lifetime_template* implied_template = new PDU__Lifetime_template; implied_template->set_param(*param.get_elem(1)); *this = PDU__Lifetime_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.PDU_Lifetime"); } is_ifpresent = param.get_ifpresent(); } void PDU__Lifetime_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_Lifetime"); single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_Lifetime"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_Lifetime"); single_value->field_delay__Value.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.PDU_Lifetime"); 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 : "@BSSGP_Types.PDU_Lifetime"); } boolean PDU__Lifetime_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean PDU__Lifetime_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pvi().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) qa().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) priority__Level().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pci().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(7)); 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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pvi")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pvi().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "qa")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { qa().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "priority_Level")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { priority__Level().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pci")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pci().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "spare")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { spare().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.Priority_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.Priority_BSSGP"); } } void Priority__BSSGP::encode_text(Text_Buf& text_buf) const { field_iEI.encode_text(text_buf); field_ext.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_pvi.encode_text(text_buf); field_qa.encode_text(text_buf); field_priority__Level.encode_text(text_buf); field_pci.encode_text(text_buf); field_spare.encode_text(text_buf); } void Priority__BSSGP::decode_text(Text_Buf& text_buf) { field_iEI.decode_text(text_buf); field_ext.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_pvi.decode_text(text_buf); field_qa.decode_text(text_buf); field_priority__Level.decode_text(text_buf); field_pci.decode_text(text_buf); field_spare.decode_text(text_buf); } void Priority__BSSGP::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void Priority__BSSGP::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int Priority__BSSGP::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; int selected_field = -1; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field2 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit); decoded_field_length = field_iEI.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, Priority__BSSGP_ext_descr_.raw->forceomit); decoded_field_length = field_ext.RAW_decode(Priority__BSSGP_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_ext == bs_0) selected_field = 0; else if (field_ext == bs_1) selected_field = 1; else selected_field = -1; RAW_Force_Omit field_2_force_omit(2, force_omit, Priority__BSSGP_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(Priority__BSSGP_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: { INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_); field_lengthIndicator.length1() = tmp1; value_of_length_field2 += tmp1.get_long_long_val() * 8; break; } case LIN2__2a::ALT_length2: { INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_); field_lengthIndicator.length2() = tmp2; value_of_length_field2 += tmp2.get_long_long_val() * 8; break; } default: value_of_length_field2 = 0; } RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::BIT1_descr_.raw->forceomit); decoded_field_length = field_pvi.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT1_descr_.raw->forceomit); decoded_field_length = field_qa.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT4_descr_.raw->forceomit); decoded_field_length = field_priority__Level.RAW_decode(General__Types::BIT4_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit); decoded_field_length = field_pci.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::BIT1_descr_.raw->forceomit); decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_7_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; if (field_iEI != os_2) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int Priority__BSSGP::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 8; myleaf.body.node.nodes = init_nodes_of_enc_tree(8); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, Priority__BSSGP_ext_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, Priority__BSSGP_lengthIndicator_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::BIT1_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT1_descr_.raw); myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT4_descr_.raw); myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw); myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT1_descr_.raw); encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ext.RAW_encode(Priority__BSSGP_ext_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_lengthIndicator.RAW_encode(Priority__BSSGP_lengthIndicator_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_pvi.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_qa.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[4]); encoded_length += field_priority__Level.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[5]); encoded_length += field_pci.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]); encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[7]); { int sel_field = 0; while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; } const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr; int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length; delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field]; myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 5; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(5); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[7]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[7]->curr_pos.pos; } switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: if (field_ext != bs_0) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_0.RAW_encode(Priority__BSSGP_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; case LIN2__2a::ALT_length2: if (field_ext != bs_1) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_1.RAW_encode(Priority__BSSGP_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; default:; } if (field_iEI != os_2) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ os_2.RAW_encode(General__Types::OCT1_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct Priority__BSSGP_template::single_value_struct { OCTETSTRING_template field_iEI; BITSTRING_template field_ext; LIN2__2a_template field_lengthIndicator; BITSTRING_template field_pvi; BITSTRING_template field_qa; BITSTRING_template field_priority__Level; BITSTRING_template field_pci; BITSTRING_template field_spare; }; void Priority__BSSGP_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_iEI = ANY_VALUE; single_value->field_ext = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_pvi = ANY_VALUE; single_value->field_qa = ANY_VALUE; single_value->field_priority__Level = ANY_VALUE; single_value->field_pci = ANY_VALUE; single_value->field_spare = ANY_VALUE; } } } void Priority__BSSGP_template::copy_value(const Priority__BSSGP& other_value) { single_value = new single_value_struct; if (other_value.iEI().is_bound()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (other_value.ext().is_bound()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.pvi().is_bound()) { single_value->field_pvi = other_value.pvi(); } else { single_value->field_pvi.clean_up(); } if (other_value.qa().is_bound()) { single_value->field_qa = other_value.qa(); } else { single_value->field_qa.clean_up(); } if (other_value.priority__Level().is_bound()) { single_value->field_priority__Level = other_value.priority__Level(); } else { single_value->field_priority__Level.clean_up(); } if (other_value.pci().is_bound()) { single_value->field_pci = other_value.pci(); } else { single_value->field_pci.clean_up(); } if (other_value.spare().is_bound()) { single_value->field_spare = other_value.spare(); } else { single_value->field_spare.clean_up(); } set_selection(SPECIFIC_VALUE); } void Priority__BSSGP_template::copy_template(const Priority__BSSGP_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pvi().get_selection()) { single_value->field_pvi = other_value.pvi(); } else { single_value->field_pvi.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.qa().get_selection()) { single_value->field_qa = other_value.qa(); } else { single_value->field_qa.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.priority__Level().get_selection()) { single_value->field_priority__Level = other_value.priority__Level(); } else { single_value->field_priority__Level.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.pci().get_selection()) { single_value->field_pci = other_value.pci(); } else { single_value->field_pci.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) { single_value->field_spare = other_value.spare(); } else { single_value->field_spare.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 Priority__BSSGP_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 Priority__BSSGP_template(*other_value.implication_.precondition); implication_.implied_template = new Priority__BSSGP_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 @BSSGP_Types.Priority_BSSGP."); break; } set_selection(other_value); } Priority__BSSGP_template::Priority__BSSGP_template() { } Priority__BSSGP_template::Priority__BSSGP_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } Priority__BSSGP_template::Priority__BSSGP_template(const Priority__BSSGP& other_value) { copy_value(other_value); } Priority__BSSGP_template::Priority__BSSGP_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Priority__BSSGP&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.Priority_BSSGP from an unbound optional field."); } } Priority__BSSGP_template::Priority__BSSGP_template(Priority__BSSGP_template* p_precondition, Priority__BSSGP_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } Priority__BSSGP_template::Priority__BSSGP_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; } Priority__BSSGP_template::Priority__BSSGP_template(const Priority__BSSGP_template& other_value) : Base_Template() { copy_template(other_value); } Priority__BSSGP_template::~Priority__BSSGP_template() { clean_up(); } Priority__BSSGP_template& Priority__BSSGP_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } Priority__BSSGP_template& Priority__BSSGP_template::operator=(const Priority__BSSGP& other_value) { clean_up(); copy_value(other_value); return *this; } Priority__BSSGP_template& Priority__BSSGP_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const Priority__BSSGP&)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 @BSSGP_Types.Priority_BSSGP."); } return *this; } Priority__BSSGP_template& Priority__BSSGP_template::operator=(const Priority__BSSGP_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean Priority__BSSGP_template::match(const Priority__BSSGP& 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.iEI().is_bound()) return FALSE; if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE; if(!other_value.ext().is_bound()) return FALSE; if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.pvi().is_bound()) return FALSE; if(!single_value->field_pvi.match(other_value.pvi(), legacy))return FALSE; if(!other_value.qa().is_bound()) return FALSE; if(!single_value->field_qa.match(other_value.qa(), legacy))return FALSE; if(!other_value.priority__Level().is_bound()) return FALSE; if(!single_value->field_priority__Level.match(other_value.priority__Level(), legacy))return FALSE; if(!other_value.pci().is_bound()) return FALSE; if(!single_value->field_pci.match(other_value.pci(), legacy))return FALSE; if(!other_value.spare().is_bound()) return FALSE; if(!single_value->field_spare.match(other_value.spare(), 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 @BSSGP_Types.Priority_BSSGP."); } return FALSE; } boolean Priority__BSSGP_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iEI.is_bound() || single_value->field_ext.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_pvi.is_bound() || single_value->field_qa.is_bound() || single_value->field_priority__Level.is_bound() || single_value->field_pci.is_bound() || single_value->field_spare.is_bound(); } boolean Priority__BSSGP_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iEI.is_value() && single_value->field_ext.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_pvi.is_value() && single_value->field_qa.is_value() && single_value->field_priority__Level.is_value() && single_value->field_pci.is_value() && single_value->field_spare.is_value(); } void Priority__BSSGP_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; } Priority__BSSGP Priority__BSSGP_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 @BSSGP_Types.Priority_BSSGP."); Priority__BSSGP ret_val; if (single_value->field_iEI.is_bound()) { ret_val.iEI() = single_value->field_iEI.valueof(); } if (single_value->field_ext.is_bound()) { ret_val.ext() = single_value->field_ext.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_pvi.is_bound()) { ret_val.pvi() = single_value->field_pvi.valueof(); } if (single_value->field_qa.is_bound()) { ret_val.qa() = single_value->field_qa.valueof(); } if (single_value->field_priority__Level.is_bound()) { ret_val.priority__Level() = single_value->field_priority__Level.valueof(); } if (single_value->field_pci.is_bound()) { ret_val.pci() = single_value->field_pci.valueof(); } if (single_value->field_spare.is_bound()) { ret_val.spare() = single_value->field_spare.valueof(); } return ret_val; } void Priority__BSSGP_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 @BSSGP_Types.Priority_BSSGP."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new Priority__BSSGP_template[list_length]; } Priority__BSSGP_template& Priority__BSSGP_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 @BSSGP_Types.Priority_BSSGP."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.Priority_BSSGP."); return value_list.list_value[list_index]; } OCTETSTRING_template& Priority__BSSGP_template::iEI() { set_specific(); return single_value->field_iEI; } const OCTETSTRING_template& Priority__BSSGP_template::iEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.Priority_BSSGP."); return single_value->field_iEI; } BITSTRING_template& Priority__BSSGP_template::ext() { set_specific(); return single_value->field_ext; } const BITSTRING_template& Priority__BSSGP_template::ext() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.Priority_BSSGP."); return single_value->field_ext; } LIN2__2a_template& Priority__BSSGP_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const LIN2__2a_template& Priority__BSSGP_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.Priority_BSSGP."); return single_value->field_lengthIndicator; } BITSTRING_template& Priority__BSSGP_template::pvi() { set_specific(); return single_value->field_pvi; } const BITSTRING_template& Priority__BSSGP_template::pvi() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pvi of a non-specific template of type @BSSGP_Types.Priority_BSSGP."); return single_value->field_pvi; } BITSTRING_template& Priority__BSSGP_template::qa() { set_specific(); return single_value->field_qa; } const BITSTRING_template& Priority__BSSGP_template::qa() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field qa of a non-specific template of type @BSSGP_Types.Priority_BSSGP."); return single_value->field_qa; } BITSTRING_template& Priority__BSSGP_template::priority__Level() { set_specific(); return single_value->field_priority__Level; } const BITSTRING_template& Priority__BSSGP_template::priority__Level() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field priority_Level of a non-specific template of type @BSSGP_Types.Priority_BSSGP."); return single_value->field_priority__Level; } BITSTRING_template& Priority__BSSGP_template::pci() { set_specific(); return single_value->field_pci; } const BITSTRING_template& Priority__BSSGP_template::pci() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field pci of a non-specific template of type @BSSGP_Types.Priority_BSSGP."); return single_value->field_pci; } BITSTRING_template& Priority__BSSGP_template::spare() { set_specific(); return single_value->field_spare; } const BITSTRING_template& Priority__BSSGP_template::spare() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field spare of a non-specific template of type @BSSGP_Types.Priority_BSSGP."); return single_value->field_spare; } int Priority__BSSGP_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Priority_BSSGP which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 8; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.Priority_BSSGP 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 @BSSGP_Types.Priority_BSSGP containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Priority_BSSGP containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Priority_BSSGP containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Priority_BSSGP containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Priority_BSSGP containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Priority_BSSGP containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.Priority_BSSGP containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.Priority_BSSGP."); } return 0; } void Priority__BSSGP_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iEI := "); single_value->field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", pvi := "); single_value->field_pvi.log(); TTCN_Logger::log_event_str(", qa := "); single_value->field_qa.log(); TTCN_Logger::log_event_str(", priority_Level := "); single_value->field_priority__Level.log(); TTCN_Logger::log_event_str(", pci := "); single_value->field_pci.log(); TTCN_Logger::log_event_str(", spare := "); single_value->field_spare.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 Priority__BSSGP_template::log_match(const Priority__BSSGP& 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_iEI.match(match_value.iEI(), legacy)){ TTCN_Logger::log_logmatch_info(".iEI"); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ext.match(match_value.ext(), legacy)){ TTCN_Logger::log_logmatch_info(".ext"); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_pvi.match(match_value.pvi(), legacy)){ TTCN_Logger::log_logmatch_info(".pvi"); single_value->field_pvi.log_match(match_value.pvi(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_qa.match(match_value.qa(), legacy)){ TTCN_Logger::log_logmatch_info(".qa"); single_value->field_qa.log_match(match_value.qa(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_priority__Level.match(match_value.priority__Level(), legacy)){ TTCN_Logger::log_logmatch_info(".priority_Level"); single_value->field_priority__Level.log_match(match_value.priority__Level(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_pci.match(match_value.pci(), legacy)){ TTCN_Logger::log_logmatch_info(".pci"); single_value->field_pci.log_match(match_value.pci(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_spare.match(match_value.spare(), legacy)){ TTCN_Logger::log_logmatch_info(".spare"); single_value->field_spare.log_match(match_value.spare(), 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("{ iEI := "); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", pvi := "); single_value->field_pvi.log_match(match_value.pvi(), legacy); TTCN_Logger::log_event_str(", qa := "); single_value->field_qa.log_match(match_value.qa(), legacy); TTCN_Logger::log_event_str(", priority_Level := "); single_value->field_priority__Level.log_match(match_value.priority__Level(), legacy); TTCN_Logger::log_event_str(", pci := "); single_value->field_pci.log_match(match_value.pci(), legacy); TTCN_Logger::log_event_str(", spare := "); single_value->field_spare.log_match(match_value.spare(), 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 Priority__BSSGP_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iEI.encode_text(text_buf); single_value->field_ext.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_pvi.encode_text(text_buf); single_value->field_qa.encode_text(text_buf); single_value->field_priority__Level.encode_text(text_buf); single_value->field_pci.encode_text(text_buf); single_value->field_spare.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 @BSSGP_Types.Priority_BSSGP."); } } void Priority__BSSGP_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_iEI.decode_text(text_buf); single_value->field_ext.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_pvi.decode_text(text_buf); single_value->field_qa.decode_text(text_buf); single_value->field_priority__Level.decode_text(text_buf); single_value->field_pci.decode_text(text_buf); single_value->field_spare.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 Priority__BSSGP_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 @BSSGP_Types.Priority_BSSGP."); } } void Priority__BSSGP_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: { Priority__BSSGP_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) pvi().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) qa().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) priority__Level().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) pci().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(7)); 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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pvi")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pvi().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "qa")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { qa().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "priority_Level")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { priority__Level().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "pci")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { pci().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "spare")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { spare().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.Priority_BSSGP: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { Priority__BSSGP_template* precondition = new Priority__BSSGP_template; precondition->set_param(*param.get_elem(0)); Priority__BSSGP_template* implied_template = new Priority__BSSGP_template; implied_template->set_param(*param.get_elem(1)); *this = Priority__BSSGP_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.Priority_BSSGP"); } is_ifpresent = param.get_ifpresent(); } void Priority__BSSGP_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_BSSGP"); single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_BSSGP"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_BSSGP"); single_value->field_pvi.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_BSSGP"); single_value->field_qa.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_BSSGP"); single_value->field_priority__Level.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_BSSGP"); single_value->field_pci.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_BSSGP"); single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.Priority_BSSGP"); 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 : "@BSSGP_Types.Priority_BSSGP"); } boolean Priority__BSSGP_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean Priority__BSSGP_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) peak__Bit__Rate().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) precedence().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) a__bit().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) t__bit().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) c__r__bit().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) peakBitRateGranularity().set_param(*param.get_elem(8)); 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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "peak_Bit_Rate")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { peak__Bit__Rate().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "precedence")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { precedence().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a_bit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a__bit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "t_bit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { t__bit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "c_r_bit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { c__r__bit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "peakBitRateGranularity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { peakBitRateGranularity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.QoS_Profile: %s", curr_param->get_id()->get_name()); break; } } break; default: param.type_error("record value", "@BSSGP_Types.QoS_Profile"); } } void QoS__Profile::encode_text(Text_Buf& text_buf) const { field_iEI.encode_text(text_buf); field_ext.encode_text(text_buf); field_lengthIndicator.encode_text(text_buf); field_peak__Bit__Rate.encode_text(text_buf); field_precedence.encode_text(text_buf); field_a__bit.encode_text(text_buf); field_t__bit.encode_text(text_buf); field_c__r__bit.encode_text(text_buf); field_peakBitRateGranularity.encode_text(text_buf); } void QoS__Profile::decode_text(Text_Buf& text_buf) { field_iEI.decode_text(text_buf); field_ext.decode_text(text_buf); field_lengthIndicator.decode_text(text_buf); field_peak__Bit__Rate.decode_text(text_buf); field_precedence.decode_text(text_buf); field_a__bit.decode_text(text_buf); field_t__bit.decode_text(text_buf); field_c__r__bit.decode_text(text_buf); field_peakBitRateGranularity.decode_text(text_buf); } void QoS__Profile::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;} default: TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name); } va_end(pvar); } void QoS__Profile::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;} default: TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name); } va_end(pvar); } int QoS__Profile::RAW_decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int limit, raw_order_t top_bit_ord, boolean no_err, int, boolean, const RAW_Force_Omit* force_omit) { (void)no_err; int prepaddlength=p_buf.increase_pos_padd(p_td.raw->prepadding); limit-=prepaddlength; size_t last_decoded_pos = p_buf.get_pos_bit(); int decoded_length = 0; int decoded_field_length = 0; raw_order_t local_top_order; int selected_field = -1; if(p_td.raw->top_bit_order==TOP_BIT_INHERITED)local_top_order=top_bit_ord; else if(p_td.raw->top_bit_order==TOP_BIT_RIGHT)local_top_order=ORDER_MSB; else local_top_order=ORDER_LSB; int value_of_length_field2 = 0; RAW_Force_Omit field_0_force_omit(0, force_omit, General__Types::OCT1_descr_.raw->forceomit); decoded_field_length = field_iEI.RAW_decode(General__Types::OCT1_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_0_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); RAW_Force_Omit field_1_force_omit(1, force_omit, QoS__Profile_ext_descr_.raw->forceomit); decoded_field_length = field_ext.RAW_decode(QoS__Profile_ext_descr_, p_buf, limit, local_top_order, no_err, -1, TRUE, &field_1_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); if (field_ext == bs_0) selected_field = 0; else if (field_ext == bs_1) selected_field = 1; else selected_field = -1; RAW_Force_Omit field_2_force_omit(2, force_omit, QoS__Profile_lengthIndicator_descr_.raw->forceomit); decoded_field_length = field_lengthIndicator.RAW_decode(QoS__Profile_lengthIndicator_descr_, p_buf, limit, local_top_order, no_err, selected_field, TRUE, &field_2_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: { INTEGER tmp1 = field_lengthIndicator.length1().convert_to_Integer(LIN2__2a_length1_descr_); field_lengthIndicator.length1() = tmp1; value_of_length_field2 += tmp1.get_long_long_val() * 8; break; } case LIN2__2a::ALT_length2: { INTEGER tmp2 = field_lengthIndicator.length2().convert_to_Integer(LIN2__2a_length2_descr_); field_lengthIndicator.length2() = tmp2; value_of_length_field2 += tmp2.get_long_long_val() * 8; break; } default: value_of_length_field2 = 0; } RAW_Force_Omit field_3_force_omit(3, force_omit, General__Types::OCT2_descr_.raw->forceomit); decoded_field_length = field_peak__Bit__Rate.RAW_decode(General__Types::OCT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_3_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_4_force_omit(4, force_omit, General__Types::BIT3_descr_.raw->forceomit); decoded_field_length = field_precedence.RAW_decode(General__Types::BIT3_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_4_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_5_force_omit(5, force_omit, General__Types::BIT1_descr_.raw->forceomit); decoded_field_length = field_a__bit.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_5_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_6_force_omit(6, force_omit, General__Types::BIT1_descr_.raw->forceomit); decoded_field_length = field_t__bit.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_6_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_7_force_omit(7, force_omit, General__Types::BIT1_descr_.raw->forceomit); decoded_field_length = field_c__r__bit.RAW_decode(General__Types::BIT1_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_7_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; RAW_Force_Omit field_8_force_omit(8, force_omit, General__Types::BIT2_descr_.raw->forceomit); decoded_field_length = field_peakBitRateGranularity.RAW_decode(General__Types::BIT2_descr_, p_buf, min_of_ints(2, limit, value_of_length_field2), local_top_order, no_err, -1, TRUE, &field_8_force_omit); if (decoded_field_length < 0) return decoded_field_length; decoded_length+=decoded_field_length; limit-=decoded_field_length; last_decoded_pos=bigger(last_decoded_pos, p_buf.get_pos_bit()); value_of_length_field2 -= decoded_field_length; if (field_iEI != os_35) return -1; p_buf.set_pos_bit(last_decoded_pos); return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding); } int QoS__Profile::RAW_encode(const TTCN_Typedescriptor_t&, RAW_enc_tree& myleaf) const { if (!is_bound()) TTCN_EncDec_ErrorContext::error(TTCN_EncDec::ET_UNBOUND, "Encoding an unbound value."); int encoded_length = 0; myleaf.isleaf = FALSE; myleaf.body.node.num_of_nodes = 9; myleaf.body.node.nodes = init_nodes_of_enc_tree(9); myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::OCT1_descr_.raw); myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, QoS__Profile_ext_descr_.raw); myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, QoS__Profile_lengthIndicator_descr_.raw); myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, General__Types::OCT2_descr_.raw); myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT3_descr_.raw); myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, General__Types::BIT1_descr_.raw); myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, General__Types::BIT1_descr_.raw); myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, General__Types::BIT1_descr_.raw); myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, General__Types::BIT2_descr_.raw); encoded_length += field_iEI.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]); encoded_length += field_ext.RAW_encode(QoS__Profile_ext_descr_, *myleaf.body.node.nodes[1]); encoded_length += field_lengthIndicator.RAW_encode(QoS__Profile_lengthIndicator_descr_, *myleaf.body.node.nodes[2]); encoded_length += field_peak__Bit__Rate.RAW_encode(General__Types::OCT2_descr_, *myleaf.body.node.nodes[3]); encoded_length += field_precedence.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[4]); encoded_length += field_a__bit.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[5]); encoded_length += field_t__bit.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[6]); encoded_length += field_c__r__bit.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[7]); encoded_length += field_peakBitRateGranularity.RAW_encode(General__Types::BIT2_descr_, *myleaf.body.node.nodes[8]); { int sel_field = 0; while (myleaf.body.node.nodes[2]->body.node.nodes[sel_field] == NULL) { sel_field++; } const TTCN_Typedescriptor_t* tmpTypeDesc = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr; int tmp_length = myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length; delete myleaf.body.node.nodes[2]->body.node.nodes[sel_field]; myleaf.body.node.nodes[2]->body.node.nodes[sel_field] = new RAW_enc_tree(TRUE, myleaf.body.node.nodes[2], &(myleaf.body.node.nodes[2]->curr_pos), sel_field, tmpTypeDesc->raw); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->length = tmp_length; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calc = CALC_LENGTH; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->coding_descr = tmpTypeDesc; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.num_of_fields = 6; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.unit = 8; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.offset = 0; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields = init_lengthto_fields_list(6); myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].level = myleaf.body.node.nodes[3]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[0].pos = myleaf.body.node.nodes[3]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].level = myleaf.body.node.nodes[4]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[1].pos = myleaf.body.node.nodes[4]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].level = myleaf.body.node.nodes[5]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[2].pos = myleaf.body.node.nodes[5]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].level = myleaf.body.node.nodes[6]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[3].pos = myleaf.body.node.nodes[6]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].level = myleaf.body.node.nodes[7]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[4].pos = myleaf.body.node.nodes[7]->curr_pos.pos; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].level = myleaf.body.node.nodes[8]->curr_pos.level; myleaf.body.node.nodes[2]->body.node.nodes[sel_field]->calcof.lengthto.fields[5].pos = myleaf.body.node.nodes[8]->curr_pos.pos; } switch (field_lengthIndicator.get_selection()) { case LIN2__2a::ALT_length1: if (field_ext != bs_0) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_0.RAW_encode(QoS__Profile_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; case LIN2__2a::ALT_length2: if (field_ext != bs_1) { RAW_enc_tr_pos pr_pos; pr_pos.level = myleaf.curr_pos.level + 1; int new_pos[] = { 1 }; pr_pos.pos = init_new_tree_pos(myleaf.curr_pos, 1, new_pos); RAW_enc_tree* temp_leaf = myleaf.get_node(pr_pos); if (temp_leaf != NULL) bs_1.RAW_encode(QoS__Profile_ext_descr_,*temp_leaf); else TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); free_tree_pos(pr_pos.pos); } break; default:; } if (field_iEI != os_35) { RAW_enc_tree* temp_leaf; { RAW_enc_tr_pos pr_pos0; pr_pos0.level=myleaf.curr_pos.level+1; int new_pos0[]={0}; pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,1,new_pos0); temp_leaf = myleaf.get_node(pr_pos0); if(temp_leaf != NULL){ os_35.RAW_encode(General__Types::OCT1_descr_,*temp_leaf); } else { TTCN_EncDec_ErrorContext::error (TTCN_EncDec::ET_OMITTED_TAG, "Encoding a tagged, but omitted value."); } free_tree_pos(pr_pos0.pos); } } return myleaf.length = encoded_length; } struct QoS__Profile_template::single_value_struct { OCTETSTRING_template field_iEI; BITSTRING_template field_ext; LIN2__2a_template field_lengthIndicator; OCTETSTRING_template field_peak__Bit__Rate; BITSTRING_template field_precedence; BITSTRING_template field_a__bit; BITSTRING_template field_t__bit; BITSTRING_template field_c__r__bit; BITSTRING_template field_peakBitRateGranularity; }; void QoS__Profile_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_iEI = ANY_VALUE; single_value->field_ext = ANY_VALUE; single_value->field_lengthIndicator = ANY_VALUE; single_value->field_peak__Bit__Rate = ANY_VALUE; single_value->field_precedence = ANY_VALUE; single_value->field_a__bit = ANY_VALUE; single_value->field_t__bit = ANY_VALUE; single_value->field_c__r__bit = ANY_VALUE; single_value->field_peakBitRateGranularity = ANY_VALUE; } } } void QoS__Profile_template::copy_value(const QoS__Profile& other_value) { single_value = new single_value_struct; if (other_value.iEI().is_bound()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (other_value.ext().is_bound()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (other_value.lengthIndicator().is_bound()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (other_value.peak__Bit__Rate().is_bound()) { single_value->field_peak__Bit__Rate = other_value.peak__Bit__Rate(); } else { single_value->field_peak__Bit__Rate.clean_up(); } if (other_value.precedence().is_bound()) { single_value->field_precedence = other_value.precedence(); } else { single_value->field_precedence.clean_up(); } if (other_value.a__bit().is_bound()) { single_value->field_a__bit = other_value.a__bit(); } else { single_value->field_a__bit.clean_up(); } if (other_value.t__bit().is_bound()) { single_value->field_t__bit = other_value.t__bit(); } else { single_value->field_t__bit.clean_up(); } if (other_value.c__r__bit().is_bound()) { single_value->field_c__r__bit = other_value.c__r__bit(); } else { single_value->field_c__r__bit.clean_up(); } if (other_value.peakBitRateGranularity().is_bound()) { single_value->field_peakBitRateGranularity = other_value.peakBitRateGranularity(); } else { single_value->field_peakBitRateGranularity.clean_up(); } set_selection(SPECIFIC_VALUE); } void QoS__Profile_template::copy_template(const QoS__Profile_template& other_value) { switch (other_value.template_selection) { case SPECIFIC_VALUE: single_value = new single_value_struct; if (UNINITIALIZED_TEMPLATE != other_value.iEI().get_selection()) { single_value->field_iEI = other_value.iEI(); } else { single_value->field_iEI.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.ext().get_selection()) { single_value->field_ext = other_value.ext(); } else { single_value->field_ext.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.lengthIndicator().get_selection()) { single_value->field_lengthIndicator = other_value.lengthIndicator(); } else { single_value->field_lengthIndicator.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.peak__Bit__Rate().get_selection()) { single_value->field_peak__Bit__Rate = other_value.peak__Bit__Rate(); } else { single_value->field_peak__Bit__Rate.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.precedence().get_selection()) { single_value->field_precedence = other_value.precedence(); } else { single_value->field_precedence.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.a__bit().get_selection()) { single_value->field_a__bit = other_value.a__bit(); } else { single_value->field_a__bit.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.t__bit().get_selection()) { single_value->field_t__bit = other_value.t__bit(); } else { single_value->field_t__bit.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.c__r__bit().get_selection()) { single_value->field_c__r__bit = other_value.c__r__bit(); } else { single_value->field_c__r__bit.clean_up(); } if (UNINITIALIZED_TEMPLATE != other_value.peakBitRateGranularity().get_selection()) { single_value->field_peakBitRateGranularity = other_value.peakBitRateGranularity(); } else { single_value->field_peakBitRateGranularity.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 QoS__Profile_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 QoS__Profile_template(*other_value.implication_.precondition); implication_.implied_template = new QoS__Profile_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 @BSSGP_Types.QoS_Profile."); break; } set_selection(other_value); } QoS__Profile_template::QoS__Profile_template() { } QoS__Profile_template::QoS__Profile_template(template_sel other_value) : Base_Template(other_value) { check_single_selection(other_value); } QoS__Profile_template::QoS__Profile_template(const QoS__Profile& other_value) { copy_value(other_value); } QoS__Profile_template::QoS__Profile_template(const OPTIONAL& other_value) { switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const QoS__Profile&)other_value); break; case OPTIONAL_OMIT: set_selection(OMIT_VALUE); break; default: TTCN_error("Creating a template of type @BSSGP_Types.QoS_Profile from an unbound optional field."); } } QoS__Profile_template::QoS__Profile_template(QoS__Profile_template* p_precondition, QoS__Profile_template* p_implied_template) : Base_Template(IMPLICATION_MATCH) { implication_.precondition = p_precondition; implication_.implied_template = p_implied_template; } QoS__Profile_template::QoS__Profile_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; } QoS__Profile_template::QoS__Profile_template(const QoS__Profile_template& other_value) : Base_Template() { copy_template(other_value); } QoS__Profile_template::~QoS__Profile_template() { clean_up(); } QoS__Profile_template& QoS__Profile_template::operator=(template_sel other_value) { check_single_selection(other_value); clean_up(); set_selection(other_value); return *this; } QoS__Profile_template& QoS__Profile_template::operator=(const QoS__Profile& other_value) { clean_up(); copy_value(other_value); return *this; } QoS__Profile_template& QoS__Profile_template::operator=(const OPTIONAL& other_value) { clean_up(); switch (other_value.get_selection()) { case OPTIONAL_PRESENT: copy_value((const QoS__Profile&)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 @BSSGP_Types.QoS_Profile."); } return *this; } QoS__Profile_template& QoS__Profile_template::operator=(const QoS__Profile_template& other_value) { if (&other_value != this) { clean_up(); copy_template(other_value); } return *this; } boolean QoS__Profile_template::match(const QoS__Profile& 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.iEI().is_bound()) return FALSE; if(!single_value->field_iEI.match(other_value.iEI(), legacy))return FALSE; if(!other_value.ext().is_bound()) return FALSE; if(!single_value->field_ext.match(other_value.ext(), legacy))return FALSE; if(!other_value.lengthIndicator().is_bound()) return FALSE; if(!single_value->field_lengthIndicator.match(other_value.lengthIndicator(), legacy))return FALSE; if(!other_value.peak__Bit__Rate().is_bound()) return FALSE; if(!single_value->field_peak__Bit__Rate.match(other_value.peak__Bit__Rate(), legacy))return FALSE; if(!other_value.precedence().is_bound()) return FALSE; if(!single_value->field_precedence.match(other_value.precedence(), legacy))return FALSE; if(!other_value.a__bit().is_bound()) return FALSE; if(!single_value->field_a__bit.match(other_value.a__bit(), legacy))return FALSE; if(!other_value.t__bit().is_bound()) return FALSE; if(!single_value->field_t__bit.match(other_value.t__bit(), legacy))return FALSE; if(!other_value.c__r__bit().is_bound()) return FALSE; if(!single_value->field_c__r__bit.match(other_value.c__r__bit(), legacy))return FALSE; if(!other_value.peakBitRateGranularity().is_bound()) return FALSE; if(!single_value->field_peakBitRateGranularity.match(other_value.peakBitRateGranularity(), 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 @BSSGP_Types.QoS_Profile."); } return FALSE; } boolean QoS__Profile_template::is_bound() const { if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE; if (template_selection != SPECIFIC_VALUE) return TRUE; return single_value->field_iEI.is_bound() || single_value->field_ext.is_bound() || single_value->field_lengthIndicator.is_bound() || single_value->field_peak__Bit__Rate.is_bound() || single_value->field_precedence.is_bound() || single_value->field_a__bit.is_bound() || single_value->field_t__bit.is_bound() || single_value->field_c__r__bit.is_bound() || single_value->field_peakBitRateGranularity.is_bound(); } boolean QoS__Profile_template::is_value() const { if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE; return single_value->field_iEI.is_value() && single_value->field_ext.is_value() && single_value->field_lengthIndicator.is_value() && single_value->field_peak__Bit__Rate.is_value() && single_value->field_precedence.is_value() && single_value->field_a__bit.is_value() && single_value->field_t__bit.is_value() && single_value->field_c__r__bit.is_value() && single_value->field_peakBitRateGranularity.is_value(); } void QoS__Profile_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; } QoS__Profile QoS__Profile_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 @BSSGP_Types.QoS_Profile."); QoS__Profile ret_val; if (single_value->field_iEI.is_bound()) { ret_val.iEI() = single_value->field_iEI.valueof(); } if (single_value->field_ext.is_bound()) { ret_val.ext() = single_value->field_ext.valueof(); } if (single_value->field_lengthIndicator.is_bound()) { ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof(); } if (single_value->field_peak__Bit__Rate.is_bound()) { ret_val.peak__Bit__Rate() = single_value->field_peak__Bit__Rate.valueof(); } if (single_value->field_precedence.is_bound()) { ret_val.precedence() = single_value->field_precedence.valueof(); } if (single_value->field_a__bit.is_bound()) { ret_val.a__bit() = single_value->field_a__bit.valueof(); } if (single_value->field_t__bit.is_bound()) { ret_val.t__bit() = single_value->field_t__bit.valueof(); } if (single_value->field_c__r__bit.is_bound()) { ret_val.c__r__bit() = single_value->field_c__r__bit.valueof(); } if (single_value->field_peakBitRateGranularity.is_bound()) { ret_val.peakBitRateGranularity() = single_value->field_peakBitRateGranularity.valueof(); } return ret_val; } void QoS__Profile_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 @BSSGP_Types.QoS_Profile."); clean_up(); set_selection(template_type); value_list.n_values = list_length; value_list.list_value = new QoS__Profile_template[list_length]; } QoS__Profile_template& QoS__Profile_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 @BSSGP_Types.QoS_Profile."); if (list_index >= value_list.n_values) TTCN_error("Index overflow in a value list template of type @BSSGP_Types.QoS_Profile."); return value_list.list_value[list_index]; } OCTETSTRING_template& QoS__Profile_template::iEI() { set_specific(); return single_value->field_iEI; } const OCTETSTRING_template& QoS__Profile_template::iEI() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field iEI of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_iEI; } BITSTRING_template& QoS__Profile_template::ext() { set_specific(); return single_value->field_ext; } const BITSTRING_template& QoS__Profile_template::ext() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field ext of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_ext; } LIN2__2a_template& QoS__Profile_template::lengthIndicator() { set_specific(); return single_value->field_lengthIndicator; } const LIN2__2a_template& QoS__Profile_template::lengthIndicator() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field lengthIndicator of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_lengthIndicator; } OCTETSTRING_template& QoS__Profile_template::peak__Bit__Rate() { set_specific(); return single_value->field_peak__Bit__Rate; } const OCTETSTRING_template& QoS__Profile_template::peak__Bit__Rate() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field peak_Bit_Rate of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_peak__Bit__Rate; } BITSTRING_template& QoS__Profile_template::precedence() { set_specific(); return single_value->field_precedence; } const BITSTRING_template& QoS__Profile_template::precedence() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field precedence of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_precedence; } BITSTRING_template& QoS__Profile_template::a__bit() { set_specific(); return single_value->field_a__bit; } const BITSTRING_template& QoS__Profile_template::a__bit() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field a_bit of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_a__bit; } BITSTRING_template& QoS__Profile_template::t__bit() { set_specific(); return single_value->field_t__bit; } const BITSTRING_template& QoS__Profile_template::t__bit() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field t_bit of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_t__bit; } BITSTRING_template& QoS__Profile_template::c__r__bit() { set_specific(); return single_value->field_c__r__bit; } const BITSTRING_template& QoS__Profile_template::c__r__bit() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field c_r_bit of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_c__r__bit; } BITSTRING_template& QoS__Profile_template::peakBitRateGranularity() { set_specific(); return single_value->field_peakBitRateGranularity; } const BITSTRING_template& QoS__Profile_template::peakBitRateGranularity() const { if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field peakBitRateGranularity of a non-specific template of type @BSSGP_Types.QoS_Profile."); return single_value->field_peakBitRateGranularity; } int QoS__Profile_template::size_of() const { if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.QoS_Profile which has an ifpresent attribute."); switch (template_selection) { case SPECIFIC_VALUE: return 9; case VALUE_LIST: { if (value_list.n_values<1) TTCN_error("Internal error: Performing sizeof() operation on a template of type @BSSGP_Types.QoS_Profile 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 @BSSGP_Types.QoS_Profile containing a value list with different sizes."); } return item_size; } case OMIT_VALUE: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.QoS_Profile containing omit value."); case ANY_VALUE: case ANY_OR_OMIT: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.QoS_Profile containing */? value."); case COMPLEMENTED_LIST: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.QoS_Profile containing complemented list."); case CONJUNCTION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.QoS_Profile containing a conjunction list match."); case IMPLICATION_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.QoS_Profile containing an implication match."); case DYNAMIC_MATCH: TTCN_error("Performing sizeof() operation on a template of type @BSSGP_Types.QoS_Profile containing a dynamic match."); default: TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BSSGP_Types.QoS_Profile."); } return 0; } void QoS__Profile_template::log() const { switch (template_selection) { case SPECIFIC_VALUE: TTCN_Logger::log_event_str("{ iEI := "); single_value->field_iEI.log(); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log(); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log(); TTCN_Logger::log_event_str(", peak_Bit_Rate := "); single_value->field_peak__Bit__Rate.log(); TTCN_Logger::log_event_str(", precedence := "); single_value->field_precedence.log(); TTCN_Logger::log_event_str(", a_bit := "); single_value->field_a__bit.log(); TTCN_Logger::log_event_str(", t_bit := "); single_value->field_t__bit.log(); TTCN_Logger::log_event_str(", c_r_bit := "); single_value->field_c__r__bit.log(); TTCN_Logger::log_event_str(", peakBitRateGranularity := "); single_value->field_peakBitRateGranularity.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 QoS__Profile_template::log_match(const QoS__Profile& 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_iEI.match(match_value.iEI(), legacy)){ TTCN_Logger::log_logmatch_info(".iEI"); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_ext.match(match_value.ext(), legacy)){ TTCN_Logger::log_logmatch_info(".ext"); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_lengthIndicator.match(match_value.lengthIndicator(), legacy)){ TTCN_Logger::log_logmatch_info(".lengthIndicator"); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_peak__Bit__Rate.match(match_value.peak__Bit__Rate(), legacy)){ TTCN_Logger::log_logmatch_info(".peak_Bit_Rate"); single_value->field_peak__Bit__Rate.log_match(match_value.peak__Bit__Rate(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_precedence.match(match_value.precedence(), legacy)){ TTCN_Logger::log_logmatch_info(".precedence"); single_value->field_precedence.log_match(match_value.precedence(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_a__bit.match(match_value.a__bit(), legacy)){ TTCN_Logger::log_logmatch_info(".a_bit"); single_value->field_a__bit.log_match(match_value.a__bit(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_t__bit.match(match_value.t__bit(), legacy)){ TTCN_Logger::log_logmatch_info(".t_bit"); single_value->field_t__bit.log_match(match_value.t__bit(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_c__r__bit.match(match_value.c__r__bit(), legacy)){ TTCN_Logger::log_logmatch_info(".c_r_bit"); single_value->field_c__r__bit.log_match(match_value.c__r__bit(), legacy); TTCN_Logger::set_logmatch_buffer_len(previous_size); } if(!single_value->field_peakBitRateGranularity.match(match_value.peakBitRateGranularity(), legacy)){ TTCN_Logger::log_logmatch_info(".peakBitRateGranularity"); single_value->field_peakBitRateGranularity.log_match(match_value.peakBitRateGranularity(), 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("{ iEI := "); single_value->field_iEI.log_match(match_value.iEI(), legacy); TTCN_Logger::log_event_str(", ext := "); single_value->field_ext.log_match(match_value.ext(), legacy); TTCN_Logger::log_event_str(", lengthIndicator := "); single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy); TTCN_Logger::log_event_str(", peak_Bit_Rate := "); single_value->field_peak__Bit__Rate.log_match(match_value.peak__Bit__Rate(), legacy); TTCN_Logger::log_event_str(", precedence := "); single_value->field_precedence.log_match(match_value.precedence(), legacy); TTCN_Logger::log_event_str(", a_bit := "); single_value->field_a__bit.log_match(match_value.a__bit(), legacy); TTCN_Logger::log_event_str(", t_bit := "); single_value->field_t__bit.log_match(match_value.t__bit(), legacy); TTCN_Logger::log_event_str(", c_r_bit := "); single_value->field_c__r__bit.log_match(match_value.c__r__bit(), legacy); TTCN_Logger::log_event_str(", peakBitRateGranularity := "); single_value->field_peakBitRateGranularity.log_match(match_value.peakBitRateGranularity(), 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 QoS__Profile_template::encode_text(Text_Buf& text_buf) const { encode_text_base(text_buf); switch (template_selection) { case SPECIFIC_VALUE: single_value->field_iEI.encode_text(text_buf); single_value->field_ext.encode_text(text_buf); single_value->field_lengthIndicator.encode_text(text_buf); single_value->field_peak__Bit__Rate.encode_text(text_buf); single_value->field_precedence.encode_text(text_buf); single_value->field_a__bit.encode_text(text_buf); single_value->field_t__bit.encode_text(text_buf); single_value->field_c__r__bit.encode_text(text_buf); single_value->field_peakBitRateGranularity.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 @BSSGP_Types.QoS_Profile."); } } void QoS__Profile_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_iEI.decode_text(text_buf); single_value->field_ext.decode_text(text_buf); single_value->field_lengthIndicator.decode_text(text_buf); single_value->field_peak__Bit__Rate.decode_text(text_buf); single_value->field_precedence.decode_text(text_buf); single_value->field_a__bit.decode_text(text_buf); single_value->field_t__bit.decode_text(text_buf); single_value->field_c__r__bit.decode_text(text_buf); single_value->field_peakBitRateGranularity.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 QoS__Profile_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 @BSSGP_Types.QoS_Profile."); } } void QoS__Profile_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: { QoS__Profile_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) iEI().set_param(*param.get_elem(0)); if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ext().set_param(*param.get_elem(1)); if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) lengthIndicator().set_param(*param.get_elem(2)); if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) peak__Bit__Rate().set_param(*param.get_elem(3)); if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) precedence().set_param(*param.get_elem(4)); if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) a__bit().set_param(*param.get_elem(5)); if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) t__bit().set_param(*param.get_elem(6)); if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) c__r__bit().set_param(*param.get_elem(7)); if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) peakBitRateGranularity().set_param(*param.get_elem(8)); 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(), "iEI")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { iEI().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "ext")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { ext().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "lengthIndicator")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { lengthIndicator().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "peak_Bit_Rate")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { peak__Bit__Rate().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "precedence")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { precedence().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "a_bit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { a__bit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "t_bit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { t__bit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "c_r_bit")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { c__r__bit().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxget_id()->get_name(), "peakBitRateGranularity")) { if (curr_param->get_type()!=Module_Param::MP_NotUsed) { peakBitRateGranularity().set_param(*curr_param); } value_used[val_idx]=TRUE; } } for (size_t val_idx=0; val_idxerror("Non existent field name in type @BSSGP_Types.QoS_Profile: %s", curr_param->get_id()->get_name()); break; } } break; case Module_Param::MP_Implication_Template: { QoS__Profile_template* precondition = new QoS__Profile_template; precondition->set_param(*param.get_elem(0)); QoS__Profile_template* implied_template = new QoS__Profile_template; implied_template->set_param(*param.get_elem(1)); *this = QoS__Profile_template(precondition, implied_template); } break; default: param.type_error("record template", "@BSSGP_Types.QoS_Profile"); } is_ifpresent = param.get_ifpresent(); } void QoS__Profile_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_iEI.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); single_value->field_ext.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); single_value->field_peak__Bit__Rate.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); single_value->field_precedence.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); single_value->field_a__bit.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); single_value->field_t__bit.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); single_value->field_c__r__bit.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); single_value->field_peakBitRateGranularity.check_restriction(t_res, t_name ? t_name : "@BSSGP_Types.QoS_Profile"); 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 : "@BSSGP_Types.QoS_Profile"); } boolean QoS__Profile_template::is_present(boolean legacy) const { if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE; return !match_omit(legacy); } boolean QoS__Profile_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