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

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

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

/* Including header files */

#include "MobileL3_GMM_SM_Types.hh"

namespace MobileL3__GMM__SM__Types {

/* Member functions of C++ classes */

RadioPriority2V::RadioPriority2V()
{
}

RadioPriority2V::RadioPriority2V(const BITSTRING& par_priorityLevelValue,
    const BITSTRING& par_spare)
  :   field_priorityLevelValue(par_priorityLevelValue),
  field_spare(par_spare)
{
}

RadioPriority2V::RadioPriority2V(const RadioPriority2V& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
if (other_value.priorityLevelValue().is_bound()) field_priorityLevelValue = other_value.priorityLevelValue();
else field_priorityLevelValue.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void RadioPriority2V::clean_up()
{
field_priorityLevelValue.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* RadioPriority2V::get_descriptor() const { return &RadioPriority2V_descr_; }
RadioPriority2V& RadioPriority2V::operator=(const RadioPriority2V& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
  if (other_value.priorityLevelValue().is_bound()) field_priorityLevelValue = other_value.priorityLevelValue();
  else field_priorityLevelValue.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean RadioPriority2V::operator==(const RadioPriority2V& other_value) const
{
return field_priorityLevelValue==other_value.field_priorityLevelValue
  && field_spare==other_value.field_spare;
}

boolean RadioPriority2V::is_bound() const
{
return (field_priorityLevelValue.is_bound())
  || (field_spare.is_bound());
}
boolean RadioPriority2V::is_value() const
{
return field_priorityLevelValue.is_value()
  && field_spare.is_value();
}
void RadioPriority2V::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
field_priorityLevelValue.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void RadioPriority2V::set_implicit_omit()
{
if (priorityLevelValue().is_bound()) priorityLevelValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void RadioPriority2V::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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.RadioPriority2V has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) priorityLevelValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priorityLevelValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevelValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RadioPriority2V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RadioPriority2V");
  }
}

void RadioPriority2V::encode_text(Text_Buf& text_buf) const
{
field_priorityLevelValue.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void RadioPriority2V::decode_text(Text_Buf& text_buf)
{
field_priorityLevelValue.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void RadioPriority2V::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RadioPriority2V::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RadioPriority2V::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::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_priorityLevelValue.RAW_decode(General__Types::BIT3_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, General__Types::BIT1_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT1_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 RadioPriority2V::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, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT1_descr_.raw);
  encoded_length += field_priorityLevelValue.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT1_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RadioPriority2V_template::single_value_struct {
BITSTRING_template field_priorityLevelValue;
BITSTRING_template field_spare;
};

void RadioPriority2V_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_priorityLevelValue = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void RadioPriority2V_template::copy_value(const RadioPriority2V& other_value)
{
single_value = new single_value_struct;
if (other_value.priorityLevelValue().is_bound()) {
  single_value->field_priorityLevelValue = other_value.priorityLevelValue();
} else {
  single_value->field_priorityLevelValue.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 RadioPriority2V_template::copy_template(const RadioPriority2V_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.priorityLevelValue().get_selection()) {
single_value->field_priorityLevelValue = other_value.priorityLevelValue();
} else {
single_value->field_priorityLevelValue.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 RadioPriority2V_template[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 RadioPriority2V_template(*other_value.implication_.precondition);
implication_.implied_template = new RadioPriority2V_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 @MobileL3_GMM_SM_Types.RadioPriority2V.");
break;
}
set_selection(other_value);
}

RadioPriority2V_template::RadioPriority2V_template()
{
}

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

RadioPriority2V_template::RadioPriority2V_template(const RadioPriority2V& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

RadioPriority2V_template& RadioPriority2V_template::operator=(const OPTIONAL<RadioPriority2V>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RadioPriority2V&)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 @MobileL3_GMM_SM_Types.RadioPriority2V.");
}
return *this;
}

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

boolean RadioPriority2V_template::match(const RadioPriority2V& 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.priorityLevelValue().is_bound()) return FALSE;
if(!single_value->field_priorityLevelValue.match(other_value.priorityLevelValue(), 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 @MobileL3_GMM_SM_Types.RadioPriority2V.");
}
return FALSE;
}

boolean RadioPriority2V_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_priorityLevelValue.is_bound()
 || single_value->field_spare.is_bound();
}

boolean RadioPriority2V_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_priorityLevelValue.is_value()
 && single_value->field_spare.is_value();
}

void RadioPriority2V_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;
}

RadioPriority2V RadioPriority2V_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 @MobileL3_GMM_SM_Types.RadioPriority2V.");
RadioPriority2V ret_val;
if (single_value->field_priorityLevelValue.is_bound()) {
ret_val.priorityLevelValue() = single_value->field_priorityLevelValue.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void RadioPriority2V_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 @MobileL3_GMM_SM_Types.RadioPriority2V.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RadioPriority2V_template[list_length];
}

RadioPriority2V_template& RadioPriority2V_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 @MobileL3_GMM_SM_Types.RadioPriority2V.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
return value_list.list_value[list_index];
}

BITSTRING_template& RadioPriority2V_template::priorityLevelValue()
{
set_specific();
return single_value->field_priorityLevelValue;
}

const BITSTRING_template& RadioPriority2V_template::priorityLevelValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field priorityLevelValue of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
return single_value->field_priorityLevelValue;
}

BITSTRING_template& RadioPriority2V_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& RadioPriority2V_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
return single_value->field_spare;
}

int RadioPriority2V_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2V 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 @MobileL3_GMM_SM_Types.RadioPriority2V 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 @MobileL3_GMM_SM_Types.RadioPriority2V containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2V containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2V containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2V containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2V containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2V containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2V containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriority2V.");
  }
  return 0;
}

void RadioPriority2V_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ priorityLevelValue := ");
single_value->field_priorityLevelValue.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 RadioPriority2V_template::log_match(const RadioPriority2V& 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_priorityLevelValue.match(match_value.priorityLevelValue(), legacy)){
TTCN_Logger::log_logmatch_info(".priorityLevelValue");
single_value->field_priorityLevelValue.log_match(match_value.priorityLevelValue(), 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("{ priorityLevelValue := ");
single_value->field_priorityLevelValue.log_match(match_value.priorityLevelValue(), 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 RadioPriority2V_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (priorityLevelValue().is_bound()) priorityLevelValue().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void RadioPriority2V_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_priorityLevelValue.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 @MobileL3_GMM_SM_Types.RadioPriority2V.");
}
}

void RadioPriority2V_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_priorityLevelValue.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 RadioPriority2V_template[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 @MobileL3_GMM_SM_Types.RadioPriority2V.");
}
}

void RadioPriority2V_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: {
    RadioPriority2V_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.RadioPriority2V has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) priorityLevelValue().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "priorityLevelValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          priorityLevelValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RadioPriority2V: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RadioPriority2V_template* precondition = new RadioPriority2V_template;
    precondition->set_param(*param.get_elem(0));
    RadioPriority2V_template* implied_template = new RadioPriority2V_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RadioPriority2V_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RadioPriority2V");
  }
  is_ifpresent = param.get_ifpresent();
}

void RadioPriority2V_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_priorityLevelValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriority2V");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriority2V");
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 : "@MobileL3_GMM_SM_Types.RadioPriority2V");
}

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

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

RadioPriority2TV::RadioPriority2TV()
{
}

RadioPriority2TV::RadioPriority2TV(const RadioPriority2V& par_valueField,
    const BITSTRING& par_elementIdentifier)
  :   field_valueField(par_valueField),
  field_elementIdentifier(par_elementIdentifier)
{
}

RadioPriority2TV::RadioPriority2TV(const RadioPriority2TV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
}

void RadioPriority2TV::clean_up()
{
field_valueField.clean_up();
field_elementIdentifier.clean_up();
}

const TTCN_Typedescriptor_t* RadioPriority2TV::get_descriptor() const { return &RadioPriority2TV_descr_; }
RadioPriority2TV& RadioPriority2TV::operator=(const RadioPriority2TV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
}
return *this;
}

boolean RadioPriority2TV::operator==(const RadioPriority2TV& other_value) const
{
return field_valueField==other_value.field_valueField
  && field_elementIdentifier==other_value.field_elementIdentifier;
}

boolean RadioPriority2TV::is_bound() const
{
return (field_valueField.is_bound())
  || (field_elementIdentifier.is_bound());
}
boolean RadioPriority2TV::is_value() const
{
return field_valueField.is_value()
  && field_elementIdentifier.is_value();
}
void RadioPriority2TV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(" }");
}

void RadioPriority2TV::set_implicit_omit()
{
if (valueField().is_bound()) valueField().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void RadioPriority2TV::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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.RadioPriority2TV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RadioPriority2TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.RadioPriority2TV");
  }
}

void RadioPriority2TV::encode_text(Text_Buf& text_buf) const
{
field_valueField.encode_text(text_buf);
field_elementIdentifier.encode_text(text_buf);
}

void RadioPriority2TV::decode_text(Text_Buf& text_buf)
{
field_valueField.decode_text(text_buf);
field_elementIdentifier.decode_text(text_buf);
}

void RadioPriority2TV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void RadioPriority2TV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int RadioPriority2TV::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, RadioPriority2V_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(RadioPriority2V_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, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.RAW_decode(General__Types::BIT4_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 RadioPriority2TV::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, RadioPriority2V_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT4_descr_.raw);
  encoded_length += field_valueField.RAW_encode(RadioPriority2V_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct RadioPriority2TV_template::single_value_struct {
RadioPriority2V_template field_valueField;
BITSTRING_template field_elementIdentifier;
};

void RadioPriority2TV_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_valueField = ANY_VALUE;
single_value->field_elementIdentifier = ANY_VALUE;
}
}
}

void RadioPriority2TV_template::copy_value(const RadioPriority2TV& other_value)
{
single_value = new single_value_struct;
if (other_value.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RadioPriority2TV_template::copy_template(const RadioPriority2TV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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 RadioPriority2TV_template[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 RadioPriority2TV_template(*other_value.implication_.precondition);
implication_.implied_template = new RadioPriority2TV_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 @MobileL3_GMM_SM_Types.RadioPriority2TV.");
break;
}
set_selection(other_value);
}

RadioPriority2TV_template::RadioPriority2TV_template()
{
}

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

RadioPriority2TV_template::RadioPriority2TV_template(const RadioPriority2TV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

RadioPriority2TV_template& RadioPriority2TV_template::operator=(const OPTIONAL<RadioPriority2TV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RadioPriority2TV&)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 @MobileL3_GMM_SM_Types.RadioPriority2TV.");
}
return *this;
}

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

boolean RadioPriority2TV_template::match(const RadioPriority2TV& 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.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), legacy))return FALSE;
if(!other_value.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), 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 @MobileL3_GMM_SM_Types.RadioPriority2TV.");
}
return FALSE;
}

boolean RadioPriority2TV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_valueField.is_bound()
 || single_value->field_elementIdentifier.is_bound();
}

boolean RadioPriority2TV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_valueField.is_value()
 && single_value->field_elementIdentifier.is_value();
}

void RadioPriority2TV_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;
}

RadioPriority2TV RadioPriority2TV_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 @MobileL3_GMM_SM_Types.RadioPriority2TV.");
RadioPriority2TV ret_val;
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
return ret_val;
}

void RadioPriority2TV_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 @MobileL3_GMM_SM_Types.RadioPriority2TV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RadioPriority2TV_template[list_length];
}

RadioPriority2TV_template& RadioPriority2TV_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 @MobileL3_GMM_SM_Types.RadioPriority2TV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
return value_list.list_value[list_index];
}

RadioPriority2V_template& RadioPriority2TV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const RadioPriority2V_template& RadioPriority2TV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
return single_value->field_valueField;
}

BITSTRING_template& RadioPriority2TV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const BITSTRING_template& RadioPriority2TV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
return single_value->field_elementIdentifier;
}

int RadioPriority2TV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2TV 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 @MobileL3_GMM_SM_Types.RadioPriority2TV 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 @MobileL3_GMM_SM_Types.RadioPriority2TV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2TV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2TV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2TV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2TV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2TV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.RadioPriority2TV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.RadioPriority2TV.");
  }
  return 0;
}

void RadioPriority2TV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ valueField := ");
single_value->field_valueField.log();
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.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 RadioPriority2TV_template::log_match(const RadioPriority2TV& 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_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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("{ valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), legacy);
TTCN_Logger::log_event_str(", elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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 RadioPriority2TV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (valueField().is_bound()) valueField().set_implicit_omit();
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
}

void RadioPriority2TV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_valueField.encode_text(text_buf);
single_value->field_elementIdentifier.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 @MobileL3_GMM_SM_Types.RadioPriority2TV.");
}
}

void RadioPriority2TV_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_valueField.decode_text(text_buf);
single_value->field_elementIdentifier.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 RadioPriority2TV_template[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 @MobileL3_GMM_SM_Types.RadioPriority2TV.");
}
}

void RadioPriority2TV_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: {
    RadioPriority2TV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.RadioPriority2TV has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) valueField().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.RadioPriority2TV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RadioPriority2TV_template* precondition = new RadioPriority2TV_template;
    precondition->set_param(*param.get_elem(0));
    RadioPriority2TV_template* implied_template = new RadioPriority2TV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RadioPriority2TV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.RadioPriority2TV");
  }
  is_ifpresent = param.get_ifpresent();
}

void RadioPriority2TV_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_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriority2TV");
single_value->field_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.RadioPriority2TV");
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 : "@MobileL3_GMM_SM_Types.RadioPriority2TV");
}

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

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

MBMS__ContextStatusTLV::MBMS__ContextStatusTLV()
{
}

MBMS__ContextStatusTLV::MBMS__ContextStatusTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const OCTETSTRING& par_mBMSContextStatusInformation)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_mBMSContextStatusInformation(par_mBMSContextStatusInformation)
{
}

MBMS__ContextStatusTLV::MBMS__ContextStatusTLV(const MBMS__ContextStatusTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.mBMSContextStatusInformation().is_bound()) field_mBMSContextStatusInformation = other_value.mBMSContextStatusInformation();
else field_mBMSContextStatusInformation.clean_up();
}

void MBMS__ContextStatusTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_mBMSContextStatusInformation.clean_up();
}

const TTCN_Typedescriptor_t* MBMS__ContextStatusTLV::get_descriptor() const { return &MBMS__ContextStatusTLV_descr_; }
MBMS__ContextStatusTLV& MBMS__ContextStatusTLV::operator=(const MBMS__ContextStatusTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.mBMSContextStatusInformation().is_bound()) field_mBMSContextStatusInformation = other_value.mBMSContextStatusInformation();
  else field_mBMSContextStatusInformation.clean_up();
}
return *this;
}

boolean MBMS__ContextStatusTLV::operator==(const MBMS__ContextStatusTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_mBMSContextStatusInformation==other_value.field_mBMSContextStatusInformation;
}

boolean MBMS__ContextStatusTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_mBMSContextStatusInformation.is_bound());
}
boolean MBMS__ContextStatusTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_mBMSContextStatusInformation.is_value();
}
void MBMS__ContextStatusTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mBMSContextStatusInformation := ");
field_mBMSContextStatusInformation.log();
TTCN_Logger::log_event_str(" }");
}

void MBMS__ContextStatusTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mBMSContextStatusInformation().is_bound()) mBMSContextStatusInformation().set_implicit_omit();
}

void MBMS__ContextStatusTLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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) mBMSContextStatusInformation().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMSContextStatusInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMSContextStatusInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
  }
}

void MBMS__ContextStatusTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_mBMSContextStatusInformation.encode_text(text_buf);
}

void MBMS__ContextStatusTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_mBMSContextStatusInformation.decode_text(text_buf);
}

void MBMS__ContextStatusTLV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void MBMS__ContextStatusTLV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int MBMS__ContextStatusTLV::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, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.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, MBMS__ContextStatusTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(MBMS__ContextStatusTLV_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(MBMS__ContextStatusTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, OCTETSTRING_descr_.raw->forceomit);
  decoded_field_length = field_mBMSContextStatusInformation.RAW_decode(OCTETSTRING_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 (field_elementIdentifier !=  os_21) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int MBMS__ContextStatusTLV::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, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MBMS__ContextStatusTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, OCTETSTRING_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &MBMS__ContextStatusTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  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;
  encoded_length += field_mBMSContextStatusInformation.RAW_encode(OCTETSTRING_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_21) {
  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_21.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 MBMS__ContextStatusTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
OCTETSTRING_template field_mBMSContextStatusInformation;
};

void MBMS__ContextStatusTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_mBMSContextStatusInformation = ANY_VALUE;
}
}
}

void MBMS__ContextStatusTLV_template::copy_value(const MBMS__ContextStatusTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.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.mBMSContextStatusInformation().is_bound()) {
  single_value->field_mBMSContextStatusInformation = other_value.mBMSContextStatusInformation();
} else {
  single_value->field_mBMSContextStatusInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MBMS__ContextStatusTLV_template::copy_template(const MBMS__ContextStatusTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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.mBMSContextStatusInformation().get_selection()) {
single_value->field_mBMSContextStatusInformation = other_value.mBMSContextStatusInformation();
} else {
single_value->field_mBMSContextStatusInformation.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 MBMS__ContextStatusTLV_template[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 MBMS__ContextStatusTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new MBMS__ContextStatusTLV_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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
break;
}
set_selection(other_value);
}

MBMS__ContextStatusTLV_template::MBMS__ContextStatusTLV_template()
{
}

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

MBMS__ContextStatusTLV_template::MBMS__ContextStatusTLV_template(const MBMS__ContextStatusTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

MBMS__ContextStatusTLV_template& MBMS__ContextStatusTLV_template::operator=(const OPTIONAL<MBMS__ContextStatusTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MBMS__ContextStatusTLV&)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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
}
return *this;
}

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

boolean MBMS__ContextStatusTLV_template::match(const MBMS__ContextStatusTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), 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.mBMSContextStatusInformation().is_bound()) return FALSE;
if(!single_value->field_mBMSContextStatusInformation.match(other_value.mBMSContextStatusInformation(), 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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
}
return FALSE;
}

boolean MBMS__ContextStatusTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_mBMSContextStatusInformation.is_bound();
}

boolean MBMS__ContextStatusTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_mBMSContextStatusInformation.is_value();
}

void MBMS__ContextStatusTLV_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;
}

MBMS__ContextStatusTLV MBMS__ContextStatusTLV_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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
MBMS__ContextStatusTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_mBMSContextStatusInformation.is_bound()) {
ret_val.mBMSContextStatusInformation() = single_value->field_mBMSContextStatusInformation.valueof();
}
return ret_val;
}

void MBMS__ContextStatusTLV_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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MBMS__ContextStatusTLV_template[list_length];
}

MBMS__ContextStatusTLV_template& MBMS__ContextStatusTLV_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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& MBMS__ContextStatusTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& MBMS__ContextStatusTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& MBMS__ContextStatusTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& MBMS__ContextStatusTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
return single_value->field_lengthIndicator;
}

OCTETSTRING_template& MBMS__ContextStatusTLV_template::mBMSContextStatusInformation()
{
set_specific();
return single_value->field_mBMSContextStatusInformation;
}

const OCTETSTRING_template& MBMS__ContextStatusTLV_template::mBMSContextStatusInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMSContextStatusInformation of a non-specific template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
return single_value->field_mBMSContextStatusInformation;
}

int MBMS__ContextStatusTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV 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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV 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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
  }
  return 0;
}

void MBMS__ContextStatusTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", mBMSContextStatusInformation := ");
single_value->field_mBMSContextStatusInformation.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 MBMS__ContextStatusTLV_template::log_match(const MBMS__ContextStatusTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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_mBMSContextStatusInformation.match(match_value.mBMSContextStatusInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMSContextStatusInformation");
single_value->field_mBMSContextStatusInformation.log_match(match_value.mBMSContextStatusInformation(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", mBMSContextStatusInformation := ");
single_value->field_mBMSContextStatusInformation.log_match(match_value.mBMSContextStatusInformation(), 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 MBMS__ContextStatusTLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (mBMSContextStatusInformation().is_bound()) mBMSContextStatusInformation().set_implicit_omit();
}

void MBMS__ContextStatusTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_mBMSContextStatusInformation.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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
}
}

void MBMS__ContextStatusTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_mBMSContextStatusInformation.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 MBMS__ContextStatusTLV_template[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 @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV.");
}
}

void MBMS__ContextStatusTLV_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: {
    MBMS__ContextStatusTLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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) mBMSContextStatusInformation().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMSContextStatusInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMSContextStatusInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MBMS__ContextStatusTLV_template* precondition = new MBMS__ContextStatusTLV_template;
    precondition->set_param(*param.get_elem(0));
    MBMS__ContextStatusTLV_template* implied_template = new MBMS__ContextStatusTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MBMS__ContextStatusTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void MBMS__ContextStatusTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
single_value->field_mBMSContextStatusInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
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 : "@MobileL3_GMM_SM_Types.MBMS_ContextStatusTLV");
}

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

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

UplinkDataStatusV::UplinkDataStatusV()
{
}

UplinkDataStatusV::UplinkDataStatusV(const BITSTRING& par_spare,
    const BITSTRING& par_nSAPI__5__to__7,
    const BITSTRING& par_nSAPI__8__to__15)
  :   field_spare(par_spare),
  field_nSAPI__5__to__7(par_nSAPI__5__to__7),
  field_nSAPI__8__to__15(par_nSAPI__8__to__15)
{
}

UplinkDataStatusV::UplinkDataStatusV(const UplinkDataStatusV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.nSAPI__5__to__7().is_bound()) field_nSAPI__5__to__7 = other_value.nSAPI__5__to__7();
else field_nSAPI__5__to__7.clean_up();
if (other_value.nSAPI__8__to__15().is_bound()) field_nSAPI__8__to__15 = other_value.nSAPI__8__to__15();
else field_nSAPI__8__to__15.clean_up();
}

void UplinkDataStatusV::clean_up()
{
field_spare.clean_up();
field_nSAPI__5__to__7.clean_up();
field_nSAPI__8__to__15.clean_up();
}

const TTCN_Typedescriptor_t* UplinkDataStatusV::get_descriptor() const { return &UplinkDataStatusV_descr_; }
UplinkDataStatusV& UplinkDataStatusV::operator=(const UplinkDataStatusV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.nSAPI__5__to__7().is_bound()) field_nSAPI__5__to__7 = other_value.nSAPI__5__to__7();
  else field_nSAPI__5__to__7.clean_up();
  if (other_value.nSAPI__8__to__15().is_bound()) field_nSAPI__8__to__15 = other_value.nSAPI__8__to__15();
  else field_nSAPI__8__to__15.clean_up();
}
return *this;
}

boolean UplinkDataStatusV::operator==(const UplinkDataStatusV& other_value) const
{
return field_spare==other_value.field_spare
  && field_nSAPI__5__to__7==other_value.field_nSAPI__5__to__7
  && field_nSAPI__8__to__15==other_value.field_nSAPI__8__to__15;
}

boolean UplinkDataStatusV::is_bound() const
{
return (field_spare.is_bound())
  || (field_nSAPI__5__to__7.is_bound())
  || (field_nSAPI__8__to__15.is_bound());
}
boolean UplinkDataStatusV::is_value() const
{
return field_spare.is_value()
  && field_nSAPI__5__to__7.is_value()
  && field_nSAPI__8__to__15.is_value();
}
void UplinkDataStatusV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", nSAPI_5_to_7 := ");
field_nSAPI__5__to__7.log();
TTCN_Logger::log_event_str(", nSAPI_8_to_15 := ");
field_nSAPI__8__to__15.log();
TTCN_Logger::log_event_str(" }");
}

void UplinkDataStatusV::set_implicit_omit()
{
if (spare().is_bound()) spare().set_implicit_omit();
if (nSAPI__5__to__7().is_bound()) nSAPI__5__to__7().set_implicit_omit();
if (nSAPI__8__to__15().is_bound()) nSAPI__8__to__15().set_implicit_omit();
}

void UplinkDataStatusV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.UplinkDataStatusV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nSAPI__5__to__7().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) nSAPI__8__to__15().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSAPI_5_to_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSAPI__5__to__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSAPI_8_to_15")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSAPI__8__to__15().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.UplinkDataStatusV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
  }
}

void UplinkDataStatusV::encode_text(Text_Buf& text_buf) const
{
field_spare.encode_text(text_buf);
field_nSAPI__5__to__7.encode_text(text_buf);
field_nSAPI__8__to__15.encode_text(text_buf);
}

void UplinkDataStatusV::decode_text(Text_Buf& text_buf)
{
field_spare.decode_text(text_buf);
field_nSAPI__5__to__7.decode_text(text_buf);
field_nSAPI__8__to__15.decode_text(text_buf);
}

void UplinkDataStatusV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UplinkDataStatusV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UplinkDataStatusV::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::BIT5_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT5_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, General__Types::BIT3_descr_.raw->forceomit);
  decoded_field_length = field_nSAPI__5__to__7.RAW_decode(General__Types::BIT3_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, General__Types::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_nSAPI__8__to__15.RAW_decode(General__Types::BIT8_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 UplinkDataStatusV::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, General__Types::BIT5_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, General__Types::BIT3_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT8_descr_.raw);
  encoded_length += field_spare.RAW_encode(General__Types::BIT5_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_nSAPI__5__to__7.RAW_encode(General__Types::BIT3_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_nSAPI__8__to__15.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[2]);
  return myleaf.length = encoded_length;
}

struct UplinkDataStatusV_template::single_value_struct {
BITSTRING_template field_spare;
BITSTRING_template field_nSAPI__5__to__7;
BITSTRING_template field_nSAPI__8__to__15;
};

void UplinkDataStatusV_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_spare = ANY_VALUE;
single_value->field_nSAPI__5__to__7 = ANY_VALUE;
single_value->field_nSAPI__8__to__15 = ANY_VALUE;
}
}
}

void UplinkDataStatusV_template::copy_value(const UplinkDataStatusV& other_value)
{
single_value = new single_value_struct;
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.nSAPI__5__to__7().is_bound()) {
  single_value->field_nSAPI__5__to__7 = other_value.nSAPI__5__to__7();
} else {
  single_value->field_nSAPI__5__to__7.clean_up();
}
if (other_value.nSAPI__8__to__15().is_bound()) {
  single_value->field_nSAPI__8__to__15 = other_value.nSAPI__8__to__15();
} else {
  single_value->field_nSAPI__8__to__15.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UplinkDataStatusV_template::copy_template(const UplinkDataStatusV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nSAPI__5__to__7().get_selection()) {
single_value->field_nSAPI__5__to__7 = other_value.nSAPI__5__to__7();
} else {
single_value->field_nSAPI__5__to__7.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.nSAPI__8__to__15().get_selection()) {
single_value->field_nSAPI__8__to__15 = other_value.nSAPI__8__to__15();
} else {
single_value->field_nSAPI__8__to__15.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 UplinkDataStatusV_template[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 UplinkDataStatusV_template(*other_value.implication_.precondition);
implication_.implied_template = new UplinkDataStatusV_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 @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
break;
}
set_selection(other_value);
}

UplinkDataStatusV_template::UplinkDataStatusV_template()
{
}

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

UplinkDataStatusV_template::UplinkDataStatusV_template(const UplinkDataStatusV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

UplinkDataStatusV_template& UplinkDataStatusV_template::operator=(const OPTIONAL<UplinkDataStatusV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UplinkDataStatusV&)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 @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
}
return *this;
}

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

boolean UplinkDataStatusV_template::match(const UplinkDataStatusV& 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.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.nSAPI__5__to__7().is_bound()) return FALSE;
if(!single_value->field_nSAPI__5__to__7.match(other_value.nSAPI__5__to__7(), legacy))return FALSE;
if(!other_value.nSAPI__8__to__15().is_bound()) return FALSE;
if(!single_value->field_nSAPI__8__to__15.match(other_value.nSAPI__8__to__15(), 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 @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
}
return FALSE;
}

boolean UplinkDataStatusV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_spare.is_bound()
 || single_value->field_nSAPI__5__to__7.is_bound()
 || single_value->field_nSAPI__8__to__15.is_bound();
}

boolean UplinkDataStatusV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_spare.is_value()
 && single_value->field_nSAPI__5__to__7.is_value()
 && single_value->field_nSAPI__8__to__15.is_value();
}

void UplinkDataStatusV_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;
}

UplinkDataStatusV UplinkDataStatusV_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 @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
UplinkDataStatusV ret_val;
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_nSAPI__5__to__7.is_bound()) {
ret_val.nSAPI__5__to__7() = single_value->field_nSAPI__5__to__7.valueof();
}
if (single_value->field_nSAPI__8__to__15.is_bound()) {
ret_val.nSAPI__8__to__15() = single_value->field_nSAPI__8__to__15.valueof();
}
return ret_val;
}

void UplinkDataStatusV_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 @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UplinkDataStatusV_template[list_length];
}

UplinkDataStatusV_template& UplinkDataStatusV_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 @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
return value_list.list_value[list_index];
}

BITSTRING_template& UplinkDataStatusV_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& UplinkDataStatusV_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
return single_value->field_spare;
}

BITSTRING_template& UplinkDataStatusV_template::nSAPI__5__to__7()
{
set_specific();
return single_value->field_nSAPI__5__to__7;
}

const BITSTRING_template& UplinkDataStatusV_template::nSAPI__5__to__7() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nSAPI_5_to_7 of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
return single_value->field_nSAPI__5__to__7;
}

BITSTRING_template& UplinkDataStatusV_template::nSAPI__8__to__15()
{
set_specific();
return single_value->field_nSAPI__8__to__15;
}

const BITSTRING_template& UplinkDataStatusV_template::nSAPI__8__to__15() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field nSAPI_8_to_15 of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
return single_value->field_nSAPI__8__to__15;
}

int UplinkDataStatusV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV 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 @MobileL3_GMM_SM_Types.UplinkDataStatusV 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 @MobileL3_GMM_SM_Types.UplinkDataStatusV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
  }
  return 0;
}

void UplinkDataStatusV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", nSAPI_5_to_7 := ");
single_value->field_nSAPI__5__to__7.log();
TTCN_Logger::log_event_str(", nSAPI_8_to_15 := ");
single_value->field_nSAPI__8__to__15.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 UplinkDataStatusV_template::log_match(const UplinkDataStatusV& 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_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);
}
if(!single_value->field_nSAPI__5__to__7.match(match_value.nSAPI__5__to__7(), legacy)){
TTCN_Logger::log_logmatch_info(".nSAPI_5_to_7");
single_value->field_nSAPI__5__to__7.log_match(match_value.nSAPI__5__to__7(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_nSAPI__8__to__15.match(match_value.nSAPI__8__to__15(), legacy)){
TTCN_Logger::log_logmatch_info(".nSAPI_8_to_15");
single_value->field_nSAPI__8__to__15.log_match(match_value.nSAPI__8__to__15(), 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("{ spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", nSAPI_5_to_7 := ");
single_value->field_nSAPI__5__to__7.log_match(match_value.nSAPI__5__to__7(), legacy);
TTCN_Logger::log_event_str(", nSAPI_8_to_15 := ");
single_value->field_nSAPI__8__to__15.log_match(match_value.nSAPI__8__to__15(), 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 UplinkDataStatusV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (spare().is_bound()) spare().set_implicit_omit();
if (nSAPI__5__to__7().is_bound()) nSAPI__5__to__7().set_implicit_omit();
if (nSAPI__8__to__15().is_bound()) nSAPI__8__to__15().set_implicit_omit();
}

void UplinkDataStatusV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_spare.encode_text(text_buf);
single_value->field_nSAPI__5__to__7.encode_text(text_buf);
single_value->field_nSAPI__8__to__15.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 @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
}
}

void UplinkDataStatusV_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_spare.decode_text(text_buf);
single_value->field_nSAPI__5__to__7.decode_text(text_buf);
single_value->field_nSAPI__8__to__15.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 UplinkDataStatusV_template[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 @MobileL3_GMM_SM_Types.UplinkDataStatusV.");
}
}

void UplinkDataStatusV_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: {
    UplinkDataStatusV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.UplinkDataStatusV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) nSAPI__5__to__7().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) nSAPI__8__to__15().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSAPI_5_to_7")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSAPI__5__to__7().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "nSAPI_8_to_15")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          nSAPI__8__to__15().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.UplinkDataStatusV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UplinkDataStatusV_template* precondition = new UplinkDataStatusV_template;
    precondition->set_param(*param.get_elem(0));
    UplinkDataStatusV_template* implied_template = new UplinkDataStatusV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UplinkDataStatusV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UplinkDataStatusV_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_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
single_value->field_nSAPI__5__to__7.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
single_value->field_nSAPI__8__to__15.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
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 : "@MobileL3_GMM_SM_Types.UplinkDataStatusV");
}

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

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

UplinkDataStatusTLV::UplinkDataStatusTLV()
{
}

UplinkDataStatusTLV::UplinkDataStatusTLV(const OCTETSTRING& par_elementIdentifier,
    const INTEGER& par_lengthIndicator,
    const UplinkDataStatusV& par_valueField)
  :   field_elementIdentifier(par_elementIdentifier),
  field_lengthIndicator(par_lengthIndicator),
  field_valueField(par_valueField)
{
}

UplinkDataStatusTLV::UplinkDataStatusTLV(const UplinkDataStatusTLV& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
else field_elementIdentifier.clean_up();
if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
else field_lengthIndicator.clean_up();
if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
else field_valueField.clean_up();
}

void UplinkDataStatusTLV::clean_up()
{
field_elementIdentifier.clean_up();
field_lengthIndicator.clean_up();
field_valueField.clean_up();
}

const TTCN_Typedescriptor_t* UplinkDataStatusTLV::get_descriptor() const { return &UplinkDataStatusTLV_descr_; }
UplinkDataStatusTLV& UplinkDataStatusTLV::operator=(const UplinkDataStatusTLV& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
  if (other_value.elementIdentifier().is_bound()) field_elementIdentifier = other_value.elementIdentifier();
  else field_elementIdentifier.clean_up();
  if (other_value.lengthIndicator().is_bound()) field_lengthIndicator = other_value.lengthIndicator();
  else field_lengthIndicator.clean_up();
  if (other_value.valueField().is_bound()) field_valueField = other_value.valueField();
  else field_valueField.clean_up();
}
return *this;
}

boolean UplinkDataStatusTLV::operator==(const UplinkDataStatusTLV& other_value) const
{
return field_elementIdentifier==other_value.field_elementIdentifier
  && field_lengthIndicator==other_value.field_lengthIndicator
  && field_valueField==other_value.field_valueField;
}

boolean UplinkDataStatusTLV::is_bound() const
{
return (field_elementIdentifier.is_bound())
  || (field_lengthIndicator.is_bound())
  || (field_valueField.is_bound());
}
boolean UplinkDataStatusTLV::is_value() const
{
return field_elementIdentifier.is_value()
  && field_lengthIndicator.is_value()
  && field_valueField.is_value();
}
void UplinkDataStatusTLV::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ elementIdentifier := ");
field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
field_lengthIndicator.log();
TTCN_Logger::log_event_str(", valueField := ");
field_valueField.log();
TTCN_Logger::log_event_str(" }");
}

void UplinkDataStatusTLV::set_implicit_omit()
{
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

void UplinkDataStatusTLV::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
  }
}

void UplinkDataStatusTLV::encode_text(Text_Buf& text_buf) const
{
field_elementIdentifier.encode_text(text_buf);
field_lengthIndicator.encode_text(text_buf);
field_valueField.encode_text(text_buf);
}

void UplinkDataStatusTLV::decode_text(Text_Buf& text_buf)
{
field_elementIdentifier.decode_text(text_buf);
field_lengthIndicator.decode_text(text_buf);
field_valueField.decode_text(text_buf);
}

void UplinkDataStatusTLV::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void UplinkDataStatusTLV::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int UplinkDataStatusTLV::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, General__Types::OCT1_descr_.raw->forceomit);
  decoded_field_length = field_elementIdentifier.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, UplinkDataStatusTLV_lengthIndicator_descr_.raw->forceomit);
  decoded_field_length = field_lengthIndicator.RAW_decode(UplinkDataStatusTLV_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(UplinkDataStatusTLV_lengthIndicator_descr_);
  field_lengthIndicator = tmp1;
  value_of_length_field1 += tmp1.get_long_long_val() * 8;
  RAW_Force_Omit field_2_force_omit(2, force_omit, UplinkDataStatusV_descr_.raw->forceomit);
  decoded_field_length = field_valueField.RAW_decode(UplinkDataStatusV_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 (field_elementIdentifier !=  os_20) return -1;
  p_buf.set_pos_bit(last_decoded_pos);
  return decoded_length+prepaddlength+p_buf.increase_pos_padd(p_td.raw->padding);
}

int UplinkDataStatusTLV::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, General__Types::OCT1_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, UplinkDataStatusTLV_lengthIndicator_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, UplinkDataStatusV_descr_.raw);
  encoded_length += field_elementIdentifier.RAW_encode(General__Types::OCT1_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += 8;
  myleaf.body.node.nodes[1]->calc = CALC_LENGTH;
  myleaf.body.node.nodes[1]->coding_descr = &UplinkDataStatusTLV_lengthIndicator_descr_;
  myleaf.body.node.nodes[1]->calcof.lengthto.num_of_fields = 1;
  myleaf.body.node.nodes[1]->calcof.lengthto.unit = 8;
  myleaf.body.node.nodes[1]->calcof.lengthto.offset = 0;
  myleaf.body.node.nodes[1]->calcof.lengthto.fields = init_lengthto_fields_list(1);
  myleaf.body.node.nodes[1]->length = 8;
  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;
  encoded_length += field_valueField.RAW_encode(UplinkDataStatusV_descr_, *myleaf.body.node.nodes[2]);
  if (field_elementIdentifier !=  os_20) {
  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_20.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 UplinkDataStatusTLV_template::single_value_struct {
OCTETSTRING_template field_elementIdentifier;
INTEGER_template field_lengthIndicator;
UplinkDataStatusV_template field_valueField;
};

void UplinkDataStatusTLV_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_elementIdentifier = ANY_VALUE;
single_value->field_lengthIndicator = ANY_VALUE;
single_value->field_valueField = ANY_VALUE;
}
}
}

void UplinkDataStatusTLV_template::copy_value(const UplinkDataStatusTLV& other_value)
{
single_value = new single_value_struct;
if (other_value.elementIdentifier().is_bound()) {
  single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
  single_value->field_elementIdentifier.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.valueField().is_bound()) {
  single_value->field_valueField = other_value.valueField();
} else {
  single_value->field_valueField.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void UplinkDataStatusTLV_template::copy_template(const UplinkDataStatusTLV_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.elementIdentifier().get_selection()) {
single_value->field_elementIdentifier = other_value.elementIdentifier();
} else {
single_value->field_elementIdentifier.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.valueField().get_selection()) {
single_value->field_valueField = other_value.valueField();
} else {
single_value->field_valueField.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 UplinkDataStatusTLV_template[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 UplinkDataStatusTLV_template(*other_value.implication_.precondition);
implication_.implied_template = new UplinkDataStatusTLV_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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
break;
}
set_selection(other_value);
}

UplinkDataStatusTLV_template::UplinkDataStatusTLV_template()
{
}

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

UplinkDataStatusTLV_template::UplinkDataStatusTLV_template(const UplinkDataStatusTLV& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

UplinkDataStatusTLV_template& UplinkDataStatusTLV_template::operator=(const OPTIONAL<UplinkDataStatusTLV>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const UplinkDataStatusTLV&)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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
}
return *this;
}

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

boolean UplinkDataStatusTLV_template::match(const UplinkDataStatusTLV& 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.elementIdentifier().is_bound()) return FALSE;
if(!single_value->field_elementIdentifier.match(other_value.elementIdentifier(), 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.valueField().is_bound()) return FALSE;
if(!single_value->field_valueField.match(other_value.valueField(), 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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
}
return FALSE;
}

boolean UplinkDataStatusTLV_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_elementIdentifier.is_bound()
 || single_value->field_lengthIndicator.is_bound()
 || single_value->field_valueField.is_bound();
}

boolean UplinkDataStatusTLV_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_elementIdentifier.is_value()
 && single_value->field_lengthIndicator.is_value()
 && single_value->field_valueField.is_value();
}

void UplinkDataStatusTLV_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;
}

UplinkDataStatusTLV UplinkDataStatusTLV_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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
UplinkDataStatusTLV ret_val;
if (single_value->field_elementIdentifier.is_bound()) {
ret_val.elementIdentifier() = single_value->field_elementIdentifier.valueof();
}
if (single_value->field_lengthIndicator.is_bound()) {
ret_val.lengthIndicator() = single_value->field_lengthIndicator.valueof();
}
if (single_value->field_valueField.is_bound()) {
ret_val.valueField() = single_value->field_valueField.valueof();
}
return ret_val;
}

void UplinkDataStatusTLV_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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new UplinkDataStatusTLV_template[list_length];
}

UplinkDataStatusTLV_template& UplinkDataStatusTLV_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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
return value_list.list_value[list_index];
}

OCTETSTRING_template& UplinkDataStatusTLV_template::elementIdentifier()
{
set_specific();
return single_value->field_elementIdentifier;
}

const OCTETSTRING_template& UplinkDataStatusTLV_template::elementIdentifier() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field elementIdentifier of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
return single_value->field_elementIdentifier;
}

INTEGER_template& UplinkDataStatusTLV_template::lengthIndicator()
{
set_specific();
return single_value->field_lengthIndicator;
}

const INTEGER_template& UplinkDataStatusTLV_template::lengthIndicator() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field lengthIndicator of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
return single_value->field_lengthIndicator;
}

UplinkDataStatusV_template& UplinkDataStatusTLV_template::valueField()
{
set_specific();
return single_value->field_valueField;
}

const UplinkDataStatusV_template& UplinkDataStatusTLV_template::valueField() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field valueField of a non-specific template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
return single_value->field_valueField;
}

int UplinkDataStatusTLV_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV 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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV 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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
  }
  return 0;
}

void UplinkDataStatusTLV_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ elementIdentifier := ");
single_value->field_elementIdentifier.log();
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log();
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.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 UplinkDataStatusTLV_template::log_match(const UplinkDataStatusTLV& 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_elementIdentifier.match(match_value.elementIdentifier(), legacy)){
TTCN_Logger::log_logmatch_info(".elementIdentifier");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), 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_valueField.match(match_value.valueField(), legacy)){
TTCN_Logger::log_logmatch_info(".valueField");
single_value->field_valueField.log_match(match_value.valueField(), 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("{ elementIdentifier := ");
single_value->field_elementIdentifier.log_match(match_value.elementIdentifier(), legacy);
TTCN_Logger::log_event_str(", lengthIndicator := ");
single_value->field_lengthIndicator.log_match(match_value.lengthIndicator(), legacy);
TTCN_Logger::log_event_str(", valueField := ");
single_value->field_valueField.log_match(match_value.valueField(), 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 UplinkDataStatusTLV_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (elementIdentifier().is_bound()) elementIdentifier().set_implicit_omit();
if (lengthIndicator().is_bound()) lengthIndicator().set_implicit_omit();
if (valueField().is_bound()) valueField().set_implicit_omit();
}

void UplinkDataStatusTLV_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_elementIdentifier.encode_text(text_buf);
single_value->field_lengthIndicator.encode_text(text_buf);
single_value->field_valueField.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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
}
}

void UplinkDataStatusTLV_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_elementIdentifier.decode_text(text_buf);
single_value->field_lengthIndicator.decode_text(text_buf);
single_value->field_valueField.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 UplinkDataStatusTLV_template[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 @MobileL3_GMM_SM_Types.UplinkDataStatusTLV.");
}
}

void UplinkDataStatusTLV_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: {
    UplinkDataStatusTLV_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) elementIdentifier().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) valueField().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "elementIdentifier")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          elementIdentifier().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "valueField")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          valueField().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.UplinkDataStatusTLV: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    UplinkDataStatusTLV_template* precondition = new UplinkDataStatusTLV_template;
    precondition->set_param(*param.get_elem(0));
    UplinkDataStatusTLV_template* implied_template = new UplinkDataStatusTLV_template;
    implied_template->set_param(*param.get_elem(1));
    *this = UplinkDataStatusTLV_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
  }
  is_ifpresent = param.get_ifpresent();
}

void UplinkDataStatusTLV_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_elementIdentifier.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
single_value->field_lengthIndicator.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
single_value->field_valueField.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
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 : "@MobileL3_GMM_SM_Types.UplinkDataStatusTLV");
}

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

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

PDU__GMM__AttachRequest::PDU__GMM__AttachRequest()
{
}

PDU__GMM__AttachRequest::PDU__GMM__AttachRequest(const BITSTRING& par_messageType,
    const MSNetworkCapabilityLV& par_msNetworkCapability,
    const AttachTypeV& par_attachType,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_gprsCKSN,
    const DRXParameterV& par_drxParam,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity,
    const RoutingAreaIdentificationV& par_oldRoutingAreaID,
    const MSRadioAccessCapabilityLV& par_msRACap,
    const OPTIONAL< P__TMSISignatureTV >& par_ptmsiSignature,
    const OPTIONAL< GPRSTimerTV >& par_reqGPRStimer,
    const OPTIONAL< TMSIStatusTV >& par_tmsiStatus,
    const OPTIONAL< PC__LCSCapability >& par_pC__LCSCapability,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark2__TLV >& par_mobileStationClassmark2,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark3__TLV >& par_mobileStationClassmark3,
    const OPTIONAL< MobileL3__CommonIE__Types::SupportedCodecList >& par_supportedCodecs,
    const OPTIONAL< UENetworkCapabilityTLV >& par_uENetworkCapability,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_additionalMobileIdentity,
    const OPTIONAL< MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV >& par_routingAreaIdentification2,
    const OPTIONAL< VoiceDomainPreferenceandUEsUsageSettingTLV >& par_voiceDomainandUEsUsageSetting,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties,
    const OPTIONAL< MobileL3__CommonIE__Types::P__TMSI__TypeTV >& par_p__TMSI__Type,
    const OPTIONAL< MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV >& par_mS__NetworkFeatureSupport,
    const OPTIONAL< LocationAreaIdentification2__TLV >& par_oldLocationAreaIdentification,
    const OPTIONAL< AdditionalUpdateTypeTV >& par_additionalUpdateType,
    const OPTIONAL< NetworkResourceIdentifierContainerTLV >& par_tMSIBasedNRIcontainer,
    const OPTIONAL< GPRSTimer2TLV >& par_t3324,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_t3312__ExtendedValue,
    const OPTIONAL< ExtendedDRXParametersTLV >& par_extendedDRXParameters)
  :   field_messageType(par_messageType),
  field_msNetworkCapability(par_msNetworkCapability),
  field_attachType(par_attachType),
  field_gprsCKSN(par_gprsCKSN),
  field_drxParam(par_drxParam),
  field_mobileIdentity(par_mobileIdentity),
  field_oldRoutingAreaID(par_oldRoutingAreaID),
  field_msRACap(par_msRACap),
  field_ptmsiSignature(par_ptmsiSignature),
  field_reqGPRStimer(par_reqGPRStimer),
  field_tmsiStatus(par_tmsiStatus),
  field_pC__LCSCapability(par_pC__LCSCapability),
  field_mobileStationClassmark2(par_mobileStationClassmark2),
  field_mobileStationClassmark3(par_mobileStationClassmark3),
  field_supportedCodecs(par_supportedCodecs),
  field_uENetworkCapability(par_uENetworkCapability),
  field_additionalMobileIdentity(par_additionalMobileIdentity),
  field_routingAreaIdentification2(par_routingAreaIdentification2),
  field_voiceDomainandUEsUsageSetting(par_voiceDomainandUEsUsageSetting),
  field_deviceProperties(par_deviceProperties),
  field_p__TMSI__Type(par_p__TMSI__Type),
  field_mS__NetworkFeatureSupport(par_mS__NetworkFeatureSupport),
  field_oldLocationAreaIdentification(par_oldLocationAreaIdentification),
  field_additionalUpdateType(par_additionalUpdateType),
  field_tMSIBasedNRIcontainer(par_tMSIBasedNRIcontainer),
  field_t3324(par_t3324),
  field_t3312__ExtendedValue(par_t3312__ExtendedValue),
  field_extendedDRXParameters(par_extendedDRXParameters)
{
}

PDU__GMM__AttachRequest::PDU__GMM__AttachRequest(const PDU__GMM__AttachRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.msNetworkCapability().is_bound()) field_msNetworkCapability = other_value.msNetworkCapability();
else field_msNetworkCapability.clean_up();
if (other_value.attachType().is_bound()) field_attachType = other_value.attachType();
else field_attachType.clean_up();
if (other_value.gprsCKSN().is_bound()) field_gprsCKSN = other_value.gprsCKSN();
else field_gprsCKSN.clean_up();
if (other_value.drxParam().is_bound()) field_drxParam = other_value.drxParam();
else field_drxParam.clean_up();
if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
else field_mobileIdentity.clean_up();
if (other_value.oldRoutingAreaID().is_bound()) field_oldRoutingAreaID = other_value.oldRoutingAreaID();
else field_oldRoutingAreaID.clean_up();
if (other_value.msRACap().is_bound()) field_msRACap = other_value.msRACap();
else field_msRACap.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
if (other_value.reqGPRStimer().is_bound()) field_reqGPRStimer = other_value.reqGPRStimer();
else field_reqGPRStimer.clean_up();
if (other_value.tmsiStatus().is_bound()) field_tmsiStatus = other_value.tmsiStatus();
else field_tmsiStatus.clean_up();
if (other_value.pC__LCSCapability().is_bound()) field_pC__LCSCapability = other_value.pC__LCSCapability();
else field_pC__LCSCapability.clean_up();
if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
else field_mobileStationClassmark2.clean_up();
if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
else field_mobileStationClassmark3.clean_up();
if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
else field_supportedCodecs.clean_up();
if (other_value.uENetworkCapability().is_bound()) field_uENetworkCapability = other_value.uENetworkCapability();
else field_uENetworkCapability.clean_up();
if (other_value.additionalMobileIdentity().is_bound()) field_additionalMobileIdentity = other_value.additionalMobileIdentity();
else field_additionalMobileIdentity.clean_up();
if (other_value.routingAreaIdentification2().is_bound()) field_routingAreaIdentification2 = other_value.routingAreaIdentification2();
else field_routingAreaIdentification2.clean_up();
if (other_value.voiceDomainandUEsUsageSetting().is_bound()) field_voiceDomainandUEsUsageSetting = other_value.voiceDomainandUEsUsageSetting();
else field_voiceDomainandUEsUsageSetting.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
if (other_value.p__TMSI__Type().is_bound()) field_p__TMSI__Type = other_value.p__TMSI__Type();
else field_p__TMSI__Type.clean_up();
if (other_value.mS__NetworkFeatureSupport().is_bound()) field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
else field_mS__NetworkFeatureSupport.clean_up();
if (other_value.oldLocationAreaIdentification().is_bound()) field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
else field_oldLocationAreaIdentification.clean_up();
if (other_value.additionalUpdateType().is_bound()) field_additionalUpdateType = other_value.additionalUpdateType();
else field_additionalUpdateType.clean_up();
if (other_value.tMSIBasedNRIcontainer().is_bound()) field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
else field_tMSIBasedNRIcontainer.clean_up();
if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
else field_t3324.clean_up();
if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
else field_t3312__ExtendedValue.clean_up();
if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
else field_extendedDRXParameters.clean_up();
}

void PDU__GMM__AttachRequest::clean_up()
{
field_messageType.clean_up();
field_msNetworkCapability.clean_up();
field_attachType.clean_up();
field_gprsCKSN.clean_up();
field_drxParam.clean_up();
field_mobileIdentity.clean_up();
field_oldRoutingAreaID.clean_up();
field_msRACap.clean_up();
field_ptmsiSignature.clean_up();
field_reqGPRStimer.clean_up();
field_tmsiStatus.clean_up();
field_pC__LCSCapability.clean_up();
field_mobileStationClassmark2.clean_up();
field_mobileStationClassmark3.clean_up();
field_supportedCodecs.clean_up();
field_uENetworkCapability.clean_up();
field_additionalMobileIdentity.clean_up();
field_routingAreaIdentification2.clean_up();
field_voiceDomainandUEsUsageSetting.clean_up();
field_deviceProperties.clean_up();
field_p__TMSI__Type.clean_up();
field_mS__NetworkFeatureSupport.clean_up();
field_oldLocationAreaIdentification.clean_up();
field_additionalUpdateType.clean_up();
field_tMSIBasedNRIcontainer.clean_up();
field_t3324.clean_up();
field_t3312__ExtendedValue.clean_up();
field_extendedDRXParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AttachRequest::get_descriptor() const { return &PDU__GMM__AttachRequest_descr_; }
PDU__GMM__AttachRequest& PDU__GMM__AttachRequest::operator=(const PDU__GMM__AttachRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.msNetworkCapability().is_bound()) field_msNetworkCapability = other_value.msNetworkCapability();
  else field_msNetworkCapability.clean_up();
  if (other_value.attachType().is_bound()) field_attachType = other_value.attachType();
  else field_attachType.clean_up();
  if (other_value.gprsCKSN().is_bound()) field_gprsCKSN = other_value.gprsCKSN();
  else field_gprsCKSN.clean_up();
  if (other_value.drxParam().is_bound()) field_drxParam = other_value.drxParam();
  else field_drxParam.clean_up();
  if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
  else field_mobileIdentity.clean_up();
  if (other_value.oldRoutingAreaID().is_bound()) field_oldRoutingAreaID = other_value.oldRoutingAreaID();
  else field_oldRoutingAreaID.clean_up();
  if (other_value.msRACap().is_bound()) field_msRACap = other_value.msRACap();
  else field_msRACap.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
  if (other_value.reqGPRStimer().is_bound()) field_reqGPRStimer = other_value.reqGPRStimer();
  else field_reqGPRStimer.clean_up();
  if (other_value.tmsiStatus().is_bound()) field_tmsiStatus = other_value.tmsiStatus();
  else field_tmsiStatus.clean_up();
  if (other_value.pC__LCSCapability().is_bound()) field_pC__LCSCapability = other_value.pC__LCSCapability();
  else field_pC__LCSCapability.clean_up();
  if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
  else field_mobileStationClassmark2.clean_up();
  if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
  else field_mobileStationClassmark3.clean_up();
  if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
  else field_supportedCodecs.clean_up();
  if (other_value.uENetworkCapability().is_bound()) field_uENetworkCapability = other_value.uENetworkCapability();
  else field_uENetworkCapability.clean_up();
  if (other_value.additionalMobileIdentity().is_bound()) field_additionalMobileIdentity = other_value.additionalMobileIdentity();
  else field_additionalMobileIdentity.clean_up();
  if (other_value.routingAreaIdentification2().is_bound()) field_routingAreaIdentification2 = other_value.routingAreaIdentification2();
  else field_routingAreaIdentification2.clean_up();
  if (other_value.voiceDomainandUEsUsageSetting().is_bound()) field_voiceDomainandUEsUsageSetting = other_value.voiceDomainandUEsUsageSetting();
  else field_voiceDomainandUEsUsageSetting.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
  if (other_value.p__TMSI__Type().is_bound()) field_p__TMSI__Type = other_value.p__TMSI__Type();
  else field_p__TMSI__Type.clean_up();
  if (other_value.mS__NetworkFeatureSupport().is_bound()) field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
  else field_mS__NetworkFeatureSupport.clean_up();
  if (other_value.oldLocationAreaIdentification().is_bound()) field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
  else field_oldLocationAreaIdentification.clean_up();
  if (other_value.additionalUpdateType().is_bound()) field_additionalUpdateType = other_value.additionalUpdateType();
  else field_additionalUpdateType.clean_up();
  if (other_value.tMSIBasedNRIcontainer().is_bound()) field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
  else field_tMSIBasedNRIcontainer.clean_up();
  if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
  else field_t3324.clean_up();
  if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
  else field_t3312__ExtendedValue.clean_up();
  if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
  else field_extendedDRXParameters.clean_up();
}
return *this;
}

boolean PDU__GMM__AttachRequest::operator==(const PDU__GMM__AttachRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_msNetworkCapability==other_value.field_msNetworkCapability
  && field_attachType==other_value.field_attachType
  && field_gprsCKSN==other_value.field_gprsCKSN
  && field_drxParam==other_value.field_drxParam
  && field_mobileIdentity==other_value.field_mobileIdentity
  && field_oldRoutingAreaID==other_value.field_oldRoutingAreaID
  && field_msRACap==other_value.field_msRACap
  && field_ptmsiSignature==other_value.field_ptmsiSignature
  && field_reqGPRStimer==other_value.field_reqGPRStimer
  && field_tmsiStatus==other_value.field_tmsiStatus
  && field_pC__LCSCapability==other_value.field_pC__LCSCapability
  && field_mobileStationClassmark2==other_value.field_mobileStationClassmark2
  && field_mobileStationClassmark3==other_value.field_mobileStationClassmark3
  && field_supportedCodecs==other_value.field_supportedCodecs
  && field_uENetworkCapability==other_value.field_uENetworkCapability
  && field_additionalMobileIdentity==other_value.field_additionalMobileIdentity
  && field_routingAreaIdentification2==other_value.field_routingAreaIdentification2
  && field_voiceDomainandUEsUsageSetting==other_value.field_voiceDomainandUEsUsageSetting
  && field_deviceProperties==other_value.field_deviceProperties
  && field_p__TMSI__Type==other_value.field_p__TMSI__Type
  && field_mS__NetworkFeatureSupport==other_value.field_mS__NetworkFeatureSupport
  && field_oldLocationAreaIdentification==other_value.field_oldLocationAreaIdentification
  && field_additionalUpdateType==other_value.field_additionalUpdateType
  && field_tMSIBasedNRIcontainer==other_value.field_tMSIBasedNRIcontainer
  && field_t3324==other_value.field_t3324
  && field_t3312__ExtendedValue==other_value.field_t3312__ExtendedValue
  && field_extendedDRXParameters==other_value.field_extendedDRXParameters;
}

boolean PDU__GMM__AttachRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_msNetworkCapability.is_bound())
  || (field_attachType.is_bound())
  || (field_gprsCKSN.is_bound())
  || (field_drxParam.is_bound())
  || (field_mobileIdentity.is_bound())
  || (field_oldRoutingAreaID.is_bound())
  || (field_msRACap.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound())
  || (OPTIONAL_OMIT == field_reqGPRStimer.get_selection() || field_reqGPRStimer.is_bound())
  || (OPTIONAL_OMIT == field_tmsiStatus.get_selection() || field_tmsiStatus.is_bound())
  || (OPTIONAL_OMIT == field_pC__LCSCapability.get_selection() || field_pC__LCSCapability.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark2.get_selection() || field_mobileStationClassmark2.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_bound())
  || (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_bound())
  || (OPTIONAL_OMIT == field_uENetworkCapability.get_selection() || field_uENetworkCapability.is_bound())
  || (OPTIONAL_OMIT == field_additionalMobileIdentity.get_selection() || field_additionalMobileIdentity.is_bound())
  || (OPTIONAL_OMIT == field_routingAreaIdentification2.get_selection() || field_routingAreaIdentification2.is_bound())
  || (OPTIONAL_OMIT == field_voiceDomainandUEsUsageSetting.get_selection() || field_voiceDomainandUEsUsageSetting.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound())
  || (OPTIONAL_OMIT == field_p__TMSI__Type.get_selection() || field_p__TMSI__Type.is_bound())
  || (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_oldLocationAreaIdentification.get_selection() || field_oldLocationAreaIdentification.is_bound())
  || (OPTIONAL_OMIT == field_additionalUpdateType.get_selection() || field_additionalUpdateType.is_bound())
  || (OPTIONAL_OMIT == field_tMSIBasedNRIcontainer.get_selection() || field_tMSIBasedNRIcontainer.is_bound())
  || (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_bound())
  || (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_bound())
  || (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_bound());
}
boolean PDU__GMM__AttachRequest::is_value() const
{
return field_messageType.is_value()
  && field_msNetworkCapability.is_value()
  && field_attachType.is_value()
  && field_gprsCKSN.is_value()
  && field_drxParam.is_value()
  && field_mobileIdentity.is_value()
  && field_oldRoutingAreaID.is_value()
  && field_msRACap.is_value()
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value())
  && (OPTIONAL_OMIT == field_reqGPRStimer.get_selection() || field_reqGPRStimer.is_value())
  && (OPTIONAL_OMIT == field_tmsiStatus.get_selection() || field_tmsiStatus.is_value())
  && (OPTIONAL_OMIT == field_pC__LCSCapability.get_selection() || field_pC__LCSCapability.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark2.get_selection() || field_mobileStationClassmark2.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_value())
  && (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_value())
  && (OPTIONAL_OMIT == field_uENetworkCapability.get_selection() || field_uENetworkCapability.is_value())
  && (OPTIONAL_OMIT == field_additionalMobileIdentity.get_selection() || field_additionalMobileIdentity.is_value())
  && (OPTIONAL_OMIT == field_routingAreaIdentification2.get_selection() || field_routingAreaIdentification2.is_value())
  && (OPTIONAL_OMIT == field_voiceDomainandUEsUsageSetting.get_selection() || field_voiceDomainandUEsUsageSetting.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value())
  && (OPTIONAL_OMIT == field_p__TMSI__Type.get_selection() || field_p__TMSI__Type.is_value())
  && (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_oldLocationAreaIdentification.get_selection() || field_oldLocationAreaIdentification.is_value())
  && (OPTIONAL_OMIT == field_additionalUpdateType.get_selection() || field_additionalUpdateType.is_value())
  && (OPTIONAL_OMIT == field_tMSIBasedNRIcontainer.get_selection() || field_tMSIBasedNRIcontainer.is_value())
  && (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_value())
  && (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_value())
  && (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_value());
}
int PDU__GMM__AttachRequest::size_of() const
{
  int ret_val = 8;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  if (field_reqGPRStimer.ispresent()) ret_val++;
  if (field_tmsiStatus.ispresent()) ret_val++;
  if (field_pC__LCSCapability.ispresent()) ret_val++;
  if (field_mobileStationClassmark2.ispresent()) ret_val++;
  if (field_mobileStationClassmark3.ispresent()) ret_val++;
  if (field_supportedCodecs.ispresent()) ret_val++;
  if (field_uENetworkCapability.ispresent()) ret_val++;
  if (field_additionalMobileIdentity.ispresent()) ret_val++;
  if (field_routingAreaIdentification2.ispresent()) ret_val++;
  if (field_voiceDomainandUEsUsageSetting.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  if (field_p__TMSI__Type.ispresent()) ret_val++;
  if (field_mS__NetworkFeatureSupport.ispresent()) ret_val++;
  if (field_oldLocationAreaIdentification.ispresent()) ret_val++;
  if (field_additionalUpdateType.ispresent()) ret_val++;
  if (field_tMSIBasedNRIcontainer.ispresent()) ret_val++;
  if (field_t3324.ispresent()) ret_val++;
  if (field_t3312__ExtendedValue.ispresent()) ret_val++;
  if (field_extendedDRXParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AttachRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", msNetworkCapability := ");
field_msNetworkCapability.log();
TTCN_Logger::log_event_str(", attachType := ");
field_attachType.log();
TTCN_Logger::log_event_str(", gprsCKSN := ");
field_gprsCKSN.log();
TTCN_Logger::log_event_str(", drxParam := ");
field_drxParam.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(", oldRoutingAreaID := ");
field_oldRoutingAreaID.log();
TTCN_Logger::log_event_str(", msRACap := ");
field_msRACap.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", reqGPRStimer := ");
field_reqGPRStimer.log();
TTCN_Logger::log_event_str(", tmsiStatus := ");
field_tmsiStatus.log();
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
field_supportedCodecs.log();
TTCN_Logger::log_event_str(", uENetworkCapability := ");
field_uENetworkCapability.log();
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(", routingAreaIdentification2 := ");
field_routingAreaIdentification2.log();
TTCN_Logger::log_event_str(", voiceDomainandUEsUsageSetting := ");
field_voiceDomainandUEsUsageSetting.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(", additionalUpdateType := ");
field_additionalUpdateType.log();
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(", t3324 := ");
field_t3324.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
field_extendedDRXParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AttachRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (msNetworkCapability().is_bound()) msNetworkCapability().set_implicit_omit();
if (attachType().is_bound()) attachType().set_implicit_omit();
if (gprsCKSN().is_bound()) gprsCKSN().set_implicit_omit();
if (drxParam().is_bound()) drxParam().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
if (oldRoutingAreaID().is_bound()) oldRoutingAreaID().set_implicit_omit();
if (msRACap().is_bound()) msRACap().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!reqGPRStimer().is_bound()) reqGPRStimer() = OMIT_VALUE;
else reqGPRStimer().set_implicit_omit();
if (!tmsiStatus().is_bound()) tmsiStatus() = OMIT_VALUE;
else tmsiStatus().set_implicit_omit();
if (!pC__LCSCapability().is_bound()) pC__LCSCapability() = OMIT_VALUE;
else pC__LCSCapability().set_implicit_omit();
if (!mobileStationClassmark2().is_bound()) mobileStationClassmark2() = OMIT_VALUE;
else mobileStationClassmark2().set_implicit_omit();
if (!mobileStationClassmark3().is_bound()) mobileStationClassmark3() = OMIT_VALUE;
else mobileStationClassmark3().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!uENetworkCapability().is_bound()) uENetworkCapability() = OMIT_VALUE;
else uENetworkCapability().set_implicit_omit();
if (!additionalMobileIdentity().is_bound()) additionalMobileIdentity() = OMIT_VALUE;
else additionalMobileIdentity().set_implicit_omit();
if (!routingAreaIdentification2().is_bound()) routingAreaIdentification2() = OMIT_VALUE;
else routingAreaIdentification2().set_implicit_omit();
if (!voiceDomainandUEsUsageSetting().is_bound()) voiceDomainandUEsUsageSetting() = OMIT_VALUE;
else voiceDomainandUEsUsageSetting().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
if (!p__TMSI__Type().is_bound()) p__TMSI__Type() = OMIT_VALUE;
else p__TMSI__Type().set_implicit_omit();
if (!mS__NetworkFeatureSupport().is_bound()) mS__NetworkFeatureSupport() = OMIT_VALUE;
else mS__NetworkFeatureSupport().set_implicit_omit();
if (!oldLocationAreaIdentification().is_bound()) oldLocationAreaIdentification() = OMIT_VALUE;
else oldLocationAreaIdentification().set_implicit_omit();
if (!additionalUpdateType().is_bound()) additionalUpdateType() = OMIT_VALUE;
else additionalUpdateType().set_implicit_omit();
if (!tMSIBasedNRIcontainer().is_bound()) tMSIBasedNRIcontainer() = OMIT_VALUE;
else tMSIBasedNRIcontainer().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__AttachRequest::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 (28<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest has 28 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msNetworkCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) attachType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gprsCKSN().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) drxParam().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaID().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) msRACap().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) reqGPRStimer().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tmsiStatus().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapability().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapability().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) additionalMobileIdentity().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification2().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) voiceDomainandUEsUsageSetting().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__Type().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) oldLocationAreaIdentification().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateType().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) tMSIBasedNRIcontainer().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(27));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msNetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msNetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsCKSN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsCKSN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "drxParam")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          drxParam().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRACap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reqGPRStimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reqGPRStimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tmsiStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tmsiStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pC_LCSCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uENetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalMobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalMobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "voiceDomainandUEsUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainandUEsUsageSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_NetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__NetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldLocationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldLocationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSIBasedNRIcontainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSIBasedNRIcontainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
  }
}

void PDU__GMM__AttachRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_msNetworkCapability.encode_text(text_buf);
field_attachType.encode_text(text_buf);
field_gprsCKSN.encode_text(text_buf);
field_drxParam.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
field_oldRoutingAreaID.encode_text(text_buf);
field_msRACap.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
field_reqGPRStimer.encode_text(text_buf);
field_tmsiStatus.encode_text(text_buf);
field_pC__LCSCapability.encode_text(text_buf);
field_mobileStationClassmark2.encode_text(text_buf);
field_mobileStationClassmark3.encode_text(text_buf);
field_supportedCodecs.encode_text(text_buf);
field_uENetworkCapability.encode_text(text_buf);
field_additionalMobileIdentity.encode_text(text_buf);
field_routingAreaIdentification2.encode_text(text_buf);
field_voiceDomainandUEsUsageSetting.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
field_p__TMSI__Type.encode_text(text_buf);
field_mS__NetworkFeatureSupport.encode_text(text_buf);
field_oldLocationAreaIdentification.encode_text(text_buf);
field_additionalUpdateType.encode_text(text_buf);
field_tMSIBasedNRIcontainer.encode_text(text_buf);
field_t3324.encode_text(text_buf);
field_t3312__ExtendedValue.encode_text(text_buf);
field_extendedDRXParameters.encode_text(text_buf);
}

void PDU__GMM__AttachRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_msNetworkCapability.decode_text(text_buf);
field_attachType.decode_text(text_buf);
field_gprsCKSN.decode_text(text_buf);
field_drxParam.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
field_oldRoutingAreaID.decode_text(text_buf);
field_msRACap.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
field_reqGPRStimer.decode_text(text_buf);
field_tmsiStatus.decode_text(text_buf);
field_pC__LCSCapability.decode_text(text_buf);
field_mobileStationClassmark2.decode_text(text_buf);
field_mobileStationClassmark3.decode_text(text_buf);
field_supportedCodecs.decode_text(text_buf);
field_uENetworkCapability.decode_text(text_buf);
field_additionalMobileIdentity.decode_text(text_buf);
field_routingAreaIdentification2.decode_text(text_buf);
field_voiceDomainandUEsUsageSetting.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
field_p__TMSI__Type.decode_text(text_buf);
field_mS__NetworkFeatureSupport.decode_text(text_buf);
field_oldLocationAreaIdentification.decode_text(text_buf);
field_additionalUpdateType.decode_text(text_buf);
field_tMSIBasedNRIcontainer.decode_text(text_buf);
field_t3324.decode_text(text_buf);
field_t3312__ExtendedValue.decode_text(text_buf);
field_extendedDRXParameters.decode_text(text_buf);
}

void PDU__GMM__AttachRequest::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__AttachRequest::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__AttachRequest::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, MSNetworkCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_msNetworkCapability.RAW_decode(MSNetworkCapabilityLV_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, AttachTypeV_descr_.raw->forceomit);
  decoded_field_length = field_attachType.RAW_decode(AttachTypeV_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, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_gprsCKSN.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_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, DRXParameterV_descr_.raw->forceomit);
  decoded_field_length = field_drxParam.RAW_decode(DRXParameterV_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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_oldRoutingAreaID.RAW_decode(RoutingAreaIdentificationV_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, MSRadioAccessCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_msRACap.RAW_decode(MSRadioAccessCapabilityLV_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){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_reqGPRStimer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, GPRSTimerTV_descr_.raw->forceomit);
  decoded_field_length = field_reqGPRStimer().RAW_decode(GPRSTimerTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_reqGPRStimer = 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_reqGPRStimer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_tmsiStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, TMSIStatusTV_descr_.raw->forceomit);
  decoded_field_length = field_tmsiStatus().RAW_decode(TMSIStatusTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_tmsiStatus = 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_tmsiStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_pC__LCSCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, PC__LCSCapability_descr_.raw->forceomit);
  decoded_field_length = field_pC__LCSCapability().RAW_decode(PC__LCSCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_pC__LCSCapability = 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_pC__LCSCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_mobileStationClassmark2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark2 = 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_mobileStationClassmark2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_mobileStationClassmark3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark3().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark3 = 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_mobileStationClassmark3=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_supportedCodecs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw->forceomit);
  decoded_field_length = field_supportedCodecs().RAW_decode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_supportedCodecs = 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_supportedCodecs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_uENetworkCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, UENetworkCapabilityTLV_descr_.raw->forceomit);
  decoded_field_length = field_uENetworkCapability().RAW_decode(UENetworkCapabilityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_uENetworkCapability = 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_uENetworkCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_additionalMobileIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_additionalMobileIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_additionalMobileIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_additionalMobileIdentity.ispresent() || field_additionalMobileIdentity().elementIdentifier() !=  bs_23){
  field_additionalMobileIdentity=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_additionalMobileIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_routingAreaIdentification2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification2().RAW_decode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_routingAreaIdentification2 = 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_routingAreaIdentification2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_voiceDomainandUEsUsageSetting = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, VoiceDomainPreferenceandUEsUsageSettingTLV_descr_.raw->forceomit);
  decoded_field_length = field_voiceDomainandUEsUsageSetting().RAW_decode(VoiceDomainPreferenceandUEsUsageSettingTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_voiceDomainandUEsUsageSetting = 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_voiceDomainandUEsUsageSetting=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_p__TMSI__Type = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw->forceomit);
  decoded_field_length = field_p__TMSI__Type().RAW_decode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_p__TMSI__Type = 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_p__TMSI__Type=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_mS__NetworkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw->forceomit);
  decoded_field_length = field_mS__NetworkFeatureSupport().RAW_decode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_mS__NetworkFeatureSupport = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mS__NetworkFeatureSupport.ispresent() || field_mS__NetworkFeatureSupport().elementIdentifier() !=  bs_21){
  field_mS__NetworkFeatureSupport=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_mS__NetworkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_oldLocationAreaIdentification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, LocationAreaIdentification2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_oldLocationAreaIdentification().RAW_decode(LocationAreaIdentification2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_oldLocationAreaIdentification = 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_oldLocationAreaIdentification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_additionalUpdateType = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, AdditionalUpdateTypeTV_descr_.raw->forceomit);
  decoded_field_length = field_additionalUpdateType().RAW_decode(AdditionalUpdateTypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_additionalUpdateType = 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_additionalUpdateType=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_tMSIBasedNRIcontainer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, NetworkResourceIdentifierContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_tMSIBasedNRIcontainer().RAW_decode(NetworkResourceIdentifierContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_tMSIBasedNRIcontainer = 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_tMSIBasedNRIcontainer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(25)) {
    field_t3324 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3324().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_25_force_omit);
  if (decoded_field_length < 1) {
  field_t3324 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31){
  field_t3324=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_t3324=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(26)) {
    field_t3312__ExtendedValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_26_force_omit(26, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3312__ExtendedValue().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_26_force_omit);
  if (decoded_field_length < 1) {
  field_t3312__ExtendedValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17){
  field_t3312__ExtendedValue=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_t3312__ExtendedValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(27)) {
    field_extendedDRXParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_27_force_omit(27, force_omit, ExtendedDRXParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_extendedDRXParameters().RAW_decode(ExtendedDRXParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_27_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDRXParameters = 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_extendedDRXParameters=OMIT_VALUE;
  if (field_messageType !=  bs_22) 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__GMM__AttachRequest::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 = 28;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(28);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MSNetworkCapabilityLV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, AttachTypeV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, DRXParameterV_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RoutingAreaIdentificationV_descr_.raw);
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MSRadioAccessCapabilityLV_descr_.raw);
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_reqGPRStimer.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, GPRSTimerTV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_tmsiStatus.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, TMSIStatusTV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_pC__LCSCapability.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, PC__LCSCapability_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_mobileStationClassmark2.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_mobileStationClassmark3.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_supportedCodecs.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_uENetworkCapability.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, UENetworkCapabilityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_additionalMobileIdentity.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_routingAreaIdentification2.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_voiceDomainandUEsUsageSetting.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, VoiceDomainPreferenceandUEsUsageSettingTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_p__TMSI__Type.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_oldLocationAreaIdentification.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, LocationAreaIdentification2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_additionalUpdateType.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, AdditionalUpdateTypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_tMSIBasedNRIcontainer.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, NetworkResourceIdentifierContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_t3324.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = NULL;
  if (field_t3312__ExtendedValue.ispresent()) {
  myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 26, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[26] = NULL;
  if (field_extendedDRXParameters.ispresent()) {
  myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 27, ExtendedDRXParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[27] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_msNetworkCapability.RAW_encode(MSNetworkCapabilityLV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_attachType.RAW_encode(AttachTypeV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_gprsCKSN.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_drxParam.RAW_encode(DRXParameterV_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_mobileIdentity.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_oldRoutingAreaID.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[6]);
  encoded_length += field_msRACap.RAW_encode(MSRadioAccessCapabilityLV_descr_, *myleaf.body.node.nodes[7]);
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_reqGPRStimer.ispresent()) {
  encoded_length += field_reqGPRStimer().RAW_encode(GPRSTimerTV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_tmsiStatus.ispresent()) {
  encoded_length += field_tmsiStatus().RAW_encode(TMSIStatusTV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_pC__LCSCapability.ispresent()) {
  encoded_length += field_pC__LCSCapability().RAW_encode(PC__LCSCapability_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_mobileStationClassmark2.ispresent()) {
  encoded_length += field_mobileStationClassmark2().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_mobileStationClassmark3.ispresent()) {
  encoded_length += field_mobileStationClassmark3().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_supportedCodecs.ispresent()) {
  encoded_length += field_supportedCodecs().RAW_encode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_uENetworkCapability.ispresent()) {
  encoded_length += field_uENetworkCapability().RAW_encode(UENetworkCapabilityTLV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_additionalMobileIdentity.ispresent()) {
  encoded_length += field_additionalMobileIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_routingAreaIdentification2.ispresent()) {
  encoded_length += field_routingAreaIdentification2().RAW_encode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_voiceDomainandUEsUsageSetting.ispresent()) {
  encoded_length += field_voiceDomainandUEsUsageSetting().RAW_encode(VoiceDomainPreferenceandUEsUsageSettingTLV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_p__TMSI__Type.ispresent()) {
  encoded_length += field_p__TMSI__Type().RAW_encode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  encoded_length += field_mS__NetworkFeatureSupport().RAW_encode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_oldLocationAreaIdentification.ispresent()) {
  encoded_length += field_oldLocationAreaIdentification().RAW_encode(LocationAreaIdentification2__TLV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_additionalUpdateType.ispresent()) {
  encoded_length += field_additionalUpdateType().RAW_encode(AdditionalUpdateTypeTV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_tMSIBasedNRIcontainer.ispresent()) {
  encoded_length += field_tMSIBasedNRIcontainer().RAW_encode(NetworkResourceIdentifierContainerTLV_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_t3324.ispresent()) {
  encoded_length += field_t3324().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_t3312__ExtendedValue.ispresent()) {
  encoded_length += field_t3312__ExtendedValue().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[26]);
  }
  if (field_extendedDRXParameters.ispresent()) {
  encoded_length += field_extendedDRXParameters().RAW_encode(ExtendedDRXParametersTLV_descr_, *myleaf.body.node.nodes[27]);
  }
  if (field_additionalMobileIdentity.ispresent() && (!field_additionalMobileIdentity.ispresent() || field_additionalMobileIdentity().elementIdentifier() !=  bs_23)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={16,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_23.RAW_encode(General__Types::BIT7_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_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_24.RAW_encode(General__Types::BIT4_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_mS__NetworkFeatureSupport.ispresent() && (!field_mS__NetworkFeatureSupport.ispresent() || field_mS__NetworkFeatureSupport().elementIdentifier() !=  bs_21)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={21,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_21.RAW_encode(General__Types::BIT4_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_t3324.ispresent() && (!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={25,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_31.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);
  }
  }
  if (field_t3312__ExtendedValue.ispresent() && (!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={26,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.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);
  }
  }
  if (field_messageType !=  bs_22) {
  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_22.RAW_encode(General__Types::BIT8_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__GMM__AttachRequest_template::single_value_struct {
BITSTRING_template field_messageType;
MSNetworkCapabilityLV_template field_msNetworkCapability;
AttachTypeV_template field_attachType;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_gprsCKSN;
DRXParameterV_template field_drxParam;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity;
RoutingAreaIdentificationV_template field_oldRoutingAreaID;
MSRadioAccessCapabilityLV_template field_msRACap;
P__TMSISignatureTV_template field_ptmsiSignature;
GPRSTimerTV_template field_reqGPRStimer;
TMSIStatusTV_template field_tmsiStatus;
PC__LCSCapability_template field_pC__LCSCapability;
MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template field_mobileStationClassmark2;
MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template field_mobileStationClassmark3;
MobileL3__CommonIE__Types::SupportedCodecList_template field_supportedCodecs;
UENetworkCapabilityTLV_template field_uENetworkCapability;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_additionalMobileIdentity;
MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template field_routingAreaIdentification2;
VoiceDomainPreferenceandUEsUsageSettingTLV_template field_voiceDomainandUEsUsageSetting;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
MobileL3__CommonIE__Types::P__TMSI__TypeTV_template field_p__TMSI__Type;
MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template field_mS__NetworkFeatureSupport;
LocationAreaIdentification2__TLV_template field_oldLocationAreaIdentification;
AdditionalUpdateTypeTV_template field_additionalUpdateType;
NetworkResourceIdentifierContainerTLV_template field_tMSIBasedNRIcontainer;
GPRSTimer2TLV_template field_t3324;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_t3312__ExtendedValue;
ExtendedDRXParametersTLV_template field_extendedDRXParameters;
};

void PDU__GMM__AttachRequest_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_messageType = ANY_VALUE;
single_value->field_msNetworkCapability = ANY_VALUE;
single_value->field_attachType = ANY_VALUE;
single_value->field_gprsCKSN = ANY_VALUE;
single_value->field_drxParam = ANY_VALUE;
single_value->field_mobileIdentity = ANY_VALUE;
single_value->field_oldRoutingAreaID = ANY_VALUE;
single_value->field_msRACap = ANY_VALUE;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
single_value->field_reqGPRStimer = ANY_OR_OMIT;
single_value->field_tmsiStatus = ANY_OR_OMIT;
single_value->field_pC__LCSCapability = ANY_OR_OMIT;
single_value->field_mobileStationClassmark2 = ANY_OR_OMIT;
single_value->field_mobileStationClassmark3 = ANY_OR_OMIT;
single_value->field_supportedCodecs = ANY_OR_OMIT;
single_value->field_uENetworkCapability = ANY_OR_OMIT;
single_value->field_additionalMobileIdentity = ANY_OR_OMIT;
single_value->field_routingAreaIdentification2 = ANY_OR_OMIT;
single_value->field_voiceDomainandUEsUsageSetting = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
single_value->field_p__TMSI__Type = ANY_OR_OMIT;
single_value->field_mS__NetworkFeatureSupport = ANY_OR_OMIT;
single_value->field_oldLocationAreaIdentification = ANY_OR_OMIT;
single_value->field_additionalUpdateType = ANY_OR_OMIT;
single_value->field_tMSIBasedNRIcontainer = ANY_OR_OMIT;
single_value->field_t3324 = ANY_OR_OMIT;
single_value->field_t3312__ExtendedValue = ANY_OR_OMIT;
single_value->field_extendedDRXParameters = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AttachRequest_template::copy_value(const PDU__GMM__AttachRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.msNetworkCapability().is_bound()) {
  single_value->field_msNetworkCapability = other_value.msNetworkCapability();
} else {
  single_value->field_msNetworkCapability.clean_up();
}
if (other_value.attachType().is_bound()) {
  single_value->field_attachType = other_value.attachType();
} else {
  single_value->field_attachType.clean_up();
}
if (other_value.gprsCKSN().is_bound()) {
  single_value->field_gprsCKSN = other_value.gprsCKSN();
} else {
  single_value->field_gprsCKSN.clean_up();
}
if (other_value.drxParam().is_bound()) {
  single_value->field_drxParam = other_value.drxParam();
} else {
  single_value->field_drxParam.clean_up();
}
if (other_value.mobileIdentity().is_bound()) {
  single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
  single_value->field_mobileIdentity.clean_up();
}
if (other_value.oldRoutingAreaID().is_bound()) {
  single_value->field_oldRoutingAreaID = other_value.oldRoutingAreaID();
} else {
  single_value->field_oldRoutingAreaID.clean_up();
}
if (other_value.msRACap().is_bound()) {
  single_value->field_msRACap = other_value.msRACap();
} else {
  single_value->field_msRACap.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
if (other_value.reqGPRStimer().is_bound()) {
  if (other_value.reqGPRStimer().ispresent()) single_value->field_reqGPRStimer = other_value.reqGPRStimer()();
  else single_value->field_reqGPRStimer = OMIT_VALUE;
} else {
  single_value->field_reqGPRStimer.clean_up();
}
if (other_value.tmsiStatus().is_bound()) {
  if (other_value.tmsiStatus().ispresent()) single_value->field_tmsiStatus = other_value.tmsiStatus()();
  else single_value->field_tmsiStatus = OMIT_VALUE;
} else {
  single_value->field_tmsiStatus.clean_up();
}
if (other_value.pC__LCSCapability().is_bound()) {
  if (other_value.pC__LCSCapability().ispresent()) single_value->field_pC__LCSCapability = other_value.pC__LCSCapability()();
  else single_value->field_pC__LCSCapability = OMIT_VALUE;
} else {
  single_value->field_pC__LCSCapability.clean_up();
}
if (other_value.mobileStationClassmark2().is_bound()) {
  if (other_value.mobileStationClassmark2().ispresent()) single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2()();
  else single_value->field_mobileStationClassmark2 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark2.clean_up();
}
if (other_value.mobileStationClassmark3().is_bound()) {
  if (other_value.mobileStationClassmark3().ispresent()) single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3()();
  else single_value->field_mobileStationClassmark3 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark3.clean_up();
}
if (other_value.supportedCodecs().is_bound()) {
  if (other_value.supportedCodecs().ispresent()) single_value->field_supportedCodecs = other_value.supportedCodecs()();
  else single_value->field_supportedCodecs = OMIT_VALUE;
} else {
  single_value->field_supportedCodecs.clean_up();
}
if (other_value.uENetworkCapability().is_bound()) {
  if (other_value.uENetworkCapability().ispresent()) single_value->field_uENetworkCapability = other_value.uENetworkCapability()();
  else single_value->field_uENetworkCapability = OMIT_VALUE;
} else {
  single_value->field_uENetworkCapability.clean_up();
}
if (other_value.additionalMobileIdentity().is_bound()) {
  if (other_value.additionalMobileIdentity().ispresent()) single_value->field_additionalMobileIdentity = other_value.additionalMobileIdentity()();
  else single_value->field_additionalMobileIdentity = OMIT_VALUE;
} else {
  single_value->field_additionalMobileIdentity.clean_up();
}
if (other_value.routingAreaIdentification2().is_bound()) {
  if (other_value.routingAreaIdentification2().ispresent()) single_value->field_routingAreaIdentification2 = other_value.routingAreaIdentification2()();
  else single_value->field_routingAreaIdentification2 = OMIT_VALUE;
} else {
  single_value->field_routingAreaIdentification2.clean_up();
}
if (other_value.voiceDomainandUEsUsageSetting().is_bound()) {
  if (other_value.voiceDomainandUEsUsageSetting().ispresent()) single_value->field_voiceDomainandUEsUsageSetting = other_value.voiceDomainandUEsUsageSetting()();
  else single_value->field_voiceDomainandUEsUsageSetting = OMIT_VALUE;
} else {
  single_value->field_voiceDomainandUEsUsageSetting.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
if (other_value.p__TMSI__Type().is_bound()) {
  if (other_value.p__TMSI__Type().ispresent()) single_value->field_p__TMSI__Type = other_value.p__TMSI__Type()();
  else single_value->field_p__TMSI__Type = OMIT_VALUE;
} else {
  single_value->field_p__TMSI__Type.clean_up();
}
if (other_value.mS__NetworkFeatureSupport().is_bound()) {
  if (other_value.mS__NetworkFeatureSupport().ispresent()) single_value->field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport()();
  else single_value->field_mS__NetworkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_mS__NetworkFeatureSupport.clean_up();
}
if (other_value.oldLocationAreaIdentification().is_bound()) {
  if (other_value.oldLocationAreaIdentification().ispresent()) single_value->field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification()();
  else single_value->field_oldLocationAreaIdentification = OMIT_VALUE;
} else {
  single_value->field_oldLocationAreaIdentification.clean_up();
}
if (other_value.additionalUpdateType().is_bound()) {
  if (other_value.additionalUpdateType().ispresent()) single_value->field_additionalUpdateType = other_value.additionalUpdateType()();
  else single_value->field_additionalUpdateType = OMIT_VALUE;
} else {
  single_value->field_additionalUpdateType.clean_up();
}
if (other_value.tMSIBasedNRIcontainer().is_bound()) {
  if (other_value.tMSIBasedNRIcontainer().ispresent()) single_value->field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer()();
  else single_value->field_tMSIBasedNRIcontainer = OMIT_VALUE;
} else {
  single_value->field_tMSIBasedNRIcontainer.clean_up();
}
if (other_value.t3324().is_bound()) {
  if (other_value.t3324().ispresent()) single_value->field_t3324 = other_value.t3324()();
  else single_value->field_t3324 = OMIT_VALUE;
} else {
  single_value->field_t3324.clean_up();
}
if (other_value.t3312__ExtendedValue().is_bound()) {
  if (other_value.t3312__ExtendedValue().ispresent()) single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue()();
  else single_value->field_t3312__ExtendedValue = OMIT_VALUE;
} else {
  single_value->field_t3312__ExtendedValue.clean_up();
}
if (other_value.extendedDRXParameters().is_bound()) {
  if (other_value.extendedDRXParameters().ispresent()) single_value->field_extendedDRXParameters = other_value.extendedDRXParameters()();
  else single_value->field_extendedDRXParameters = OMIT_VALUE;
} else {
  single_value->field_extendedDRXParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AttachRequest_template::copy_template(const PDU__GMM__AttachRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msNetworkCapability().get_selection()) {
single_value->field_msNetworkCapability = other_value.msNetworkCapability();
} else {
single_value->field_msNetworkCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.attachType().get_selection()) {
single_value->field_attachType = other_value.attachType();
} else {
single_value->field_attachType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gprsCKSN().get_selection()) {
single_value->field_gprsCKSN = other_value.gprsCKSN();
} else {
single_value->field_gprsCKSN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.drxParam().get_selection()) {
single_value->field_drxParam = other_value.drxParam();
} else {
single_value->field_drxParam.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity().get_selection()) {
single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
single_value->field_mobileIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldRoutingAreaID().get_selection()) {
single_value->field_oldRoutingAreaID = other_value.oldRoutingAreaID();
} else {
single_value->field_oldRoutingAreaID.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msRACap().get_selection()) {
single_value->field_msRACap = other_value.msRACap();
} else {
single_value->field_msRACap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.reqGPRStimer().get_selection()) {
single_value->field_reqGPRStimer = other_value.reqGPRStimer();
} else {
single_value->field_reqGPRStimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tmsiStatus().get_selection()) {
single_value->field_tmsiStatus = other_value.tmsiStatus();
} else {
single_value->field_tmsiStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pC__LCSCapability().get_selection()) {
single_value->field_pC__LCSCapability = other_value.pC__LCSCapability();
} else {
single_value->field_pC__LCSCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark2().get_selection()) {
single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
single_value->field_mobileStationClassmark2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark3().get_selection()) {
single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
} else {
single_value->field_mobileStationClassmark3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supportedCodecs().get_selection()) {
single_value->field_supportedCodecs = other_value.supportedCodecs();
} else {
single_value->field_supportedCodecs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uENetworkCapability().get_selection()) {
single_value->field_uENetworkCapability = other_value.uENetworkCapability();
} else {
single_value->field_uENetworkCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalMobileIdentity().get_selection()) {
single_value->field_additionalMobileIdentity = other_value.additionalMobileIdentity();
} else {
single_value->field_additionalMobileIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaIdentification2().get_selection()) {
single_value->field_routingAreaIdentification2 = other_value.routingAreaIdentification2();
} else {
single_value->field_routingAreaIdentification2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.voiceDomainandUEsUsageSetting().get_selection()) {
single_value->field_voiceDomainandUEsUsageSetting = other_value.voiceDomainandUEsUsageSetting();
} else {
single_value->field_voiceDomainandUEsUsageSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p__TMSI__Type().get_selection()) {
single_value->field_p__TMSI__Type = other_value.p__TMSI__Type();
} else {
single_value->field_p__TMSI__Type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__NetworkFeatureSupport().get_selection()) {
single_value->field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
} else {
single_value->field_mS__NetworkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldLocationAreaIdentification().get_selection()) {
single_value->field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
} else {
single_value->field_oldLocationAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalUpdateType().get_selection()) {
single_value->field_additionalUpdateType = other_value.additionalUpdateType();
} else {
single_value->field_additionalUpdateType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tMSIBasedNRIcontainer().get_selection()) {
single_value->field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
} else {
single_value->field_tMSIBasedNRIcontainer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3324().get_selection()) {
single_value->field_t3324 = other_value.t3324();
} else {
single_value->field_t3324.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3312__ExtendedValue().get_selection()) {
single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
} else {
single_value->field_t3312__ExtendedValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDRXParameters().get_selection()) {
single_value->field_extendedDRXParameters = other_value.extendedDRXParameters();
} else {
single_value->field_extendedDRXParameters.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__GMM__AttachRequest_template[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__GMM__AttachRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AttachRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__AttachRequest_template::PDU__GMM__AttachRequest_template()
{
}

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

PDU__GMM__AttachRequest_template::PDU__GMM__AttachRequest_template(const PDU__GMM__AttachRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__AttachRequest_template& PDU__GMM__AttachRequest_template::operator=(const OPTIONAL<PDU__GMM__AttachRequest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__AttachRequest&)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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
}
return *this;
}

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

boolean PDU__GMM__AttachRequest_template::match(const PDU__GMM__AttachRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.msNetworkCapability().is_bound()) return FALSE;
if(!single_value->field_msNetworkCapability.match(other_value.msNetworkCapability(), legacy))return FALSE;
if(!other_value.attachType().is_bound()) return FALSE;
if(!single_value->field_attachType.match(other_value.attachType(), legacy))return FALSE;
if(!other_value.gprsCKSN().is_bound()) return FALSE;
if(!single_value->field_gprsCKSN.match(other_value.gprsCKSN(), legacy))return FALSE;
if(!other_value.drxParam().is_bound()) return FALSE;
if(!single_value->field_drxParam.match(other_value.drxParam(), legacy))return FALSE;
if(!other_value.mobileIdentity().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity.match(other_value.mobileIdentity(), legacy))return FALSE;
if(!other_value.oldRoutingAreaID().is_bound()) return FALSE;
if(!single_value->field_oldRoutingAreaID.match(other_value.oldRoutingAreaID(), legacy))return FALSE;
if(!other_value.msRACap().is_bound()) return FALSE;
if(!single_value->field_msRACap.match(other_value.msRACap(), legacy))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const P__TMSISignatureTV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.match_omit(legacy)))return FALSE;
if(!other_value.reqGPRStimer().is_bound()) return FALSE;
if((other_value.reqGPRStimer().ispresent() ? !single_value->field_reqGPRStimer.match((const GPRSTimerTV&)other_value.reqGPRStimer(), legacy) : !single_value->field_reqGPRStimer.match_omit(legacy)))return FALSE;
if(!other_value.tmsiStatus().is_bound()) return FALSE;
if((other_value.tmsiStatus().ispresent() ? !single_value->field_tmsiStatus.match((const TMSIStatusTV&)other_value.tmsiStatus(), legacy) : !single_value->field_tmsiStatus.match_omit(legacy)))return FALSE;
if(!other_value.pC__LCSCapability().is_bound()) return FALSE;
if((other_value.pC__LCSCapability().ispresent() ? !single_value->field_pC__LCSCapability.match((const PC__LCSCapability&)other_value.pC__LCSCapability(), legacy) : !single_value->field_pC__LCSCapability.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark2().is_bound()) return FALSE;
if((other_value.mobileStationClassmark2().ispresent() ? !single_value->field_mobileStationClassmark2.match((const MobileL3__CommonIE__Types::MobileStationClassmark2__TLV&)other_value.mobileStationClassmark2(), legacy) : !single_value->field_mobileStationClassmark2.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark3().is_bound()) return FALSE;
if((other_value.mobileStationClassmark3().ispresent() ? !single_value->field_mobileStationClassmark3.match((const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV&)other_value.mobileStationClassmark3(), legacy) : !single_value->field_mobileStationClassmark3.match_omit(legacy)))return FALSE;
if(!other_value.supportedCodecs().is_bound()) return FALSE;
if((other_value.supportedCodecs().ispresent() ? !single_value->field_supportedCodecs.match((const MobileL3__CommonIE__Types::SupportedCodecList&)other_value.supportedCodecs(), legacy) : !single_value->field_supportedCodecs.match_omit(legacy)))return FALSE;
if(!other_value.uENetworkCapability().is_bound()) return FALSE;
if((other_value.uENetworkCapability().ispresent() ? !single_value->field_uENetworkCapability.match((const UENetworkCapabilityTLV&)other_value.uENetworkCapability(), legacy) : !single_value->field_uENetworkCapability.match_omit(legacy)))return FALSE;
if(!other_value.additionalMobileIdentity().is_bound()) return FALSE;
if((other_value.additionalMobileIdentity().ispresent() ? !single_value->field_additionalMobileIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.additionalMobileIdentity(), legacy) : !single_value->field_additionalMobileIdentity.match_omit(legacy)))return FALSE;
if(!other_value.routingAreaIdentification2().is_bound()) return FALSE;
if((other_value.routingAreaIdentification2().ispresent() ? !single_value->field_routingAreaIdentification2.match((const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV&)other_value.routingAreaIdentification2(), legacy) : !single_value->field_routingAreaIdentification2.match_omit(legacy)))return FALSE;
if(!other_value.voiceDomainandUEsUsageSetting().is_bound()) return FALSE;
if((other_value.voiceDomainandUEsUsageSetting().ispresent() ? !single_value->field_voiceDomainandUEsUsageSetting.match((const VoiceDomainPreferenceandUEsUsageSettingTLV&)other_value.voiceDomainandUEsUsageSetting(), legacy) : !single_value->field_voiceDomainandUEsUsageSetting.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.match_omit(legacy)))return FALSE;
if(!other_value.p__TMSI__Type().is_bound()) return FALSE;
if((other_value.p__TMSI__Type().ispresent() ? !single_value->field_p__TMSI__Type.match((const MobileL3__CommonIE__Types::P__TMSI__TypeTV&)other_value.p__TMSI__Type(), legacy) : !single_value->field_p__TMSI__Type.match_omit(legacy)))return FALSE;
if(!other_value.mS__NetworkFeatureSupport().is_bound()) return FALSE;
if((other_value.mS__NetworkFeatureSupport().ispresent() ? !single_value->field_mS__NetworkFeatureSupport.match((const MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV&)other_value.mS__NetworkFeatureSupport(), legacy) : !single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.oldLocationAreaIdentification().is_bound()) return FALSE;
if((other_value.oldLocationAreaIdentification().ispresent() ? !single_value->field_oldLocationAreaIdentification.match((const LocationAreaIdentification2__TLV&)other_value.oldLocationAreaIdentification(), legacy) : !single_value->field_oldLocationAreaIdentification.match_omit(legacy)))return FALSE;
if(!other_value.additionalUpdateType().is_bound()) return FALSE;
if((other_value.additionalUpdateType().ispresent() ? !single_value->field_additionalUpdateType.match((const AdditionalUpdateTypeTV&)other_value.additionalUpdateType(), legacy) : !single_value->field_additionalUpdateType.match_omit(legacy)))return FALSE;
if(!other_value.tMSIBasedNRIcontainer().is_bound()) return FALSE;
if((other_value.tMSIBasedNRIcontainer().ispresent() ? !single_value->field_tMSIBasedNRIcontainer.match((const NetworkResourceIdentifierContainerTLV&)other_value.tMSIBasedNRIcontainer(), legacy) : !single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)))return FALSE;
if(!other_value.t3324().is_bound()) return FALSE;
if((other_value.t3324().ispresent() ? !single_value->field_t3324.match((const GPRSTimer2TLV&)other_value.t3324(), legacy) : !single_value->field_t3324.match_omit(legacy)))return FALSE;
if(!other_value.t3312__ExtendedValue().is_bound()) return FALSE;
if((other_value.t3312__ExtendedValue().ispresent() ? !single_value->field_t3312__ExtendedValue.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.t3312__ExtendedValue(), legacy) : !single_value->field_t3312__ExtendedValue.match_omit(legacy)))return FALSE;
if(!other_value.extendedDRXParameters().is_bound()) return FALSE;
if((other_value.extendedDRXParameters().ispresent() ? !single_value->field_extendedDRXParameters.match((const ExtendedDRXParametersTLV&)other_value.extendedDRXParameters(), legacy) : !single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
}
return FALSE;
}

boolean PDU__GMM__AttachRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_msNetworkCapability.is_bound()
 || single_value->field_attachType.is_bound()
 || single_value->field_gprsCKSN.is_bound()
 || single_value->field_drxParam.is_bound()
 || single_value->field_mobileIdentity.is_bound()
 || single_value->field_oldRoutingAreaID.is_bound()
 || single_value->field_msRACap.is_bound()
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound())
 || (single_value->field_reqGPRStimer.is_omit() || single_value->field_reqGPRStimer.is_bound())
 || (single_value->field_tmsiStatus.is_omit() || single_value->field_tmsiStatus.is_bound())
 || (single_value->field_pC__LCSCapability.is_omit() || single_value->field_pC__LCSCapability.is_bound())
 || (single_value->field_mobileStationClassmark2.is_omit() || single_value->field_mobileStationClassmark2.is_bound())
 || (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_bound())
 || (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_bound())
 || (single_value->field_uENetworkCapability.is_omit() || single_value->field_uENetworkCapability.is_bound())
 || (single_value->field_additionalMobileIdentity.is_omit() || single_value->field_additionalMobileIdentity.is_bound())
 || (single_value->field_routingAreaIdentification2.is_omit() || single_value->field_routingAreaIdentification2.is_bound())
 || (single_value->field_voiceDomainandUEsUsageSetting.is_omit() || single_value->field_voiceDomainandUEsUsageSetting.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound())
 || (single_value->field_p__TMSI__Type.is_omit() || single_value->field_p__TMSI__Type.is_bound())
 || (single_value->field_mS__NetworkFeatureSupport.is_omit() || single_value->field_mS__NetworkFeatureSupport.is_bound())
 || (single_value->field_oldLocationAreaIdentification.is_omit() || single_value->field_oldLocationAreaIdentification.is_bound())
 || (single_value->field_additionalUpdateType.is_omit() || single_value->field_additionalUpdateType.is_bound())
 || (single_value->field_tMSIBasedNRIcontainer.is_omit() || single_value->field_tMSIBasedNRIcontainer.is_bound())
 || (single_value->field_t3324.is_omit() || single_value->field_t3324.is_bound())
 || (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_bound())
 || (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_bound());
}

boolean PDU__GMM__AttachRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_msNetworkCapability.is_value()
 && single_value->field_attachType.is_value()
 && single_value->field_gprsCKSN.is_value()
 && single_value->field_drxParam.is_value()
 && single_value->field_mobileIdentity.is_value()
 && single_value->field_oldRoutingAreaID.is_value()
 && single_value->field_msRACap.is_value()
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value())
 && (single_value->field_reqGPRStimer.is_omit() || single_value->field_reqGPRStimer.is_value())
 && (single_value->field_tmsiStatus.is_omit() || single_value->field_tmsiStatus.is_value())
 && (single_value->field_pC__LCSCapability.is_omit() || single_value->field_pC__LCSCapability.is_value())
 && (single_value->field_mobileStationClassmark2.is_omit() || single_value->field_mobileStationClassmark2.is_value())
 && (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_value())
 && (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_value())
 && (single_value->field_uENetworkCapability.is_omit() || single_value->field_uENetworkCapability.is_value())
 && (single_value->field_additionalMobileIdentity.is_omit() || single_value->field_additionalMobileIdentity.is_value())
 && (single_value->field_routingAreaIdentification2.is_omit() || single_value->field_routingAreaIdentification2.is_value())
 && (single_value->field_voiceDomainandUEsUsageSetting.is_omit() || single_value->field_voiceDomainandUEsUsageSetting.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value())
 && (single_value->field_p__TMSI__Type.is_omit() || single_value->field_p__TMSI__Type.is_value())
 && (single_value->field_mS__NetworkFeatureSupport.is_omit() || single_value->field_mS__NetworkFeatureSupport.is_value())
 && (single_value->field_oldLocationAreaIdentification.is_omit() || single_value->field_oldLocationAreaIdentification.is_value())
 && (single_value->field_additionalUpdateType.is_omit() || single_value->field_additionalUpdateType.is_value())
 && (single_value->field_tMSIBasedNRIcontainer.is_omit() || single_value->field_tMSIBasedNRIcontainer.is_value())
 && (single_value->field_t3324.is_omit() || single_value->field_t3324.is_value())
 && (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_value())
 && (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_value());
}

void PDU__GMM__AttachRequest_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__GMM__AttachRequest PDU__GMM__AttachRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
PDU__GMM__AttachRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_msNetworkCapability.is_bound()) {
ret_val.msNetworkCapability() = single_value->field_msNetworkCapability.valueof();
}
if (single_value->field_attachType.is_bound()) {
ret_val.attachType() = single_value->field_attachType.valueof();
}
if (single_value->field_gprsCKSN.is_bound()) {
ret_val.gprsCKSN() = single_value->field_gprsCKSN.valueof();
}
if (single_value->field_drxParam.is_bound()) {
ret_val.drxParam() = single_value->field_drxParam.valueof();
}
if (single_value->field_mobileIdentity.is_bound()) {
ret_val.mobileIdentity() = single_value->field_mobileIdentity.valueof();
}
if (single_value->field_oldRoutingAreaID.is_bound()) {
ret_val.oldRoutingAreaID() = single_value->field_oldRoutingAreaID.valueof();
}
if (single_value->field_msRACap.is_bound()) {
ret_val.msRACap() = single_value->field_msRACap.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
if (single_value->field_reqGPRStimer.is_omit()) ret_val.reqGPRStimer() = OMIT_VALUE;
else if (single_value->field_reqGPRStimer.is_bound()) {
ret_val.reqGPRStimer() = single_value->field_reqGPRStimer.valueof();
}
if (single_value->field_tmsiStatus.is_omit()) ret_val.tmsiStatus() = OMIT_VALUE;
else if (single_value->field_tmsiStatus.is_bound()) {
ret_val.tmsiStatus() = single_value->field_tmsiStatus.valueof();
}
if (single_value->field_pC__LCSCapability.is_omit()) ret_val.pC__LCSCapability() = OMIT_VALUE;
else if (single_value->field_pC__LCSCapability.is_bound()) {
ret_val.pC__LCSCapability() = single_value->field_pC__LCSCapability.valueof();
}
if (single_value->field_mobileStationClassmark2.is_omit()) ret_val.mobileStationClassmark2() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark2.is_bound()) {
ret_val.mobileStationClassmark2() = single_value->field_mobileStationClassmark2.valueof();
}
if (single_value->field_mobileStationClassmark3.is_omit()) ret_val.mobileStationClassmark3() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark3.is_bound()) {
ret_val.mobileStationClassmark3() = single_value->field_mobileStationClassmark3.valueof();
}
if (single_value->field_supportedCodecs.is_omit()) ret_val.supportedCodecs() = OMIT_VALUE;
else if (single_value->field_supportedCodecs.is_bound()) {
ret_val.supportedCodecs() = single_value->field_supportedCodecs.valueof();
}
if (single_value->field_uENetworkCapability.is_omit()) ret_val.uENetworkCapability() = OMIT_VALUE;
else if (single_value->field_uENetworkCapability.is_bound()) {
ret_val.uENetworkCapability() = single_value->field_uENetworkCapability.valueof();
}
if (single_value->field_additionalMobileIdentity.is_omit()) ret_val.additionalMobileIdentity() = OMIT_VALUE;
else if (single_value->field_additionalMobileIdentity.is_bound()) {
ret_val.additionalMobileIdentity() = single_value->field_additionalMobileIdentity.valueof();
}
if (single_value->field_routingAreaIdentification2.is_omit()) ret_val.routingAreaIdentification2() = OMIT_VALUE;
else if (single_value->field_routingAreaIdentification2.is_bound()) {
ret_val.routingAreaIdentification2() = single_value->field_routingAreaIdentification2.valueof();
}
if (single_value->field_voiceDomainandUEsUsageSetting.is_omit()) ret_val.voiceDomainandUEsUsageSetting() = OMIT_VALUE;
else if (single_value->field_voiceDomainandUEsUsageSetting.is_bound()) {
ret_val.voiceDomainandUEsUsageSetting() = single_value->field_voiceDomainandUEsUsageSetting.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
if (single_value->field_p__TMSI__Type.is_omit()) ret_val.p__TMSI__Type() = OMIT_VALUE;
else if (single_value->field_p__TMSI__Type.is_bound()) {
ret_val.p__TMSI__Type() = single_value->field_p__TMSI__Type.valueof();
}
if (single_value->field_mS__NetworkFeatureSupport.is_omit()) ret_val.mS__NetworkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_mS__NetworkFeatureSupport.is_bound()) {
ret_val.mS__NetworkFeatureSupport() = single_value->field_mS__NetworkFeatureSupport.valueof();
}
if (single_value->field_oldLocationAreaIdentification.is_omit()) ret_val.oldLocationAreaIdentification() = OMIT_VALUE;
else if (single_value->field_oldLocationAreaIdentification.is_bound()) {
ret_val.oldLocationAreaIdentification() = single_value->field_oldLocationAreaIdentification.valueof();
}
if (single_value->field_additionalUpdateType.is_omit()) ret_val.additionalUpdateType() = OMIT_VALUE;
else if (single_value->field_additionalUpdateType.is_bound()) {
ret_val.additionalUpdateType() = single_value->field_additionalUpdateType.valueof();
}
if (single_value->field_tMSIBasedNRIcontainer.is_omit()) ret_val.tMSIBasedNRIcontainer() = OMIT_VALUE;
else if (single_value->field_tMSIBasedNRIcontainer.is_bound()) {
ret_val.tMSIBasedNRIcontainer() = single_value->field_tMSIBasedNRIcontainer.valueof();
}
if (single_value->field_t3324.is_omit()) ret_val.t3324() = OMIT_VALUE;
else if (single_value->field_t3324.is_bound()) {
ret_val.t3324() = single_value->field_t3324.valueof();
}
if (single_value->field_t3312__ExtendedValue.is_omit()) ret_val.t3312__ExtendedValue() = OMIT_VALUE;
else if (single_value->field_t3312__ExtendedValue.is_bound()) {
ret_val.t3312__ExtendedValue() = single_value->field_t3312__ExtendedValue.valueof();
}
if (single_value->field_extendedDRXParameters.is_omit()) ret_val.extendedDRXParameters() = OMIT_VALUE;
else if (single_value->field_extendedDRXParameters.is_bound()) {
ret_val.extendedDRXParameters() = single_value->field_extendedDRXParameters.valueof();
}
return ret_val;
}

void PDU__GMM__AttachRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AttachRequest_template[list_length];
}

PDU__GMM__AttachRequest_template& PDU__GMM__AttachRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__AttachRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AttachRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_messageType;
}

MSNetworkCapabilityLV_template& PDU__GMM__AttachRequest_template::msNetworkCapability()
{
set_specific();
return single_value->field_msNetworkCapability;
}

const MSNetworkCapabilityLV_template& PDU__GMM__AttachRequest_template::msNetworkCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msNetworkCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_msNetworkCapability;
}

AttachTypeV_template& PDU__GMM__AttachRequest_template::attachType()
{
set_specific();
return single_value->field_attachType;
}

const AttachTypeV_template& PDU__GMM__AttachRequest_template::attachType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field attachType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_attachType;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__AttachRequest_template::gprsCKSN()
{
set_specific();
return single_value->field_gprsCKSN;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__AttachRequest_template::gprsCKSN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsCKSN of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_gprsCKSN;
}

DRXParameterV_template& PDU__GMM__AttachRequest_template::drxParam()
{
set_specific();
return single_value->field_drxParam;
}

const DRXParameterV_template& PDU__GMM__AttachRequest_template::drxParam() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field drxParam of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_drxParam;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__AttachRequest_template::mobileIdentity()
{
set_specific();
return single_value->field_mobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__AttachRequest_template::mobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_mobileIdentity;
}

RoutingAreaIdentificationV_template& PDU__GMM__AttachRequest_template::oldRoutingAreaID()
{
set_specific();
return single_value->field_oldRoutingAreaID;
}

const RoutingAreaIdentificationV_template& PDU__GMM__AttachRequest_template::oldRoutingAreaID() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldRoutingAreaID of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_oldRoutingAreaID;
}

MSRadioAccessCapabilityLV_template& PDU__GMM__AttachRequest_template::msRACap()
{
set_specific();
return single_value->field_msRACap;
}

const MSRadioAccessCapabilityLV_template& PDU__GMM__AttachRequest_template::msRACap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msRACap of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_msRACap;
}

P__TMSISignatureTV_template& PDU__GMM__AttachRequest_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const P__TMSISignatureTV_template& PDU__GMM__AttachRequest_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_ptmsiSignature;
}

GPRSTimerTV_template& PDU__GMM__AttachRequest_template::reqGPRStimer()
{
set_specific();
return single_value->field_reqGPRStimer;
}

const GPRSTimerTV_template& PDU__GMM__AttachRequest_template::reqGPRStimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field reqGPRStimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_reqGPRStimer;
}

TMSIStatusTV_template& PDU__GMM__AttachRequest_template::tmsiStatus()
{
set_specific();
return single_value->field_tmsiStatus;
}

const TMSIStatusTV_template& PDU__GMM__AttachRequest_template::tmsiStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tmsiStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_tmsiStatus;
}

PC__LCSCapability_template& PDU__GMM__AttachRequest_template::pC__LCSCapability()
{
set_specific();
return single_value->field_pC__LCSCapability;
}

const PC__LCSCapability_template& PDU__GMM__AttachRequest_template::pC__LCSCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pC_LCSCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_pC__LCSCapability;
}

MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template& PDU__GMM__AttachRequest_template::mobileStationClassmark2()
{
set_specific();
return single_value->field_mobileStationClassmark2;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template& PDU__GMM__AttachRequest_template::mobileStationClassmark2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_mobileStationClassmark2;
}

MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__GMM__AttachRequest_template::mobileStationClassmark3()
{
set_specific();
return single_value->field_mobileStationClassmark3;
}

const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__GMM__AttachRequest_template::mobileStationClassmark3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark3 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_mobileStationClassmark3;
}

MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__GMM__AttachRequest_template::supportedCodecs()
{
set_specific();
return single_value->field_supportedCodecs;
}

const MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__GMM__AttachRequest_template::supportedCodecs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field supportedCodecs of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_supportedCodecs;
}

UENetworkCapabilityTLV_template& PDU__GMM__AttachRequest_template::uENetworkCapability()
{
set_specific();
return single_value->field_uENetworkCapability;
}

const UENetworkCapabilityTLV_template& PDU__GMM__AttachRequest_template::uENetworkCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uENetworkCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_uENetworkCapability;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachRequest_template::additionalMobileIdentity()
{
set_specific();
return single_value->field_additionalMobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachRequest_template::additionalMobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalMobileIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_additionalMobileIdentity;
}

MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__GMM__AttachRequest_template::routingAreaIdentification2()
{
set_specific();
return single_value->field_routingAreaIdentification2;
}

const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__GMM__AttachRequest_template::routingAreaIdentification2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaIdentification2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_routingAreaIdentification2;
}

VoiceDomainPreferenceandUEsUsageSettingTLV_template& PDU__GMM__AttachRequest_template::voiceDomainandUEsUsageSetting()
{
set_specific();
return single_value->field_voiceDomainandUEsUsageSetting;
}

const VoiceDomainPreferenceandUEsUsageSettingTLV_template& PDU__GMM__AttachRequest_template::voiceDomainandUEsUsageSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field voiceDomainandUEsUsageSetting of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_voiceDomainandUEsUsageSetting;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__AttachRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__AttachRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_deviceProperties;
}

MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__GMM__AttachRequest_template::p__TMSI__Type()
{
set_specific();
return single_value->field_p__TMSI__Type;
}

const MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__GMM__AttachRequest_template::p__TMSI__Type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p_TMSI_Type of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_p__TMSI__Type;
}

MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template& PDU__GMM__AttachRequest_template::mS__NetworkFeatureSupport()
{
set_specific();
return single_value->field_mS__NetworkFeatureSupport;
}

const MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template& PDU__GMM__AttachRequest_template::mS__NetworkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_NetworkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_mS__NetworkFeatureSupport;
}

LocationAreaIdentification2__TLV_template& PDU__GMM__AttachRequest_template::oldLocationAreaIdentification()
{
set_specific();
return single_value->field_oldLocationAreaIdentification;
}

const LocationAreaIdentification2__TLV_template& PDU__GMM__AttachRequest_template::oldLocationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldLocationAreaIdentification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_oldLocationAreaIdentification;
}

AdditionalUpdateTypeTV_template& PDU__GMM__AttachRequest_template::additionalUpdateType()
{
set_specific();
return single_value->field_additionalUpdateType;
}

const AdditionalUpdateTypeTV_template& PDU__GMM__AttachRequest_template::additionalUpdateType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalUpdateType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_additionalUpdateType;
}

NetworkResourceIdentifierContainerTLV_template& PDU__GMM__AttachRequest_template::tMSIBasedNRIcontainer()
{
set_specific();
return single_value->field_tMSIBasedNRIcontainer;
}

const NetworkResourceIdentifierContainerTLV_template& PDU__GMM__AttachRequest_template::tMSIBasedNRIcontainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMSIBasedNRIcontainer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_tMSIBasedNRIcontainer;
}

GPRSTimer2TLV_template& PDU__GMM__AttachRequest_template::t3324()
{
set_specific();
return single_value->field_t3324;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachRequest_template::t3324() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3324 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_t3324;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__AttachRequest_template::t3312__ExtendedValue()
{
set_specific();
return single_value->field_t3312__ExtendedValue;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__AttachRequest_template::t3312__ExtendedValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3312_ExtendedValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_t3312__ExtendedValue;
}

ExtendedDRXParametersTLV_template& PDU__GMM__AttachRequest_template::extendedDRXParameters()
{
set_specific();
return single_value->field_extendedDRXParameters;
}

const ExtendedDRXParametersTLV_template& PDU__GMM__AttachRequest_template::extendedDRXParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDRXParameters of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
return single_value->field_extendedDRXParameters;
}

int PDU__GMM__AttachRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 8;
      if (single_value->field_ptmsiSignature.is_present()) ret_val++;
      if (single_value->field_reqGPRStimer.is_present()) ret_val++;
      if (single_value->field_tmsiStatus.is_present()) ret_val++;
      if (single_value->field_pC__LCSCapability.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark2.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark3.is_present()) ret_val++;
      if (single_value->field_supportedCodecs.is_present()) ret_val++;
      if (single_value->field_uENetworkCapability.is_present()) ret_val++;
      if (single_value->field_additionalMobileIdentity.is_present()) ret_val++;
      if (single_value->field_routingAreaIdentification2.is_present()) ret_val++;
      if (single_value->field_voiceDomainandUEsUsageSetting.is_present()) ret_val++;
      if (single_value->field_deviceProperties.is_present()) ret_val++;
      if (single_value->field_p__TMSI__Type.is_present()) ret_val++;
      if (single_value->field_mS__NetworkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_oldLocationAreaIdentification.is_present()) ret_val++;
      if (single_value->field_additionalUpdateType.is_present()) ret_val++;
      if (single_value->field_tMSIBasedNRIcontainer.is_present()) ret_val++;
      if (single_value->field_t3324.is_present()) ret_val++;
      if (single_value->field_t3312__ExtendedValue.is_present()) ret_val++;
      if (single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest 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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
  }
  return 0;
}

void PDU__GMM__AttachRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", msNetworkCapability := ");
single_value->field_msNetworkCapability.log();
TTCN_Logger::log_event_str(", attachType := ");
single_value->field_attachType.log();
TTCN_Logger::log_event_str(", gprsCKSN := ");
single_value->field_gprsCKSN.log();
TTCN_Logger::log_event_str(", drxParam := ");
single_value->field_drxParam.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log();
TTCN_Logger::log_event_str(", oldRoutingAreaID := ");
single_value->field_oldRoutingAreaID.log();
TTCN_Logger::log_event_str(", msRACap := ");
single_value->field_msRACap.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", reqGPRStimer := ");
single_value->field_reqGPRStimer.log();
TTCN_Logger::log_event_str(", tmsiStatus := ");
single_value->field_tmsiStatus.log();
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
single_value->field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(", uENetworkCapability := ");
single_value->field_uENetworkCapability.log();
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
single_value->field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(", routingAreaIdentification2 := ");
single_value->field_routingAreaIdentification2.log();
TTCN_Logger::log_event_str(", voiceDomainandUEsUsageSetting := ");
single_value->field_voiceDomainandUEsUsageSetting.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
single_value->field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
single_value->field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
single_value->field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(", additionalUpdateType := ");
single_value->field_additionalUpdateType.log();
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
single_value->field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(", t3324 := ");
single_value->field_t3324.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
single_value->field_extendedDRXParameters.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__GMM__AttachRequest_template::log_match(const PDU__GMM__AttachRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msNetworkCapability.match(match_value.msNetworkCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".msNetworkCapability");
single_value->field_msNetworkCapability.log_match(match_value.msNetworkCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_attachType.match(match_value.attachType(), legacy)){
TTCN_Logger::log_logmatch_info(".attachType");
single_value->field_attachType.log_match(match_value.attachType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gprsCKSN.match(match_value.gprsCKSN(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsCKSN");
single_value->field_gprsCKSN.log_match(match_value.gprsCKSN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_drxParam.match(match_value.drxParam(), legacy)){
TTCN_Logger::log_logmatch_info(".drxParam");
single_value->field_drxParam.log_match(match_value.drxParam(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity.match(match_value.mobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oldRoutingAreaID.match(match_value.oldRoutingAreaID(), legacy)){
TTCN_Logger::log_logmatch_info(".oldRoutingAreaID");
single_value->field_oldRoutingAreaID.log_match(match_value.oldRoutingAreaID(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msRACap.match(match_value.msRACap(), legacy)){
TTCN_Logger::log_logmatch_info(".msRACap");
single_value->field_msRACap.log_match(match_value.msRACap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.reqGPRStimer().ispresent()){
if(!single_value->field_reqGPRStimer.match(match_value.reqGPRStimer(), legacy)){
TTCN_Logger::log_logmatch_info(".reqGPRStimer");
single_value->field_reqGPRStimer.log_match(match_value.reqGPRStimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_reqGPRStimer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".reqGPRStimer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_reqGPRStimer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tmsiStatus().ispresent()){
if(!single_value->field_tmsiStatus.match(match_value.tmsiStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".tmsiStatus");
single_value->field_tmsiStatus.log_match(match_value.tmsiStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tmsiStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tmsiStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tmsiStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pC__LCSCapability().ispresent()){
if(!single_value->field_pC__LCSCapability.match(match_value.pC__LCSCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".pC_LCSCapability");
single_value->field_pC__LCSCapability.log_match(match_value.pC__LCSCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pC__LCSCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pC_LCSCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark2().ispresent()){
if(!single_value->field_mobileStationClassmark2.match(match_value.mobileStationClassmark2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark3().ispresent()){
if(!single_value->field_mobileStationClassmark3.match(match_value.mobileStationClassmark3(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark3");
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.supportedCodecs().ispresent()){
if(!single_value->field_supportedCodecs.match(match_value.supportedCodecs(), legacy)){
TTCN_Logger::log_logmatch_info(".supportedCodecs");
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supportedCodecs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supportedCodecs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uENetworkCapability().ispresent()){
if(!single_value->field_uENetworkCapability.match(match_value.uENetworkCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".uENetworkCapability");
single_value->field_uENetworkCapability.log_match(match_value.uENetworkCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uENetworkCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uENetworkCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uENetworkCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalMobileIdentity().ispresent()){
if(!single_value->field_additionalMobileIdentity.match(match_value.additionalMobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalMobileIdentity");
single_value->field_additionalMobileIdentity.log_match(match_value.additionalMobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalMobileIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalMobileIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.routingAreaIdentification2().ispresent()){
if(!single_value->field_routingAreaIdentification2.match(match_value.routingAreaIdentification2(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification2");
single_value->field_routingAreaIdentification2.log_match(match_value.routingAreaIdentification2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_routingAreaIdentification2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".routingAreaIdentification2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_routingAreaIdentification2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.voiceDomainandUEsUsageSetting().ispresent()){
if(!single_value->field_voiceDomainandUEsUsageSetting.match(match_value.voiceDomainandUEsUsageSetting(), legacy)){
TTCN_Logger::log_logmatch_info(".voiceDomainandUEsUsageSetting");
single_value->field_voiceDomainandUEsUsageSetting.log_match(match_value.voiceDomainandUEsUsageSetting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_voiceDomainandUEsUsageSetting.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".voiceDomainandUEsUsageSetting := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_voiceDomainandUEsUsageSetting.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.p__TMSI__Type().ispresent()){
if(!single_value->field_p__TMSI__Type.match(match_value.p__TMSI__Type(), legacy)){
TTCN_Logger::log_logmatch_info(".p_TMSI_Type");
single_value->field_p__TMSI__Type.log_match(match_value.p__TMSI__Type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_p__TMSI__Type.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".p_TMSI_Type := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mS__NetworkFeatureSupport().ispresent()){
if(!single_value->field_mS__NetworkFeatureSupport.match(match_value.mS__NetworkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_NetworkFeatureSupport");
single_value->field_mS__NetworkFeatureSupport.log_match(match_value.mS__NetworkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mS_NetworkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.oldLocationAreaIdentification().ispresent()){
if(!single_value->field_oldLocationAreaIdentification.match(match_value.oldLocationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".oldLocationAreaIdentification");
single_value->field_oldLocationAreaIdentification.log_match(match_value.oldLocationAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_oldLocationAreaIdentification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".oldLocationAreaIdentification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalUpdateType().ispresent()){
if(!single_value->field_additionalUpdateType.match(match_value.additionalUpdateType(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalUpdateType");
single_value->field_additionalUpdateType.log_match(match_value.additionalUpdateType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalUpdateType.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalUpdateType := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalUpdateType.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tMSIBasedNRIcontainer().ispresent()){
if(!single_value->field_tMSIBasedNRIcontainer.match(match_value.tMSIBasedNRIcontainer(), legacy)){
TTCN_Logger::log_logmatch_info(".tMSIBasedNRIcontainer");
single_value->field_tMSIBasedNRIcontainer.log_match(match_value.tMSIBasedNRIcontainer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tMSIBasedNRIcontainer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3324().ispresent()){
if(!single_value->field_t3324.match(match_value.t3324(), legacy)){
TTCN_Logger::log_logmatch_info(".t3324");
single_value->field_t3324.log_match(match_value.t3324(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3324.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3324 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3324.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3312__ExtendedValue().ispresent()){
if(!single_value->field_t3312__ExtendedValue.match(match_value.t3312__ExtendedValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue");
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3312__ExtendedValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedDRXParameters().ispresent()){
if(!single_value->field_extendedDRXParameters.match(match_value.extendedDRXParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDRXParameters");
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDRXParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDRXParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDRXParameters.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", msNetworkCapability := ");
single_value->field_msNetworkCapability.log_match(match_value.msNetworkCapability(), legacy);
TTCN_Logger::log_event_str(", attachType := ");
single_value->field_attachType.log_match(match_value.attachType(), legacy);
TTCN_Logger::log_event_str(", gprsCKSN := ");
single_value->field_gprsCKSN.log_match(match_value.gprsCKSN(), legacy);
TTCN_Logger::log_event_str(", drxParam := ");
single_value->field_drxParam.log_match(match_value.drxParam(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), legacy);
TTCN_Logger::log_event_str(", oldRoutingAreaID := ");
single_value->field_oldRoutingAreaID.log_match(match_value.oldRoutingAreaID(), legacy);
TTCN_Logger::log_event_str(", msRACap := ");
single_value->field_msRACap.log_match(match_value.msRACap(), legacy);
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", reqGPRStimer := ");
if (match_value.reqGPRStimer().ispresent()) {
single_value->field_reqGPRStimer.log_match(match_value.reqGPRStimer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_reqGPRStimer.log();
if (single_value->field_reqGPRStimer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tmsiStatus := ");
if (match_value.tmsiStatus().ispresent()) {
single_value->field_tmsiStatus.log_match(match_value.tmsiStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tmsiStatus.log();
if (single_value->field_tmsiStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
if (match_value.pC__LCSCapability().ispresent()) {
single_value->field_pC__LCSCapability.log_match(match_value.pC__LCSCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pC__LCSCapability.log();
if (single_value->field_pC__LCSCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
if (match_value.mobileStationClassmark2().ispresent()) {
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark2.log();
if (single_value->field_mobileStationClassmark2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
if (match_value.mobileStationClassmark3().ispresent()) {
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark3.log();
if (single_value->field_mobileStationClassmark3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", supportedCodecs := ");
if (match_value.supportedCodecs().ispresent()) {
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supportedCodecs.log();
if (single_value->field_supportedCodecs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uENetworkCapability := ");
if (match_value.uENetworkCapability().ispresent()) {
single_value->field_uENetworkCapability.log_match(match_value.uENetworkCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uENetworkCapability.log();
if (single_value->field_uENetworkCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
if (match_value.additionalMobileIdentity().ispresent()) {
single_value->field_additionalMobileIdentity.log_match(match_value.additionalMobileIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalMobileIdentity.log();
if (single_value->field_additionalMobileIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", routingAreaIdentification2 := ");
if (match_value.routingAreaIdentification2().ispresent()) {
single_value->field_routingAreaIdentification2.log_match(match_value.routingAreaIdentification2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_routingAreaIdentification2.log();
if (single_value->field_routingAreaIdentification2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", voiceDomainandUEsUsageSetting := ");
if (match_value.voiceDomainandUEsUsageSetting().ispresent()) {
single_value->field_voiceDomainandUEsUsageSetting.log_match(match_value.voiceDomainandUEsUsageSetting(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_voiceDomainandUEsUsageSetting.log();
if (single_value->field_voiceDomainandUEsUsageSetting.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
if (match_value.p__TMSI__Type().ispresent()) {
single_value->field_p__TMSI__Type.log_match(match_value.p__TMSI__Type(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_p__TMSI__Type.log();
if (single_value->field_p__TMSI__Type.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
if (match_value.mS__NetworkFeatureSupport().ispresent()) {
single_value->field_mS__NetworkFeatureSupport.log_match(match_value.mS__NetworkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mS__NetworkFeatureSupport.log();
if (single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
if (match_value.oldLocationAreaIdentification().ispresent()) {
single_value->field_oldLocationAreaIdentification.log_match(match_value.oldLocationAreaIdentification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_oldLocationAreaIdentification.log();
if (single_value->field_oldLocationAreaIdentification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalUpdateType := ");
if (match_value.additionalUpdateType().ispresent()) {
single_value->field_additionalUpdateType.log_match(match_value.additionalUpdateType(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalUpdateType.log();
if (single_value->field_additionalUpdateType.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
if (match_value.tMSIBasedNRIcontainer().ispresent()) {
single_value->field_tMSIBasedNRIcontainer.log_match(match_value.tMSIBasedNRIcontainer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tMSIBasedNRIcontainer.log();
if (single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3324 := ");
if (match_value.t3324().ispresent()) {
single_value->field_t3324.log_match(match_value.t3324(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3324.log();
if (single_value->field_t3324.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
if (match_value.t3312__ExtendedValue().ispresent()) {
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3312__ExtendedValue.log();
if (single_value->field_t3312__ExtendedValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
if (match_value.extendedDRXParameters().ispresent()) {
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDRXParameters.log();
if (single_value->field_extendedDRXParameters.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 PDU__GMM__AttachRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (msNetworkCapability().is_bound()) msNetworkCapability().set_implicit_omit();
if (attachType().is_bound()) attachType().set_implicit_omit();
if (gprsCKSN().is_bound()) gprsCKSN().set_implicit_omit();
if (drxParam().is_bound()) drxParam().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
if (oldRoutingAreaID().is_bound()) oldRoutingAreaID().set_implicit_omit();
if (msRACap().is_bound()) msRACap().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!reqGPRStimer().is_bound()) reqGPRStimer() = OMIT_VALUE;
else reqGPRStimer().set_implicit_omit();
if (!tmsiStatus().is_bound()) tmsiStatus() = OMIT_VALUE;
else tmsiStatus().set_implicit_omit();
if (!pC__LCSCapability().is_bound()) pC__LCSCapability() = OMIT_VALUE;
else pC__LCSCapability().set_implicit_omit();
if (!mobileStationClassmark2().is_bound()) mobileStationClassmark2() = OMIT_VALUE;
else mobileStationClassmark2().set_implicit_omit();
if (!mobileStationClassmark3().is_bound()) mobileStationClassmark3() = OMIT_VALUE;
else mobileStationClassmark3().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!uENetworkCapability().is_bound()) uENetworkCapability() = OMIT_VALUE;
else uENetworkCapability().set_implicit_omit();
if (!additionalMobileIdentity().is_bound()) additionalMobileIdentity() = OMIT_VALUE;
else additionalMobileIdentity().set_implicit_omit();
if (!routingAreaIdentification2().is_bound()) routingAreaIdentification2() = OMIT_VALUE;
else routingAreaIdentification2().set_implicit_omit();
if (!voiceDomainandUEsUsageSetting().is_bound()) voiceDomainandUEsUsageSetting() = OMIT_VALUE;
else voiceDomainandUEsUsageSetting().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
if (!p__TMSI__Type().is_bound()) p__TMSI__Type() = OMIT_VALUE;
else p__TMSI__Type().set_implicit_omit();
if (!mS__NetworkFeatureSupport().is_bound()) mS__NetworkFeatureSupport() = OMIT_VALUE;
else mS__NetworkFeatureSupport().set_implicit_omit();
if (!oldLocationAreaIdentification().is_bound()) oldLocationAreaIdentification() = OMIT_VALUE;
else oldLocationAreaIdentification().set_implicit_omit();
if (!additionalUpdateType().is_bound()) additionalUpdateType() = OMIT_VALUE;
else additionalUpdateType().set_implicit_omit();
if (!tMSIBasedNRIcontainer().is_bound()) tMSIBasedNRIcontainer() = OMIT_VALUE;
else tMSIBasedNRIcontainer().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__AttachRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_msNetworkCapability.encode_text(text_buf);
single_value->field_attachType.encode_text(text_buf);
single_value->field_gprsCKSN.encode_text(text_buf);
single_value->field_drxParam.encode_text(text_buf);
single_value->field_mobileIdentity.encode_text(text_buf);
single_value->field_oldRoutingAreaID.encode_text(text_buf);
single_value->field_msRACap.encode_text(text_buf);
single_value->field_ptmsiSignature.encode_text(text_buf);
single_value->field_reqGPRStimer.encode_text(text_buf);
single_value->field_tmsiStatus.encode_text(text_buf);
single_value->field_pC__LCSCapability.encode_text(text_buf);
single_value->field_mobileStationClassmark2.encode_text(text_buf);
single_value->field_mobileStationClassmark3.encode_text(text_buf);
single_value->field_supportedCodecs.encode_text(text_buf);
single_value->field_uENetworkCapability.encode_text(text_buf);
single_value->field_additionalMobileIdentity.encode_text(text_buf);
single_value->field_routingAreaIdentification2.encode_text(text_buf);
single_value->field_voiceDomainandUEsUsageSetting.encode_text(text_buf);
single_value->field_deviceProperties.encode_text(text_buf);
single_value->field_p__TMSI__Type.encode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.encode_text(text_buf);
single_value->field_oldLocationAreaIdentification.encode_text(text_buf);
single_value->field_additionalUpdateType.encode_text(text_buf);
single_value->field_tMSIBasedNRIcontainer.encode_text(text_buf);
single_value->field_t3324.encode_text(text_buf);
single_value->field_t3312__ExtendedValue.encode_text(text_buf);
single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
}
}

void PDU__GMM__AttachRequest_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_messageType.decode_text(text_buf);
single_value->field_msNetworkCapability.decode_text(text_buf);
single_value->field_attachType.decode_text(text_buf);
single_value->field_gprsCKSN.decode_text(text_buf);
single_value->field_drxParam.decode_text(text_buf);
single_value->field_mobileIdentity.decode_text(text_buf);
single_value->field_oldRoutingAreaID.decode_text(text_buf);
single_value->field_msRACap.decode_text(text_buf);
single_value->field_ptmsiSignature.decode_text(text_buf);
single_value->field_reqGPRStimer.decode_text(text_buf);
single_value->field_tmsiStatus.decode_text(text_buf);
single_value->field_pC__LCSCapability.decode_text(text_buf);
single_value->field_mobileStationClassmark2.decode_text(text_buf);
single_value->field_mobileStationClassmark3.decode_text(text_buf);
single_value->field_supportedCodecs.decode_text(text_buf);
single_value->field_uENetworkCapability.decode_text(text_buf);
single_value->field_additionalMobileIdentity.decode_text(text_buf);
single_value->field_routingAreaIdentification2.decode_text(text_buf);
single_value->field_voiceDomainandUEsUsageSetting.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
single_value->field_p__TMSI__Type.decode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.decode_text(text_buf);
single_value->field_oldLocationAreaIdentification.decode_text(text_buf);
single_value->field_additionalUpdateType.decode_text(text_buf);
single_value->field_tMSIBasedNRIcontainer.decode_text(text_buf);
single_value->field_t3324.decode_text(text_buf);
single_value->field_t3312__ExtendedValue.decode_text(text_buf);
single_value->field_extendedDRXParameters.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__GMM__AttachRequest_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest.");
}
}

void PDU__GMM__AttachRequest_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__GMM__AttachRequest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (28<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest has 28 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) msNetworkCapability().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) attachType().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gprsCKSN().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) drxParam().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaID().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) msRACap().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) reqGPRStimer().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) tmsiStatus().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapability().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapability().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) additionalMobileIdentity().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification2().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) voiceDomainandUEsUsageSetting().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__Type().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) oldLocationAreaIdentification().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateType().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) tMSIBasedNRIcontainer().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(27));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msNetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msNetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsCKSN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsCKSN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "drxParam")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          drxParam().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaID")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaID().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRACap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "reqGPRStimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          reqGPRStimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tmsiStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tmsiStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pC_LCSCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uENetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalMobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalMobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "voiceDomainandUEsUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainandUEsUsageSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_NetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__NetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldLocationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldLocationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSIBasedNRIcontainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSIBasedNRIcontainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AttachRequest_template* precondition = new PDU__GMM__AttachRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AttachRequest_template* implied_template = new PDU__GMM__AttachRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AttachRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AttachRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_msNetworkCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_attachType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_gprsCKSN.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_drxParam.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_oldRoutingAreaID.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_msRACap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_reqGPRStimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_tmsiStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_pC__LCSCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_mobileStationClassmark2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_mobileStationClassmark3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_supportedCodecs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_uENetworkCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_additionalMobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_routingAreaIdentification2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_voiceDomainandUEsUsageSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_p__TMSI__Type.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_mS__NetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_oldLocationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_additionalUpdateType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_tMSIBasedNRIcontainer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_t3324.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_t3312__ExtendedValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
single_value->field_extendedDRXParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachRequest");
}

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

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

PDU__GMM__AttachAccept::PDU__GMM__AttachAccept()
{
}

PDU__GMM__AttachAccept::PDU__GMM__AttachAccept(const BITSTRING& par_messageType,
    const AttachResultV& par_attachResult,
    const ForceToStandbyV& par_forceToStandby,
    const GPRSTimerV& par_updateTimer,
    const RadioPriorityV& par_radioPriority,
    const RadioPriority2V& par_radioPriorityTOM8,
    const RoutingAreaIdentificationV& par_routingAreaIdentification,
    const OPTIONAL< P__TMSISignatureTV >& par_ptmsiSignature,
    const OPTIONAL< GPRSTimerTV >& par_readyTimer,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_allocatedPTMSI,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_msIdentity,
    const OPTIONAL< GMM__CauseTV >& par_gmmCause,
    const OPTIONAL< GPRSTimer2TLV >& par_t3302,
    const OPTIONAL< CellNotificationT >& par_cellNotification,
    const OPTIONAL< MobileL3__CommonIE__Types::PLMNListTLV >& par_equivalentPLMNs,
    const OPTIONAL< NetworkFeatureSupportTV >& par_networkFeatureSupport,
    const OPTIONAL< MobileL3__MM__Types::EmergencyNumberListTLV >& par_emergencyNumberList,
    const OPTIONAL< RequestedMSInformationTV >& par_requestedMSInformation,
    const OPTIONAL< GPRSTimer2TLV >& par_t3319,
    const OPTIONAL< GPRSTimer2TLV >& par_t3323,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_t3312__ExtendedValue,
    const OPTIONAL< AdditionalNetworkFeatureSupportTLV >& par_additionalNetworkFeatureSupport,
    const OPTIONAL< GPRSTimer2TLV >& par_t3324,
    const OPTIONAL< ExtendedDRXParametersTLV >& par_extendedDRXParameters)
  :   field_messageType(par_messageType),
  field_attachResult(par_attachResult),
  field_forceToStandby(par_forceToStandby),
  field_updateTimer(par_updateTimer),
  field_radioPriority(par_radioPriority),
  field_radioPriorityTOM8(par_radioPriorityTOM8),
  field_routingAreaIdentification(par_routingAreaIdentification),
  field_ptmsiSignature(par_ptmsiSignature),
  field_readyTimer(par_readyTimer),
  field_allocatedPTMSI(par_allocatedPTMSI),
  field_msIdentity(par_msIdentity),
  field_gmmCause(par_gmmCause),
  field_t3302(par_t3302),
  field_cellNotification(par_cellNotification),
  field_equivalentPLMNs(par_equivalentPLMNs),
  field_networkFeatureSupport(par_networkFeatureSupport),
  field_emergencyNumberList(par_emergencyNumberList),
  field_requestedMSInformation(par_requestedMSInformation),
  field_t3319(par_t3319),
  field_t3323(par_t3323),
  field_t3312__ExtendedValue(par_t3312__ExtendedValue),
  field_additionalNetworkFeatureSupport(par_additionalNetworkFeatureSupport),
  field_t3324(par_t3324),
  field_extendedDRXParameters(par_extendedDRXParameters)
{
}

PDU__GMM__AttachAccept::PDU__GMM__AttachAccept(const PDU__GMM__AttachAccept& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.attachResult().is_bound()) field_attachResult = other_value.attachResult();
else field_attachResult.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.updateTimer().is_bound()) field_updateTimer = other_value.updateTimer();
else field_updateTimer.clean_up();
if (other_value.radioPriority().is_bound()) field_radioPriority = other_value.radioPriority();
else field_radioPriority.clean_up();
if (other_value.radioPriorityTOM8().is_bound()) field_radioPriorityTOM8 = other_value.radioPriorityTOM8();
else field_radioPriorityTOM8.clean_up();
if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
else field_routingAreaIdentification.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
if (other_value.readyTimer().is_bound()) field_readyTimer = other_value.readyTimer();
else field_readyTimer.clean_up();
if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
else field_allocatedPTMSI.clean_up();
if (other_value.msIdentity().is_bound()) field_msIdentity = other_value.msIdentity();
else field_msIdentity.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
else field_t3302.clean_up();
if (other_value.cellNotification().is_bound()) field_cellNotification = other_value.cellNotification();
else field_cellNotification.clean_up();
if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
else field_equivalentPLMNs.clean_up();
if (other_value.networkFeatureSupport().is_bound()) field_networkFeatureSupport = other_value.networkFeatureSupport();
else field_networkFeatureSupport.clean_up();
if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
else field_emergencyNumberList.clean_up();
if (other_value.requestedMSInformation().is_bound()) field_requestedMSInformation = other_value.requestedMSInformation();
else field_requestedMSInformation.clean_up();
if (other_value.t3319().is_bound()) field_t3319 = other_value.t3319();
else field_t3319.clean_up();
if (other_value.t3323().is_bound()) field_t3323 = other_value.t3323();
else field_t3323.clean_up();
if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
else field_t3312__ExtendedValue.clean_up();
if (other_value.additionalNetworkFeatureSupport().is_bound()) field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
else field_additionalNetworkFeatureSupport.clean_up();
if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
else field_t3324.clean_up();
if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
else field_extendedDRXParameters.clean_up();
}

void PDU__GMM__AttachAccept::clean_up()
{
field_messageType.clean_up();
field_attachResult.clean_up();
field_forceToStandby.clean_up();
field_updateTimer.clean_up();
field_radioPriority.clean_up();
field_radioPriorityTOM8.clean_up();
field_routingAreaIdentification.clean_up();
field_ptmsiSignature.clean_up();
field_readyTimer.clean_up();
field_allocatedPTMSI.clean_up();
field_msIdentity.clean_up();
field_gmmCause.clean_up();
field_t3302.clean_up();
field_cellNotification.clean_up();
field_equivalentPLMNs.clean_up();
field_networkFeatureSupport.clean_up();
field_emergencyNumberList.clean_up();
field_requestedMSInformation.clean_up();
field_t3319.clean_up();
field_t3323.clean_up();
field_t3312__ExtendedValue.clean_up();
field_additionalNetworkFeatureSupport.clean_up();
field_t3324.clean_up();
field_extendedDRXParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AttachAccept::get_descriptor() const { return &PDU__GMM__AttachAccept_descr_; }
PDU__GMM__AttachAccept& PDU__GMM__AttachAccept::operator=(const PDU__GMM__AttachAccept& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.attachResult().is_bound()) field_attachResult = other_value.attachResult();
  else field_attachResult.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.updateTimer().is_bound()) field_updateTimer = other_value.updateTimer();
  else field_updateTimer.clean_up();
  if (other_value.radioPriority().is_bound()) field_radioPriority = other_value.radioPriority();
  else field_radioPriority.clean_up();
  if (other_value.radioPriorityTOM8().is_bound()) field_radioPriorityTOM8 = other_value.radioPriorityTOM8();
  else field_radioPriorityTOM8.clean_up();
  if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
  else field_routingAreaIdentification.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
  if (other_value.readyTimer().is_bound()) field_readyTimer = other_value.readyTimer();
  else field_readyTimer.clean_up();
  if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
  else field_allocatedPTMSI.clean_up();
  if (other_value.msIdentity().is_bound()) field_msIdentity = other_value.msIdentity();
  else field_msIdentity.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
  else field_t3302.clean_up();
  if (other_value.cellNotification().is_bound()) field_cellNotification = other_value.cellNotification();
  else field_cellNotification.clean_up();
  if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
  else field_equivalentPLMNs.clean_up();
  if (other_value.networkFeatureSupport().is_bound()) field_networkFeatureSupport = other_value.networkFeatureSupport();
  else field_networkFeatureSupport.clean_up();
  if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
  else field_emergencyNumberList.clean_up();
  if (other_value.requestedMSInformation().is_bound()) field_requestedMSInformation = other_value.requestedMSInformation();
  else field_requestedMSInformation.clean_up();
  if (other_value.t3319().is_bound()) field_t3319 = other_value.t3319();
  else field_t3319.clean_up();
  if (other_value.t3323().is_bound()) field_t3323 = other_value.t3323();
  else field_t3323.clean_up();
  if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
  else field_t3312__ExtendedValue.clean_up();
  if (other_value.additionalNetworkFeatureSupport().is_bound()) field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
  else field_additionalNetworkFeatureSupport.clean_up();
  if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
  else field_t3324.clean_up();
  if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
  else field_extendedDRXParameters.clean_up();
}
return *this;
}

boolean PDU__GMM__AttachAccept::operator==(const PDU__GMM__AttachAccept& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_attachResult==other_value.field_attachResult
  && field_forceToStandby==other_value.field_forceToStandby
  && field_updateTimer==other_value.field_updateTimer
  && field_radioPriority==other_value.field_radioPriority
  && field_radioPriorityTOM8==other_value.field_radioPriorityTOM8
  && field_routingAreaIdentification==other_value.field_routingAreaIdentification
  && field_ptmsiSignature==other_value.field_ptmsiSignature
  && field_readyTimer==other_value.field_readyTimer
  && field_allocatedPTMSI==other_value.field_allocatedPTMSI
  && field_msIdentity==other_value.field_msIdentity
  && field_gmmCause==other_value.field_gmmCause
  && field_t3302==other_value.field_t3302
  && field_cellNotification==other_value.field_cellNotification
  && field_equivalentPLMNs==other_value.field_equivalentPLMNs
  && field_networkFeatureSupport==other_value.field_networkFeatureSupport
  && field_emergencyNumberList==other_value.field_emergencyNumberList
  && field_requestedMSInformation==other_value.field_requestedMSInformation
  && field_t3319==other_value.field_t3319
  && field_t3323==other_value.field_t3323
  && field_t3312__ExtendedValue==other_value.field_t3312__ExtendedValue
  && field_additionalNetworkFeatureSupport==other_value.field_additionalNetworkFeatureSupport
  && field_t3324==other_value.field_t3324
  && field_extendedDRXParameters==other_value.field_extendedDRXParameters;
}

boolean PDU__GMM__AttachAccept::is_bound() const
{
return (field_messageType.is_bound())
  || (field_attachResult.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_updateTimer.is_bound())
  || (field_radioPriority.is_bound())
  || (field_radioPriorityTOM8.is_bound())
  || (field_routingAreaIdentification.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound())
  || (OPTIONAL_OMIT == field_readyTimer.get_selection() || field_readyTimer.is_bound())
  || (OPTIONAL_OMIT == field_allocatedPTMSI.get_selection() || field_allocatedPTMSI.is_bound())
  || (OPTIONAL_OMIT == field_msIdentity.get_selection() || field_msIdentity.is_bound())
  || (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_bound())
  || (OPTIONAL_OMIT == field_cellNotification.get_selection() || field_cellNotification.is_bound())
  || (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_bound())
  || (OPTIONAL_OMIT == field_networkFeatureSupport.get_selection() || field_networkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_bound())
  || (OPTIONAL_OMIT == field_requestedMSInformation.get_selection() || field_requestedMSInformation.is_bound())
  || (OPTIONAL_OMIT == field_t3319.get_selection() || field_t3319.is_bound())
  || (OPTIONAL_OMIT == field_t3323.get_selection() || field_t3323.is_bound())
  || (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_bound())
  || (OPTIONAL_OMIT == field_additionalNetworkFeatureSupport.get_selection() || field_additionalNetworkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_bound())
  || (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_bound());
}
boolean PDU__GMM__AttachAccept::is_value() const
{
return field_messageType.is_value()
  && field_attachResult.is_value()
  && field_forceToStandby.is_value()
  && field_updateTimer.is_value()
  && field_radioPriority.is_value()
  && field_radioPriorityTOM8.is_value()
  && field_routingAreaIdentification.is_value()
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value())
  && (OPTIONAL_OMIT == field_readyTimer.get_selection() || field_readyTimer.is_value())
  && (OPTIONAL_OMIT == field_allocatedPTMSI.get_selection() || field_allocatedPTMSI.is_value())
  && (OPTIONAL_OMIT == field_msIdentity.get_selection() || field_msIdentity.is_value())
  && (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_value())
  && (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_value())
  && (OPTIONAL_OMIT == field_cellNotification.get_selection() || field_cellNotification.is_value())
  && (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_value())
  && (OPTIONAL_OMIT == field_networkFeatureSupport.get_selection() || field_networkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_value())
  && (OPTIONAL_OMIT == field_requestedMSInformation.get_selection() || field_requestedMSInformation.is_value())
  && (OPTIONAL_OMIT == field_t3319.get_selection() || field_t3319.is_value())
  && (OPTIONAL_OMIT == field_t3323.get_selection() || field_t3323.is_value())
  && (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_value())
  && (OPTIONAL_OMIT == field_additionalNetworkFeatureSupport.get_selection() || field_additionalNetworkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_value())
  && (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_value());
}
int PDU__GMM__AttachAccept::size_of() const
{
  int ret_val = 7;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  if (field_readyTimer.ispresent()) ret_val++;
  if (field_allocatedPTMSI.ispresent()) ret_val++;
  if (field_msIdentity.ispresent()) ret_val++;
  if (field_gmmCause.ispresent()) ret_val++;
  if (field_t3302.ispresent()) ret_val++;
  if (field_cellNotification.ispresent()) ret_val++;
  if (field_equivalentPLMNs.ispresent()) ret_val++;
  if (field_networkFeatureSupport.ispresent()) ret_val++;
  if (field_emergencyNumberList.ispresent()) ret_val++;
  if (field_requestedMSInformation.ispresent()) ret_val++;
  if (field_t3319.ispresent()) ret_val++;
  if (field_t3323.ispresent()) ret_val++;
  if (field_t3312__ExtendedValue.ispresent()) ret_val++;
  if (field_additionalNetworkFeatureSupport.ispresent()) ret_val++;
  if (field_t3324.ispresent()) ret_val++;
  if (field_extendedDRXParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AttachAccept::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", attachResult := ");
field_attachResult.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", updateTimer := ");
field_updateTimer.log();
TTCN_Logger::log_event_str(", radioPriority := ");
field_radioPriority.log();
TTCN_Logger::log_event_str(", radioPriorityTOM8 := ");
field_radioPriorityTOM8.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", readyTimer := ");
field_readyTimer.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", msIdentity := ");
field_msIdentity.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
field_t3302.log();
TTCN_Logger::log_event_str(", cellNotification := ");
field_cellNotification.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", requestedMSInformation := ");
field_requestedMSInformation.log();
TTCN_Logger::log_event_str(", t3319 := ");
field_t3319.log();
TTCN_Logger::log_event_str(", t3323 := ");
field_t3323.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", t3324 := ");
field_t3324.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
field_extendedDRXParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AttachAccept::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (attachResult().is_bound()) attachResult().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (updateTimer().is_bound()) updateTimer().set_implicit_omit();
if (radioPriority().is_bound()) radioPriority().set_implicit_omit();
if (radioPriorityTOM8().is_bound()) radioPriorityTOM8().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!readyTimer().is_bound()) readyTimer() = OMIT_VALUE;
else readyTimer().set_implicit_omit();
if (!allocatedPTMSI().is_bound()) allocatedPTMSI() = OMIT_VALUE;
else allocatedPTMSI().set_implicit_omit();
if (!msIdentity().is_bound()) msIdentity() = OMIT_VALUE;
else msIdentity().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!cellNotification().is_bound()) cellNotification() = OMIT_VALUE;
else cellNotification().set_implicit_omit();
if (!equivalentPLMNs().is_bound()) equivalentPLMNs() = OMIT_VALUE;
else equivalentPLMNs().set_implicit_omit();
if (!networkFeatureSupport().is_bound()) networkFeatureSupport() = OMIT_VALUE;
else networkFeatureSupport().set_implicit_omit();
if (!emergencyNumberList().is_bound()) emergencyNumberList() = OMIT_VALUE;
else emergencyNumberList().set_implicit_omit();
if (!requestedMSInformation().is_bound()) requestedMSInformation() = OMIT_VALUE;
else requestedMSInformation().set_implicit_omit();
if (!t3319().is_bound()) t3319() = OMIT_VALUE;
else t3319().set_implicit_omit();
if (!t3323().is_bound()) t3323() = OMIT_VALUE;
else t3323().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!additionalNetworkFeatureSupport().is_bound()) additionalNetworkFeatureSupport() = OMIT_VALUE;
else additionalNetworkFeatureSupport().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__AttachAccept::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 (24<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept has 24 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) attachResult().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) updateTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) radioPriority().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) radioPriorityTOM8().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) readyTimer().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) msIdentity().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) cellNotification().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) networkFeatureSupport().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) requestedMSInformation().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) t3319().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) t3323().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupport().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(23));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attachResult")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attachResult().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriorityTOM8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriorityTOM8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellNotification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellNotification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "equivalentPLMNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          equivalentPLMNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedMSInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedMSInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3319")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3319().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3323")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3323().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalNetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
  }
}

void PDU__GMM__AttachAccept::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_attachResult.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_updateTimer.encode_text(text_buf);
field_radioPriority.encode_text(text_buf);
field_radioPriorityTOM8.encode_text(text_buf);
field_routingAreaIdentification.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
field_readyTimer.encode_text(text_buf);
field_allocatedPTMSI.encode_text(text_buf);
field_msIdentity.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_t3302.encode_text(text_buf);
field_cellNotification.encode_text(text_buf);
field_equivalentPLMNs.encode_text(text_buf);
field_networkFeatureSupport.encode_text(text_buf);
field_emergencyNumberList.encode_text(text_buf);
field_requestedMSInformation.encode_text(text_buf);
field_t3319.encode_text(text_buf);
field_t3323.encode_text(text_buf);
field_t3312__ExtendedValue.encode_text(text_buf);
field_additionalNetworkFeatureSupport.encode_text(text_buf);
field_t3324.encode_text(text_buf);
field_extendedDRXParameters.encode_text(text_buf);
}

void PDU__GMM__AttachAccept::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_attachResult.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_updateTimer.decode_text(text_buf);
field_radioPriority.decode_text(text_buf);
field_radioPriorityTOM8.decode_text(text_buf);
field_routingAreaIdentification.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
field_readyTimer.decode_text(text_buf);
field_allocatedPTMSI.decode_text(text_buf);
field_msIdentity.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_t3302.decode_text(text_buf);
field_cellNotification.decode_text(text_buf);
field_equivalentPLMNs.decode_text(text_buf);
field_networkFeatureSupport.decode_text(text_buf);
field_emergencyNumberList.decode_text(text_buf);
field_requestedMSInformation.decode_text(text_buf);
field_t3319.decode_text(text_buf);
field_t3323.decode_text(text_buf);
field_t3312__ExtendedValue.decode_text(text_buf);
field_additionalNetworkFeatureSupport.decode_text(text_buf);
field_t3324.decode_text(text_buf);
field_extendedDRXParameters.decode_text(text_buf);
}

void PDU__GMM__AttachAccept::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__AttachAccept::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__AttachAccept::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, AttachResultV_descr_.raw->forceomit);
  decoded_field_length = field_attachResult.RAW_decode(AttachResultV_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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, GPRSTimerV_descr_.raw->forceomit);
  decoded_field_length = field_updateTimer.RAW_decode(GPRSTimerV_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, RadioPriorityV_descr_.raw->forceomit);
  decoded_field_length = field_radioPriority.RAW_decode(RadioPriorityV_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, RadioPriority2V_descr_.raw->forceomit);
  decoded_field_length = field_radioPriorityTOM8.RAW_decode(RadioPriority2V_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification.RAW_decode(RoutingAreaIdentificationV_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());
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_readyTimer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, GPRSTimerTV_descr_.raw->forceomit);
  decoded_field_length = field_readyTimer().RAW_decode(GPRSTimerTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_readyTimer = 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_readyTimer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_allocatedPTMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_allocatedPTMSI().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_allocatedPTMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_allocatedPTMSI.ispresent() || field_allocatedPTMSI().elementIdentifier() !=  bs_26){
  field_allocatedPTMSI=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_allocatedPTMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_msIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_msIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_msIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_msIdentity.ispresent() || field_msIdentity().elementIdentifier() !=  bs_27){
  field_msIdentity=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_msIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_gmmCause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, GMM__CauseTV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause().RAW_decode(GMM__CauseTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_gmmCause = 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_gmmCause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_t3302 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3302().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_t3302 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32){
  field_t3302=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_t3302=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_cellNotification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, CellNotificationT_descr_.raw->forceomit);
  decoded_field_length = field_cellNotification().RAW_decode(CellNotificationT_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_cellNotification = 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_cellNotification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_equivalentPLMNs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw->forceomit);
  decoded_field_length = field_equivalentPLMNs().RAW_decode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_equivalentPLMNs = 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_equivalentPLMNs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_networkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, NetworkFeatureSupportTV_descr_.raw->forceomit);
  decoded_field_length = field_networkFeatureSupport().RAW_decode(NetworkFeatureSupportTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_networkFeatureSupport = 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_networkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_emergencyNumberList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__MM__Types::EmergencyNumberListTLV_descr_.raw->forceomit);
  decoded_field_length = field_emergencyNumberList().RAW_decode(MobileL3__MM__Types::EmergencyNumberListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_emergencyNumberList = 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_emergencyNumberList=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_requestedMSInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, RequestedMSInformationTV_descr_.raw->forceomit);
  decoded_field_length = field_requestedMSInformation().RAW_decode(RequestedMSInformationTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_requestedMSInformation = 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_requestedMSInformation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_t3319 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3319().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_t3319 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3319.ispresent() || field_t3319().elementIdentifier() !=  os_33){
  field_t3319=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_t3319=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_t3323 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3323().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_t3323 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3323.ispresent() || field_t3323().elementIdentifier() !=  os_34){
  field_t3323=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_t3323=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_t3312__ExtendedValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3312__ExtendedValue().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_t3312__ExtendedValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17){
  field_t3312__ExtendedValue=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_t3312__ExtendedValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_additionalNetworkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, AdditionalNetworkFeatureSupportTLV_descr_.raw->forceomit);
  decoded_field_length = field_additionalNetworkFeatureSupport().RAW_decode(AdditionalNetworkFeatureSupportTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_additionalNetworkFeatureSupport = 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_additionalNetworkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_t3324 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3324().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_t3324 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31){
  field_t3324=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_t3324=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_extendedDRXParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, ExtendedDRXParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_extendedDRXParameters().RAW_decode(ExtendedDRXParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDRXParameters = 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_extendedDRXParameters=OMIT_VALUE;
  if (field_messageType !=  bs_25) 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__GMM__AttachAccept::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 = 24;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(24);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, AttachResultV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRSTimerV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RadioPriorityV_descr_.raw);
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, RadioPriority2V_descr_.raw);
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, RoutingAreaIdentificationV_descr_.raw);
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_readyTimer.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, GPRSTimerTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_allocatedPTMSI.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_msIdentity.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_gmmCause.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, GMM__CauseTV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_t3302.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_cellNotification.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, CellNotificationT_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_equivalentPLMNs.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_networkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_emergencyNumberList.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__MM__Types::EmergencyNumberListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_requestedMSInformation.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, RequestedMSInformationTV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_t3319.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_t3323.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_t3312__ExtendedValue.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_additionalNetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, AdditionalNetworkFeatureSupportTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_t3324.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_extendedDRXParameters.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, ExtendedDRXParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_attachResult.RAW_encode(AttachResultV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_updateTimer.RAW_encode(GPRSTimerV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_radioPriority.RAW_encode(RadioPriorityV_descr_, *myleaf.body.node.nodes[4]);
  encoded_length += field_radioPriorityTOM8.RAW_encode(RadioPriority2V_descr_, *myleaf.body.node.nodes[5]);
  encoded_length += field_routingAreaIdentification.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[6]);
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_readyTimer.ispresent()) {
  encoded_length += field_readyTimer().RAW_encode(GPRSTimerTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_allocatedPTMSI.ispresent()) {
  encoded_length += field_allocatedPTMSI().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_msIdentity.ispresent()) {
  encoded_length += field_msIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_gmmCause.ispresent()) {
  encoded_length += field_gmmCause().RAW_encode(GMM__CauseTV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_t3302.ispresent()) {
  encoded_length += field_t3302().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_cellNotification.ispresent()) {
  encoded_length += field_cellNotification().RAW_encode(CellNotificationT_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_equivalentPLMNs.ispresent()) {
  encoded_length += field_equivalentPLMNs().RAW_encode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_networkFeatureSupport.ispresent()) {
  encoded_length += field_networkFeatureSupport().RAW_encode(NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_emergencyNumberList.ispresent()) {
  encoded_length += field_emergencyNumberList().RAW_encode(MobileL3__MM__Types::EmergencyNumberListTLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_requestedMSInformation.ispresent()) {
  encoded_length += field_requestedMSInformation().RAW_encode(RequestedMSInformationTV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_t3319.ispresent()) {
  encoded_length += field_t3319().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_t3323.ispresent()) {
  encoded_length += field_t3323().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_t3312__ExtendedValue.ispresent()) {
  encoded_length += field_t3312__ExtendedValue().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_additionalNetworkFeatureSupport.ispresent()) {
  encoded_length += field_additionalNetworkFeatureSupport().RAW_encode(AdditionalNetworkFeatureSupportTLV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_t3324.ispresent()) {
  encoded_length += field_t3324().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_extendedDRXParameters.ispresent()) {
  encoded_length += field_extendedDRXParameters().RAW_encode(ExtendedDRXParametersTLV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_allocatedPTMSI.ispresent() && (!field_allocatedPTMSI.ispresent() || field_allocatedPTMSI().elementIdentifier() !=  bs_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT7_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_msIdentity.ispresent() && (!field_msIdentity.ispresent() || field_msIdentity().elementIdentifier() !=  bs_27)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={10,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_27.RAW_encode(General__Types::BIT7_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_t3302.ispresent() && (!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={12,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_32.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);
  }
  }
  if (field_t3319.ispresent() && (!field_t3319.ispresent() || field_t3319().elementIdentifier() !=  os_33)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={18,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_33.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);
  }
  }
  if (field_t3323.ispresent() && (!field_t3323.ispresent() || field_t3323().elementIdentifier() !=  os_34)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_34.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);
  }
  }
  if (field_t3312__ExtendedValue.ispresent() && (!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={20,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.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);
  }
  }
  if (field_t3324.ispresent() && (!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={22,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_31.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);
  }
  }
  if (field_messageType !=  bs_25) {
  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_25.RAW_encode(General__Types::BIT8_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__GMM__AttachAccept_template::single_value_struct {
BITSTRING_template field_messageType;
AttachResultV_template field_attachResult;
ForceToStandbyV_template field_forceToStandby;
GPRSTimerV_template field_updateTimer;
RadioPriorityV_template field_radioPriority;
RadioPriority2V_template field_radioPriorityTOM8;
RoutingAreaIdentificationV_template field_routingAreaIdentification;
P__TMSISignatureTV_template field_ptmsiSignature;
GPRSTimerTV_template field_readyTimer;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_allocatedPTMSI;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_msIdentity;
GMM__CauseTV_template field_gmmCause;
GPRSTimer2TLV_template field_t3302;
CellNotificationT_template field_cellNotification;
MobileL3__CommonIE__Types::PLMNListTLV_template field_equivalentPLMNs;
NetworkFeatureSupportTV_template field_networkFeatureSupport;
MobileL3__MM__Types::EmergencyNumberListTLV_template field_emergencyNumberList;
RequestedMSInformationTV_template field_requestedMSInformation;
GPRSTimer2TLV_template field_t3319;
GPRSTimer2TLV_template field_t3323;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_t3312__ExtendedValue;
AdditionalNetworkFeatureSupportTLV_template field_additionalNetworkFeatureSupport;
GPRSTimer2TLV_template field_t3324;
ExtendedDRXParametersTLV_template field_extendedDRXParameters;
};

void PDU__GMM__AttachAccept_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_messageType = ANY_VALUE;
single_value->field_attachResult = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_updateTimer = ANY_VALUE;
single_value->field_radioPriority = ANY_VALUE;
single_value->field_radioPriorityTOM8 = ANY_VALUE;
single_value->field_routingAreaIdentification = ANY_VALUE;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
single_value->field_readyTimer = ANY_OR_OMIT;
single_value->field_allocatedPTMSI = ANY_OR_OMIT;
single_value->field_msIdentity = ANY_OR_OMIT;
single_value->field_gmmCause = ANY_OR_OMIT;
single_value->field_t3302 = ANY_OR_OMIT;
single_value->field_cellNotification = ANY_OR_OMIT;
single_value->field_equivalentPLMNs = ANY_OR_OMIT;
single_value->field_networkFeatureSupport = ANY_OR_OMIT;
single_value->field_emergencyNumberList = ANY_OR_OMIT;
single_value->field_requestedMSInformation = ANY_OR_OMIT;
single_value->field_t3319 = ANY_OR_OMIT;
single_value->field_t3323 = ANY_OR_OMIT;
single_value->field_t3312__ExtendedValue = ANY_OR_OMIT;
single_value->field_additionalNetworkFeatureSupport = ANY_OR_OMIT;
single_value->field_t3324 = ANY_OR_OMIT;
single_value->field_extendedDRXParameters = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AttachAccept_template::copy_value(const PDU__GMM__AttachAccept& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.attachResult().is_bound()) {
  single_value->field_attachResult = other_value.attachResult();
} else {
  single_value->field_attachResult.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.updateTimer().is_bound()) {
  single_value->field_updateTimer = other_value.updateTimer();
} else {
  single_value->field_updateTimer.clean_up();
}
if (other_value.radioPriority().is_bound()) {
  single_value->field_radioPriority = other_value.radioPriority();
} else {
  single_value->field_radioPriority.clean_up();
}
if (other_value.radioPriorityTOM8().is_bound()) {
  single_value->field_radioPriorityTOM8 = other_value.radioPriorityTOM8();
} else {
  single_value->field_radioPriorityTOM8.clean_up();
}
if (other_value.routingAreaIdentification().is_bound()) {
  single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
  single_value->field_routingAreaIdentification.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
if (other_value.readyTimer().is_bound()) {
  if (other_value.readyTimer().ispresent()) single_value->field_readyTimer = other_value.readyTimer()();
  else single_value->field_readyTimer = OMIT_VALUE;
} else {
  single_value->field_readyTimer.clean_up();
}
if (other_value.allocatedPTMSI().is_bound()) {
  if (other_value.allocatedPTMSI().ispresent()) single_value->field_allocatedPTMSI = other_value.allocatedPTMSI()();
  else single_value->field_allocatedPTMSI = OMIT_VALUE;
} else {
  single_value->field_allocatedPTMSI.clean_up();
}
if (other_value.msIdentity().is_bound()) {
  if (other_value.msIdentity().ispresent()) single_value->field_msIdentity = other_value.msIdentity()();
  else single_value->field_msIdentity = OMIT_VALUE;
} else {
  single_value->field_msIdentity.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  if (other_value.gmmCause().ispresent()) single_value->field_gmmCause = other_value.gmmCause()();
  else single_value->field_gmmCause = OMIT_VALUE;
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.t3302().is_bound()) {
  if (other_value.t3302().ispresent()) single_value->field_t3302 = other_value.t3302()();
  else single_value->field_t3302 = OMIT_VALUE;
} else {
  single_value->field_t3302.clean_up();
}
if (other_value.cellNotification().is_bound()) {
  if (other_value.cellNotification().ispresent()) single_value->field_cellNotification = other_value.cellNotification()();
  else single_value->field_cellNotification = OMIT_VALUE;
} else {
  single_value->field_cellNotification.clean_up();
}
if (other_value.equivalentPLMNs().is_bound()) {
  if (other_value.equivalentPLMNs().ispresent()) single_value->field_equivalentPLMNs = other_value.equivalentPLMNs()();
  else single_value->field_equivalentPLMNs = OMIT_VALUE;
} else {
  single_value->field_equivalentPLMNs.clean_up();
}
if (other_value.networkFeatureSupport().is_bound()) {
  if (other_value.networkFeatureSupport().ispresent()) single_value->field_networkFeatureSupport = other_value.networkFeatureSupport()();
  else single_value->field_networkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_networkFeatureSupport.clean_up();
}
if (other_value.emergencyNumberList().is_bound()) {
  if (other_value.emergencyNumberList().ispresent()) single_value->field_emergencyNumberList = other_value.emergencyNumberList()();
  else single_value->field_emergencyNumberList = OMIT_VALUE;
} else {
  single_value->field_emergencyNumberList.clean_up();
}
if (other_value.requestedMSInformation().is_bound()) {
  if (other_value.requestedMSInformation().ispresent()) single_value->field_requestedMSInformation = other_value.requestedMSInformation()();
  else single_value->field_requestedMSInformation = OMIT_VALUE;
} else {
  single_value->field_requestedMSInformation.clean_up();
}
if (other_value.t3319().is_bound()) {
  if (other_value.t3319().ispresent()) single_value->field_t3319 = other_value.t3319()();
  else single_value->field_t3319 = OMIT_VALUE;
} else {
  single_value->field_t3319.clean_up();
}
if (other_value.t3323().is_bound()) {
  if (other_value.t3323().ispresent()) single_value->field_t3323 = other_value.t3323()();
  else single_value->field_t3323 = OMIT_VALUE;
} else {
  single_value->field_t3323.clean_up();
}
if (other_value.t3312__ExtendedValue().is_bound()) {
  if (other_value.t3312__ExtendedValue().ispresent()) single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue()();
  else single_value->field_t3312__ExtendedValue = OMIT_VALUE;
} else {
  single_value->field_t3312__ExtendedValue.clean_up();
}
if (other_value.additionalNetworkFeatureSupport().is_bound()) {
  if (other_value.additionalNetworkFeatureSupport().ispresent()) single_value->field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport()();
  else single_value->field_additionalNetworkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_additionalNetworkFeatureSupport.clean_up();
}
if (other_value.t3324().is_bound()) {
  if (other_value.t3324().ispresent()) single_value->field_t3324 = other_value.t3324()();
  else single_value->field_t3324 = OMIT_VALUE;
} else {
  single_value->field_t3324.clean_up();
}
if (other_value.extendedDRXParameters().is_bound()) {
  if (other_value.extendedDRXParameters().ispresent()) single_value->field_extendedDRXParameters = other_value.extendedDRXParameters()();
  else single_value->field_extendedDRXParameters = OMIT_VALUE;
} else {
  single_value->field_extendedDRXParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AttachAccept_template::copy_template(const PDU__GMM__AttachAccept_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.attachResult().get_selection()) {
single_value->field_attachResult = other_value.attachResult();
} else {
single_value->field_attachResult.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.updateTimer().get_selection()) {
single_value->field_updateTimer = other_value.updateTimer();
} else {
single_value->field_updateTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.radioPriority().get_selection()) {
single_value->field_radioPriority = other_value.radioPriority();
} else {
single_value->field_radioPriority.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.radioPriorityTOM8().get_selection()) {
single_value->field_radioPriorityTOM8 = other_value.radioPriorityTOM8();
} else {
single_value->field_radioPriorityTOM8.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaIdentification().get_selection()) {
single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
single_value->field_routingAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.readyTimer().get_selection()) {
single_value->field_readyTimer = other_value.readyTimer();
} else {
single_value->field_readyTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.allocatedPTMSI().get_selection()) {
single_value->field_allocatedPTMSI = other_value.allocatedPTMSI();
} else {
single_value->field_allocatedPTMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msIdentity().get_selection()) {
single_value->field_msIdentity = other_value.msIdentity();
} else {
single_value->field_msIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3302().get_selection()) {
single_value->field_t3302 = other_value.t3302();
} else {
single_value->field_t3302.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellNotification().get_selection()) {
single_value->field_cellNotification = other_value.cellNotification();
} else {
single_value->field_cellNotification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.equivalentPLMNs().get_selection()) {
single_value->field_equivalentPLMNs = other_value.equivalentPLMNs();
} else {
single_value->field_equivalentPLMNs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkFeatureSupport().get_selection()) {
single_value->field_networkFeatureSupport = other_value.networkFeatureSupport();
} else {
single_value->field_networkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.emergencyNumberList().get_selection()) {
single_value->field_emergencyNumberList = other_value.emergencyNumberList();
} else {
single_value->field_emergencyNumberList.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedMSInformation().get_selection()) {
single_value->field_requestedMSInformation = other_value.requestedMSInformation();
} else {
single_value->field_requestedMSInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3319().get_selection()) {
single_value->field_t3319 = other_value.t3319();
} else {
single_value->field_t3319.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3323().get_selection()) {
single_value->field_t3323 = other_value.t3323();
} else {
single_value->field_t3323.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3312__ExtendedValue().get_selection()) {
single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
} else {
single_value->field_t3312__ExtendedValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalNetworkFeatureSupport().get_selection()) {
single_value->field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
} else {
single_value->field_additionalNetworkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3324().get_selection()) {
single_value->field_t3324 = other_value.t3324();
} else {
single_value->field_t3324.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDRXParameters().get_selection()) {
single_value->field_extendedDRXParameters = other_value.extendedDRXParameters();
} else {
single_value->field_extendedDRXParameters.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__GMM__AttachAccept_template[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__GMM__AttachAccept_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AttachAccept_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
break;
}
set_selection(other_value);
}

PDU__GMM__AttachAccept_template::PDU__GMM__AttachAccept_template()
{
}

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

PDU__GMM__AttachAccept_template::PDU__GMM__AttachAccept_template(const PDU__GMM__AttachAccept& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__AttachAccept_template& PDU__GMM__AttachAccept_template::operator=(const OPTIONAL<PDU__GMM__AttachAccept>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__AttachAccept&)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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
}
return *this;
}

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

boolean PDU__GMM__AttachAccept_template::match(const PDU__GMM__AttachAccept& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.attachResult().is_bound()) return FALSE;
if(!single_value->field_attachResult.match(other_value.attachResult(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.updateTimer().is_bound()) return FALSE;
if(!single_value->field_updateTimer.match(other_value.updateTimer(), legacy))return FALSE;
if(!other_value.radioPriority().is_bound()) return FALSE;
if(!single_value->field_radioPriority.match(other_value.radioPriority(), legacy))return FALSE;
if(!other_value.radioPriorityTOM8().is_bound()) return FALSE;
if(!single_value->field_radioPriorityTOM8.match(other_value.radioPriorityTOM8(), legacy))return FALSE;
if(!other_value.routingAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_routingAreaIdentification.match(other_value.routingAreaIdentification(), legacy))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const P__TMSISignatureTV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.match_omit(legacy)))return FALSE;
if(!other_value.readyTimer().is_bound()) return FALSE;
if((other_value.readyTimer().ispresent() ? !single_value->field_readyTimer.match((const GPRSTimerTV&)other_value.readyTimer(), legacy) : !single_value->field_readyTimer.match_omit(legacy)))return FALSE;
if(!other_value.allocatedPTMSI().is_bound()) return FALSE;
if((other_value.allocatedPTMSI().ispresent() ? !single_value->field_allocatedPTMSI.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.allocatedPTMSI(), legacy) : !single_value->field_allocatedPTMSI.match_omit(legacy)))return FALSE;
if(!other_value.msIdentity().is_bound()) return FALSE;
if((other_value.msIdentity().ispresent() ? !single_value->field_msIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.msIdentity(), legacy) : !single_value->field_msIdentity.match_omit(legacy)))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if((other_value.gmmCause().ispresent() ? !single_value->field_gmmCause.match((const GMM__CauseTV&)other_value.gmmCause(), legacy) : !single_value->field_gmmCause.match_omit(legacy)))return FALSE;
if(!other_value.t3302().is_bound()) return FALSE;
if((other_value.t3302().ispresent() ? !single_value->field_t3302.match((const GPRSTimer2TLV&)other_value.t3302(), legacy) : !single_value->field_t3302.match_omit(legacy)))return FALSE;
if(!other_value.cellNotification().is_bound()) return FALSE;
if((other_value.cellNotification().ispresent() ? !single_value->field_cellNotification.match((const CellNotificationT&)other_value.cellNotification(), legacy) : !single_value->field_cellNotification.match_omit(legacy)))return FALSE;
if(!other_value.equivalentPLMNs().is_bound()) return FALSE;
if((other_value.equivalentPLMNs().ispresent() ? !single_value->field_equivalentPLMNs.match((const MobileL3__CommonIE__Types::PLMNListTLV&)other_value.equivalentPLMNs(), legacy) : !single_value->field_equivalentPLMNs.match_omit(legacy)))return FALSE;
if(!other_value.networkFeatureSupport().is_bound()) return FALSE;
if((other_value.networkFeatureSupport().ispresent() ? !single_value->field_networkFeatureSupport.match((const NetworkFeatureSupportTV&)other_value.networkFeatureSupport(), legacy) : !single_value->field_networkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.emergencyNumberList().is_bound()) return FALSE;
if((other_value.emergencyNumberList().ispresent() ? !single_value->field_emergencyNumberList.match((const MobileL3__MM__Types::EmergencyNumberListTLV&)other_value.emergencyNumberList(), legacy) : !single_value->field_emergencyNumberList.match_omit(legacy)))return FALSE;
if(!other_value.requestedMSInformation().is_bound()) return FALSE;
if((other_value.requestedMSInformation().ispresent() ? !single_value->field_requestedMSInformation.match((const RequestedMSInformationTV&)other_value.requestedMSInformation(), legacy) : !single_value->field_requestedMSInformation.match_omit(legacy)))return FALSE;
if(!other_value.t3319().is_bound()) return FALSE;
if((other_value.t3319().ispresent() ? !single_value->field_t3319.match((const GPRSTimer2TLV&)other_value.t3319(), legacy) : !single_value->field_t3319.match_omit(legacy)))return FALSE;
if(!other_value.t3323().is_bound()) return FALSE;
if((other_value.t3323().ispresent() ? !single_value->field_t3323.match((const GPRSTimer2TLV&)other_value.t3323(), legacy) : !single_value->field_t3323.match_omit(legacy)))return FALSE;
if(!other_value.t3312__ExtendedValue().is_bound()) return FALSE;
if((other_value.t3312__ExtendedValue().ispresent() ? !single_value->field_t3312__ExtendedValue.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.t3312__ExtendedValue(), legacy) : !single_value->field_t3312__ExtendedValue.match_omit(legacy)))return FALSE;
if(!other_value.additionalNetworkFeatureSupport().is_bound()) return FALSE;
if((other_value.additionalNetworkFeatureSupport().ispresent() ? !single_value->field_additionalNetworkFeatureSupport.match((const AdditionalNetworkFeatureSupportTLV&)other_value.additionalNetworkFeatureSupport(), legacy) : !single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.t3324().is_bound()) return FALSE;
if((other_value.t3324().ispresent() ? !single_value->field_t3324.match((const GPRSTimer2TLV&)other_value.t3324(), legacy) : !single_value->field_t3324.match_omit(legacy)))return FALSE;
if(!other_value.extendedDRXParameters().is_bound()) return FALSE;
if((other_value.extendedDRXParameters().ispresent() ? !single_value->field_extendedDRXParameters.match((const ExtendedDRXParametersTLV&)other_value.extendedDRXParameters(), legacy) : !single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
}
return FALSE;
}

boolean PDU__GMM__AttachAccept_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_attachResult.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_updateTimer.is_bound()
 || single_value->field_radioPriority.is_bound()
 || single_value->field_radioPriorityTOM8.is_bound()
 || single_value->field_routingAreaIdentification.is_bound()
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound())
 || (single_value->field_readyTimer.is_omit() || single_value->field_readyTimer.is_bound())
 || (single_value->field_allocatedPTMSI.is_omit() || single_value->field_allocatedPTMSI.is_bound())
 || (single_value->field_msIdentity.is_omit() || single_value->field_msIdentity.is_bound())
 || (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_bound())
 || (single_value->field_t3302.is_omit() || single_value->field_t3302.is_bound())
 || (single_value->field_cellNotification.is_omit() || single_value->field_cellNotification.is_bound())
 || (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_bound())
 || (single_value->field_networkFeatureSupport.is_omit() || single_value->field_networkFeatureSupport.is_bound())
 || (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_bound())
 || (single_value->field_requestedMSInformation.is_omit() || single_value->field_requestedMSInformation.is_bound())
 || (single_value->field_t3319.is_omit() || single_value->field_t3319.is_bound())
 || (single_value->field_t3323.is_omit() || single_value->field_t3323.is_bound())
 || (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_bound())
 || (single_value->field_additionalNetworkFeatureSupport.is_omit() || single_value->field_additionalNetworkFeatureSupport.is_bound())
 || (single_value->field_t3324.is_omit() || single_value->field_t3324.is_bound())
 || (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_bound());
}

boolean PDU__GMM__AttachAccept_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_attachResult.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_updateTimer.is_value()
 && single_value->field_radioPriority.is_value()
 && single_value->field_radioPriorityTOM8.is_value()
 && single_value->field_routingAreaIdentification.is_value()
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value())
 && (single_value->field_readyTimer.is_omit() || single_value->field_readyTimer.is_value())
 && (single_value->field_allocatedPTMSI.is_omit() || single_value->field_allocatedPTMSI.is_value())
 && (single_value->field_msIdentity.is_omit() || single_value->field_msIdentity.is_value())
 && (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_value())
 && (single_value->field_t3302.is_omit() || single_value->field_t3302.is_value())
 && (single_value->field_cellNotification.is_omit() || single_value->field_cellNotification.is_value())
 && (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_value())
 && (single_value->field_networkFeatureSupport.is_omit() || single_value->field_networkFeatureSupport.is_value())
 && (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_value())
 && (single_value->field_requestedMSInformation.is_omit() || single_value->field_requestedMSInformation.is_value())
 && (single_value->field_t3319.is_omit() || single_value->field_t3319.is_value())
 && (single_value->field_t3323.is_omit() || single_value->field_t3323.is_value())
 && (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_value())
 && (single_value->field_additionalNetworkFeatureSupport.is_omit() || single_value->field_additionalNetworkFeatureSupport.is_value())
 && (single_value->field_t3324.is_omit() || single_value->field_t3324.is_value())
 && (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_value());
}

void PDU__GMM__AttachAccept_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__GMM__AttachAccept PDU__GMM__AttachAccept_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
PDU__GMM__AttachAccept ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_attachResult.is_bound()) {
ret_val.attachResult() = single_value->field_attachResult.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_updateTimer.is_bound()) {
ret_val.updateTimer() = single_value->field_updateTimer.valueof();
}
if (single_value->field_radioPriority.is_bound()) {
ret_val.radioPriority() = single_value->field_radioPriority.valueof();
}
if (single_value->field_radioPriorityTOM8.is_bound()) {
ret_val.radioPriorityTOM8() = single_value->field_radioPriorityTOM8.valueof();
}
if (single_value->field_routingAreaIdentification.is_bound()) {
ret_val.routingAreaIdentification() = single_value->field_routingAreaIdentification.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
if (single_value->field_readyTimer.is_omit()) ret_val.readyTimer() = OMIT_VALUE;
else if (single_value->field_readyTimer.is_bound()) {
ret_val.readyTimer() = single_value->field_readyTimer.valueof();
}
if (single_value->field_allocatedPTMSI.is_omit()) ret_val.allocatedPTMSI() = OMIT_VALUE;
else if (single_value->field_allocatedPTMSI.is_bound()) {
ret_val.allocatedPTMSI() = single_value->field_allocatedPTMSI.valueof();
}
if (single_value->field_msIdentity.is_omit()) ret_val.msIdentity() = OMIT_VALUE;
else if (single_value->field_msIdentity.is_bound()) {
ret_val.msIdentity() = single_value->field_msIdentity.valueof();
}
if (single_value->field_gmmCause.is_omit()) ret_val.gmmCause() = OMIT_VALUE;
else if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_t3302.is_omit()) ret_val.t3302() = OMIT_VALUE;
else if (single_value->field_t3302.is_bound()) {
ret_val.t3302() = single_value->field_t3302.valueof();
}
if (single_value->field_cellNotification.is_omit()) ret_val.cellNotification() = OMIT_VALUE;
else if (single_value->field_cellNotification.is_bound()) {
ret_val.cellNotification() = single_value->field_cellNotification.valueof();
}
if (single_value->field_equivalentPLMNs.is_omit()) ret_val.equivalentPLMNs() = OMIT_VALUE;
else if (single_value->field_equivalentPLMNs.is_bound()) {
ret_val.equivalentPLMNs() = single_value->field_equivalentPLMNs.valueof();
}
if (single_value->field_networkFeatureSupport.is_omit()) ret_val.networkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_networkFeatureSupport.is_bound()) {
ret_val.networkFeatureSupport() = single_value->field_networkFeatureSupport.valueof();
}
if (single_value->field_emergencyNumberList.is_omit()) ret_val.emergencyNumberList() = OMIT_VALUE;
else if (single_value->field_emergencyNumberList.is_bound()) {
ret_val.emergencyNumberList() = single_value->field_emergencyNumberList.valueof();
}
if (single_value->field_requestedMSInformation.is_omit()) ret_val.requestedMSInformation() = OMIT_VALUE;
else if (single_value->field_requestedMSInformation.is_bound()) {
ret_val.requestedMSInformation() = single_value->field_requestedMSInformation.valueof();
}
if (single_value->field_t3319.is_omit()) ret_val.t3319() = OMIT_VALUE;
else if (single_value->field_t3319.is_bound()) {
ret_val.t3319() = single_value->field_t3319.valueof();
}
if (single_value->field_t3323.is_omit()) ret_val.t3323() = OMIT_VALUE;
else if (single_value->field_t3323.is_bound()) {
ret_val.t3323() = single_value->field_t3323.valueof();
}
if (single_value->field_t3312__ExtendedValue.is_omit()) ret_val.t3312__ExtendedValue() = OMIT_VALUE;
else if (single_value->field_t3312__ExtendedValue.is_bound()) {
ret_val.t3312__ExtendedValue() = single_value->field_t3312__ExtendedValue.valueof();
}
if (single_value->field_additionalNetworkFeatureSupport.is_omit()) ret_val.additionalNetworkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_additionalNetworkFeatureSupport.is_bound()) {
ret_val.additionalNetworkFeatureSupport() = single_value->field_additionalNetworkFeatureSupport.valueof();
}
if (single_value->field_t3324.is_omit()) ret_val.t3324() = OMIT_VALUE;
else if (single_value->field_t3324.is_bound()) {
ret_val.t3324() = single_value->field_t3324.valueof();
}
if (single_value->field_extendedDRXParameters.is_omit()) ret_val.extendedDRXParameters() = OMIT_VALUE;
else if (single_value->field_extendedDRXParameters.is_bound()) {
ret_val.extendedDRXParameters() = single_value->field_extendedDRXParameters.valueof();
}
return ret_val;
}

void PDU__GMM__AttachAccept_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AttachAccept_template[list_length];
}

PDU__GMM__AttachAccept_template& PDU__GMM__AttachAccept_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__AttachAccept_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AttachAccept_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_messageType;
}

AttachResultV_template& PDU__GMM__AttachAccept_template::attachResult()
{
set_specific();
return single_value->field_attachResult;
}

const AttachResultV_template& PDU__GMM__AttachAccept_template::attachResult() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field attachResult of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_attachResult;
}

ForceToStandbyV_template& PDU__GMM__AttachAccept_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__AttachAccept_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_forceToStandby;
}

GPRSTimerV_template& PDU__GMM__AttachAccept_template::updateTimer()
{
set_specific();
return single_value->field_updateTimer;
}

const GPRSTimerV_template& PDU__GMM__AttachAccept_template::updateTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field updateTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_updateTimer;
}

RadioPriorityV_template& PDU__GMM__AttachAccept_template::radioPriority()
{
set_specific();
return single_value->field_radioPriority;
}

const RadioPriorityV_template& PDU__GMM__AttachAccept_template::radioPriority() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radioPriority of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_radioPriority;
}

RadioPriority2V_template& PDU__GMM__AttachAccept_template::radioPriorityTOM8()
{
set_specific();
return single_value->field_radioPriorityTOM8;
}

const RadioPriority2V_template& PDU__GMM__AttachAccept_template::radioPriorityTOM8() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field radioPriorityTOM8 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_radioPriorityTOM8;
}

RoutingAreaIdentificationV_template& PDU__GMM__AttachAccept_template::routingAreaIdentification()
{
set_specific();
return single_value->field_routingAreaIdentification;
}

const RoutingAreaIdentificationV_template& PDU__GMM__AttachAccept_template::routingAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaIdentification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_routingAreaIdentification;
}

P__TMSISignatureTV_template& PDU__GMM__AttachAccept_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const P__TMSISignatureTV_template& PDU__GMM__AttachAccept_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_ptmsiSignature;
}

GPRSTimerTV_template& PDU__GMM__AttachAccept_template::readyTimer()
{
set_specific();
return single_value->field_readyTimer;
}

const GPRSTimerTV_template& PDU__GMM__AttachAccept_template::readyTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field readyTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_readyTimer;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachAccept_template::allocatedPTMSI()
{
set_specific();
return single_value->field_allocatedPTMSI;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachAccept_template::allocatedPTMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allocatedPTMSI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_allocatedPTMSI;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachAccept_template::msIdentity()
{
set_specific();
return single_value->field_msIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AttachAccept_template::msIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_msIdentity;
}

GMM__CauseTV_template& PDU__GMM__AttachAccept_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseTV_template& PDU__GMM__AttachAccept_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_gmmCause;
}

GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3302()
{
set_specific();
return single_value->field_t3302;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3302() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3302 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3302;
}

CellNotificationT_template& PDU__GMM__AttachAccept_template::cellNotification()
{
set_specific();
return single_value->field_cellNotification;
}

const CellNotificationT_template& PDU__GMM__AttachAccept_template::cellNotification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellNotification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_cellNotification;
}

MobileL3__CommonIE__Types::PLMNListTLV_template& PDU__GMM__AttachAccept_template::equivalentPLMNs()
{
set_specific();
return single_value->field_equivalentPLMNs;
}

const MobileL3__CommonIE__Types::PLMNListTLV_template& PDU__GMM__AttachAccept_template::equivalentPLMNs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field equivalentPLMNs of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_equivalentPLMNs;
}

NetworkFeatureSupportTV_template& PDU__GMM__AttachAccept_template::networkFeatureSupport()
{
set_specific();
return single_value->field_networkFeatureSupport;
}

const NetworkFeatureSupportTV_template& PDU__GMM__AttachAccept_template::networkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_networkFeatureSupport;
}

MobileL3__MM__Types::EmergencyNumberListTLV_template& PDU__GMM__AttachAccept_template::emergencyNumberList()
{
set_specific();
return single_value->field_emergencyNumberList;
}

const MobileL3__MM__Types::EmergencyNumberListTLV_template& PDU__GMM__AttachAccept_template::emergencyNumberList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyNumberList of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_emergencyNumberList;
}

RequestedMSInformationTV_template& PDU__GMM__AttachAccept_template::requestedMSInformation()
{
set_specific();
return single_value->field_requestedMSInformation;
}

const RequestedMSInformationTV_template& PDU__GMM__AttachAccept_template::requestedMSInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedMSInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_requestedMSInformation;
}

GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3319()
{
set_specific();
return single_value->field_t3319;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3319() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3319 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3319;
}

GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3323()
{
set_specific();
return single_value->field_t3323;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3323() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3323 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3323;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__AttachAccept_template::t3312__ExtendedValue()
{
set_specific();
return single_value->field_t3312__ExtendedValue;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__AttachAccept_template::t3312__ExtendedValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3312_ExtendedValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3312__ExtendedValue;
}

AdditionalNetworkFeatureSupportTLV_template& PDU__GMM__AttachAccept_template::additionalNetworkFeatureSupport()
{
set_specific();
return single_value->field_additionalNetworkFeatureSupport;
}

const AdditionalNetworkFeatureSupportTLV_template& PDU__GMM__AttachAccept_template::additionalNetworkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalNetworkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_additionalNetworkFeatureSupport;
}

GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3324()
{
set_specific();
return single_value->field_t3324;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachAccept_template::t3324() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3324 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_t3324;
}

ExtendedDRXParametersTLV_template& PDU__GMM__AttachAccept_template::extendedDRXParameters()
{
set_specific();
return single_value->field_extendedDRXParameters;
}

const ExtendedDRXParametersTLV_template& PDU__GMM__AttachAccept_template::extendedDRXParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDRXParameters of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
return single_value->field_extendedDRXParameters;
}

int PDU__GMM__AttachAccept_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 7;
      if (single_value->field_ptmsiSignature.is_present()) ret_val++;
      if (single_value->field_readyTimer.is_present()) ret_val++;
      if (single_value->field_allocatedPTMSI.is_present()) ret_val++;
      if (single_value->field_msIdentity.is_present()) ret_val++;
      if (single_value->field_gmmCause.is_present()) ret_val++;
      if (single_value->field_t3302.is_present()) ret_val++;
      if (single_value->field_cellNotification.is_present()) ret_val++;
      if (single_value->field_equivalentPLMNs.is_present()) ret_val++;
      if (single_value->field_networkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_emergencyNumberList.is_present()) ret_val++;
      if (single_value->field_requestedMSInformation.is_present()) ret_val++;
      if (single_value->field_t3319.is_present()) ret_val++;
      if (single_value->field_t3323.is_present()) ret_val++;
      if (single_value->field_t3312__ExtendedValue.is_present()) ret_val++;
      if (single_value->field_additionalNetworkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_t3324.is_present()) ret_val++;
      if (single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept 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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
  }
  return 0;
}

void PDU__GMM__AttachAccept_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", attachResult := ");
single_value->field_attachResult.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", updateTimer := ");
single_value->field_updateTimer.log();
TTCN_Logger::log_event_str(", radioPriority := ");
single_value->field_radioPriority.log();
TTCN_Logger::log_event_str(", radioPriorityTOM8 := ");
single_value->field_radioPriorityTOM8.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", readyTimer := ");
single_value->field_readyTimer.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", msIdentity := ");
single_value->field_msIdentity.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
single_value->field_t3302.log();
TTCN_Logger::log_event_str(", cellNotification := ");
single_value->field_cellNotification.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
single_value->field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", requestedMSInformation := ");
single_value->field_requestedMSInformation.log();
TTCN_Logger::log_event_str(", t3319 := ");
single_value->field_t3319.log();
TTCN_Logger::log_event_str(", t3323 := ");
single_value->field_t3323.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
single_value->field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", t3324 := ");
single_value->field_t3324.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
single_value->field_extendedDRXParameters.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__GMM__AttachAccept_template::log_match(const PDU__GMM__AttachAccept& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_attachResult.match(match_value.attachResult(), legacy)){
TTCN_Logger::log_logmatch_info(".attachResult");
single_value->field_attachResult.log_match(match_value.attachResult(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_updateTimer.match(match_value.updateTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".updateTimer");
single_value->field_updateTimer.log_match(match_value.updateTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_radioPriority.match(match_value.radioPriority(), legacy)){
TTCN_Logger::log_logmatch_info(".radioPriority");
single_value->field_radioPriority.log_match(match_value.radioPriority(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_radioPriorityTOM8.match(match_value.radioPriorityTOM8(), legacy)){
TTCN_Logger::log_logmatch_info(".radioPriorityTOM8");
single_value->field_radioPriorityTOM8.log_match(match_value.radioPriorityTOM8(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingAreaIdentification.match(match_value.routingAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.readyTimer().ispresent()){
if(!single_value->field_readyTimer.match(match_value.readyTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".readyTimer");
single_value->field_readyTimer.log_match(match_value.readyTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_readyTimer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".readyTimer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_readyTimer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.allocatedPTMSI().ispresent()){
if(!single_value->field_allocatedPTMSI.match(match_value.allocatedPTMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".allocatedPTMSI");
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_allocatedPTMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".allocatedPTMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.msIdentity().ispresent()){
if(!single_value->field_msIdentity.match(match_value.msIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".msIdentity");
single_value->field_msIdentity.log_match(match_value.msIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_msIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".msIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_msIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.gmmCause().ispresent()){
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gmmCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gmmCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3302().ispresent()){
if(!single_value->field_t3302.match(match_value.t3302(), legacy)){
TTCN_Logger::log_logmatch_info(".t3302");
single_value->field_t3302.log_match(match_value.t3302(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3302.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3302 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3302.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cellNotification().ispresent()){
if(!single_value->field_cellNotification.match(match_value.cellNotification(), legacy)){
TTCN_Logger::log_logmatch_info(".cellNotification");
single_value->field_cellNotification.log_match(match_value.cellNotification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellNotification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellNotification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellNotification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.equivalentPLMNs().ispresent()){
if(!single_value->field_equivalentPLMNs.match(match_value.equivalentPLMNs(), legacy)){
TTCN_Logger::log_logmatch_info(".equivalentPLMNs");
single_value->field_equivalentPLMNs.log_match(match_value.equivalentPLMNs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_equivalentPLMNs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".equivalentPLMNs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkFeatureSupport().ispresent()){
if(!single_value->field_networkFeatureSupport.match(match_value.networkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".networkFeatureSupport");
single_value->field_networkFeatureSupport.log_match(match_value.networkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.emergencyNumberList().ispresent()){
if(!single_value->field_emergencyNumberList.match(match_value.emergencyNumberList(), legacy)){
TTCN_Logger::log_logmatch_info(".emergencyNumberList");
single_value->field_emergencyNumberList.log_match(match_value.emergencyNumberList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_emergencyNumberList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".emergencyNumberList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.requestedMSInformation().ispresent()){
if(!single_value->field_requestedMSInformation.match(match_value.requestedMSInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedMSInformation");
single_value->field_requestedMSInformation.log_match(match_value.requestedMSInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_requestedMSInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".requestedMSInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_requestedMSInformation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3319().ispresent()){
if(!single_value->field_t3319.match(match_value.t3319(), legacy)){
TTCN_Logger::log_logmatch_info(".t3319");
single_value->field_t3319.log_match(match_value.t3319(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3319.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3319 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3319.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3323().ispresent()){
if(!single_value->field_t3323.match(match_value.t3323(), legacy)){
TTCN_Logger::log_logmatch_info(".t3323");
single_value->field_t3323.log_match(match_value.t3323(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3323.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3323 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3323.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3312__ExtendedValue().ispresent()){
if(!single_value->field_t3312__ExtendedValue.match(match_value.t3312__ExtendedValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue");
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3312__ExtendedValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalNetworkFeatureSupport().ispresent()){
if(!single_value->field_additionalNetworkFeatureSupport.match(match_value.additionalNetworkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupport");
single_value->field_additionalNetworkFeatureSupport.log_match(match_value.additionalNetworkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3324().ispresent()){
if(!single_value->field_t3324.match(match_value.t3324(), legacy)){
TTCN_Logger::log_logmatch_info(".t3324");
single_value->field_t3324.log_match(match_value.t3324(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3324.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3324 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3324.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedDRXParameters().ispresent()){
if(!single_value->field_extendedDRXParameters.match(match_value.extendedDRXParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDRXParameters");
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDRXParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDRXParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDRXParameters.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", attachResult := ");
single_value->field_attachResult.log_match(match_value.attachResult(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", updateTimer := ");
single_value->field_updateTimer.log_match(match_value.updateTimer(), legacy);
TTCN_Logger::log_event_str(", radioPriority := ");
single_value->field_radioPriority.log_match(match_value.radioPriority(), legacy);
TTCN_Logger::log_event_str(", radioPriorityTOM8 := ");
single_value->field_radioPriorityTOM8.log_match(match_value.radioPriorityTOM8(), legacy);
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", readyTimer := ");
if (match_value.readyTimer().ispresent()) {
single_value->field_readyTimer.log_match(match_value.readyTimer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_readyTimer.log();
if (single_value->field_readyTimer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
if (match_value.allocatedPTMSI().ispresent()) {
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_allocatedPTMSI.log();
if (single_value->field_allocatedPTMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", msIdentity := ");
if (match_value.msIdentity().ispresent()) {
single_value->field_msIdentity.log_match(match_value.msIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_msIdentity.log();
if (single_value->field_msIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", gmmCause := ");
if (match_value.gmmCause().ispresent()) {
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gmmCause.log();
if (single_value->field_gmmCause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3302 := ");
if (match_value.t3302().ispresent()) {
single_value->field_t3302.log_match(match_value.t3302(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3302.log();
if (single_value->field_t3302.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cellNotification := ");
if (match_value.cellNotification().ispresent()) {
single_value->field_cellNotification.log_match(match_value.cellNotification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellNotification.log();
if (single_value->field_cellNotification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
if (match_value.equivalentPLMNs().ispresent()) {
single_value->field_equivalentPLMNs.log_match(match_value.equivalentPLMNs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_equivalentPLMNs.log();
if (single_value->field_equivalentPLMNs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
if (match_value.networkFeatureSupport().ispresent()) {
single_value->field_networkFeatureSupport.log_match(match_value.networkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkFeatureSupport.log();
if (single_value->field_networkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", emergencyNumberList := ");
if (match_value.emergencyNumberList().ispresent()) {
single_value->field_emergencyNumberList.log_match(match_value.emergencyNumberList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_emergencyNumberList.log();
if (single_value->field_emergencyNumberList.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", requestedMSInformation := ");
if (match_value.requestedMSInformation().ispresent()) {
single_value->field_requestedMSInformation.log_match(match_value.requestedMSInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_requestedMSInformation.log();
if (single_value->field_requestedMSInformation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3319 := ");
if (match_value.t3319().ispresent()) {
single_value->field_t3319.log_match(match_value.t3319(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3319.log();
if (single_value->field_t3319.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3323 := ");
if (match_value.t3323().ispresent()) {
single_value->field_t3323.log_match(match_value.t3323(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3323.log();
if (single_value->field_t3323.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
if (match_value.t3312__ExtendedValue().ispresent()) {
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3312__ExtendedValue.log();
if (single_value->field_t3312__ExtendedValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
if (match_value.additionalNetworkFeatureSupport().ispresent()) {
single_value->field_additionalNetworkFeatureSupport.log_match(match_value.additionalNetworkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalNetworkFeatureSupport.log();
if (single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3324 := ");
if (match_value.t3324().ispresent()) {
single_value->field_t3324.log_match(match_value.t3324(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3324.log();
if (single_value->field_t3324.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
if (match_value.extendedDRXParameters().ispresent()) {
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDRXParameters.log();
if (single_value->field_extendedDRXParameters.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 PDU__GMM__AttachAccept_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (attachResult().is_bound()) attachResult().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (updateTimer().is_bound()) updateTimer().set_implicit_omit();
if (radioPriority().is_bound()) radioPriority().set_implicit_omit();
if (radioPriorityTOM8().is_bound()) radioPriorityTOM8().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!readyTimer().is_bound()) readyTimer() = OMIT_VALUE;
else readyTimer().set_implicit_omit();
if (!allocatedPTMSI().is_bound()) allocatedPTMSI() = OMIT_VALUE;
else allocatedPTMSI().set_implicit_omit();
if (!msIdentity().is_bound()) msIdentity() = OMIT_VALUE;
else msIdentity().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!cellNotification().is_bound()) cellNotification() = OMIT_VALUE;
else cellNotification().set_implicit_omit();
if (!equivalentPLMNs().is_bound()) equivalentPLMNs() = OMIT_VALUE;
else equivalentPLMNs().set_implicit_omit();
if (!networkFeatureSupport().is_bound()) networkFeatureSupport() = OMIT_VALUE;
else networkFeatureSupport().set_implicit_omit();
if (!emergencyNumberList().is_bound()) emergencyNumberList() = OMIT_VALUE;
else emergencyNumberList().set_implicit_omit();
if (!requestedMSInformation().is_bound()) requestedMSInformation() = OMIT_VALUE;
else requestedMSInformation().set_implicit_omit();
if (!t3319().is_bound()) t3319() = OMIT_VALUE;
else t3319().set_implicit_omit();
if (!t3323().is_bound()) t3323() = OMIT_VALUE;
else t3323().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!additionalNetworkFeatureSupport().is_bound()) additionalNetworkFeatureSupport() = OMIT_VALUE;
else additionalNetworkFeatureSupport().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__AttachAccept_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_attachResult.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_updateTimer.encode_text(text_buf);
single_value->field_radioPriority.encode_text(text_buf);
single_value->field_radioPriorityTOM8.encode_text(text_buf);
single_value->field_routingAreaIdentification.encode_text(text_buf);
single_value->field_ptmsiSignature.encode_text(text_buf);
single_value->field_readyTimer.encode_text(text_buf);
single_value->field_allocatedPTMSI.encode_text(text_buf);
single_value->field_msIdentity.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_t3302.encode_text(text_buf);
single_value->field_cellNotification.encode_text(text_buf);
single_value->field_equivalentPLMNs.encode_text(text_buf);
single_value->field_networkFeatureSupport.encode_text(text_buf);
single_value->field_emergencyNumberList.encode_text(text_buf);
single_value->field_requestedMSInformation.encode_text(text_buf);
single_value->field_t3319.encode_text(text_buf);
single_value->field_t3323.encode_text(text_buf);
single_value->field_t3312__ExtendedValue.encode_text(text_buf);
single_value->field_additionalNetworkFeatureSupport.encode_text(text_buf);
single_value->field_t3324.encode_text(text_buf);
single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
}
}

void PDU__GMM__AttachAccept_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_messageType.decode_text(text_buf);
single_value->field_attachResult.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_updateTimer.decode_text(text_buf);
single_value->field_radioPriority.decode_text(text_buf);
single_value->field_radioPriorityTOM8.decode_text(text_buf);
single_value->field_routingAreaIdentification.decode_text(text_buf);
single_value->field_ptmsiSignature.decode_text(text_buf);
single_value->field_readyTimer.decode_text(text_buf);
single_value->field_allocatedPTMSI.decode_text(text_buf);
single_value->field_msIdentity.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_t3302.decode_text(text_buf);
single_value->field_cellNotification.decode_text(text_buf);
single_value->field_equivalentPLMNs.decode_text(text_buf);
single_value->field_networkFeatureSupport.decode_text(text_buf);
single_value->field_emergencyNumberList.decode_text(text_buf);
single_value->field_requestedMSInformation.decode_text(text_buf);
single_value->field_t3319.decode_text(text_buf);
single_value->field_t3323.decode_text(text_buf);
single_value->field_t3312__ExtendedValue.decode_text(text_buf);
single_value->field_additionalNetworkFeatureSupport.decode_text(text_buf);
single_value->field_t3324.decode_text(text_buf);
single_value->field_extendedDRXParameters.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__GMM__AttachAccept_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept.");
}
}

void PDU__GMM__AttachAccept_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__GMM__AttachAccept_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (24<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept has 24 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) attachResult().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) updateTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) radioPriority().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) radioPriorityTOM8().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) readyTimer().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) msIdentity().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) cellNotification().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) networkFeatureSupport().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) requestedMSInformation().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) t3319().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) t3323().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupport().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(23));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "attachResult")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          attachResult().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriority")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriority().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "radioPriorityTOM8")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          radioPriorityTOM8().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellNotification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellNotification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "equivalentPLMNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          equivalentPLMNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedMSInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedMSInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3319")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3319().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3323")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3323().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalNetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AttachAccept_template* precondition = new PDU__GMM__AttachAccept_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AttachAccept_template* implied_template = new PDU__GMM__AttachAccept_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AttachAccept_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AttachAccept_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_attachResult.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_updateTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_radioPriority.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_radioPriorityTOM8.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_routingAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_readyTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_allocatedPTMSI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_msIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3302.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_cellNotification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_equivalentPLMNs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_networkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_emergencyNumberList.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_requestedMSInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3319.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3323.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3312__ExtendedValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_additionalNetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_t3324.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
single_value->field_extendedDRXParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachAccept");
}

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

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

PDU__GMM__AttachComplete::PDU__GMM__AttachComplete()
{
}

PDU__GMM__AttachComplete::PDU__GMM__AttachComplete(const BITSTRING& par_messageType,
    const OPTIONAL< InterRATInformationContainerTLV >& par_interRATHandoverInformation,
    const OPTIONAL< EUTRANinterRATInformationContainerTLV >& par_eUTRANinterRATHandoverInformation)
  :   field_messageType(par_messageType),
  field_interRATHandoverInformation(par_interRATHandoverInformation),
  field_eUTRANinterRATHandoverInformation(par_eUTRANinterRATHandoverInformation)
{
}

PDU__GMM__AttachComplete::PDU__GMM__AttachComplete(const PDU__GMM__AttachComplete& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.interRATHandoverInformation().is_bound()) field_interRATHandoverInformation = other_value.interRATHandoverInformation();
else field_interRATHandoverInformation.clean_up();
if (other_value.eUTRANinterRATHandoverInformation().is_bound()) field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
else field_eUTRANinterRATHandoverInformation.clean_up();
}

void PDU__GMM__AttachComplete::clean_up()
{
field_messageType.clean_up();
field_interRATHandoverInformation.clean_up();
field_eUTRANinterRATHandoverInformation.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AttachComplete::get_descriptor() const { return &PDU__GMM__AttachComplete_descr_; }
PDU__GMM__AttachComplete& PDU__GMM__AttachComplete::operator=(const PDU__GMM__AttachComplete& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.interRATHandoverInformation().is_bound()) field_interRATHandoverInformation = other_value.interRATHandoverInformation();
  else field_interRATHandoverInformation.clean_up();
  if (other_value.eUTRANinterRATHandoverInformation().is_bound()) field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
  else field_eUTRANinterRATHandoverInformation.clean_up();
}
return *this;
}

boolean PDU__GMM__AttachComplete::operator==(const PDU__GMM__AttachComplete& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_interRATHandoverInformation==other_value.field_interRATHandoverInformation
  && field_eUTRANinterRATHandoverInformation==other_value.field_eUTRANinterRATHandoverInformation;
}

boolean PDU__GMM__AttachComplete::is_bound() const
{
return (field_messageType.is_bound())
  || (OPTIONAL_OMIT == field_interRATHandoverInformation.get_selection() || field_interRATHandoverInformation.is_bound())
  || (OPTIONAL_OMIT == field_eUTRANinterRATHandoverInformation.get_selection() || field_eUTRANinterRATHandoverInformation.is_bound());
}
boolean PDU__GMM__AttachComplete::is_value() const
{
return field_messageType.is_value()
  && (OPTIONAL_OMIT == field_interRATHandoverInformation.get_selection() || field_interRATHandoverInformation.is_value())
  && (OPTIONAL_OMIT == field_eUTRANinterRATHandoverInformation.get_selection() || field_eUTRANinterRATHandoverInformation.is_value());
}
int PDU__GMM__AttachComplete::size_of() const
{
  int ret_val = 1;
  if (field_interRATHandoverInformation.ispresent()) ret_val++;
  if (field_eUTRANinterRATHandoverInformation.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AttachComplete::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
field_eUTRANinterRATHandoverInformation.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AttachComplete::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!interRATHandoverInformation().is_bound()) interRATHandoverInformation() = OMIT_VALUE;
else interRATHandoverInformation().set_implicit_omit();
if (!eUTRANinterRATHandoverInformation().is_bound()) eUTRANinterRATHandoverInformation() = OMIT_VALUE;
else eUTRANinterRATHandoverInformation().set_implicit_omit();
}

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

void PDU__GMM__AttachComplete::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_interRATHandoverInformation.encode_text(text_buf);
field_eUTRANinterRATHandoverInformation.encode_text(text_buf);
}

void PDU__GMM__AttachComplete::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_interRATHandoverInformation.decode_text(text_buf);
field_eUTRANinterRATHandoverInformation.decode_text(text_buf);
}

void PDU__GMM__AttachComplete::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__AttachComplete::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__AttachComplete::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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_interRATHandoverInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_1_force_omit(1, force_omit, InterRATInformationContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_interRATHandoverInformation().RAW_decode(InterRATInformationContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_1_force_omit);
  if (decoded_field_length < 1) {
  field_interRATHandoverInformation = 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_interRATHandoverInformation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_eUTRANinterRATHandoverInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, EUTRANinterRATInformationContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_eUTRANinterRATHandoverInformation().RAW_decode(EUTRANinterRATInformationContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_eUTRANinterRATHandoverInformation = 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_eUTRANinterRATHandoverInformation=OMIT_VALUE;
  if (field_messageType !=  bs_28) 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__GMM__AttachComplete::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, General__Types::BIT8_descr_.raw);
  if (field_interRATHandoverInformation.ispresent()) {
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, InterRATInformationContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[1] = NULL;
  if (field_eUTRANinterRATHandoverInformation.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, EUTRANinterRATInformationContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_interRATHandoverInformation.ispresent()) {
  encoded_length += field_interRATHandoverInformation().RAW_encode(InterRATInformationContainerTLV_descr_, *myleaf.body.node.nodes[1]);
  }
  if (field_eUTRANinterRATHandoverInformation.ispresent()) {
  encoded_length += field_eUTRANinterRATHandoverInformation().RAW_encode(EUTRANinterRATInformationContainerTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_messageType !=  bs_28) {
  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_28.RAW_encode(General__Types::BIT8_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__GMM__AttachComplete_template::single_value_struct {
BITSTRING_template field_messageType;
InterRATInformationContainerTLV_template field_interRATHandoverInformation;
EUTRANinterRATInformationContainerTLV_template field_eUTRANinterRATHandoverInformation;
};

void PDU__GMM__AttachComplete_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_messageType = ANY_VALUE;
single_value->field_interRATHandoverInformation = ANY_OR_OMIT;
single_value->field_eUTRANinterRATHandoverInformation = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AttachComplete_template::copy_value(const PDU__GMM__AttachComplete& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.interRATHandoverInformation().is_bound()) {
  if (other_value.interRATHandoverInformation().ispresent()) single_value->field_interRATHandoverInformation = other_value.interRATHandoverInformation()();
  else single_value->field_interRATHandoverInformation = OMIT_VALUE;
} else {
  single_value->field_interRATHandoverInformation.clean_up();
}
if (other_value.eUTRANinterRATHandoverInformation().is_bound()) {
  if (other_value.eUTRANinterRATHandoverInformation().ispresent()) single_value->field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation()();
  else single_value->field_eUTRANinterRATHandoverInformation = OMIT_VALUE;
} else {
  single_value->field_eUTRANinterRATHandoverInformation.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AttachComplete_template::copy_template(const PDU__GMM__AttachComplete_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.interRATHandoverInformation().get_selection()) {
single_value->field_interRATHandoverInformation = other_value.interRATHandoverInformation();
} else {
single_value->field_interRATHandoverInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.eUTRANinterRATHandoverInformation().get_selection()) {
single_value->field_eUTRANinterRATHandoverInformation = other_value.eUTRANinterRATHandoverInformation();
} else {
single_value->field_eUTRANinterRATHandoverInformation.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__GMM__AttachComplete_template[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__GMM__AttachComplete_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AttachComplete_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
break;
}
set_selection(other_value);
}

PDU__GMM__AttachComplete_template::PDU__GMM__AttachComplete_template()
{
}

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

PDU__GMM__AttachComplete_template::PDU__GMM__AttachComplete_template(const PDU__GMM__AttachComplete& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__AttachComplete_template& PDU__GMM__AttachComplete_template::operator=(const OPTIONAL<PDU__GMM__AttachComplete>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__AttachComplete&)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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
}
return *this;
}

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

boolean PDU__GMM__AttachComplete_template::match(const PDU__GMM__AttachComplete& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.interRATHandoverInformation().is_bound()) return FALSE;
if((other_value.interRATHandoverInformation().ispresent() ? !single_value->field_interRATHandoverInformation.match((const InterRATInformationContainerTLV&)other_value.interRATHandoverInformation(), legacy) : !single_value->field_interRATHandoverInformation.match_omit(legacy)))return FALSE;
if(!other_value.eUTRANinterRATHandoverInformation().is_bound()) return FALSE;
if((other_value.eUTRANinterRATHandoverInformation().ispresent() ? !single_value->field_eUTRANinterRATHandoverInformation.match((const EUTRANinterRATInformationContainerTLV&)other_value.eUTRANinterRATHandoverInformation(), legacy) : !single_value->field_eUTRANinterRATHandoverInformation.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
}
return FALSE;
}

boolean PDU__GMM__AttachComplete_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || (single_value->field_interRATHandoverInformation.is_omit() || single_value->field_interRATHandoverInformation.is_bound())
 || (single_value->field_eUTRANinterRATHandoverInformation.is_omit() || single_value->field_eUTRANinterRATHandoverInformation.is_bound());
}

boolean PDU__GMM__AttachComplete_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && (single_value->field_interRATHandoverInformation.is_omit() || single_value->field_interRATHandoverInformation.is_value())
 && (single_value->field_eUTRANinterRATHandoverInformation.is_omit() || single_value->field_eUTRANinterRATHandoverInformation.is_value());
}

void PDU__GMM__AttachComplete_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__GMM__AttachComplete PDU__GMM__AttachComplete_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
PDU__GMM__AttachComplete ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_interRATHandoverInformation.is_omit()) ret_val.interRATHandoverInformation() = OMIT_VALUE;
else if (single_value->field_interRATHandoverInformation.is_bound()) {
ret_val.interRATHandoverInformation() = single_value->field_interRATHandoverInformation.valueof();
}
if (single_value->field_eUTRANinterRATHandoverInformation.is_omit()) ret_val.eUTRANinterRATHandoverInformation() = OMIT_VALUE;
else if (single_value->field_eUTRANinterRATHandoverInformation.is_bound()) {
ret_val.eUTRANinterRATHandoverInformation() = single_value->field_eUTRANinterRATHandoverInformation.valueof();
}
return ret_val;
}

void PDU__GMM__AttachComplete_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AttachComplete_template[list_length];
}

PDU__GMM__AttachComplete_template& PDU__GMM__AttachComplete_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__AttachComplete_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AttachComplete_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
return single_value->field_messageType;
}

InterRATInformationContainerTLV_template& PDU__GMM__AttachComplete_template::interRATHandoverInformation()
{
set_specific();
return single_value->field_interRATHandoverInformation;
}

const InterRATInformationContainerTLV_template& PDU__GMM__AttachComplete_template::interRATHandoverInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field interRATHandoverInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
return single_value->field_interRATHandoverInformation;
}

EUTRANinterRATInformationContainerTLV_template& PDU__GMM__AttachComplete_template::eUTRANinterRATHandoverInformation()
{
set_specific();
return single_value->field_eUTRANinterRATHandoverInformation;
}

const EUTRANinterRATInformationContainerTLV_template& PDU__GMM__AttachComplete_template::eUTRANinterRATHandoverInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field eUTRANinterRATHandoverInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
return single_value->field_eUTRANinterRATHandoverInformation;
}

int PDU__GMM__AttachComplete_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_interRATHandoverInformation.is_present()) ret_val++;
      if (single_value->field_eUTRANinterRATHandoverInformation.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete 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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
  }
  return 0;
}

void PDU__GMM__AttachComplete_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
single_value->field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
single_value->field_eUTRANinterRATHandoverInformation.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__GMM__AttachComplete_template::log_match(const PDU__GMM__AttachComplete& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.interRATHandoverInformation().ispresent()){
if(!single_value->field_interRATHandoverInformation.match(match_value.interRATHandoverInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".interRATHandoverInformation");
single_value->field_interRATHandoverInformation.log_match(match_value.interRATHandoverInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_interRATHandoverInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".interRATHandoverInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_interRATHandoverInformation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.eUTRANinterRATHandoverInformation().ispresent()){
if(!single_value->field_eUTRANinterRATHandoverInformation.match(match_value.eUTRANinterRATHandoverInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".eUTRANinterRATHandoverInformation");
single_value->field_eUTRANinterRATHandoverInformation.log_match(match_value.eUTRANinterRATHandoverInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_eUTRANinterRATHandoverInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".eUTRANinterRATHandoverInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_eUTRANinterRATHandoverInformation.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", interRATHandoverInformation := ");
if (match_value.interRATHandoverInformation().ispresent()) {
single_value->field_interRATHandoverInformation.log_match(match_value.interRATHandoverInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_interRATHandoverInformation.log();
if (single_value->field_interRATHandoverInformation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", eUTRANinterRATHandoverInformation := ");
if (match_value.eUTRANinterRATHandoverInformation().ispresent()) {
single_value->field_eUTRANinterRATHandoverInformation.log_match(match_value.eUTRANinterRATHandoverInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_eUTRANinterRATHandoverInformation.log();
if (single_value->field_eUTRANinterRATHandoverInformation.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 PDU__GMM__AttachComplete_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (!interRATHandoverInformation().is_bound()) interRATHandoverInformation() = OMIT_VALUE;
else interRATHandoverInformation().set_implicit_omit();
if (!eUTRANinterRATHandoverInformation().is_bound()) eUTRANinterRATHandoverInformation() = OMIT_VALUE;
else eUTRANinterRATHandoverInformation().set_implicit_omit();
}

void PDU__GMM__AttachComplete_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_interRATHandoverInformation.encode_text(text_buf);
single_value->field_eUTRANinterRATHandoverInformation.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
}
}

void PDU__GMM__AttachComplete_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_messageType.decode_text(text_buf);
single_value->field_interRATHandoverInformation.decode_text(text_buf);
single_value->field_eUTRANinterRATHandoverInformation.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__GMM__AttachComplete_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete.");
}
}

void PDU__GMM__AttachComplete_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__GMM__AttachComplete_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) interRATHandoverInformation().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) eUTRANinterRATHandoverInformation().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "interRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          interRATHandoverInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "eUTRANinterRATHandoverInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          eUTRANinterRATHandoverInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AttachComplete_template* precondition = new PDU__GMM__AttachComplete_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AttachComplete_template* implied_template = new PDU__GMM__AttachComplete_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AttachComplete_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AttachComplete_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
single_value->field_interRATHandoverInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
single_value->field_eUTRANinterRATHandoverInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachComplete");
}

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

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

PDU__GMM__AttachReject::PDU__GMM__AttachReject()
{
}

PDU__GMM__AttachReject::PDU__GMM__AttachReject(const BITSTRING& par_messageType,
    const GMM__CauseV& par_gmmCause,
    const OPTIONAL< GPRSTimer2TLV >& par_t3302,
    const OPTIONAL< GPRSTimer2TLV >& par_t3346)
  :   field_messageType(par_messageType),
  field_gmmCause(par_gmmCause),
  field_t3302(par_t3302),
  field_t3346(par_t3346)
{
}

PDU__GMM__AttachReject::PDU__GMM__AttachReject(const PDU__GMM__AttachReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
else field_t3302.clean_up();
if (other_value.t3346().is_bound()) field_t3346 = other_value.t3346();
else field_t3346.clean_up();
}

void PDU__GMM__AttachReject::clean_up()
{
field_messageType.clean_up();
field_gmmCause.clean_up();
field_t3302.clean_up();
field_t3346.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AttachReject::get_descriptor() const { return &PDU__GMM__AttachReject_descr_; }
PDU__GMM__AttachReject& PDU__GMM__AttachReject::operator=(const PDU__GMM__AttachReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
  else field_t3302.clean_up();
  if (other_value.t3346().is_bound()) field_t3346 = other_value.t3346();
  else field_t3346.clean_up();
}
return *this;
}

boolean PDU__GMM__AttachReject::operator==(const PDU__GMM__AttachReject& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_gmmCause==other_value.field_gmmCause
  && field_t3302==other_value.field_t3302
  && field_t3346==other_value.field_t3346;
}

boolean PDU__GMM__AttachReject::is_bound() const
{
return (field_messageType.is_bound())
  || (field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_bound())
  || (OPTIONAL_OMIT == field_t3346.get_selection() || field_t3346.is_bound());
}
boolean PDU__GMM__AttachReject::is_value() const
{
return field_messageType.is_value()
  && field_gmmCause.is_value()
  && (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_value())
  && (OPTIONAL_OMIT == field_t3346.get_selection() || field_t3346.is_value());
}
int PDU__GMM__AttachReject::size_of() const
{
  int ret_val = 2;
  if (field_t3302.ispresent()) ret_val++;
  if (field_t3346.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AttachReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
field_t3302.log();
TTCN_Logger::log_event_str(", t3346 := ");
field_t3346.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AttachReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!t3346().is_bound()) t3346() = OMIT_VALUE;
else t3346().set_implicit_omit();
}

void PDU__GMM__AttachReject::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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) t3346().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3346")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3346().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
  }
}

void PDU__GMM__AttachReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_t3302.encode_text(text_buf);
field_t3346.encode_text(text_buf);
}

void PDU__GMM__AttachReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_t3302.decode_text(text_buf);
field_t3346.decode_text(text_buf);
}

void PDU__GMM__AttachReject::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__AttachReject::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__AttachReject::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, GMM__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause.RAW_decode(GMM__CauseV_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){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_t3302 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3302().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_t3302 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32){
  field_t3302=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_t3302=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_t3346 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3346().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_t3346 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3346.ispresent() || field_t3346().elementIdentifier() !=  os_35){
  field_t3346=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_t3346=OMIT_VALUE;
  if (field_messageType !=  bs_29) 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__GMM__AttachReject::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GMM__CauseV_descr_.raw);
  if (field_t3302.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  if (field_t3346.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gmmCause.RAW_encode(GMM__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_t3302.ispresent()) {
  encoded_length += field_t3302().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_t3346.ispresent()) {
  encoded_length += field_t3346().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_t3302.ispresent() && (!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_32.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);
  }
  }
  if (field_t3346.ispresent() && (!field_t3346.ispresent() || field_t3346().elementIdentifier() !=  os_35)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,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);
  }
  }
  if (field_messageType !=  bs_29) {
  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_29.RAW_encode(General__Types::BIT8_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__GMM__AttachReject_template::single_value_struct {
BITSTRING_template field_messageType;
GMM__CauseV_template field_gmmCause;
GPRSTimer2TLV_template field_t3302;
GPRSTimer2TLV_template field_t3346;
};

void PDU__GMM__AttachReject_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_messageType = ANY_VALUE;
single_value->field_gmmCause = ANY_VALUE;
single_value->field_t3302 = ANY_OR_OMIT;
single_value->field_t3346 = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AttachReject_template::copy_value(const PDU__GMM__AttachReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  single_value->field_gmmCause = other_value.gmmCause();
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.t3302().is_bound()) {
  if (other_value.t3302().ispresent()) single_value->field_t3302 = other_value.t3302()();
  else single_value->field_t3302 = OMIT_VALUE;
} else {
  single_value->field_t3302.clean_up();
}
if (other_value.t3346().is_bound()) {
  if (other_value.t3346().ispresent()) single_value->field_t3346 = other_value.t3346()();
  else single_value->field_t3346 = OMIT_VALUE;
} else {
  single_value->field_t3346.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AttachReject_template::copy_template(const PDU__GMM__AttachReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3302().get_selection()) {
single_value->field_t3302 = other_value.t3302();
} else {
single_value->field_t3302.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3346().get_selection()) {
single_value->field_t3346 = other_value.t3346();
} else {
single_value->field_t3346.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__GMM__AttachReject_template[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__GMM__AttachReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AttachReject_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
break;
}
set_selection(other_value);
}

PDU__GMM__AttachReject_template::PDU__GMM__AttachReject_template()
{
}

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

PDU__GMM__AttachReject_template::PDU__GMM__AttachReject_template(const PDU__GMM__AttachReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__AttachReject_template& PDU__GMM__AttachReject_template::operator=(const OPTIONAL<PDU__GMM__AttachReject>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__AttachReject&)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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
}
return *this;
}

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

boolean PDU__GMM__AttachReject_template::match(const PDU__GMM__AttachReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if(!single_value->field_gmmCause.match(other_value.gmmCause(), legacy))return FALSE;
if(!other_value.t3302().is_bound()) return FALSE;
if((other_value.t3302().ispresent() ? !single_value->field_t3302.match((const GPRSTimer2TLV&)other_value.t3302(), legacy) : !single_value->field_t3302.match_omit(legacy)))return FALSE;
if(!other_value.t3346().is_bound()) return FALSE;
if((other_value.t3346().ispresent() ? !single_value->field_t3346.match((const GPRSTimer2TLV&)other_value.t3346(), legacy) : !single_value->field_t3346.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
}
return FALSE;
}

boolean PDU__GMM__AttachReject_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_gmmCause.is_bound()
 || (single_value->field_t3302.is_omit() || single_value->field_t3302.is_bound())
 || (single_value->field_t3346.is_omit() || single_value->field_t3346.is_bound());
}

boolean PDU__GMM__AttachReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_gmmCause.is_value()
 && (single_value->field_t3302.is_omit() || single_value->field_t3302.is_value())
 && (single_value->field_t3346.is_omit() || single_value->field_t3346.is_value());
}

void PDU__GMM__AttachReject_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__GMM__AttachReject PDU__GMM__AttachReject_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
PDU__GMM__AttachReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_t3302.is_omit()) ret_val.t3302() = OMIT_VALUE;
else if (single_value->field_t3302.is_bound()) {
ret_val.t3302() = single_value->field_t3302.valueof();
}
if (single_value->field_t3346.is_omit()) ret_val.t3346() = OMIT_VALUE;
else if (single_value->field_t3346.is_bound()) {
ret_val.t3346() = single_value->field_t3346.valueof();
}
return ret_val;
}

void PDU__GMM__AttachReject_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AttachReject_template[list_length];
}

PDU__GMM__AttachReject_template& PDU__GMM__AttachReject_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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__AttachReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AttachReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return single_value->field_messageType;
}

GMM__CauseV_template& PDU__GMM__AttachReject_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseV_template& PDU__GMM__AttachReject_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return single_value->field_gmmCause;
}

GPRSTimer2TLV_template& PDU__GMM__AttachReject_template::t3302()
{
set_specific();
return single_value->field_t3302;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachReject_template::t3302() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3302 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return single_value->field_t3302;
}

GPRSTimer2TLV_template& PDU__GMM__AttachReject_template::t3346()
{
set_specific();
return single_value->field_t3346;
}

const GPRSTimer2TLV_template& PDU__GMM__AttachReject_template::t3346() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3346 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
return single_value->field_t3346;
}

int PDU__GMM__AttachReject_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_t3302.is_present()) ret_val++;
      if (single_value->field_t3346.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject 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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
  }
  return 0;
}

void PDU__GMM__AttachReject_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
single_value->field_t3302.log();
TTCN_Logger::log_event_str(", t3346 := ");
single_value->field_t3346.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__GMM__AttachReject_template::log_match(const PDU__GMM__AttachReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.t3302().ispresent()){
if(!single_value->field_t3302.match(match_value.t3302(), legacy)){
TTCN_Logger::log_logmatch_info(".t3302");
single_value->field_t3302.log_match(match_value.t3302(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3302.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3302 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3302.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3346().ispresent()){
if(!single_value->field_t3346.match(match_value.t3346(), legacy)){
TTCN_Logger::log_logmatch_info(".t3346");
single_value->field_t3346.log_match(match_value.t3346(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3346.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3346 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3346.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::log_event_str(", t3302 := ");
if (match_value.t3302().ispresent()) {
single_value->field_t3302.log_match(match_value.t3302(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3302.log();
if (single_value->field_t3302.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3346 := ");
if (match_value.t3346().ispresent()) {
single_value->field_t3346.log_match(match_value.t3346(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3346.log();
if (single_value->field_t3346.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 PDU__GMM__AttachReject_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!t3346().is_bound()) t3346() = OMIT_VALUE;
else t3346().set_implicit_omit();
}

void PDU__GMM__AttachReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_t3302.encode_text(text_buf);
single_value->field_t3346.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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
}
}

void PDU__GMM__AttachReject_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_messageType.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_t3302.decode_text(text_buf);
single_value->field_t3346.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__GMM__AttachReject_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject.");
}
}

void PDU__GMM__AttachReject_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__GMM__AttachReject_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) t3346().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3346")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3346().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AttachReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AttachReject_template* precondition = new PDU__GMM__AttachReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AttachReject_template* implied_template = new PDU__GMM__AttachReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AttachReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AttachReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
single_value->field_t3302.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
single_value->field_t3346.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_AttachReject");
}

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

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

PDU__GMM__DetachRequest__SGSN__MS::PDU__GMM__DetachRequest__SGSN__MS()
{
}

PDU__GMM__DetachRequest__SGSN__MS::PDU__GMM__DetachRequest__SGSN__MS(const BITSTRING& par_messageType,
    const DetachTypeV& par_detachType,
    const ForceToStandbyV& par_forceToStandby,
    const OPTIONAL< GMM__CauseTV >& par_gmmCause)
  :   field_messageType(par_messageType),
  field_detachType(par_detachType),
  field_forceToStandby(par_forceToStandby),
  field_gmmCause(par_gmmCause)
{
}

PDU__GMM__DetachRequest__SGSN__MS::PDU__GMM__DetachRequest__SGSN__MS(const PDU__GMM__DetachRequest__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.detachType().is_bound()) field_detachType = other_value.detachType();
else field_detachType.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
}

void PDU__GMM__DetachRequest__SGSN__MS::clean_up()
{
field_messageType.clean_up();
field_detachType.clean_up();
field_forceToStandby.clean_up();
field_gmmCause.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__DetachRequest__SGSN__MS::get_descriptor() const { return &PDU__GMM__DetachRequest__SGSN__MS_descr_; }
PDU__GMM__DetachRequest__SGSN__MS& PDU__GMM__DetachRequest__SGSN__MS::operator=(const PDU__GMM__DetachRequest__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.detachType().is_bound()) field_detachType = other_value.detachType();
  else field_detachType.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
}
return *this;
}

boolean PDU__GMM__DetachRequest__SGSN__MS::operator==(const PDU__GMM__DetachRequest__SGSN__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_detachType==other_value.field_detachType
  && field_forceToStandby==other_value.field_forceToStandby
  && field_gmmCause==other_value.field_gmmCause;
}

boolean PDU__GMM__DetachRequest__SGSN__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_detachType.is_bound())
  || (field_forceToStandby.is_bound())
  || (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_bound());
}
boolean PDU__GMM__DetachRequest__SGSN__MS::is_value() const
{
return field_messageType.is_value()
  && field_detachType.is_value()
  && field_forceToStandby.is_value()
  && (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_value());
}
int PDU__GMM__DetachRequest__SGSN__MS::size_of() const
{
  int ret_val = 3;
  if (field_gmmCause.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__DetachRequest__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", detachType := ");
field_detachType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__DetachRequest__SGSN__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (detachType().is_bound()) detachType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
}

void PDU__GMM__DetachRequest__SGSN__MS::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 (4<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) detachType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "detachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          detachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
  }
}

void PDU__GMM__DetachRequest__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_detachType.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
}

void PDU__GMM__DetachRequest__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_detachType.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
}

void PDU__GMM__DetachRequest__SGSN__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__DetachRequest__SGSN__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__DetachRequest__SGSN__MS::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, DetachTypeV_descr_.raw->forceomit);
  decoded_field_length = field_detachType.RAW_decode(DetachTypeV_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_gmmCause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, GMM__CauseTV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause().RAW_decode(GMM__CauseTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_gmmCause = 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_gmmCause=OMIT_VALUE;
  if (field_messageType !=  bs_30) 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__GMM__DetachRequest__SGSN__MS::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DetachTypeV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ForceToStandbyV_descr_.raw);
  if (field_gmmCause.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GMM__CauseTV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_detachType.RAW_encode(DetachTypeV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[2]);
  if (field_gmmCause.ispresent()) {
  encoded_length += field_gmmCause().RAW_encode(GMM__CauseTV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_messageType !=  bs_30) {
  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_30.RAW_encode(General__Types::BIT8_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__GMM__DetachRequest__SGSN__MS_template::single_value_struct {
BITSTRING_template field_messageType;
DetachTypeV_template field_detachType;
ForceToStandbyV_template field_forceToStandby;
GMM__CauseTV_template field_gmmCause;
};

void PDU__GMM__DetachRequest__SGSN__MS_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_messageType = ANY_VALUE;
single_value->field_detachType = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_gmmCause = ANY_OR_OMIT;
}
}
}

void PDU__GMM__DetachRequest__SGSN__MS_template::copy_value(const PDU__GMM__DetachRequest__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.detachType().is_bound()) {
  single_value->field_detachType = other_value.detachType();
} else {
  single_value->field_detachType.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  if (other_value.gmmCause().ispresent()) single_value->field_gmmCause = other_value.gmmCause()();
  else single_value->field_gmmCause = OMIT_VALUE;
} else {
  single_value->field_gmmCause.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__DetachRequest__SGSN__MS_template::copy_template(const PDU__GMM__DetachRequest__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.detachType().get_selection()) {
single_value->field_detachType = other_value.detachType();
} else {
single_value->field_detachType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.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__GMM__DetachRequest__SGSN__MS_template[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__GMM__DetachRequest__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__DetachRequest__SGSN__MS_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
break;
}
set_selection(other_value);
}

PDU__GMM__DetachRequest__SGSN__MS_template::PDU__GMM__DetachRequest__SGSN__MS_template()
{
}

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

PDU__GMM__DetachRequest__SGSN__MS_template::PDU__GMM__DetachRequest__SGSN__MS_template(const PDU__GMM__DetachRequest__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__DetachRequest__SGSN__MS_template& PDU__GMM__DetachRequest__SGSN__MS_template::operator=(const OPTIONAL<PDU__GMM__DetachRequest__SGSN__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__DetachRequest__SGSN__MS&)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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
}
return *this;
}

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

boolean PDU__GMM__DetachRequest__SGSN__MS_template::match(const PDU__GMM__DetachRequest__SGSN__MS& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.detachType().is_bound()) return FALSE;
if(!single_value->field_detachType.match(other_value.detachType(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if((other_value.gmmCause().ispresent() ? !single_value->field_gmmCause.match((const GMM__CauseTV&)other_value.gmmCause(), legacy) : !single_value->field_gmmCause.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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
}
return FALSE;
}

boolean PDU__GMM__DetachRequest__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_detachType.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_bound());
}

boolean PDU__GMM__DetachRequest__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_detachType.is_value()
 && single_value->field_forceToStandby.is_value()
 && (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_value());
}

void PDU__GMM__DetachRequest__SGSN__MS_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__GMM__DetachRequest__SGSN__MS PDU__GMM__DetachRequest__SGSN__MS_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
PDU__GMM__DetachRequest__SGSN__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_detachType.is_bound()) {
ret_val.detachType() = single_value->field_detachType.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_gmmCause.is_omit()) ret_val.gmmCause() = OMIT_VALUE;
else if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
return ret_val;
}

void PDU__GMM__DetachRequest__SGSN__MS_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__DetachRequest__SGSN__MS_template[list_length];
}

PDU__GMM__DetachRequest__SGSN__MS_template& PDU__GMM__DetachRequest__SGSN__MS_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__DetachRequest__SGSN__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__DetachRequest__SGSN__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return single_value->field_messageType;
}

DetachTypeV_template& PDU__GMM__DetachRequest__SGSN__MS_template::detachType()
{
set_specific();
return single_value->field_detachType;
}

const DetachTypeV_template& PDU__GMM__DetachRequest__SGSN__MS_template::detachType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field detachType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return single_value->field_detachType;
}

ForceToStandbyV_template& PDU__GMM__DetachRequest__SGSN__MS_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__DetachRequest__SGSN__MS_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return single_value->field_forceToStandby;
}

GMM__CauseTV_template& PDU__GMM__DetachRequest__SGSN__MS_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseTV_template& PDU__GMM__DetachRequest__SGSN__MS_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
return single_value->field_gmmCause;
}

int PDU__GMM__DetachRequest__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_gmmCause.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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS 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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
  }
  return 0;
}

void PDU__GMM__DetachRequest__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", detachType := ");
single_value->field_detachType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.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__GMM__DetachRequest__SGSN__MS_template::log_match(const PDU__GMM__DetachRequest__SGSN__MS& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_detachType.match(match_value.detachType(), legacy)){
TTCN_Logger::log_logmatch_info(".detachType");
single_value->field_detachType.log_match(match_value.detachType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.gmmCause().ispresent()){
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gmmCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gmmCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gmmCause.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", detachType := ");
single_value->field_detachType.log_match(match_value.detachType(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
if (match_value.gmmCause().ispresent()) {
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gmmCause.log();
if (single_value->field_gmmCause.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 PDU__GMM__DetachRequest__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (detachType().is_bound()) detachType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
}

void PDU__GMM__DetachRequest__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_detachType.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_gmmCause.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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
}
}

void PDU__GMM__DetachRequest__SGSN__MS_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_messageType.decode_text(text_buf);
single_value->field_detachType.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_gmmCause.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__GMM__DetachRequest__SGSN__MS_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS.");
}
}

void PDU__GMM__DetachRequest__SGSN__MS_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__GMM__DetachRequest__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) detachType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "detachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          detachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__DetachRequest__SGSN__MS_template* precondition = new PDU__GMM__DetachRequest__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__DetachRequest__SGSN__MS_template* implied_template = new PDU__GMM__DetachRequest__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__DetachRequest__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__DetachRequest__SGSN__MS_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
single_value->field_detachType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_SGSN_MS");
}

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

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

PDU__GMM__DetachRequest__MS__SGSN::PDU__GMM__DetachRequest__MS__SGSN()
{
}

PDU__GMM__DetachRequest__MS__SGSN::PDU__GMM__DetachRequest__MS__SGSN(const BITSTRING& par_messageType,
    const DetachTypeV& par_detachType,
    const BITSTRING& par_spare,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_ptmsi,
    const OPTIONAL< MobileL3__CommonIE__Types::P__TMSISignature2TLV >& par_ptmsiSignature)
  :   field_messageType(par_messageType),
  field_detachType(par_detachType),
  field_spare(par_spare),
  field_ptmsi(par_ptmsi),
  field_ptmsiSignature(par_ptmsiSignature)
{
}

PDU__GMM__DetachRequest__MS__SGSN::PDU__GMM__DetachRequest__MS__SGSN(const PDU__GMM__DetachRequest__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.detachType().is_bound()) field_detachType = other_value.detachType();
else field_detachType.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
else field_ptmsi.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
}

void PDU__GMM__DetachRequest__MS__SGSN::clean_up()
{
field_messageType.clean_up();
field_detachType.clean_up();
field_spare.clean_up();
field_ptmsi.clean_up();
field_ptmsiSignature.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__DetachRequest__MS__SGSN::get_descriptor() const { return &PDU__GMM__DetachRequest__MS__SGSN_descr_; }
PDU__GMM__DetachRequest__MS__SGSN& PDU__GMM__DetachRequest__MS__SGSN::operator=(const PDU__GMM__DetachRequest__MS__SGSN& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.detachType().is_bound()) field_detachType = other_value.detachType();
  else field_detachType.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
  else field_ptmsi.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
}
return *this;
}

boolean PDU__GMM__DetachRequest__MS__SGSN::operator==(const PDU__GMM__DetachRequest__MS__SGSN& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_detachType==other_value.field_detachType
  && field_spare==other_value.field_spare
  && field_ptmsi==other_value.field_ptmsi
  && field_ptmsiSignature==other_value.field_ptmsiSignature;
}

boolean PDU__GMM__DetachRequest__MS__SGSN::is_bound() const
{
return (field_messageType.is_bound())
  || (field_detachType.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_ptmsi.get_selection() || field_ptmsi.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound());
}
boolean PDU__GMM__DetachRequest__MS__SGSN::is_value() const
{
return field_messageType.is_value()
  && field_detachType.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_ptmsi.get_selection() || field_ptmsi.is_value())
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value());
}
int PDU__GMM__DetachRequest__MS__SGSN::size_of() const
{
  int ret_val = 3;
  if (field_ptmsi.ispresent()) ret_val++;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__DetachRequest__MS__SGSN::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", detachType := ");
field_detachType.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", ptmsi := ");
field_ptmsi.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__DetachRequest__MS__SGSN::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (detachType().is_bound()) detachType().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!ptmsi().is_bound()) ptmsi() = OMIT_VALUE;
else ptmsi().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
}

void PDU__GMM__DetachRequest__MS__SGSN::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 (5<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) detachType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "detachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          detachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
  }
}

void PDU__GMM__DetachRequest__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_detachType.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_ptmsi.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
}

void PDU__GMM__DetachRequest__MS__SGSN::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_detachType.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_ptmsi.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
}

void PDU__GMM__DetachRequest__MS__SGSN::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__DetachRequest__MS__SGSN::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__DetachRequest__MS__SGSN::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, DetachTypeV_descr_.raw->forceomit);
  decoded_field_length = field_detachType.RAW_decode(DetachTypeV_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, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_ptmsi = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsi().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsi = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ptmsi.ispresent() || field_ptmsi().elementIdentifier() !=  bs_26){
  field_ptmsi=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_ptmsi=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (field_messageType !=  bs_30) 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__GMM__DetachRequest__MS__SGSN::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, DetachTypeV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  if (field_ptmsi.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_detachType.RAW_encode(DetachTypeV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  if (field_ptmsi.ispresent()) {
  encoded_length += field_ptmsi().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(MobileL3__CommonIE__Types::P__TMSISignature2TLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_ptmsi.ispresent() && (!field_ptmsi.ispresent() || field_ptmsi().elementIdentifier() !=  bs_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={3,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT7_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_messageType !=  bs_30) {
  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_30.RAW_encode(General__Types::BIT8_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__GMM__DetachRequest__MS__SGSN_template::single_value_struct {
BITSTRING_template field_messageType;
DetachTypeV_template field_detachType;
BITSTRING_template field_spare;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_ptmsi;
MobileL3__CommonIE__Types::P__TMSISignature2TLV_template field_ptmsiSignature;
};

void PDU__GMM__DetachRequest__MS__SGSN_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_messageType = ANY_VALUE;
single_value->field_detachType = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_ptmsi = ANY_OR_OMIT;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
}
}
}

void PDU__GMM__DetachRequest__MS__SGSN_template::copy_value(const PDU__GMM__DetachRequest__MS__SGSN& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.detachType().is_bound()) {
  single_value->field_detachType = other_value.detachType();
} else {
  single_value->field_detachType.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.ptmsi().is_bound()) {
  if (other_value.ptmsi().ispresent()) single_value->field_ptmsi = other_value.ptmsi()();
  else single_value->field_ptmsi = OMIT_VALUE;
} else {
  single_value->field_ptmsi.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__DetachRequest__MS__SGSN_template::copy_template(const PDU__GMM__DetachRequest__MS__SGSN_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.detachType().get_selection()) {
single_value->field_detachType = other_value.detachType();
} else {
single_value->field_detachType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsi().get_selection()) {
single_value->field_ptmsi = other_value.ptmsi();
} else {
single_value->field_ptmsi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.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__GMM__DetachRequest__MS__SGSN_template[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__GMM__DetachRequest__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__DetachRequest__MS__SGSN_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
break;
}
set_selection(other_value);
}

PDU__GMM__DetachRequest__MS__SGSN_template::PDU__GMM__DetachRequest__MS__SGSN_template()
{
}

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

PDU__GMM__DetachRequest__MS__SGSN_template::PDU__GMM__DetachRequest__MS__SGSN_template(const PDU__GMM__DetachRequest__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__DetachRequest__MS__SGSN_template& PDU__GMM__DetachRequest__MS__SGSN_template::operator=(const OPTIONAL<PDU__GMM__DetachRequest__MS__SGSN>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__DetachRequest__MS__SGSN&)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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
}
return *this;
}

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

boolean PDU__GMM__DetachRequest__MS__SGSN_template::match(const PDU__GMM__DetachRequest__MS__SGSN& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.detachType().is_bound()) return FALSE;
if(!single_value->field_detachType.match(other_value.detachType(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.ptmsi().is_bound()) return FALSE;
if((other_value.ptmsi().ispresent() ? !single_value->field_ptmsi.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.ptmsi(), legacy) : !single_value->field_ptmsi.match_omit(legacy)))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const MobileL3__CommonIE__Types::P__TMSISignature2TLV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
}
return FALSE;
}

boolean PDU__GMM__DetachRequest__MS__SGSN_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_detachType.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_ptmsi.is_omit() || single_value->field_ptmsi.is_bound())
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound());
}

boolean PDU__GMM__DetachRequest__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_detachType.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_ptmsi.is_omit() || single_value->field_ptmsi.is_value())
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value());
}

void PDU__GMM__DetachRequest__MS__SGSN_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__GMM__DetachRequest__MS__SGSN PDU__GMM__DetachRequest__MS__SGSN_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
PDU__GMM__DetachRequest__MS__SGSN ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_detachType.is_bound()) {
ret_val.detachType() = single_value->field_detachType.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_ptmsi.is_omit()) ret_val.ptmsi() = OMIT_VALUE;
else if (single_value->field_ptmsi.is_bound()) {
ret_val.ptmsi() = single_value->field_ptmsi.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
return ret_val;
}

void PDU__GMM__DetachRequest__MS__SGSN_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__DetachRequest__MS__SGSN_template[list_length];
}

PDU__GMM__DetachRequest__MS__SGSN_template& PDU__GMM__DetachRequest__MS__SGSN_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__DetachRequest__MS__SGSN_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__DetachRequest__MS__SGSN_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_messageType;
}

DetachTypeV_template& PDU__GMM__DetachRequest__MS__SGSN_template::detachType()
{
set_specific();
return single_value->field_detachType;
}

const DetachTypeV_template& PDU__GMM__DetachRequest__MS__SGSN_template::detachType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field detachType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_detachType;
}

BITSTRING_template& PDU__GMM__DetachRequest__MS__SGSN_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__DetachRequest__MS__SGSN_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_spare;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__DetachRequest__MS__SGSN_template::ptmsi()
{
set_specific();
return single_value->field_ptmsi;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__DetachRequest__MS__SGSN_template::ptmsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsi of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_ptmsi;
}

MobileL3__CommonIE__Types::P__TMSISignature2TLV_template& PDU__GMM__DetachRequest__MS__SGSN_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const MobileL3__CommonIE__Types::P__TMSISignature2TLV_template& PDU__GMM__DetachRequest__MS__SGSN_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
return single_value->field_ptmsiSignature;
}

int PDU__GMM__DetachRequest__MS__SGSN_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_ptmsi.is_present()) ret_val++;
      if (single_value->field_ptmsiSignature.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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN 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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
  }
  return 0;
}

void PDU__GMM__DetachRequest__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", detachType := ");
single_value->field_detachType.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", ptmsi := ");
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.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__GMM__DetachRequest__MS__SGSN_template::log_match(const PDU__GMM__DetachRequest__MS__SGSN& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_detachType.match(match_value.detachType(), legacy)){
TTCN_Logger::log_logmatch_info(".detachType");
single_value->field_detachType.log_match(match_value.detachType(), 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);
}
if (match_value.ptmsi().ispresent()){
if(!single_value->field_ptmsi.match(match_value.ptmsi(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsi");
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsi.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsi := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", detachType := ");
single_value->field_detachType.log_match(match_value.detachType(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", ptmsi := ");
if (match_value.ptmsi().ispresent()) {
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsi.log();
if (single_value->field_ptmsi.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.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 PDU__GMM__DetachRequest__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (detachType().is_bound()) detachType().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!ptmsi().is_bound()) ptmsi() = OMIT_VALUE;
else ptmsi().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
}

void PDU__GMM__DetachRequest__MS__SGSN_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_detachType.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_ptmsi.encode_text(text_buf);
single_value->field_ptmsiSignature.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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
}
}

void PDU__GMM__DetachRequest__MS__SGSN_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_messageType.decode_text(text_buf);
single_value->field_detachType.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_ptmsi.decode_text(text_buf);
single_value->field_ptmsiSignature.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__GMM__DetachRequest__MS__SGSN_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN.");
}
}

void PDU__GMM__DetachRequest__MS__SGSN_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__GMM__DetachRequest__MS__SGSN_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) detachType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "detachType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          detachType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__DetachRequest__MS__SGSN_template* precondition = new PDU__GMM__DetachRequest__MS__SGSN_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__DetachRequest__MS__SGSN_template* implied_template = new PDU__GMM__DetachRequest__MS__SGSN_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__DetachRequest__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__DetachRequest__MS__SGSN_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
single_value->field_detachType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
single_value->field_ptmsi.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachRequest_MS_SGSN");
}

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

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

PDU__GMM__DetachAccept__MS__SGSN::PDU__GMM__DetachAccept__MS__SGSN()
{
}

PDU__GMM__DetachAccept__MS__SGSN::PDU__GMM__DetachAccept__MS__SGSN(const BITSTRING& par_messageType)
  :   field_messageType(par_messageType)
{
}

PDU__GMM__DetachAccept__MS__SGSN::PDU__GMM__DetachAccept__MS__SGSN(const PDU__GMM__DetachAccept__MS__SGSN& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
}

void PDU__GMM__DetachAccept__MS__SGSN::clean_up()
{
field_messageType.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__DetachAccept__MS__SGSN::get_descriptor() const { return &PDU__GMM__DetachAccept__MS__SGSN_descr_; }
PDU__GMM__DetachAccept__MS__SGSN& PDU__GMM__DetachAccept__MS__SGSN::operator=(const PDU__GMM__DetachAccept__MS__SGSN& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

boolean PDU__GMM__DetachAccept__MS__SGSN::operator==(const PDU__GMM__DetachAccept__MS__SGSN& other_value) const
{
return field_messageType==other_value.field_messageType;
}

boolean PDU__GMM__DetachAccept__MS__SGSN::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__GMM__DetachAccept__MS__SGSN::is_value() const
{
return field_messageType.is_value();
}
void PDU__GMM__DetachAccept__MS__SGSN::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__DetachAccept__MS__SGSN::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__DetachAccept__MS__SGSN::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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN");
  }
}

void PDU__GMM__DetachAccept__MS__SGSN::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
}

void PDU__GMM__DetachAccept__MS__SGSN::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
}

void PDU__GMM__DetachAccept__MS__SGSN::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__DetachAccept__MS__SGSN::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__DetachAccept__MS__SGSN::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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 (field_messageType !=  bs_31) 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__GMM__DetachAccept__MS__SGSN::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::BIT8_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_messageType !=  bs_31) {
  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_31.RAW_encode(General__Types::BIT8_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__GMM__DetachAccept__MS__SGSN_template::single_value_struct {
BITSTRING_template field_messageType;
};

void PDU__GMM__DetachAccept__MS__SGSN_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_messageType = ANY_VALUE;
}
}
}

void PDU__GMM__DetachAccept__MS__SGSN_template::copy_value(const PDU__GMM__DetachAccept__MS__SGSN& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__DetachAccept__MS__SGSN_template::copy_template(const PDU__GMM__DetachAccept__MS__SGSN_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.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__GMM__DetachAccept__MS__SGSN_template[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__GMM__DetachAccept__MS__SGSN_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__DetachAccept__MS__SGSN_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
break;
}
set_selection(other_value);
}

PDU__GMM__DetachAccept__MS__SGSN_template::PDU__GMM__DetachAccept__MS__SGSN_template()
{
}

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

PDU__GMM__DetachAccept__MS__SGSN_template::PDU__GMM__DetachAccept__MS__SGSN_template(const PDU__GMM__DetachAccept__MS__SGSN& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__DetachAccept__MS__SGSN_template& PDU__GMM__DetachAccept__MS__SGSN_template::operator=(const OPTIONAL<PDU__GMM__DetachAccept__MS__SGSN>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__DetachAccept__MS__SGSN&)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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
}
return *this;
}

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

boolean PDU__GMM__DetachAccept__MS__SGSN_template::match(const PDU__GMM__DetachAccept__MS__SGSN& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), 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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
}
return FALSE;
}

boolean PDU__GMM__DetachAccept__MS__SGSN_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound();
}

boolean PDU__GMM__DetachAccept__MS__SGSN_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value();
}

void PDU__GMM__DetachAccept__MS__SGSN_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__GMM__DetachAccept__MS__SGSN PDU__GMM__DetachAccept__MS__SGSN_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
PDU__GMM__DetachAccept__MS__SGSN ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
return ret_val;
}

void PDU__GMM__DetachAccept__MS__SGSN_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__DetachAccept__MS__SGSN_template[list_length];
}

PDU__GMM__DetachAccept__MS__SGSN_template& PDU__GMM__DetachAccept__MS__SGSN_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__DetachAccept__MS__SGSN_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__DetachAccept__MS__SGSN_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
return single_value->field_messageType;
}

int PDU__GMM__DetachAccept__MS__SGSN_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN 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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN 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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
  }
  return 0;
}

void PDU__GMM__DetachAccept__MS__SGSN_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.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__GMM__DetachAccept__MS__SGSN_template::log_match(const PDU__GMM__DetachAccept__MS__SGSN& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), 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__GMM__DetachAccept__MS__SGSN_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__DetachAccept__MS__SGSN_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
}
}

void PDU__GMM__DetachAccept__MS__SGSN_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_messageType.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__GMM__DetachAccept__MS__SGSN_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN.");
}
}

void PDU__GMM__DetachAccept__MS__SGSN_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__GMM__DetachAccept__MS__SGSN_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__DetachAccept__MS__SGSN_template* precondition = new PDU__GMM__DetachAccept__MS__SGSN_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__DetachAccept__MS__SGSN_template* implied_template = new PDU__GMM__DetachAccept__MS__SGSN_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__DetachAccept__MS__SGSN_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__DetachAccept__MS__SGSN_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_MS_SGSN");
}

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

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

PDU__GMM__DetachAccept__SGSN__MS::PDU__GMM__DetachAccept__SGSN__MS()
{
}

PDU__GMM__DetachAccept__SGSN__MS::PDU__GMM__DetachAccept__SGSN__MS(const BITSTRING& par_messageType,
    const ForceToStandbyV& par_forceToStandby,
    const BITSTRING& par_spare)
  :   field_messageType(par_messageType),
  field_forceToStandby(par_forceToStandby),
  field_spare(par_spare)
{
}

PDU__GMM__DetachAccept__SGSN__MS::PDU__GMM__DetachAccept__SGSN__MS(const PDU__GMM__DetachAccept__SGSN__MS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
}

void PDU__GMM__DetachAccept__SGSN__MS::clean_up()
{
field_messageType.clean_up();
field_forceToStandby.clean_up();
field_spare.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__DetachAccept__SGSN__MS::get_descriptor() const { return &PDU__GMM__DetachAccept__SGSN__MS_descr_; }
PDU__GMM__DetachAccept__SGSN__MS& PDU__GMM__DetachAccept__SGSN__MS::operator=(const PDU__GMM__DetachAccept__SGSN__MS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
}
return *this;
}

boolean PDU__GMM__DetachAccept__SGSN__MS::operator==(const PDU__GMM__DetachAccept__SGSN__MS& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_forceToStandby==other_value.field_forceToStandby
  && field_spare==other_value.field_spare;
}

boolean PDU__GMM__DetachAccept__SGSN__MS::is_bound() const
{
return (field_messageType.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_spare.is_bound());
}
boolean PDU__GMM__DetachAccept__SGSN__MS::is_value() const
{
return field_messageType.is_value()
  && field_forceToStandby.is_value()
  && field_spare.is_value();
}
void PDU__GMM__DetachAccept__SGSN__MS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__DetachAccept__SGSN__MS::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void PDU__GMM__DetachAccept__SGSN__MS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
  }
}

void PDU__GMM__DetachAccept__SGSN__MS::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_spare.encode_text(text_buf);
}

void PDU__GMM__DetachAccept__SGSN__MS::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_spare.decode_text(text_buf);
}

void PDU__GMM__DetachAccept__SGSN__MS::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__DetachAccept__SGSN__MS::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__DetachAccept__SGSN__MS::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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 (field_messageType !=  bs_31) 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__GMM__DetachAccept__SGSN__MS::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  if (field_messageType !=  bs_31) {
  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_31.RAW_encode(General__Types::BIT8_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__GMM__DetachAccept__SGSN__MS_template::single_value_struct {
BITSTRING_template field_messageType;
ForceToStandbyV_template field_forceToStandby;
BITSTRING_template field_spare;
};

void PDU__GMM__DetachAccept__SGSN__MS_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_messageType = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
}
}
}

void PDU__GMM__DetachAccept__SGSN__MS_template::copy_value(const PDU__GMM__DetachAccept__SGSN__MS& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.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 PDU__GMM__DetachAccept__SGSN__MS_template::copy_template(const PDU__GMM__DetachAccept__SGSN__MS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.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 PDU__GMM__DetachAccept__SGSN__MS_template[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__GMM__DetachAccept__SGSN__MS_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__DetachAccept__SGSN__MS_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
break;
}
set_selection(other_value);
}

PDU__GMM__DetachAccept__SGSN__MS_template::PDU__GMM__DetachAccept__SGSN__MS_template()
{
}

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

PDU__GMM__DetachAccept__SGSN__MS_template::PDU__GMM__DetachAccept__SGSN__MS_template(const PDU__GMM__DetachAccept__SGSN__MS& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__DetachAccept__SGSN__MS_template& PDU__GMM__DetachAccept__SGSN__MS_template::operator=(const OPTIONAL<PDU__GMM__DetachAccept__SGSN__MS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__DetachAccept__SGSN__MS&)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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
}
return *this;
}

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

boolean PDU__GMM__DetachAccept__SGSN__MS_template::match(const PDU__GMM__DetachAccept__SGSN__MS& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), 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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
}
return FALSE;
}

boolean PDU__GMM__DetachAccept__SGSN__MS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_spare.is_bound();
}

boolean PDU__GMM__DetachAccept__SGSN__MS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_spare.is_value();
}

void PDU__GMM__DetachAccept__SGSN__MS_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__GMM__DetachAccept__SGSN__MS PDU__GMM__DetachAccept__SGSN__MS_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
PDU__GMM__DetachAccept__SGSN__MS ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
return ret_val;
}

void PDU__GMM__DetachAccept__SGSN__MS_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__DetachAccept__SGSN__MS_template[list_length];
}

PDU__GMM__DetachAccept__SGSN__MS_template& PDU__GMM__DetachAccept__SGSN__MS_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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__DetachAccept__SGSN__MS_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__DetachAccept__SGSN__MS_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
return single_value->field_messageType;
}

ForceToStandbyV_template& PDU__GMM__DetachAccept__SGSN__MS_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__DetachAccept__SGSN__MS_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
return single_value->field_forceToStandby;
}

BITSTRING_template& PDU__GMM__DetachAccept__SGSN__MS_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__DetachAccept__SGSN__MS_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
return single_value->field_spare;
}

int PDU__GMM__DetachAccept__SGSN__MS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS 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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS 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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
  }
  return 0;
}

void PDU__GMM__DetachAccept__SGSN__MS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.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 PDU__GMM__DetachAccept__SGSN__MS_template::log_match(const PDU__GMM__DetachAccept__SGSN__MS& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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 PDU__GMM__DetachAccept__SGSN__MS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
}

void PDU__GMM__DetachAccept__SGSN__MS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_forceToStandby.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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
}
}

void PDU__GMM__DetachAccept__SGSN__MS_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_messageType.decode_text(text_buf);
single_value->field_forceToStandby.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 PDU__GMM__DetachAccept__SGSN__MS_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS.");
}
}

void PDU__GMM__DetachAccept__SGSN__MS_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__GMM__DetachAccept__SGSN__MS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__DetachAccept__SGSN__MS_template* precondition = new PDU__GMM__DetachAccept__SGSN__MS_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__DetachAccept__SGSN__MS_template* implied_template = new PDU__GMM__DetachAccept__SGSN__MS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__DetachAccept__SGSN__MS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__DetachAccept__SGSN__MS_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_DetachAccept_SGSN_MS");
}

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

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

PDU__GMM__P__TMSIReallocationCommand::PDU__GMM__P__TMSIReallocationCommand()
{
}

PDU__GMM__P__TMSIReallocationCommand::PDU__GMM__P__TMSIReallocationCommand(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_allocatedPTMSI,
    const RoutingAreaIdentificationV& par_routingAreaIdentification,
    const ForceToStandbyV& par_forceToStandby,
    const BITSTRING& par_spare,
    const OPTIONAL< P__TMSISignatureTV >& par_ptmsiSignature)
  :   field_messageType(par_messageType),
  field_allocatedPTMSI(par_allocatedPTMSI),
  field_routingAreaIdentification(par_routingAreaIdentification),
  field_forceToStandby(par_forceToStandby),
  field_spare(par_spare),
  field_ptmsiSignature(par_ptmsiSignature)
{
}

PDU__GMM__P__TMSIReallocationCommand::PDU__GMM__P__TMSIReallocationCommand(const PDU__GMM__P__TMSIReallocationCommand& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
else field_allocatedPTMSI.clean_up();
if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
else field_routingAreaIdentification.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
}

void PDU__GMM__P__TMSIReallocationCommand::clean_up()
{
field_messageType.clean_up();
field_allocatedPTMSI.clean_up();
field_routingAreaIdentification.clean_up();
field_forceToStandby.clean_up();
field_spare.clean_up();
field_ptmsiSignature.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__P__TMSIReallocationCommand::get_descriptor() const { return &PDU__GMM__P__TMSIReallocationCommand_descr_; }
PDU__GMM__P__TMSIReallocationCommand& PDU__GMM__P__TMSIReallocationCommand::operator=(const PDU__GMM__P__TMSIReallocationCommand& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
  else field_allocatedPTMSI.clean_up();
  if (other_value.routingAreaIdentification().is_bound()) field_routingAreaIdentification = other_value.routingAreaIdentification();
  else field_routingAreaIdentification.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
}
return *this;
}

boolean PDU__GMM__P__TMSIReallocationCommand::operator==(const PDU__GMM__P__TMSIReallocationCommand& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_allocatedPTMSI==other_value.field_allocatedPTMSI
  && field_routingAreaIdentification==other_value.field_routingAreaIdentification
  && field_forceToStandby==other_value.field_forceToStandby
  && field_spare==other_value.field_spare
  && field_ptmsiSignature==other_value.field_ptmsiSignature;
}

boolean PDU__GMM__P__TMSIReallocationCommand::is_bound() const
{
return (field_messageType.is_bound())
  || (field_allocatedPTMSI.is_bound())
  || (field_routingAreaIdentification.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound());
}
boolean PDU__GMM__P__TMSIReallocationCommand::is_value() const
{
return field_messageType.is_value()
  && field_allocatedPTMSI.is_value()
  && field_routingAreaIdentification.is_value()
  && field_forceToStandby.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value());
}
int PDU__GMM__P__TMSIReallocationCommand::size_of() const
{
  int ret_val = 5;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__P__TMSIReallocationCommand::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__P__TMSIReallocationCommand::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (allocatedPTMSI().is_bound()) allocatedPTMSI().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
}

void PDU__GMM__P__TMSIReallocationCommand::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 (6<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
  }
}

void PDU__GMM__P__TMSIReallocationCommand::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_allocatedPTMSI.encode_text(text_buf);
field_routingAreaIdentification.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
}

void PDU__GMM__P__TMSIReallocationCommand::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_allocatedPTMSI.decode_text(text_buf);
field_routingAreaIdentification.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
}

void PDU__GMM__P__TMSIReallocationCommand::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__P__TMSIReallocationCommand::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__P__TMSIReallocationCommand::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_allocatedPTMSI.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaIdentification.RAW_decode(RoutingAreaIdentificationV_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (field_messageType !=  bs_32) 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__GMM__P__TMSIReallocationCommand::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, RoutingAreaIdentificationV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, General__Types::BIT4_descr_.raw);
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_allocatedPTMSI.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_routingAreaIdentification.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[4]);
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_messageType !=  bs_32) {
  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_32.RAW_encode(General__Types::BIT8_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__GMM__P__TMSIReallocationCommand_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_allocatedPTMSI;
RoutingAreaIdentificationV_template field_routingAreaIdentification;
ForceToStandbyV_template field_forceToStandby;
BITSTRING_template field_spare;
P__TMSISignatureTV_template field_ptmsiSignature;
};

void PDU__GMM__P__TMSIReallocationCommand_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_messageType = ANY_VALUE;
single_value->field_allocatedPTMSI = ANY_VALUE;
single_value->field_routingAreaIdentification = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
}
}
}

void PDU__GMM__P__TMSIReallocationCommand_template::copy_value(const PDU__GMM__P__TMSIReallocationCommand& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.allocatedPTMSI().is_bound()) {
  single_value->field_allocatedPTMSI = other_value.allocatedPTMSI();
} else {
  single_value->field_allocatedPTMSI.clean_up();
}
if (other_value.routingAreaIdentification().is_bound()) {
  single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
  single_value->field_routingAreaIdentification.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__P__TMSIReallocationCommand_template::copy_template(const PDU__GMM__P__TMSIReallocationCommand_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.allocatedPTMSI().get_selection()) {
single_value->field_allocatedPTMSI = other_value.allocatedPTMSI();
} else {
single_value->field_allocatedPTMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaIdentification().get_selection()) {
single_value->field_routingAreaIdentification = other_value.routingAreaIdentification();
} else {
single_value->field_routingAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.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__GMM__P__TMSIReallocationCommand_template[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__GMM__P__TMSIReallocationCommand_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__P__TMSIReallocationCommand_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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
break;
}
set_selection(other_value);
}

PDU__GMM__P__TMSIReallocationCommand_template::PDU__GMM__P__TMSIReallocationCommand_template()
{
}

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

PDU__GMM__P__TMSIReallocationCommand_template::PDU__GMM__P__TMSIReallocationCommand_template(const PDU__GMM__P__TMSIReallocationCommand& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__P__TMSIReallocationCommand_template& PDU__GMM__P__TMSIReallocationCommand_template::operator=(const OPTIONAL<PDU__GMM__P__TMSIReallocationCommand>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__P__TMSIReallocationCommand&)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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
}
return *this;
}

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

boolean PDU__GMM__P__TMSIReallocationCommand_template::match(const PDU__GMM__P__TMSIReallocationCommand& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.allocatedPTMSI().is_bound()) return FALSE;
if(!single_value->field_allocatedPTMSI.match(other_value.allocatedPTMSI(), legacy))return FALSE;
if(!other_value.routingAreaIdentification().is_bound()) return FALSE;
if(!single_value->field_routingAreaIdentification.match(other_value.routingAreaIdentification(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const P__TMSISignatureTV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
}
return FALSE;
}

boolean PDU__GMM__P__TMSIReallocationCommand_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_allocatedPTMSI.is_bound()
 || single_value->field_routingAreaIdentification.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound());
}

boolean PDU__GMM__P__TMSIReallocationCommand_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_allocatedPTMSI.is_value()
 && single_value->field_routingAreaIdentification.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value());
}

void PDU__GMM__P__TMSIReallocationCommand_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__GMM__P__TMSIReallocationCommand PDU__GMM__P__TMSIReallocationCommand_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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
PDU__GMM__P__TMSIReallocationCommand ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_allocatedPTMSI.is_bound()) {
ret_val.allocatedPTMSI() = single_value->field_allocatedPTMSI.valueof();
}
if (single_value->field_routingAreaIdentification.is_bound()) {
ret_val.routingAreaIdentification() = single_value->field_routingAreaIdentification.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
return ret_val;
}

void PDU__GMM__P__TMSIReallocationCommand_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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__P__TMSIReallocationCommand_template[list_length];
}

PDU__GMM__P__TMSIReallocationCommand_template& PDU__GMM__P__TMSIReallocationCommand_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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__P__TMSIReallocationCommand_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__P__TMSIReallocationCommand_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__P__TMSIReallocationCommand_template::allocatedPTMSI()
{
set_specific();
return single_value->field_allocatedPTMSI;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__P__TMSIReallocationCommand_template::allocatedPTMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allocatedPTMSI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_allocatedPTMSI;
}

RoutingAreaIdentificationV_template& PDU__GMM__P__TMSIReallocationCommand_template::routingAreaIdentification()
{
set_specific();
return single_value->field_routingAreaIdentification;
}

const RoutingAreaIdentificationV_template& PDU__GMM__P__TMSIReallocationCommand_template::routingAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaIdentification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_routingAreaIdentification;
}

ForceToStandbyV_template& PDU__GMM__P__TMSIReallocationCommand_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__P__TMSIReallocationCommand_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_forceToStandby;
}

BITSTRING_template& PDU__GMM__P__TMSIReallocationCommand_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__P__TMSIReallocationCommand_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_spare;
}

P__TMSISignatureTV_template& PDU__GMM__P__TMSIReallocationCommand_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const P__TMSISignatureTV_template& PDU__GMM__P__TMSIReallocationCommand_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
return single_value->field_ptmsiSignature;
}

int PDU__GMM__P__TMSIReallocationCommand_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_ptmsiSignature.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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand 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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
  }
  return 0;
}

void PDU__GMM__P__TMSIReallocationCommand_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.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__GMM__P__TMSIReallocationCommand_template::log_match(const PDU__GMM__P__TMSIReallocationCommand& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_allocatedPTMSI.match(match_value.allocatedPTMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".allocatedPTMSI");
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingAreaIdentification.match(match_value.routingAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaIdentification");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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);
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
TTCN_Logger::log_event_str(", routingAreaIdentification := ");
single_value->field_routingAreaIdentification.log_match(match_value.routingAreaIdentification(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.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 PDU__GMM__P__TMSIReallocationCommand_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (allocatedPTMSI().is_bound()) allocatedPTMSI().set_implicit_omit();
if (routingAreaIdentification().is_bound()) routingAreaIdentification().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
}

void PDU__GMM__P__TMSIReallocationCommand_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_allocatedPTMSI.encode_text(text_buf);
single_value->field_routingAreaIdentification.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_ptmsiSignature.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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
}
}

void PDU__GMM__P__TMSIReallocationCommand_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_messageType.decode_text(text_buf);
single_value->field_allocatedPTMSI.decode_text(text_buf);
single_value->field_routingAreaIdentification.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_ptmsiSignature.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__GMM__P__TMSIReallocationCommand_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand.");
}
}

void PDU__GMM__P__TMSIReallocationCommand_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__GMM__P__TMSIReallocationCommand_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) routingAreaIdentification().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__P__TMSIReallocationCommand_template* precondition = new PDU__GMM__P__TMSIReallocationCommand_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__P__TMSIReallocationCommand_template* implied_template = new PDU__GMM__P__TMSIReallocationCommand_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__P__TMSIReallocationCommand_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__P__TMSIReallocationCommand_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_allocatedPTMSI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_routingAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationCommand");
}

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

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

PDU__GMM__P__TMSIReallocationComplete::PDU__GMM__P__TMSIReallocationComplete()
{
}

PDU__GMM__P__TMSIReallocationComplete::PDU__GMM__P__TMSIReallocationComplete(const BITSTRING& par_messageType)
  :   field_messageType(par_messageType)
{
}

PDU__GMM__P__TMSIReallocationComplete::PDU__GMM__P__TMSIReallocationComplete(const PDU__GMM__P__TMSIReallocationComplete& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
}

void PDU__GMM__P__TMSIReallocationComplete::clean_up()
{
field_messageType.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__P__TMSIReallocationComplete::get_descriptor() const { return &PDU__GMM__P__TMSIReallocationComplete_descr_; }
PDU__GMM__P__TMSIReallocationComplete& PDU__GMM__P__TMSIReallocationComplete::operator=(const PDU__GMM__P__TMSIReallocationComplete& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

boolean PDU__GMM__P__TMSIReallocationComplete::operator==(const PDU__GMM__P__TMSIReallocationComplete& other_value) const
{
return field_messageType==other_value.field_messageType;
}

boolean PDU__GMM__P__TMSIReallocationComplete::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__GMM__P__TMSIReallocationComplete::is_value() const
{
return field_messageType.is_value();
}
void PDU__GMM__P__TMSIReallocationComplete::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__P__TMSIReallocationComplete::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__P__TMSIReallocationComplete::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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete");
  }
}

void PDU__GMM__P__TMSIReallocationComplete::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
}

void PDU__GMM__P__TMSIReallocationComplete::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
}

void PDU__GMM__P__TMSIReallocationComplete::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__P__TMSIReallocationComplete::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__P__TMSIReallocationComplete::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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 (field_messageType !=  bs_33) 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__GMM__P__TMSIReallocationComplete::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::BIT8_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_messageType !=  bs_33) {
  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_33.RAW_encode(General__Types::BIT8_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__GMM__P__TMSIReallocationComplete_template::single_value_struct {
BITSTRING_template field_messageType;
};

void PDU__GMM__P__TMSIReallocationComplete_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_messageType = ANY_VALUE;
}
}
}

void PDU__GMM__P__TMSIReallocationComplete_template::copy_value(const PDU__GMM__P__TMSIReallocationComplete& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__P__TMSIReallocationComplete_template::copy_template(const PDU__GMM__P__TMSIReallocationComplete_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.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__GMM__P__TMSIReallocationComplete_template[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__GMM__P__TMSIReallocationComplete_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__P__TMSIReallocationComplete_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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
break;
}
set_selection(other_value);
}

PDU__GMM__P__TMSIReallocationComplete_template::PDU__GMM__P__TMSIReallocationComplete_template()
{
}

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

PDU__GMM__P__TMSIReallocationComplete_template::PDU__GMM__P__TMSIReallocationComplete_template(const PDU__GMM__P__TMSIReallocationComplete& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__P__TMSIReallocationComplete_template& PDU__GMM__P__TMSIReallocationComplete_template::operator=(const OPTIONAL<PDU__GMM__P__TMSIReallocationComplete>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__P__TMSIReallocationComplete&)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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
}
return *this;
}

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

boolean PDU__GMM__P__TMSIReallocationComplete_template::match(const PDU__GMM__P__TMSIReallocationComplete& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), 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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
}
return FALSE;
}

boolean PDU__GMM__P__TMSIReallocationComplete_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound();
}

boolean PDU__GMM__P__TMSIReallocationComplete_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value();
}

void PDU__GMM__P__TMSIReallocationComplete_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__GMM__P__TMSIReallocationComplete PDU__GMM__P__TMSIReallocationComplete_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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
PDU__GMM__P__TMSIReallocationComplete ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
return ret_val;
}

void PDU__GMM__P__TMSIReallocationComplete_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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__P__TMSIReallocationComplete_template[list_length];
}

PDU__GMM__P__TMSIReallocationComplete_template& PDU__GMM__P__TMSIReallocationComplete_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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__P__TMSIReallocationComplete_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__P__TMSIReallocationComplete_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
return single_value->field_messageType;
}

int PDU__GMM__P__TMSIReallocationComplete_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete 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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete 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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
  }
  return 0;
}

void PDU__GMM__P__TMSIReallocationComplete_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.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__GMM__P__TMSIReallocationComplete_template::log_match(const PDU__GMM__P__TMSIReallocationComplete& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), 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__GMM__P__TMSIReallocationComplete_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__P__TMSIReallocationComplete_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
}
}

void PDU__GMM__P__TMSIReallocationComplete_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_messageType.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__GMM__P__TMSIReallocationComplete_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete.");
}
}

void PDU__GMM__P__TMSIReallocationComplete_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__GMM__P__TMSIReallocationComplete_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__P__TMSIReallocationComplete_template* precondition = new PDU__GMM__P__TMSIReallocationComplete_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__P__TMSIReallocationComplete_template* implied_template = new PDU__GMM__P__TMSIReallocationComplete_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__P__TMSIReallocationComplete_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__P__TMSIReallocationComplete_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_P_TMSIReallocationComplete");
}

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

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

PDU__GMM__AuthenticationAndCipheringRequest::PDU__GMM__AuthenticationAndCipheringRequest()
{
}

PDU__GMM__AuthenticationAndCipheringRequest::PDU__GMM__AuthenticationAndCipheringRequest(const BITSTRING& par_messageType,
    const CipheringAlgorithmV& par_cipheringAlgorithm,
    const IMEISVRequestV& par_imeisvRequest,
    const ForceToStandbyV& par_forceToStandby,
    const ACReferenceNumberV& par_acReferenceNumber,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationParameterRANDTV >& par_authenticationParameterRAND,
    const OPTIONAL< MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV >& par_cipheringKeySequenceNumber,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationParameterAUTNTLV >& par_authenticationParameterAUTN)
  :   field_messageType(par_messageType),
  field_cipheringAlgorithm(par_cipheringAlgorithm),
  field_imeisvRequest(par_imeisvRequest),
  field_forceToStandby(par_forceToStandby),
  field_acReferenceNumber(par_acReferenceNumber),
  field_authenticationParameterRAND(par_authenticationParameterRAND),
  field_cipheringKeySequenceNumber(par_cipheringKeySequenceNumber),
  field_authenticationParameterAUTN(par_authenticationParameterAUTN)
{
}

PDU__GMM__AuthenticationAndCipheringRequest::PDU__GMM__AuthenticationAndCipheringRequest(const PDU__GMM__AuthenticationAndCipheringRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.cipheringAlgorithm().is_bound()) field_cipheringAlgorithm = other_value.cipheringAlgorithm();
else field_cipheringAlgorithm.clean_up();
if (other_value.imeisvRequest().is_bound()) field_imeisvRequest = other_value.imeisvRequest();
else field_imeisvRequest.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
else field_acReferenceNumber.clean_up();
if (other_value.authenticationParameterRAND().is_bound()) field_authenticationParameterRAND = other_value.authenticationParameterRAND();
else field_authenticationParameterRAND.clean_up();
if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
else field_cipheringKeySequenceNumber.clean_up();
if (other_value.authenticationParameterAUTN().is_bound()) field_authenticationParameterAUTN = other_value.authenticationParameterAUTN();
else field_authenticationParameterAUTN.clean_up();
}

void PDU__GMM__AuthenticationAndCipheringRequest::clean_up()
{
field_messageType.clean_up();
field_cipheringAlgorithm.clean_up();
field_imeisvRequest.clean_up();
field_forceToStandby.clean_up();
field_acReferenceNumber.clean_up();
field_authenticationParameterRAND.clean_up();
field_cipheringKeySequenceNumber.clean_up();
field_authenticationParameterAUTN.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AuthenticationAndCipheringRequest::get_descriptor() const { return &PDU__GMM__AuthenticationAndCipheringRequest_descr_; }
PDU__GMM__AuthenticationAndCipheringRequest& PDU__GMM__AuthenticationAndCipheringRequest::operator=(const PDU__GMM__AuthenticationAndCipheringRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.cipheringAlgorithm().is_bound()) field_cipheringAlgorithm = other_value.cipheringAlgorithm();
  else field_cipheringAlgorithm.clean_up();
  if (other_value.imeisvRequest().is_bound()) field_imeisvRequest = other_value.imeisvRequest();
  else field_imeisvRequest.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
  else field_acReferenceNumber.clean_up();
  if (other_value.authenticationParameterRAND().is_bound()) field_authenticationParameterRAND = other_value.authenticationParameterRAND();
  else field_authenticationParameterRAND.clean_up();
  if (other_value.cipheringKeySequenceNumber().is_bound()) field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
  else field_cipheringKeySequenceNumber.clean_up();
  if (other_value.authenticationParameterAUTN().is_bound()) field_authenticationParameterAUTN = other_value.authenticationParameterAUTN();
  else field_authenticationParameterAUTN.clean_up();
}
return *this;
}

boolean PDU__GMM__AuthenticationAndCipheringRequest::operator==(const PDU__GMM__AuthenticationAndCipheringRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_cipheringAlgorithm==other_value.field_cipheringAlgorithm
  && field_imeisvRequest==other_value.field_imeisvRequest
  && field_forceToStandby==other_value.field_forceToStandby
  && field_acReferenceNumber==other_value.field_acReferenceNumber
  && field_authenticationParameterRAND==other_value.field_authenticationParameterRAND
  && field_cipheringKeySequenceNumber==other_value.field_cipheringKeySequenceNumber
  && field_authenticationParameterAUTN==other_value.field_authenticationParameterAUTN;
}

boolean PDU__GMM__AuthenticationAndCipheringRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_cipheringAlgorithm.is_bound())
  || (field_imeisvRequest.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_acReferenceNumber.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParameterRAND.get_selection() || field_authenticationParameterRAND.is_bound())
  || (OPTIONAL_OMIT == field_cipheringKeySequenceNumber.get_selection() || field_cipheringKeySequenceNumber.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParameterAUTN.get_selection() || field_authenticationParameterAUTN.is_bound());
}
boolean PDU__GMM__AuthenticationAndCipheringRequest::is_value() const
{
return field_messageType.is_value()
  && field_cipheringAlgorithm.is_value()
  && field_imeisvRequest.is_value()
  && field_forceToStandby.is_value()
  && field_acReferenceNumber.is_value()
  && (OPTIONAL_OMIT == field_authenticationParameterRAND.get_selection() || field_authenticationParameterRAND.is_value())
  && (OPTIONAL_OMIT == field_cipheringKeySequenceNumber.get_selection() || field_cipheringKeySequenceNumber.is_value())
  && (OPTIONAL_OMIT == field_authenticationParameterAUTN.get_selection() || field_authenticationParameterAUTN.is_value());
}
int PDU__GMM__AuthenticationAndCipheringRequest::size_of() const
{
  int ret_val = 5;
  if (field_authenticationParameterRAND.ispresent()) ret_val++;
  if (field_cipheringKeySequenceNumber.ispresent()) ret_val++;
  if (field_authenticationParameterAUTN.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", cipheringAlgorithm := ");
field_cipheringAlgorithm.log();
TTCN_Logger::log_event_str(", imeisvRequest := ");
field_imeisvRequest.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", acReferenceNumber := ");
field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", authenticationParameterRAND := ");
field_authenticationParameterRAND.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", authenticationParameterAUTN := ");
field_authenticationParameterAUTN.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AuthenticationAndCipheringRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cipheringAlgorithm().is_bound()) cipheringAlgorithm().set_implicit_omit();
if (imeisvRequest().is_bound()) imeisvRequest().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (acReferenceNumber().is_bound()) acReferenceNumber().set_implicit_omit();
if (!authenticationParameterRAND().is_bound()) authenticationParameterRAND() = OMIT_VALUE;
else authenticationParameterRAND().set_implicit_omit();
if (!cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber() = OMIT_VALUE;
else cipheringKeySequenceNumber().set_implicit_omit();
if (!authenticationParameterAUTN().is_bound()) authenticationParameterAUTN() = OMIT_VALUE;
else authenticationParameterAUTN().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringRequest::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 (8<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cipheringAlgorithm().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imeisvRequest().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumber().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationParameterRAND().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) authenticationParameterAUTN().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringAlgorithm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringAlgorithm().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imeisvRequest")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imeisvRequest().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "acReferenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acReferenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParameterRAND")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParameterRAND().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParameterAUTN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParameterAUTN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
  }
}

void PDU__GMM__AuthenticationAndCipheringRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_cipheringAlgorithm.encode_text(text_buf);
field_imeisvRequest.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_acReferenceNumber.encode_text(text_buf);
field_authenticationParameterRAND.encode_text(text_buf);
field_cipheringKeySequenceNumber.encode_text(text_buf);
field_authenticationParameterAUTN.encode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_cipheringAlgorithm.decode_text(text_buf);
field_imeisvRequest.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_acReferenceNumber.decode_text(text_buf);
field_authenticationParameterRAND.decode_text(text_buf);
field_cipheringKeySequenceNumber.decode_text(text_buf);
field_authenticationParameterAUTN.decode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringRequest::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__AuthenticationAndCipheringRequest::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__AuthenticationAndCipheringRequest::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, CipheringAlgorithmV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringAlgorithm.RAW_decode(CipheringAlgorithmV_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, IMEISVRequestV_descr_.raw->forceomit);
  decoded_field_length = field_imeisvRequest.RAW_decode(IMEISVRequestV_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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, ACReferenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_acReferenceNumber.RAW_decode(ACReferenceNumberV_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){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_authenticationParameterRAND = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__MM__Types::AuthenticationParameterRANDTV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParameterRAND().RAW_decode(MobileL3__MM__Types::AuthenticationParameterRANDTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParameterRAND = 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_authenticationParameterRAND=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_cipheringKeySequenceNumber = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_.raw->forceomit);
  decoded_field_length = field_cipheringKeySequenceNumber().RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_cipheringKeySequenceNumber = 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_cipheringKeySequenceNumber=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_authenticationParameterAUTN = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__MM__Types::AuthenticationParameterAUTNTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParameterAUTN().RAW_decode(MobileL3__MM__Types::AuthenticationParameterAUTNTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParameterAUTN = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationParameterAUTN.ispresent() || field_authenticationParameterAUTN().elementIdentifier() !=  os_14){
  field_authenticationParameterAUTN=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_authenticationParameterAUTN=OMIT_VALUE;
  if (field_messageType !=  bs_34) 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__GMM__AuthenticationAndCipheringRequest::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::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, CipheringAlgorithmV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, IMEISVRequestV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, ACReferenceNumberV_descr_.raw);
  if (field_authenticationParameterRAND.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__MM__Types::AuthenticationParameterRANDTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_cipheringKeySequenceNumber.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_authenticationParameterAUTN.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__MM__Types::AuthenticationParameterAUTNTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cipheringAlgorithm.RAW_encode(CipheringAlgorithmV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_imeisvRequest.RAW_encode(IMEISVRequestV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_acReferenceNumber.RAW_encode(ACReferenceNumberV_descr_, *myleaf.body.node.nodes[4]);
  if (field_authenticationParameterRAND.ispresent()) {
  encoded_length += field_authenticationParameterRAND().RAW_encode(MobileL3__MM__Types::AuthenticationParameterRANDTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_cipheringKeySequenceNumber.ispresent()) {
  encoded_length += field_cipheringKeySequenceNumber().RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_authenticationParameterAUTN.ispresent()) {
  encoded_length += field_authenticationParameterAUTN().RAW_encode(MobileL3__MM__Types::AuthenticationParameterAUTNTLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_authenticationParameterAUTN.ispresent() && (!field_authenticationParameterAUTN.ispresent() || field_authenticationParameterAUTN().elementIdentifier() !=  os_14)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_14.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);
  }
  }
  if (field_messageType !=  bs_34) {
  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_34.RAW_encode(General__Types::BIT8_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__GMM__AuthenticationAndCipheringRequest_template::single_value_struct {
BITSTRING_template field_messageType;
CipheringAlgorithmV_template field_cipheringAlgorithm;
IMEISVRequestV_template field_imeisvRequest;
ForceToStandbyV_template field_forceToStandby;
ACReferenceNumberV_template field_acReferenceNumber;
MobileL3__MM__Types::AuthenticationParameterRANDTV_template field_authenticationParameterRAND;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_template field_cipheringKeySequenceNumber;
MobileL3__MM__Types::AuthenticationParameterAUTNTLV_template field_authenticationParameterAUTN;
};

void PDU__GMM__AuthenticationAndCipheringRequest_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_messageType = ANY_VALUE;
single_value->field_cipheringAlgorithm = ANY_VALUE;
single_value->field_imeisvRequest = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_acReferenceNumber = ANY_VALUE;
single_value->field_authenticationParameterRAND = ANY_OR_OMIT;
single_value->field_cipheringKeySequenceNumber = ANY_OR_OMIT;
single_value->field_authenticationParameterAUTN = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AuthenticationAndCipheringRequest_template::copy_value(const PDU__GMM__AuthenticationAndCipheringRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.cipheringAlgorithm().is_bound()) {
  single_value->field_cipheringAlgorithm = other_value.cipheringAlgorithm();
} else {
  single_value->field_cipheringAlgorithm.clean_up();
}
if (other_value.imeisvRequest().is_bound()) {
  single_value->field_imeisvRequest = other_value.imeisvRequest();
} else {
  single_value->field_imeisvRequest.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.acReferenceNumber().is_bound()) {
  single_value->field_acReferenceNumber = other_value.acReferenceNumber();
} else {
  single_value->field_acReferenceNumber.clean_up();
}
if (other_value.authenticationParameterRAND().is_bound()) {
  if (other_value.authenticationParameterRAND().ispresent()) single_value->field_authenticationParameterRAND = other_value.authenticationParameterRAND()();
  else single_value->field_authenticationParameterRAND = OMIT_VALUE;
} else {
  single_value->field_authenticationParameterRAND.clean_up();
}
if (other_value.cipheringKeySequenceNumber().is_bound()) {
  if (other_value.cipheringKeySequenceNumber().ispresent()) single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber()();
  else single_value->field_cipheringKeySequenceNumber = OMIT_VALUE;
} else {
  single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (other_value.authenticationParameterAUTN().is_bound()) {
  if (other_value.authenticationParameterAUTN().ispresent()) single_value->field_authenticationParameterAUTN = other_value.authenticationParameterAUTN()();
  else single_value->field_authenticationParameterAUTN = OMIT_VALUE;
} else {
  single_value->field_authenticationParameterAUTN.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AuthenticationAndCipheringRequest_template::copy_template(const PDU__GMM__AuthenticationAndCipheringRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipheringAlgorithm().get_selection()) {
single_value->field_cipheringAlgorithm = other_value.cipheringAlgorithm();
} else {
single_value->field_cipheringAlgorithm.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.imeisvRequest().get_selection()) {
single_value->field_imeisvRequest = other_value.imeisvRequest();
} else {
single_value->field_imeisvRequest.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.acReferenceNumber().get_selection()) {
single_value->field_acReferenceNumber = other_value.acReferenceNumber();
} else {
single_value->field_acReferenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParameterRAND().get_selection()) {
single_value->field_authenticationParameterRAND = other_value.authenticationParameterRAND();
} else {
single_value->field_authenticationParameterRAND.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cipheringKeySequenceNumber().get_selection()) {
single_value->field_cipheringKeySequenceNumber = other_value.cipheringKeySequenceNumber();
} else {
single_value->field_cipheringKeySequenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParameterAUTN().get_selection()) {
single_value->field_authenticationParameterAUTN = other_value.authenticationParameterAUTN();
} else {
single_value->field_authenticationParameterAUTN.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__GMM__AuthenticationAndCipheringRequest_template[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__GMM__AuthenticationAndCipheringRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AuthenticationAndCipheringRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__AuthenticationAndCipheringRequest_template::PDU__GMM__AuthenticationAndCipheringRequest_template()
{
}

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

PDU__GMM__AuthenticationAndCipheringRequest_template::PDU__GMM__AuthenticationAndCipheringRequest_template(const PDU__GMM__AuthenticationAndCipheringRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__AuthenticationAndCipheringRequest_template& PDU__GMM__AuthenticationAndCipheringRequest_template::operator=(const OPTIONAL<PDU__GMM__AuthenticationAndCipheringRequest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__AuthenticationAndCipheringRequest&)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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
}
return *this;
}

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

boolean PDU__GMM__AuthenticationAndCipheringRequest_template::match(const PDU__GMM__AuthenticationAndCipheringRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.cipheringAlgorithm().is_bound()) return FALSE;
if(!single_value->field_cipheringAlgorithm.match(other_value.cipheringAlgorithm(), legacy))return FALSE;
if(!other_value.imeisvRequest().is_bound()) return FALSE;
if(!single_value->field_imeisvRequest.match(other_value.imeisvRequest(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.acReferenceNumber().is_bound()) return FALSE;
if(!single_value->field_acReferenceNumber.match(other_value.acReferenceNumber(), legacy))return FALSE;
if(!other_value.authenticationParameterRAND().is_bound()) return FALSE;
if((other_value.authenticationParameterRAND().ispresent() ? !single_value->field_authenticationParameterRAND.match((const MobileL3__MM__Types::AuthenticationParameterRANDTV&)other_value.authenticationParameterRAND(), legacy) : !single_value->field_authenticationParameterRAND.match_omit(legacy)))return FALSE;
if(!other_value.cipheringKeySequenceNumber().is_bound()) return FALSE;
if((other_value.cipheringKeySequenceNumber().ispresent() ? !single_value->field_cipheringKeySequenceNumber.match((const MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV&)other_value.cipheringKeySequenceNumber(), legacy) : !single_value->field_cipheringKeySequenceNumber.match_omit(legacy)))return FALSE;
if(!other_value.authenticationParameterAUTN().is_bound()) return FALSE;
if((other_value.authenticationParameterAUTN().ispresent() ? !single_value->field_authenticationParameterAUTN.match((const MobileL3__MM__Types::AuthenticationParameterAUTNTLV&)other_value.authenticationParameterAUTN(), legacy) : !single_value->field_authenticationParameterAUTN.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
}
return FALSE;
}

boolean PDU__GMM__AuthenticationAndCipheringRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_cipheringAlgorithm.is_bound()
 || single_value->field_imeisvRequest.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_acReferenceNumber.is_bound()
 || (single_value->field_authenticationParameterRAND.is_omit() || single_value->field_authenticationParameterRAND.is_bound())
 || (single_value->field_cipheringKeySequenceNumber.is_omit() || single_value->field_cipheringKeySequenceNumber.is_bound())
 || (single_value->field_authenticationParameterAUTN.is_omit() || single_value->field_authenticationParameterAUTN.is_bound());
}

boolean PDU__GMM__AuthenticationAndCipheringRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_cipheringAlgorithm.is_value()
 && single_value->field_imeisvRequest.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_acReferenceNumber.is_value()
 && (single_value->field_authenticationParameterRAND.is_omit() || single_value->field_authenticationParameterRAND.is_value())
 && (single_value->field_cipheringKeySequenceNumber.is_omit() || single_value->field_cipheringKeySequenceNumber.is_value())
 && (single_value->field_authenticationParameterAUTN.is_omit() || single_value->field_authenticationParameterAUTN.is_value());
}

void PDU__GMM__AuthenticationAndCipheringRequest_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__GMM__AuthenticationAndCipheringRequest PDU__GMM__AuthenticationAndCipheringRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
PDU__GMM__AuthenticationAndCipheringRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_cipheringAlgorithm.is_bound()) {
ret_val.cipheringAlgorithm() = single_value->field_cipheringAlgorithm.valueof();
}
if (single_value->field_imeisvRequest.is_bound()) {
ret_val.imeisvRequest() = single_value->field_imeisvRequest.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_acReferenceNumber.is_bound()) {
ret_val.acReferenceNumber() = single_value->field_acReferenceNumber.valueof();
}
if (single_value->field_authenticationParameterRAND.is_omit()) ret_val.authenticationParameterRAND() = OMIT_VALUE;
else if (single_value->field_authenticationParameterRAND.is_bound()) {
ret_val.authenticationParameterRAND() = single_value->field_authenticationParameterRAND.valueof();
}
if (single_value->field_cipheringKeySequenceNumber.is_omit()) ret_val.cipheringKeySequenceNumber() = OMIT_VALUE;
else if (single_value->field_cipheringKeySequenceNumber.is_bound()) {
ret_val.cipheringKeySequenceNumber() = single_value->field_cipheringKeySequenceNumber.valueof();
}
if (single_value->field_authenticationParameterAUTN.is_omit()) ret_val.authenticationParameterAUTN() = OMIT_VALUE;
else if (single_value->field_authenticationParameterAUTN.is_bound()) {
ret_val.authenticationParameterAUTN() = single_value->field_authenticationParameterAUTN.valueof();
}
return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AuthenticationAndCipheringRequest_template[list_length];
}

PDU__GMM__AuthenticationAndCipheringRequest_template& PDU__GMM__AuthenticationAndCipheringRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_messageType;
}

CipheringAlgorithmV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::cipheringAlgorithm()
{
set_specific();
return single_value->field_cipheringAlgorithm;
}

const CipheringAlgorithmV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::cipheringAlgorithm() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringAlgorithm of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_cipheringAlgorithm;
}

IMEISVRequestV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::imeisvRequest()
{
set_specific();
return single_value->field_imeisvRequest;
}

const IMEISVRequestV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::imeisvRequest() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imeisvRequest of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_imeisvRequest;
}

ForceToStandbyV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_forceToStandby;
}

ACReferenceNumberV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::acReferenceNumber()
{
set_specific();
return single_value->field_acReferenceNumber;
}

const ACReferenceNumberV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::acReferenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field acReferenceNumber of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_acReferenceNumber;
}

MobileL3__MM__Types::AuthenticationParameterRANDTV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::authenticationParameterRAND()
{
set_specific();
return single_value->field_authenticationParameterRAND;
}

const MobileL3__MM__Types::AuthenticationParameterRANDTV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::authenticationParameterRAND() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParameterRAND of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_authenticationParameterRAND;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::cipheringKeySequenceNumber()
{
set_specific();
return single_value->field_cipheringKeySequenceNumber;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberTV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::cipheringKeySequenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cipheringKeySequenceNumber of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_cipheringKeySequenceNumber;
}

MobileL3__MM__Types::AuthenticationParameterAUTNTLV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::authenticationParameterAUTN()
{
set_specific();
return single_value->field_authenticationParameterAUTN;
}

const MobileL3__MM__Types::AuthenticationParameterAUTNTLV_template& PDU__GMM__AuthenticationAndCipheringRequest_template::authenticationParameterAUTN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParameterAUTN of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
return single_value->field_authenticationParameterAUTN;
}

int PDU__GMM__AuthenticationAndCipheringRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_authenticationParameterRAND.is_present()) ret_val++;
      if (single_value->field_cipheringKeySequenceNumber.is_present()) ret_val++;
      if (single_value->field_authenticationParameterAUTN.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest 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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
  }
  return 0;
}

void PDU__GMM__AuthenticationAndCipheringRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", cipheringAlgorithm := ");
single_value->field_cipheringAlgorithm.log();
TTCN_Logger::log_event_str(", imeisvRequest := ");
single_value->field_imeisvRequest.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", acReferenceNumber := ");
single_value->field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", authenticationParameterRAND := ");
single_value->field_authenticationParameterRAND.log();
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(", authenticationParameterAUTN := ");
single_value->field_authenticationParameterAUTN.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__GMM__AuthenticationAndCipheringRequest_template::log_match(const PDU__GMM__AuthenticationAndCipheringRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cipheringAlgorithm.match(match_value.cipheringAlgorithm(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringAlgorithm");
single_value->field_cipheringAlgorithm.log_match(match_value.cipheringAlgorithm(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_imeisvRequest.match(match_value.imeisvRequest(), legacy)){
TTCN_Logger::log_logmatch_info(".imeisvRequest");
single_value->field_imeisvRequest.log_match(match_value.imeisvRequest(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_acReferenceNumber.match(match_value.acReferenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".acReferenceNumber");
single_value->field_acReferenceNumber.log_match(match_value.acReferenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.authenticationParameterRAND().ispresent()){
if(!single_value->field_authenticationParameterRAND.match(match_value.authenticationParameterRAND(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParameterRAND");
single_value->field_authenticationParameterRAND.log_match(match_value.authenticationParameterRAND(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParameterRAND.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParameterRAND := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParameterRAND.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cipheringKeySequenceNumber().ispresent()){
if(!single_value->field_cipheringKeySequenceNumber.match(match_value.cipheringKeySequenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber");
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cipheringKeySequenceNumber.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cipheringKeySequenceNumber := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cipheringKeySequenceNumber.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.authenticationParameterAUTN().ispresent()){
if(!single_value->field_authenticationParameterAUTN.match(match_value.authenticationParameterAUTN(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParameterAUTN");
single_value->field_authenticationParameterAUTN.log_match(match_value.authenticationParameterAUTN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParameterAUTN.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParameterAUTN := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParameterAUTN.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", cipheringAlgorithm := ");
single_value->field_cipheringAlgorithm.log_match(match_value.cipheringAlgorithm(), legacy);
TTCN_Logger::log_event_str(", imeisvRequest := ");
single_value->field_imeisvRequest.log_match(match_value.imeisvRequest(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", acReferenceNumber := ");
single_value->field_acReferenceNumber.log_match(match_value.acReferenceNumber(), legacy);
TTCN_Logger::log_event_str(", authenticationParameterRAND := ");
if (match_value.authenticationParameterRAND().ispresent()) {
single_value->field_authenticationParameterRAND.log_match(match_value.authenticationParameterRAND(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParameterRAND.log();
if (single_value->field_authenticationParameterRAND.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cipheringKeySequenceNumber := ");
if (match_value.cipheringKeySequenceNumber().ispresent()) {
single_value->field_cipheringKeySequenceNumber.log_match(match_value.cipheringKeySequenceNumber(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cipheringKeySequenceNumber.log();
if (single_value->field_cipheringKeySequenceNumber.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", authenticationParameterAUTN := ");
if (match_value.authenticationParameterAUTN().ispresent()) {
single_value->field_authenticationParameterAUTN.log_match(match_value.authenticationParameterAUTN(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParameterAUTN.log();
if (single_value->field_authenticationParameterAUTN.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 PDU__GMM__AuthenticationAndCipheringRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (cipheringAlgorithm().is_bound()) cipheringAlgorithm().set_implicit_omit();
if (imeisvRequest().is_bound()) imeisvRequest().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (acReferenceNumber().is_bound()) acReferenceNumber().set_implicit_omit();
if (!authenticationParameterRAND().is_bound()) authenticationParameterRAND() = OMIT_VALUE;
else authenticationParameterRAND().set_implicit_omit();
if (!cipheringKeySequenceNumber().is_bound()) cipheringKeySequenceNumber() = OMIT_VALUE;
else cipheringKeySequenceNumber().set_implicit_omit();
if (!authenticationParameterAUTN().is_bound()) authenticationParameterAUTN() = OMIT_VALUE;
else authenticationParameterAUTN().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_cipheringAlgorithm.encode_text(text_buf);
single_value->field_imeisvRequest.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_acReferenceNumber.encode_text(text_buf);
single_value->field_authenticationParameterRAND.encode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.encode_text(text_buf);
single_value->field_authenticationParameterAUTN.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
}
}

void PDU__GMM__AuthenticationAndCipheringRequest_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_messageType.decode_text(text_buf);
single_value->field_cipheringAlgorithm.decode_text(text_buf);
single_value->field_imeisvRequest.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_acReferenceNumber.decode_text(text_buf);
single_value->field_authenticationParameterRAND.decode_text(text_buf);
single_value->field_cipheringKeySequenceNumber.decode_text(text_buf);
single_value->field_authenticationParameterAUTN.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__GMM__AuthenticationAndCipheringRequest_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest.");
}
}

void PDU__GMM__AuthenticationAndCipheringRequest_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__GMM__AuthenticationAndCipheringRequest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (8<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest has 8 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cipheringAlgorithm().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) imeisvRequest().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumber().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationParameterRAND().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) cipheringKeySequenceNumber().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) authenticationParameterAUTN().set_param(*param.get_elem(7));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringAlgorithm")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringAlgorithm().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imeisvRequest")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imeisvRequest().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "acReferenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acReferenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParameterRAND")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParameterRAND().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cipheringKeySequenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cipheringKeySequenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParameterAUTN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParameterAUTN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AuthenticationAndCipheringRequest_template* precondition = new PDU__GMM__AuthenticationAndCipheringRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AuthenticationAndCipheringRequest_template* implied_template = new PDU__GMM__AuthenticationAndCipheringRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AuthenticationAndCipheringRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AuthenticationAndCipheringRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_cipheringAlgorithm.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_imeisvRequest.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_acReferenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_authenticationParameterRAND.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_cipheringKeySequenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
single_value->field_authenticationParameterAUTN.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringRequest");
}

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

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

PDU__GMM__AuthenticationAndCipheringResponse::PDU__GMM__AuthenticationAndCipheringResponse()
{
}

PDU__GMM__AuthenticationAndCipheringResponse::PDU__GMM__AuthenticationAndCipheringResponse(const BITSTRING& par_messageType,
    const ACReferenceNumberV& par_acReferenceNumber,
    const BITSTRING& par_spare,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationResponseParameterTV >& par_authenticationParResp,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_imeisv,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV >& par_authenticationRespParExt)
  :   field_messageType(par_messageType),
  field_acReferenceNumber(par_acReferenceNumber),
  field_spare(par_spare),
  field_authenticationParResp(par_authenticationParResp),
  field_imeisv(par_imeisv),
  field_authenticationRespParExt(par_authenticationRespParExt)
{
}

PDU__GMM__AuthenticationAndCipheringResponse::PDU__GMM__AuthenticationAndCipheringResponse(const PDU__GMM__AuthenticationAndCipheringResponse& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
else field_acReferenceNumber.clean_up();
if (other_value.spare().is_bound()) field_spare = other_value.spare();
else field_spare.clean_up();
if (other_value.authenticationParResp().is_bound()) field_authenticationParResp = other_value.authenticationParResp();
else field_authenticationParResp.clean_up();
if (other_value.imeisv().is_bound()) field_imeisv = other_value.imeisv();
else field_imeisv.clean_up();
if (other_value.authenticationRespParExt().is_bound()) field_authenticationRespParExt = other_value.authenticationRespParExt();
else field_authenticationRespParExt.clean_up();
}

void PDU__GMM__AuthenticationAndCipheringResponse::clean_up()
{
field_messageType.clean_up();
field_acReferenceNumber.clean_up();
field_spare.clean_up();
field_authenticationParResp.clean_up();
field_imeisv.clean_up();
field_authenticationRespParExt.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AuthenticationAndCipheringResponse::get_descriptor() const { return &PDU__GMM__AuthenticationAndCipheringResponse_descr_; }
PDU__GMM__AuthenticationAndCipheringResponse& PDU__GMM__AuthenticationAndCipheringResponse::operator=(const PDU__GMM__AuthenticationAndCipheringResponse& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.acReferenceNumber().is_bound()) field_acReferenceNumber = other_value.acReferenceNumber();
  else field_acReferenceNumber.clean_up();
  if (other_value.spare().is_bound()) field_spare = other_value.spare();
  else field_spare.clean_up();
  if (other_value.authenticationParResp().is_bound()) field_authenticationParResp = other_value.authenticationParResp();
  else field_authenticationParResp.clean_up();
  if (other_value.imeisv().is_bound()) field_imeisv = other_value.imeisv();
  else field_imeisv.clean_up();
  if (other_value.authenticationRespParExt().is_bound()) field_authenticationRespParExt = other_value.authenticationRespParExt();
  else field_authenticationRespParExt.clean_up();
}
return *this;
}

boolean PDU__GMM__AuthenticationAndCipheringResponse::operator==(const PDU__GMM__AuthenticationAndCipheringResponse& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_acReferenceNumber==other_value.field_acReferenceNumber
  && field_spare==other_value.field_spare
  && field_authenticationParResp==other_value.field_authenticationParResp
  && field_imeisv==other_value.field_imeisv
  && field_authenticationRespParExt==other_value.field_authenticationRespParExt;
}

boolean PDU__GMM__AuthenticationAndCipheringResponse::is_bound() const
{
return (field_messageType.is_bound())
  || (field_acReferenceNumber.is_bound())
  || (field_spare.is_bound())
  || (OPTIONAL_OMIT == field_authenticationParResp.get_selection() || field_authenticationParResp.is_bound())
  || (OPTIONAL_OMIT == field_imeisv.get_selection() || field_imeisv.is_bound())
  || (OPTIONAL_OMIT == field_authenticationRespParExt.get_selection() || field_authenticationRespParExt.is_bound());
}
boolean PDU__GMM__AuthenticationAndCipheringResponse::is_value() const
{
return field_messageType.is_value()
  && field_acReferenceNumber.is_value()
  && field_spare.is_value()
  && (OPTIONAL_OMIT == field_authenticationParResp.get_selection() || field_authenticationParResp.is_value())
  && (OPTIONAL_OMIT == field_imeisv.get_selection() || field_imeisv.is_value())
  && (OPTIONAL_OMIT == field_authenticationRespParExt.get_selection() || field_authenticationRespParExt.is_value());
}
int PDU__GMM__AuthenticationAndCipheringResponse::size_of() const
{
  int ret_val = 3;
  if (field_authenticationParResp.ispresent()) ret_val++;
  if (field_imeisv.ispresent()) ret_val++;
  if (field_authenticationRespParExt.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringResponse::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", acReferenceNumber := ");
field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", spare := ");
field_spare.log();
TTCN_Logger::log_event_str(", authenticationParResp := ");
field_authenticationParResp.log();
TTCN_Logger::log_event_str(", imeisv := ");
field_imeisv.log();
TTCN_Logger::log_event_str(", authenticationRespParExt := ");
field_authenticationRespParExt.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AuthenticationAndCipheringResponse::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (acReferenceNumber().is_bound()) acReferenceNumber().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!authenticationParResp().is_bound()) authenticationParResp() = OMIT_VALUE;
else authenticationParResp().set_implicit_omit();
if (!imeisv().is_bound()) imeisv() = OMIT_VALUE;
else imeisv().set_implicit_omit();
if (!authenticationRespParExt().is_bound()) authenticationRespParExt() = OMIT_VALUE;
else authenticationRespParExt().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringResponse::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 (6<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) authenticationParResp().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) imeisv().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationRespParExt().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "acReferenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acReferenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParResp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParResp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imeisv")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imeisv().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationRespParExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationRespParExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
  }
}

void PDU__GMM__AuthenticationAndCipheringResponse::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_acReferenceNumber.encode_text(text_buf);
field_spare.encode_text(text_buf);
field_authenticationParResp.encode_text(text_buf);
field_imeisv.encode_text(text_buf);
field_authenticationRespParExt.encode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringResponse::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_acReferenceNumber.decode_text(text_buf);
field_spare.decode_text(text_buf);
field_authenticationParResp.decode_text(text_buf);
field_imeisv.decode_text(text_buf);
field_authenticationRespParExt.decode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringResponse::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__AuthenticationAndCipheringResponse::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__AuthenticationAndCipheringResponse::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, ACReferenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_acReferenceNumber.RAW_decode(ACReferenceNumberV_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, General__Types::BIT4_descr_.raw->forceomit);
  decoded_field_length = field_spare.RAW_decode(General__Types::BIT4_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){
  if (force_omit != NULL && (*force_omit)(3)) {
    field_authenticationParResp = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_3_force_omit(3, force_omit, MobileL3__MM__Types::AuthenticationResponseParameterTV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationParResp().RAW_decode(MobileL3__MM__Types::AuthenticationResponseParameterTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_3_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationParResp = 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_authenticationParResp=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(4)) {
    field_imeisv = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_4_force_omit(4, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_imeisv().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_4_force_omit);
  if (decoded_field_length < 1) {
  field_imeisv = 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_imeisv=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_authenticationRespParExt = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationRespParExt().RAW_decode(MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationRespParExt = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationRespParExt.ispresent() || field_authenticationRespParExt().elementIdentifier() !=  os_36){
  field_authenticationRespParExt=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_authenticationRespParExt=OMIT_VALUE;
  if (field_messageType !=  bs_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 PDU__GMM__AuthenticationAndCipheringResponse::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ACReferenceNumberV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, General__Types::BIT4_descr_.raw);
  if (field_authenticationParResp.ispresent()) {
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, MobileL3__MM__Types::AuthenticationResponseParameterTV_descr_.raw);
  }
  else myleaf.body.node.nodes[3] = NULL;
  if (field_imeisv.ispresent()) {
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[4] = NULL;
  if (field_authenticationRespParExt.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_acReferenceNumber.RAW_encode(ACReferenceNumberV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_spare.RAW_encode(General__Types::BIT4_descr_, *myleaf.body.node.nodes[2]);
  if (field_authenticationParResp.ispresent()) {
  encoded_length += field_authenticationParResp().RAW_encode(MobileL3__MM__Types::AuthenticationResponseParameterTV_descr_, *myleaf.body.node.nodes[3]);
  }
  if (field_imeisv.ispresent()) {
  encoded_length += field_imeisv().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[4]);
  }
  if (field_authenticationRespParExt.ispresent()) {
  encoded_length += field_authenticationRespParExt().RAW_encode(MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_authenticationRespParExt.ispresent() && (!field_authenticationRespParExt.ispresent() || field_authenticationRespParExt().elementIdentifier() !=  os_36)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={5,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_36.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);
  }
  }
  if (field_messageType !=  bs_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){
   bs_35.RAW_encode(General__Types::BIT8_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__GMM__AuthenticationAndCipheringResponse_template::single_value_struct {
BITSTRING_template field_messageType;
ACReferenceNumberV_template field_acReferenceNumber;
BITSTRING_template field_spare;
MobileL3__MM__Types::AuthenticationResponseParameterTV_template field_authenticationParResp;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_imeisv;
MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_template field_authenticationRespParExt;
};

void PDU__GMM__AuthenticationAndCipheringResponse_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_messageType = ANY_VALUE;
single_value->field_acReferenceNumber = ANY_VALUE;
single_value->field_spare = ANY_VALUE;
single_value->field_authenticationParResp = ANY_OR_OMIT;
single_value->field_imeisv = ANY_OR_OMIT;
single_value->field_authenticationRespParExt = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AuthenticationAndCipheringResponse_template::copy_value(const PDU__GMM__AuthenticationAndCipheringResponse& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.acReferenceNumber().is_bound()) {
  single_value->field_acReferenceNumber = other_value.acReferenceNumber();
} else {
  single_value->field_acReferenceNumber.clean_up();
}
if (other_value.spare().is_bound()) {
  single_value->field_spare = other_value.spare();
} else {
  single_value->field_spare.clean_up();
}
if (other_value.authenticationParResp().is_bound()) {
  if (other_value.authenticationParResp().ispresent()) single_value->field_authenticationParResp = other_value.authenticationParResp()();
  else single_value->field_authenticationParResp = OMIT_VALUE;
} else {
  single_value->field_authenticationParResp.clean_up();
}
if (other_value.imeisv().is_bound()) {
  if (other_value.imeisv().ispresent()) single_value->field_imeisv = other_value.imeisv()();
  else single_value->field_imeisv = OMIT_VALUE;
} else {
  single_value->field_imeisv.clean_up();
}
if (other_value.authenticationRespParExt().is_bound()) {
  if (other_value.authenticationRespParExt().ispresent()) single_value->field_authenticationRespParExt = other_value.authenticationRespParExt()();
  else single_value->field_authenticationRespParExt = OMIT_VALUE;
} else {
  single_value->field_authenticationRespParExt.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AuthenticationAndCipheringResponse_template::copy_template(const PDU__GMM__AuthenticationAndCipheringResponse_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.acReferenceNumber().get_selection()) {
single_value->field_acReferenceNumber = other_value.acReferenceNumber();
} else {
single_value->field_acReferenceNumber.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spare().get_selection()) {
single_value->field_spare = other_value.spare();
} else {
single_value->field_spare.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationParResp().get_selection()) {
single_value->field_authenticationParResp = other_value.authenticationParResp();
} else {
single_value->field_authenticationParResp.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.imeisv().get_selection()) {
single_value->field_imeisv = other_value.imeisv();
} else {
single_value->field_imeisv.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationRespParExt().get_selection()) {
single_value->field_authenticationRespParExt = other_value.authenticationRespParExt();
} else {
single_value->field_authenticationRespParExt.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__GMM__AuthenticationAndCipheringResponse_template[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__GMM__AuthenticationAndCipheringResponse_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AuthenticationAndCipheringResponse_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
break;
}
set_selection(other_value);
}

PDU__GMM__AuthenticationAndCipheringResponse_template::PDU__GMM__AuthenticationAndCipheringResponse_template()
{
}

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

PDU__GMM__AuthenticationAndCipheringResponse_template::PDU__GMM__AuthenticationAndCipheringResponse_template(const PDU__GMM__AuthenticationAndCipheringResponse& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__AuthenticationAndCipheringResponse_template& PDU__GMM__AuthenticationAndCipheringResponse_template::operator=(const OPTIONAL<PDU__GMM__AuthenticationAndCipheringResponse>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__AuthenticationAndCipheringResponse&)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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
}
return *this;
}

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

boolean PDU__GMM__AuthenticationAndCipheringResponse_template::match(const PDU__GMM__AuthenticationAndCipheringResponse& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.acReferenceNumber().is_bound()) return FALSE;
if(!single_value->field_acReferenceNumber.match(other_value.acReferenceNumber(), legacy))return FALSE;
if(!other_value.spare().is_bound()) return FALSE;
if(!single_value->field_spare.match(other_value.spare(), legacy))return FALSE;
if(!other_value.authenticationParResp().is_bound()) return FALSE;
if((other_value.authenticationParResp().ispresent() ? !single_value->field_authenticationParResp.match((const MobileL3__MM__Types::AuthenticationResponseParameterTV&)other_value.authenticationParResp(), legacy) : !single_value->field_authenticationParResp.match_omit(legacy)))return FALSE;
if(!other_value.imeisv().is_bound()) return FALSE;
if((other_value.imeisv().ispresent() ? !single_value->field_imeisv.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.imeisv(), legacy) : !single_value->field_imeisv.match_omit(legacy)))return FALSE;
if(!other_value.authenticationRespParExt().is_bound()) return FALSE;
if((other_value.authenticationRespParExt().ispresent() ? !single_value->field_authenticationRespParExt.match((const MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV&)other_value.authenticationRespParExt(), legacy) : !single_value->field_authenticationRespParExt.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
}
return FALSE;
}

boolean PDU__GMM__AuthenticationAndCipheringResponse_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_acReferenceNumber.is_bound()
 || single_value->field_spare.is_bound()
 || (single_value->field_authenticationParResp.is_omit() || single_value->field_authenticationParResp.is_bound())
 || (single_value->field_imeisv.is_omit() || single_value->field_imeisv.is_bound())
 || (single_value->field_authenticationRespParExt.is_omit() || single_value->field_authenticationRespParExt.is_bound());
}

boolean PDU__GMM__AuthenticationAndCipheringResponse_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_acReferenceNumber.is_value()
 && single_value->field_spare.is_value()
 && (single_value->field_authenticationParResp.is_omit() || single_value->field_authenticationParResp.is_value())
 && (single_value->field_imeisv.is_omit() || single_value->field_imeisv.is_value())
 && (single_value->field_authenticationRespParExt.is_omit() || single_value->field_authenticationRespParExt.is_value());
}

void PDU__GMM__AuthenticationAndCipheringResponse_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__GMM__AuthenticationAndCipheringResponse PDU__GMM__AuthenticationAndCipheringResponse_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
PDU__GMM__AuthenticationAndCipheringResponse ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_acReferenceNumber.is_bound()) {
ret_val.acReferenceNumber() = single_value->field_acReferenceNumber.valueof();
}
if (single_value->field_spare.is_bound()) {
ret_val.spare() = single_value->field_spare.valueof();
}
if (single_value->field_authenticationParResp.is_omit()) ret_val.authenticationParResp() = OMIT_VALUE;
else if (single_value->field_authenticationParResp.is_bound()) {
ret_val.authenticationParResp() = single_value->field_authenticationParResp.valueof();
}
if (single_value->field_imeisv.is_omit()) ret_val.imeisv() = OMIT_VALUE;
else if (single_value->field_imeisv.is_bound()) {
ret_val.imeisv() = single_value->field_imeisv.valueof();
}
if (single_value->field_authenticationRespParExt.is_omit()) ret_val.authenticationRespParExt() = OMIT_VALUE;
else if (single_value->field_authenticationRespParExt.is_bound()) {
ret_val.authenticationRespParExt() = single_value->field_authenticationRespParExt.valueof();
}
return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringResponse_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AuthenticationAndCipheringResponse_template[list_length];
}

PDU__GMM__AuthenticationAndCipheringResponse_template& PDU__GMM__AuthenticationAndCipheringResponse_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringResponse_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringResponse_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_messageType;
}

ACReferenceNumberV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::acReferenceNumber()
{
set_specific();
return single_value->field_acReferenceNumber;
}

const ACReferenceNumberV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::acReferenceNumber() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field acReferenceNumber of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_acReferenceNumber;
}

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringResponse_template::spare()
{
set_specific();
return single_value->field_spare;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringResponse_template::spare() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spare of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_spare;
}

MobileL3__MM__Types::AuthenticationResponseParameterTV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::authenticationParResp()
{
set_specific();
return single_value->field_authenticationParResp;
}

const MobileL3__MM__Types::AuthenticationResponseParameterTV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::authenticationParResp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationParResp of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_authenticationParResp;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::imeisv()
{
set_specific();
return single_value->field_imeisv;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::imeisv() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field imeisv of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_imeisv;
}

MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::authenticationRespParExt()
{
set_specific();
return single_value->field_authenticationRespParExt;
}

const MobileL3__MM__Types::AuthenticationResponseParameterUMTSTLV_template& PDU__GMM__AuthenticationAndCipheringResponse_template::authenticationRespParExt() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationRespParExt of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
return single_value->field_authenticationRespParExt;
}

int PDU__GMM__AuthenticationAndCipheringResponse_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_authenticationParResp.is_present()) ret_val++;
      if (single_value->field_imeisv.is_present()) ret_val++;
      if (single_value->field_authenticationRespParExt.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse 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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
  }
  return 0;
}

void PDU__GMM__AuthenticationAndCipheringResponse_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", acReferenceNumber := ");
single_value->field_acReferenceNumber.log();
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log();
TTCN_Logger::log_event_str(", authenticationParResp := ");
single_value->field_authenticationParResp.log();
TTCN_Logger::log_event_str(", imeisv := ");
single_value->field_imeisv.log();
TTCN_Logger::log_event_str(", authenticationRespParExt := ");
single_value->field_authenticationRespParExt.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__GMM__AuthenticationAndCipheringResponse_template::log_match(const PDU__GMM__AuthenticationAndCipheringResponse& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_acReferenceNumber.match(match_value.acReferenceNumber(), legacy)){
TTCN_Logger::log_logmatch_info(".acReferenceNumber");
single_value->field_acReferenceNumber.log_match(match_value.acReferenceNumber(), 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);
}
if (match_value.authenticationParResp().ispresent()){
if(!single_value->field_authenticationParResp.match(match_value.authenticationParResp(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationParResp");
single_value->field_authenticationParResp.log_match(match_value.authenticationParResp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationParResp.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationParResp := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationParResp.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.imeisv().ispresent()){
if(!single_value->field_imeisv.match(match_value.imeisv(), legacy)){
TTCN_Logger::log_logmatch_info(".imeisv");
single_value->field_imeisv.log_match(match_value.imeisv(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_imeisv.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".imeisv := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_imeisv.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.authenticationRespParExt().ispresent()){
if(!single_value->field_authenticationRespParExt.match(match_value.authenticationRespParExt(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationRespParExt");
single_value->field_authenticationRespParExt.log_match(match_value.authenticationRespParExt(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationRespParExt.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationRespParExt := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationRespParExt.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", acReferenceNumber := ");
single_value->field_acReferenceNumber.log_match(match_value.acReferenceNumber(), legacy);
TTCN_Logger::log_event_str(", spare := ");
single_value->field_spare.log_match(match_value.spare(), legacy);
TTCN_Logger::log_event_str(", authenticationParResp := ");
if (match_value.authenticationParResp().ispresent()) {
single_value->field_authenticationParResp.log_match(match_value.authenticationParResp(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationParResp.log();
if (single_value->field_authenticationParResp.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", imeisv := ");
if (match_value.imeisv().ispresent()) {
single_value->field_imeisv.log_match(match_value.imeisv(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_imeisv.log();
if (single_value->field_imeisv.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", authenticationRespParExt := ");
if (match_value.authenticationRespParExt().ispresent()) {
single_value->field_authenticationRespParExt.log_match(match_value.authenticationRespParExt(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationRespParExt.log();
if (single_value->field_authenticationRespParExt.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 PDU__GMM__AuthenticationAndCipheringResponse_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (acReferenceNumber().is_bound()) acReferenceNumber().set_implicit_omit();
if (spare().is_bound()) spare().set_implicit_omit();
if (!authenticationParResp().is_bound()) authenticationParResp() = OMIT_VALUE;
else authenticationParResp().set_implicit_omit();
if (!imeisv().is_bound()) imeisv() = OMIT_VALUE;
else imeisv().set_implicit_omit();
if (!authenticationRespParExt().is_bound()) authenticationRespParExt() = OMIT_VALUE;
else authenticationRespParExt().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringResponse_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_acReferenceNumber.encode_text(text_buf);
single_value->field_spare.encode_text(text_buf);
single_value->field_authenticationParResp.encode_text(text_buf);
single_value->field_imeisv.encode_text(text_buf);
single_value->field_authenticationRespParExt.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
}
}

void PDU__GMM__AuthenticationAndCipheringResponse_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_messageType.decode_text(text_buf);
single_value->field_acReferenceNumber.decode_text(text_buf);
single_value->field_spare.decode_text(text_buf);
single_value->field_authenticationParResp.decode_text(text_buf);
single_value->field_imeisv.decode_text(text_buf);
single_value->field_authenticationRespParExt.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__GMM__AuthenticationAndCipheringResponse_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse.");
}
}

void PDU__GMM__AuthenticationAndCipheringResponse_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__GMM__AuthenticationAndCipheringResponse_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (6<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse has 6 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) acReferenceNumber().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) spare().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) authenticationParResp().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) imeisv().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) authenticationRespParExt().set_param(*param.get_elem(5));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "acReferenceNumber")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          acReferenceNumber().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "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_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationParResp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationParResp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "imeisv")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          imeisv().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationRespParExt")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationRespParExt().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AuthenticationAndCipheringResponse_template* precondition = new PDU__GMM__AuthenticationAndCipheringResponse_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AuthenticationAndCipheringResponse_template* implied_template = new PDU__GMM__AuthenticationAndCipheringResponse_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AuthenticationAndCipheringResponse_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AuthenticationAndCipheringResponse_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_acReferenceNumber.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_spare.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_authenticationParResp.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_imeisv.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
single_value->field_authenticationRespParExt.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringResponse");
}

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

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

PDU__GMM__AuthenticationAndCipheringFailure::PDU__GMM__AuthenticationAndCipheringFailure()
{
}

PDU__GMM__AuthenticationAndCipheringFailure::PDU__GMM__AuthenticationAndCipheringFailure(const BITSTRING& par_messageType,
    const GMM__CauseV& par_gmmCause,
    const OPTIONAL< MobileL3__MM__Types::AuthenticationFailureParametersTLV >& par_authenticationFailureParam)
  :   field_messageType(par_messageType),
  field_gmmCause(par_gmmCause),
  field_authenticationFailureParam(par_authenticationFailureParam)
{
}

PDU__GMM__AuthenticationAndCipheringFailure::PDU__GMM__AuthenticationAndCipheringFailure(const PDU__GMM__AuthenticationAndCipheringFailure& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.authenticationFailureParam().is_bound()) field_authenticationFailureParam = other_value.authenticationFailureParam();
else field_authenticationFailureParam.clean_up();
}

void PDU__GMM__AuthenticationAndCipheringFailure::clean_up()
{
field_messageType.clean_up();
field_gmmCause.clean_up();
field_authenticationFailureParam.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AuthenticationAndCipheringFailure::get_descriptor() const { return &PDU__GMM__AuthenticationAndCipheringFailure_descr_; }
PDU__GMM__AuthenticationAndCipheringFailure& PDU__GMM__AuthenticationAndCipheringFailure::operator=(const PDU__GMM__AuthenticationAndCipheringFailure& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.authenticationFailureParam().is_bound()) field_authenticationFailureParam = other_value.authenticationFailureParam();
  else field_authenticationFailureParam.clean_up();
}
return *this;
}

boolean PDU__GMM__AuthenticationAndCipheringFailure::operator==(const PDU__GMM__AuthenticationAndCipheringFailure& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_gmmCause==other_value.field_gmmCause
  && field_authenticationFailureParam==other_value.field_authenticationFailureParam;
}

boolean PDU__GMM__AuthenticationAndCipheringFailure::is_bound() const
{
return (field_messageType.is_bound())
  || (field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_authenticationFailureParam.get_selection() || field_authenticationFailureParam.is_bound());
}
boolean PDU__GMM__AuthenticationAndCipheringFailure::is_value() const
{
return field_messageType.is_value()
  && field_gmmCause.is_value()
  && (OPTIONAL_OMIT == field_authenticationFailureParam.get_selection() || field_authenticationFailureParam.is_value());
}
int PDU__GMM__AuthenticationAndCipheringFailure::size_of() const
{
  int ret_val = 2;
  if (field_authenticationFailureParam.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringFailure::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", authenticationFailureParam := ");
field_authenticationFailureParam.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AuthenticationAndCipheringFailure::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
if (!authenticationFailureParam().is_bound()) authenticationFailureParam() = OMIT_VALUE;
else authenticationFailureParam().set_implicit_omit();
}

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

void PDU__GMM__AuthenticationAndCipheringFailure::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_authenticationFailureParam.encode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringFailure::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_authenticationFailureParam.decode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringFailure::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__AuthenticationAndCipheringFailure::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__AuthenticationAndCipheringFailure::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, GMM__CauseV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause.RAW_decode(GMM__CauseV_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){
  if (force_omit != NULL && (*force_omit)(2)) {
    field_authenticationFailureParam = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_2_force_omit(2, force_omit, MobileL3__MM__Types::AuthenticationFailureParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_authenticationFailureParam().RAW_decode(MobileL3__MM__Types::AuthenticationFailureParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_2_force_omit);
  if (decoded_field_length < 1) {
  field_authenticationFailureParam = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_authenticationFailureParam.ispresent() || field_authenticationFailureParam().elementIdentifier() !=  os_15){
  field_authenticationFailureParam=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_authenticationFailureParam=OMIT_VALUE;
  if (field_messageType !=  bs_36) 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__GMM__AuthenticationAndCipheringFailure::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GMM__CauseV_descr_.raw);
  if (field_authenticationFailureParam.ispresent()) {
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__MM__Types::AuthenticationFailureParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[2] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_gmmCause.RAW_encode(GMM__CauseV_descr_, *myleaf.body.node.nodes[1]);
  if (field_authenticationFailureParam.ispresent()) {
  encoded_length += field_authenticationFailureParam().RAW_encode(MobileL3__MM__Types::AuthenticationFailureParametersTLV_descr_, *myleaf.body.node.nodes[2]);
  }
  if (field_authenticationFailureParam.ispresent() && (!field_authenticationFailureParam.ispresent() || field_authenticationFailureParam().elementIdentifier() !=  os_15)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={2,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_15.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);
  }
  }
  if (field_messageType !=  bs_36) {
  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_36.RAW_encode(General__Types::BIT8_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__GMM__AuthenticationAndCipheringFailure_template::single_value_struct {
BITSTRING_template field_messageType;
GMM__CauseV_template field_gmmCause;
MobileL3__MM__Types::AuthenticationFailureParametersTLV_template field_authenticationFailureParam;
};

void PDU__GMM__AuthenticationAndCipheringFailure_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_messageType = ANY_VALUE;
single_value->field_gmmCause = ANY_VALUE;
single_value->field_authenticationFailureParam = ANY_OR_OMIT;
}
}
}

void PDU__GMM__AuthenticationAndCipheringFailure_template::copy_value(const PDU__GMM__AuthenticationAndCipheringFailure& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  single_value->field_gmmCause = other_value.gmmCause();
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.authenticationFailureParam().is_bound()) {
  if (other_value.authenticationFailureParam().ispresent()) single_value->field_authenticationFailureParam = other_value.authenticationFailureParam()();
  else single_value->field_authenticationFailureParam = OMIT_VALUE;
} else {
  single_value->field_authenticationFailureParam.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AuthenticationAndCipheringFailure_template::copy_template(const PDU__GMM__AuthenticationAndCipheringFailure_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.authenticationFailureParam().get_selection()) {
single_value->field_authenticationFailureParam = other_value.authenticationFailureParam();
} else {
single_value->field_authenticationFailureParam.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__GMM__AuthenticationAndCipheringFailure_template[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__GMM__AuthenticationAndCipheringFailure_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AuthenticationAndCipheringFailure_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
break;
}
set_selection(other_value);
}

PDU__GMM__AuthenticationAndCipheringFailure_template::PDU__GMM__AuthenticationAndCipheringFailure_template()
{
}

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

PDU__GMM__AuthenticationAndCipheringFailure_template::PDU__GMM__AuthenticationAndCipheringFailure_template(const PDU__GMM__AuthenticationAndCipheringFailure& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__AuthenticationAndCipheringFailure_template& PDU__GMM__AuthenticationAndCipheringFailure_template::operator=(const OPTIONAL<PDU__GMM__AuthenticationAndCipheringFailure>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__AuthenticationAndCipheringFailure&)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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
}
return *this;
}

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

boolean PDU__GMM__AuthenticationAndCipheringFailure_template::match(const PDU__GMM__AuthenticationAndCipheringFailure& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if(!single_value->field_gmmCause.match(other_value.gmmCause(), legacy))return FALSE;
if(!other_value.authenticationFailureParam().is_bound()) return FALSE;
if((other_value.authenticationFailureParam().ispresent() ? !single_value->field_authenticationFailureParam.match((const MobileL3__MM__Types::AuthenticationFailureParametersTLV&)other_value.authenticationFailureParam(), legacy) : !single_value->field_authenticationFailureParam.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
}
return FALSE;
}

boolean PDU__GMM__AuthenticationAndCipheringFailure_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_gmmCause.is_bound()
 || (single_value->field_authenticationFailureParam.is_omit() || single_value->field_authenticationFailureParam.is_bound());
}

boolean PDU__GMM__AuthenticationAndCipheringFailure_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_gmmCause.is_value()
 && (single_value->field_authenticationFailureParam.is_omit() || single_value->field_authenticationFailureParam.is_value());
}

void PDU__GMM__AuthenticationAndCipheringFailure_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__GMM__AuthenticationAndCipheringFailure PDU__GMM__AuthenticationAndCipheringFailure_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
PDU__GMM__AuthenticationAndCipheringFailure ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_authenticationFailureParam.is_omit()) ret_val.authenticationFailureParam() = OMIT_VALUE;
else if (single_value->field_authenticationFailureParam.is_bound()) {
ret_val.authenticationFailureParam() = single_value->field_authenticationFailureParam.valueof();
}
return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringFailure_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AuthenticationAndCipheringFailure_template[list_length];
}

PDU__GMM__AuthenticationAndCipheringFailure_template& PDU__GMM__AuthenticationAndCipheringFailure_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringFailure_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringFailure_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
return single_value->field_messageType;
}

GMM__CauseV_template& PDU__GMM__AuthenticationAndCipheringFailure_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseV_template& PDU__GMM__AuthenticationAndCipheringFailure_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
return single_value->field_gmmCause;
}

MobileL3__MM__Types::AuthenticationFailureParametersTLV_template& PDU__GMM__AuthenticationAndCipheringFailure_template::authenticationFailureParam()
{
set_specific();
return single_value->field_authenticationFailureParam;
}

const MobileL3__MM__Types::AuthenticationFailureParametersTLV_template& PDU__GMM__AuthenticationAndCipheringFailure_template::authenticationFailureParam() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field authenticationFailureParam of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
return single_value->field_authenticationFailureParam;
}

int PDU__GMM__AuthenticationAndCipheringFailure_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_authenticationFailureParam.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure 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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
  }
  return 0;
}

void PDU__GMM__AuthenticationAndCipheringFailure_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", authenticationFailureParam := ");
single_value->field_authenticationFailureParam.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__GMM__AuthenticationAndCipheringFailure_template::log_match(const PDU__GMM__AuthenticationAndCipheringFailure& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.authenticationFailureParam().ispresent()){
if(!single_value->field_authenticationFailureParam.match(match_value.authenticationFailureParam(), legacy)){
TTCN_Logger::log_logmatch_info(".authenticationFailureParam");
single_value->field_authenticationFailureParam.log_match(match_value.authenticationFailureParam(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_authenticationFailureParam.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".authenticationFailureParam := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_authenticationFailureParam.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::log_event_str(", authenticationFailureParam := ");
if (match_value.authenticationFailureParam().ispresent()) {
single_value->field_authenticationFailureParam.log_match(match_value.authenticationFailureParam(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_authenticationFailureParam.log();
if (single_value->field_authenticationFailureParam.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 PDU__GMM__AuthenticationAndCipheringFailure_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (gmmCause().is_bound()) gmmCause().set_implicit_omit();
if (!authenticationFailureParam().is_bound()) authenticationFailureParam() = OMIT_VALUE;
else authenticationFailureParam().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringFailure_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_authenticationFailureParam.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
}
}

void PDU__GMM__AuthenticationAndCipheringFailure_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_messageType.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_authenticationFailureParam.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__GMM__AuthenticationAndCipheringFailure_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure.");
}
}

void PDU__GMM__AuthenticationAndCipheringFailure_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__GMM__AuthenticationAndCipheringFailure_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) authenticationFailureParam().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "authenticationFailureParam")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          authenticationFailureParam().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AuthenticationAndCipheringFailure_template* precondition = new PDU__GMM__AuthenticationAndCipheringFailure_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AuthenticationAndCipheringFailure_template* implied_template = new PDU__GMM__AuthenticationAndCipheringFailure_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AuthenticationAndCipheringFailure_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AuthenticationAndCipheringFailure_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
single_value->field_authenticationFailureParam.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringFailure");
}

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

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

PDU__GMM__AuthenticationAndCipheringReject::PDU__GMM__AuthenticationAndCipheringReject()
{
}

PDU__GMM__AuthenticationAndCipheringReject::PDU__GMM__AuthenticationAndCipheringReject(const BITSTRING& par_messageType)
  :   field_messageType(par_messageType)
{
}

PDU__GMM__AuthenticationAndCipheringReject::PDU__GMM__AuthenticationAndCipheringReject(const PDU__GMM__AuthenticationAndCipheringReject& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
}

void PDU__GMM__AuthenticationAndCipheringReject::clean_up()
{
field_messageType.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__AuthenticationAndCipheringReject::get_descriptor() const { return &PDU__GMM__AuthenticationAndCipheringReject_descr_; }
PDU__GMM__AuthenticationAndCipheringReject& PDU__GMM__AuthenticationAndCipheringReject::operator=(const PDU__GMM__AuthenticationAndCipheringReject& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
}
return *this;
}

boolean PDU__GMM__AuthenticationAndCipheringReject::operator==(const PDU__GMM__AuthenticationAndCipheringReject& other_value) const
{
return field_messageType==other_value.field_messageType;
}

boolean PDU__GMM__AuthenticationAndCipheringReject::is_bound() const
{
return (field_messageType.is_bound());
}
boolean PDU__GMM__AuthenticationAndCipheringReject::is_value() const
{
return field_messageType.is_value();
}
void PDU__GMM__AuthenticationAndCipheringReject::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__AuthenticationAndCipheringReject::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringReject::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 (1<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject");
  }
}

void PDU__GMM__AuthenticationAndCipheringReject::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringReject::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
}

void PDU__GMM__AuthenticationAndCipheringReject::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__AuthenticationAndCipheringReject::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__AuthenticationAndCipheringReject::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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 (field_messageType !=  bs_37) 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__GMM__AuthenticationAndCipheringReject::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::BIT8_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  if (field_messageType !=  bs_37) {
  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_37.RAW_encode(General__Types::BIT8_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__GMM__AuthenticationAndCipheringReject_template::single_value_struct {
BITSTRING_template field_messageType;
};

void PDU__GMM__AuthenticationAndCipheringReject_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_messageType = ANY_VALUE;
}
}
}

void PDU__GMM__AuthenticationAndCipheringReject_template::copy_value(const PDU__GMM__AuthenticationAndCipheringReject& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__AuthenticationAndCipheringReject_template::copy_template(const PDU__GMM__AuthenticationAndCipheringReject_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.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__GMM__AuthenticationAndCipheringReject_template[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__GMM__AuthenticationAndCipheringReject_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__AuthenticationAndCipheringReject_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
break;
}
set_selection(other_value);
}

PDU__GMM__AuthenticationAndCipheringReject_template::PDU__GMM__AuthenticationAndCipheringReject_template()
{
}

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

PDU__GMM__AuthenticationAndCipheringReject_template::PDU__GMM__AuthenticationAndCipheringReject_template(const PDU__GMM__AuthenticationAndCipheringReject& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__AuthenticationAndCipheringReject_template& PDU__GMM__AuthenticationAndCipheringReject_template::operator=(const OPTIONAL<PDU__GMM__AuthenticationAndCipheringReject>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__AuthenticationAndCipheringReject&)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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
}
return *this;
}

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

boolean PDU__GMM__AuthenticationAndCipheringReject_template::match(const PDU__GMM__AuthenticationAndCipheringReject& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), 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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
}
return FALSE;
}

boolean PDU__GMM__AuthenticationAndCipheringReject_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound();
}

boolean PDU__GMM__AuthenticationAndCipheringReject_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value();
}

void PDU__GMM__AuthenticationAndCipheringReject_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__GMM__AuthenticationAndCipheringReject PDU__GMM__AuthenticationAndCipheringReject_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
PDU__GMM__AuthenticationAndCipheringReject ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
return ret_val;
}

void PDU__GMM__AuthenticationAndCipheringReject_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__AuthenticationAndCipheringReject_template[list_length];
}

PDU__GMM__AuthenticationAndCipheringReject_template& PDU__GMM__AuthenticationAndCipheringReject_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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__AuthenticationAndCipheringReject_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__AuthenticationAndCipheringReject_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
return single_value->field_messageType;
}

int PDU__GMM__AuthenticationAndCipheringReject_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject 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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject 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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
  }
  return 0;
}

void PDU__GMM__AuthenticationAndCipheringReject_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.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__GMM__AuthenticationAndCipheringReject_template::log_match(const PDU__GMM__AuthenticationAndCipheringReject& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), 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__GMM__AuthenticationAndCipheringReject_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
}

void PDU__GMM__AuthenticationAndCipheringReject_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
}
}

void PDU__GMM__AuthenticationAndCipheringReject_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_messageType.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__GMM__AuthenticationAndCipheringReject_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject.");
}
}

void PDU__GMM__AuthenticationAndCipheringReject_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__GMM__AuthenticationAndCipheringReject_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__AuthenticationAndCipheringReject_template* precondition = new PDU__GMM__AuthenticationAndCipheringReject_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__AuthenticationAndCipheringReject_template* implied_template = new PDU__GMM__AuthenticationAndCipheringReject_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__AuthenticationAndCipheringReject_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__AuthenticationAndCipheringReject_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_AuthenticationAndCipheringReject");
}

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

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

PDU__GMM__IdentityRequest::PDU__GMM__IdentityRequest()
{
}

PDU__GMM__IdentityRequest::PDU__GMM__IdentityRequest(const BITSTRING& par_messageType,
    const IdentityType2V& par_identityType,
    const ForceToStandbyV& par_forceToStandby)
  :   field_messageType(par_messageType),
  field_identityType(par_identityType),
  field_forceToStandby(par_forceToStandby)
{
}

PDU__GMM__IdentityRequest::PDU__GMM__IdentityRequest(const PDU__GMM__IdentityRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.identityType().is_bound()) field_identityType = other_value.identityType();
else field_identityType.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
}

void PDU__GMM__IdentityRequest::clean_up()
{
field_messageType.clean_up();
field_identityType.clean_up();
field_forceToStandby.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__IdentityRequest::get_descriptor() const { return &PDU__GMM__IdentityRequest_descr_; }
PDU__GMM__IdentityRequest& PDU__GMM__IdentityRequest::operator=(const PDU__GMM__IdentityRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.identityType().is_bound()) field_identityType = other_value.identityType();
  else field_identityType.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
}
return *this;
}

boolean PDU__GMM__IdentityRequest::operator==(const PDU__GMM__IdentityRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_identityType==other_value.field_identityType
  && field_forceToStandby==other_value.field_forceToStandby;
}

boolean PDU__GMM__IdentityRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_identityType.is_bound())
  || (field_forceToStandby.is_bound());
}
boolean PDU__GMM__IdentityRequest::is_value() const
{
return field_messageType.is_value()
  && field_identityType.is_value()
  && field_forceToStandby.is_value();
}
void PDU__GMM__IdentityRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", identityType := ");
field_identityType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__IdentityRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (identityType().is_bound()) identityType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
}

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

void PDU__GMM__IdentityRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_identityType.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
}

void PDU__GMM__IdentityRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_identityType.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
}

void PDU__GMM__IdentityRequest::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__IdentityRequest::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__IdentityRequest::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, IdentityType2V_descr_.raw->forceomit);
  decoded_field_length = field_identityType.RAW_decode(IdentityType2V_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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 (field_messageType !=  bs_38) 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__GMM__IdentityRequest::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, IdentityType2V_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, ForceToStandbyV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_identityType.RAW_encode(IdentityType2V_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[2]);
  if (field_messageType !=  bs_38) {
  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_38.RAW_encode(General__Types::BIT8_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__GMM__IdentityRequest_template::single_value_struct {
BITSTRING_template field_messageType;
IdentityType2V_template field_identityType;
ForceToStandbyV_template field_forceToStandby;
};

void PDU__GMM__IdentityRequest_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_messageType = ANY_VALUE;
single_value->field_identityType = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
}
}
}

void PDU__GMM__IdentityRequest_template::copy_value(const PDU__GMM__IdentityRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.identityType().is_bound()) {
  single_value->field_identityType = other_value.identityType();
} else {
  single_value->field_identityType.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__IdentityRequest_template::copy_template(const PDU__GMM__IdentityRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.identityType().get_selection()) {
single_value->field_identityType = other_value.identityType();
} else {
single_value->field_identityType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.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__GMM__IdentityRequest_template[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__GMM__IdentityRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__IdentityRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__IdentityRequest_template::PDU__GMM__IdentityRequest_template()
{
}

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

PDU__GMM__IdentityRequest_template::PDU__GMM__IdentityRequest_template(const PDU__GMM__IdentityRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__IdentityRequest_template& PDU__GMM__IdentityRequest_template::operator=(const OPTIONAL<PDU__GMM__IdentityRequest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__IdentityRequest&)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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
}
return *this;
}

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

boolean PDU__GMM__IdentityRequest_template::match(const PDU__GMM__IdentityRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.identityType().is_bound()) return FALSE;
if(!single_value->field_identityType.match(other_value.identityType(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), 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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
}
return FALSE;
}

boolean PDU__GMM__IdentityRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_identityType.is_bound()
 || single_value->field_forceToStandby.is_bound();
}

boolean PDU__GMM__IdentityRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_identityType.is_value()
 && single_value->field_forceToStandby.is_value();
}

void PDU__GMM__IdentityRequest_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__GMM__IdentityRequest PDU__GMM__IdentityRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
PDU__GMM__IdentityRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_identityType.is_bound()) {
ret_val.identityType() = single_value->field_identityType.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
return ret_val;
}

void PDU__GMM__IdentityRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__IdentityRequest_template[list_length];
}

PDU__GMM__IdentityRequest_template& PDU__GMM__IdentityRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__IdentityRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__IdentityRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
return single_value->field_messageType;
}

IdentityType2V_template& PDU__GMM__IdentityRequest_template::identityType()
{
set_specific();
return single_value->field_identityType;
}

const IdentityType2V_template& PDU__GMM__IdentityRequest_template::identityType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field identityType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
return single_value->field_identityType;
}

ForceToStandbyV_template& PDU__GMM__IdentityRequest_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__IdentityRequest_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
return single_value->field_forceToStandby;
}

int PDU__GMM__IdentityRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest 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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest 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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
  }
  return 0;
}

void PDU__GMM__IdentityRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", identityType := ");
single_value->field_identityType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.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__GMM__IdentityRequest_template::log_match(const PDU__GMM__IdentityRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_identityType.match(match_value.identityType(), legacy)){
TTCN_Logger::log_logmatch_info(".identityType");
single_value->field_identityType.log_match(match_value.identityType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", identityType := ");
single_value->field_identityType.log_match(match_value.identityType(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), 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__GMM__IdentityRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (identityType().is_bound()) identityType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
}

void PDU__GMM__IdentityRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_identityType.encode_text(text_buf);
single_value->field_forceToStandby.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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
}
}

void PDU__GMM__IdentityRequest_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_messageType.decode_text(text_buf);
single_value->field_identityType.decode_text(text_buf);
single_value->field_forceToStandby.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__GMM__IdentityRequest_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest.");
}
}

void PDU__GMM__IdentityRequest_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__GMM__IdentityRequest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) identityType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "identityType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          identityType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__IdentityRequest_template* precondition = new PDU__GMM__IdentityRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__IdentityRequest_template* implied_template = new PDU__GMM__IdentityRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__IdentityRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__IdentityRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
single_value->field_identityType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityRequest");
}

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

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

PDU__GMM__IdentityResponse::PDU__GMM__IdentityResponse()
{
}

PDU__GMM__IdentityResponse::PDU__GMM__IdentityResponse(const BITSTRING& par_messageType,
    const MobileL3__CommonIE__Types::MobileIdentityLV& par_mobileIdentity)
  :   field_messageType(par_messageType),
  field_mobileIdentity(par_mobileIdentity)
{
}

PDU__GMM__IdentityResponse::PDU__GMM__IdentityResponse(const PDU__GMM__IdentityResponse& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
else field_mobileIdentity.clean_up();
}

void PDU__GMM__IdentityResponse::clean_up()
{
field_messageType.clean_up();
field_mobileIdentity.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__IdentityResponse::get_descriptor() const { return &PDU__GMM__IdentityResponse_descr_; }
PDU__GMM__IdentityResponse& PDU__GMM__IdentityResponse::operator=(const PDU__GMM__IdentityResponse& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.mobileIdentity().is_bound()) field_mobileIdentity = other_value.mobileIdentity();
  else field_mobileIdentity.clean_up();
}
return *this;
}

boolean PDU__GMM__IdentityResponse::operator==(const PDU__GMM__IdentityResponse& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_mobileIdentity==other_value.field_mobileIdentity;
}

boolean PDU__GMM__IdentityResponse::is_bound() const
{
return (field_messageType.is_bound())
  || (field_mobileIdentity.is_bound());
}
boolean PDU__GMM__IdentityResponse::is_value() const
{
return field_messageType.is_value()
  && field_mobileIdentity.is_value();
}
void PDU__GMM__IdentityResponse::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
field_mobileIdentity.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__IdentityResponse::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
}

void PDU__GMM__IdentityResponse::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 (2<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
  }
}

void PDU__GMM__IdentityResponse::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_mobileIdentity.encode_text(text_buf);
}

void PDU__GMM__IdentityResponse::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_mobileIdentity.decode_text(text_buf);
}

void PDU__GMM__IdentityResponse::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__IdentityResponse::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__IdentityResponse::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileIdentity.RAW_decode(MobileL3__CommonIE__Types::MobileIdentityLV_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_messageType !=  bs_39) 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__GMM__IdentityResponse::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, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, MobileL3__CommonIE__Types::MobileIdentityLV_descr_.raw);
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_mobileIdentity.RAW_encode(MobileL3__CommonIE__Types::MobileIdentityLV_descr_, *myleaf.body.node.nodes[1]);
  if (field_messageType !=  bs_39) {
  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_39.RAW_encode(General__Types::BIT8_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__GMM__IdentityResponse_template::single_value_struct {
BITSTRING_template field_messageType;
MobileL3__CommonIE__Types::MobileIdentityLV_template field_mobileIdentity;
};

void PDU__GMM__IdentityResponse_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_messageType = ANY_VALUE;
single_value->field_mobileIdentity = ANY_VALUE;
}
}
}

void PDU__GMM__IdentityResponse_template::copy_value(const PDU__GMM__IdentityResponse& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.mobileIdentity().is_bound()) {
  single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
  single_value->field_mobileIdentity.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__IdentityResponse_template::copy_template(const PDU__GMM__IdentityResponse_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileIdentity().get_selection()) {
single_value->field_mobileIdentity = other_value.mobileIdentity();
} else {
single_value->field_mobileIdentity.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__GMM__IdentityResponse_template[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__GMM__IdentityResponse_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__IdentityResponse_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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
break;
}
set_selection(other_value);
}

PDU__GMM__IdentityResponse_template::PDU__GMM__IdentityResponse_template()
{
}

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

PDU__GMM__IdentityResponse_template::PDU__GMM__IdentityResponse_template(const PDU__GMM__IdentityResponse& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__IdentityResponse_template& PDU__GMM__IdentityResponse_template::operator=(const OPTIONAL<PDU__GMM__IdentityResponse>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__IdentityResponse&)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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
}
return *this;
}

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

boolean PDU__GMM__IdentityResponse_template::match(const PDU__GMM__IdentityResponse& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.mobileIdentity().is_bound()) return FALSE;
if(!single_value->field_mobileIdentity.match(other_value.mobileIdentity(), 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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
}
return FALSE;
}

boolean PDU__GMM__IdentityResponse_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_mobileIdentity.is_bound();
}

boolean PDU__GMM__IdentityResponse_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_mobileIdentity.is_value();
}

void PDU__GMM__IdentityResponse_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__GMM__IdentityResponse PDU__GMM__IdentityResponse_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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
PDU__GMM__IdentityResponse ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_mobileIdentity.is_bound()) {
ret_val.mobileIdentity() = single_value->field_mobileIdentity.valueof();
}
return ret_val;
}

void PDU__GMM__IdentityResponse_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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__IdentityResponse_template[list_length];
}

PDU__GMM__IdentityResponse_template& PDU__GMM__IdentityResponse_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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__IdentityResponse_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__IdentityResponse_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
return single_value->field_messageType;
}

MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__IdentityResponse_template::mobileIdentity()
{
set_specific();
return single_value->field_mobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityLV_template& PDU__GMM__IdentityResponse_template::mobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
return single_value->field_mobileIdentity;
}

int PDU__GMM__IdentityResponse_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse 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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse 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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
  }
  return 0;
}

void PDU__GMM__IdentityResponse_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.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__GMM__IdentityResponse_template::log_match(const PDU__GMM__IdentityResponse& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_mobileIdentity.match(match_value.mobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileIdentity");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), 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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", mobileIdentity := ");
single_value->field_mobileIdentity.log_match(match_value.mobileIdentity(), 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__GMM__IdentityResponse_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (mobileIdentity().is_bound()) mobileIdentity().set_implicit_omit();
}

void PDU__GMM__IdentityResponse_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_mobileIdentity.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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
}
}

void PDU__GMM__IdentityResponse_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_messageType.decode_text(text_buf);
single_value->field_mobileIdentity.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__GMM__IdentityResponse_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse.");
}
}

void PDU__GMM__IdentityResponse_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__GMM__IdentityResponse_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) mobileIdentity().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__IdentityResponse_template* precondition = new PDU__GMM__IdentityResponse_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__IdentityResponse_template* implied_template = new PDU__GMM__IdentityResponse_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__IdentityResponse_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__IdentityResponse_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
single_value->field_mobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_IdentityResponse");
}

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

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

PDU__GMM__RoutingAreaUpdateRequest::PDU__GMM__RoutingAreaUpdateRequest()
{
}

PDU__GMM__RoutingAreaUpdateRequest::PDU__GMM__RoutingAreaUpdateRequest(const BITSTRING& par_messageType,
    const UpdateTypeV& par_updateType,
    const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV& par_gprsCKSN,
    const RoutingAreaIdentificationV& par_oldRoutingAreaId,
    const MSRadioAccessCapabilityLV& par_msRACap,
    const OPTIONAL< P__TMSISignatureTV >& par_oldPTMSISignature,
    const OPTIONAL< GPRSTimerTV >& par_readyTimerValue,
    const OPTIONAL< DRXParameterTV >& par_drxParameter,
    const OPTIONAL< TMSIStatusTV >& par_tmsiStatus,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_ptmsi,
    const OPTIONAL< MSNetworkCapabilityTLV >& par_mSNetworkCapability,
    const OPTIONAL< PDPContextStatusTLV >& par_pdpContextStatus,
    const OPTIONAL< PC__LCSCapability >& par_pC__LCSCapability,
    const OPTIONAL< MBMS__ContextStatusTLV >& par_mBMS__ContextStatus,
    const OPTIONAL< UENetworkCapabilityTLV >& par_uENetworkCapability,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_additionalMobileIdentity,
    const OPTIONAL< MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV >& par_oldRoutingAreaIdentification2,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark2__TLV >& par_mobileStationClassmark2,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileStationClassmark3__TLV >& par_mobileStationClassmark3,
    const OPTIONAL< MobileL3__CommonIE__Types::SupportedCodecList >& par_supportedCodecs,
    const OPTIONAL< VoiceDomainPreferenceandUEsUsageSettingTLV >& par_voiceDomainUEUsageSetting,
    const OPTIONAL< MobileL3__CommonIE__Types::P__TMSI__TypeTV >& par_p__TMSI__Type,
    const OPTIONAL< MobileL3__CommonIE__Types::DevicePropertiesTV >& par_deviceProperties,
    const OPTIONAL< MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV >& par_mS__NetworkFeatureSupport,
    const OPTIONAL< LocationAreaIdentification2__TLV >& par_oldLocationAreaIdentification,
    const OPTIONAL< AdditionalUpdateTypeTV >& par_additionalUpdateType,
    const OPTIONAL< NetworkResourceIdentifierContainerTLV >& par_tMSIBasedNRIcontainer,
    const OPTIONAL< GPRSTimer2TLV >& par_t3324,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_t3312__ExtendedValue,
    const OPTIONAL< ExtendedDRXParametersTLV >& par_extendedDRXParameters)
  :   field_messageType(par_messageType),
  field_updateType(par_updateType),
  field_gprsCKSN(par_gprsCKSN),
  field_oldRoutingAreaId(par_oldRoutingAreaId),
  field_msRACap(par_msRACap),
  field_oldPTMSISignature(par_oldPTMSISignature),
  field_readyTimerValue(par_readyTimerValue),
  field_drxParameter(par_drxParameter),
  field_tmsiStatus(par_tmsiStatus),
  field_ptmsi(par_ptmsi),
  field_mSNetworkCapability(par_mSNetworkCapability),
  field_pdpContextStatus(par_pdpContextStatus),
  field_pC__LCSCapability(par_pC__LCSCapability),
  field_mBMS__ContextStatus(par_mBMS__ContextStatus),
  field_uENetworkCapability(par_uENetworkCapability),
  field_additionalMobileIdentity(par_additionalMobileIdentity),
  field_oldRoutingAreaIdentification2(par_oldRoutingAreaIdentification2),
  field_mobileStationClassmark2(par_mobileStationClassmark2),
  field_mobileStationClassmark3(par_mobileStationClassmark3),
  field_supportedCodecs(par_supportedCodecs),
  field_voiceDomainUEUsageSetting(par_voiceDomainUEUsageSetting),
  field_p__TMSI__Type(par_p__TMSI__Type),
  field_deviceProperties(par_deviceProperties),
  field_mS__NetworkFeatureSupport(par_mS__NetworkFeatureSupport),
  field_oldLocationAreaIdentification(par_oldLocationAreaIdentification),
  field_additionalUpdateType(par_additionalUpdateType),
  field_tMSIBasedNRIcontainer(par_tMSIBasedNRIcontainer),
  field_t3324(par_t3324),
  field_t3312__ExtendedValue(par_t3312__ExtendedValue),
  field_extendedDRXParameters(par_extendedDRXParameters)
{
}

PDU__GMM__RoutingAreaUpdateRequest::PDU__GMM__RoutingAreaUpdateRequest(const PDU__GMM__RoutingAreaUpdateRequest& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.updateType().is_bound()) field_updateType = other_value.updateType();
else field_updateType.clean_up();
if (other_value.gprsCKSN().is_bound()) field_gprsCKSN = other_value.gprsCKSN();
else field_gprsCKSN.clean_up();
if (other_value.oldRoutingAreaId().is_bound()) field_oldRoutingAreaId = other_value.oldRoutingAreaId();
else field_oldRoutingAreaId.clean_up();
if (other_value.msRACap().is_bound()) field_msRACap = other_value.msRACap();
else field_msRACap.clean_up();
if (other_value.oldPTMSISignature().is_bound()) field_oldPTMSISignature = other_value.oldPTMSISignature();
else field_oldPTMSISignature.clean_up();
if (other_value.readyTimerValue().is_bound()) field_readyTimerValue = other_value.readyTimerValue();
else field_readyTimerValue.clean_up();
if (other_value.drxParameter().is_bound()) field_drxParameter = other_value.drxParameter();
else field_drxParameter.clean_up();
if (other_value.tmsiStatus().is_bound()) field_tmsiStatus = other_value.tmsiStatus();
else field_tmsiStatus.clean_up();
if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
else field_ptmsi.clean_up();
if (other_value.mSNetworkCapability().is_bound()) field_mSNetworkCapability = other_value.mSNetworkCapability();
else field_mSNetworkCapability.clean_up();
if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
else field_pdpContextStatus.clean_up();
if (other_value.pC__LCSCapability().is_bound()) field_pC__LCSCapability = other_value.pC__LCSCapability();
else field_pC__LCSCapability.clean_up();
if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
else field_mBMS__ContextStatus.clean_up();
if (other_value.uENetworkCapability().is_bound()) field_uENetworkCapability = other_value.uENetworkCapability();
else field_uENetworkCapability.clean_up();
if (other_value.additionalMobileIdentity().is_bound()) field_additionalMobileIdentity = other_value.additionalMobileIdentity();
else field_additionalMobileIdentity.clean_up();
if (other_value.oldRoutingAreaIdentification2().is_bound()) field_oldRoutingAreaIdentification2 = other_value.oldRoutingAreaIdentification2();
else field_oldRoutingAreaIdentification2.clean_up();
if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
else field_mobileStationClassmark2.clean_up();
if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
else field_mobileStationClassmark3.clean_up();
if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
else field_supportedCodecs.clean_up();
if (other_value.voiceDomainUEUsageSetting().is_bound()) field_voiceDomainUEUsageSetting = other_value.voiceDomainUEUsageSetting();
else field_voiceDomainUEUsageSetting.clean_up();
if (other_value.p__TMSI__Type().is_bound()) field_p__TMSI__Type = other_value.p__TMSI__Type();
else field_p__TMSI__Type.clean_up();
if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
else field_deviceProperties.clean_up();
if (other_value.mS__NetworkFeatureSupport().is_bound()) field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
else field_mS__NetworkFeatureSupport.clean_up();
if (other_value.oldLocationAreaIdentification().is_bound()) field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
else field_oldLocationAreaIdentification.clean_up();
if (other_value.additionalUpdateType().is_bound()) field_additionalUpdateType = other_value.additionalUpdateType();
else field_additionalUpdateType.clean_up();
if (other_value.tMSIBasedNRIcontainer().is_bound()) field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
else field_tMSIBasedNRIcontainer.clean_up();
if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
else field_t3324.clean_up();
if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
else field_t3312__ExtendedValue.clean_up();
if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
else field_extendedDRXParameters.clean_up();
}

void PDU__GMM__RoutingAreaUpdateRequest::clean_up()
{
field_messageType.clean_up();
field_updateType.clean_up();
field_gprsCKSN.clean_up();
field_oldRoutingAreaId.clean_up();
field_msRACap.clean_up();
field_oldPTMSISignature.clean_up();
field_readyTimerValue.clean_up();
field_drxParameter.clean_up();
field_tmsiStatus.clean_up();
field_ptmsi.clean_up();
field_mSNetworkCapability.clean_up();
field_pdpContextStatus.clean_up();
field_pC__LCSCapability.clean_up();
field_mBMS__ContextStatus.clean_up();
field_uENetworkCapability.clean_up();
field_additionalMobileIdentity.clean_up();
field_oldRoutingAreaIdentification2.clean_up();
field_mobileStationClassmark2.clean_up();
field_mobileStationClassmark3.clean_up();
field_supportedCodecs.clean_up();
field_voiceDomainUEUsageSetting.clean_up();
field_p__TMSI__Type.clean_up();
field_deviceProperties.clean_up();
field_mS__NetworkFeatureSupport.clean_up();
field_oldLocationAreaIdentification.clean_up();
field_additionalUpdateType.clean_up();
field_tMSIBasedNRIcontainer.clean_up();
field_t3324.clean_up();
field_t3312__ExtendedValue.clean_up();
field_extendedDRXParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__RoutingAreaUpdateRequest::get_descriptor() const { return &PDU__GMM__RoutingAreaUpdateRequest_descr_; }
PDU__GMM__RoutingAreaUpdateRequest& PDU__GMM__RoutingAreaUpdateRequest::operator=(const PDU__GMM__RoutingAreaUpdateRequest& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.updateType().is_bound()) field_updateType = other_value.updateType();
  else field_updateType.clean_up();
  if (other_value.gprsCKSN().is_bound()) field_gprsCKSN = other_value.gprsCKSN();
  else field_gprsCKSN.clean_up();
  if (other_value.oldRoutingAreaId().is_bound()) field_oldRoutingAreaId = other_value.oldRoutingAreaId();
  else field_oldRoutingAreaId.clean_up();
  if (other_value.msRACap().is_bound()) field_msRACap = other_value.msRACap();
  else field_msRACap.clean_up();
  if (other_value.oldPTMSISignature().is_bound()) field_oldPTMSISignature = other_value.oldPTMSISignature();
  else field_oldPTMSISignature.clean_up();
  if (other_value.readyTimerValue().is_bound()) field_readyTimerValue = other_value.readyTimerValue();
  else field_readyTimerValue.clean_up();
  if (other_value.drxParameter().is_bound()) field_drxParameter = other_value.drxParameter();
  else field_drxParameter.clean_up();
  if (other_value.tmsiStatus().is_bound()) field_tmsiStatus = other_value.tmsiStatus();
  else field_tmsiStatus.clean_up();
  if (other_value.ptmsi().is_bound()) field_ptmsi = other_value.ptmsi();
  else field_ptmsi.clean_up();
  if (other_value.mSNetworkCapability().is_bound()) field_mSNetworkCapability = other_value.mSNetworkCapability();
  else field_mSNetworkCapability.clean_up();
  if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
  else field_pdpContextStatus.clean_up();
  if (other_value.pC__LCSCapability().is_bound()) field_pC__LCSCapability = other_value.pC__LCSCapability();
  else field_pC__LCSCapability.clean_up();
  if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
  else field_mBMS__ContextStatus.clean_up();
  if (other_value.uENetworkCapability().is_bound()) field_uENetworkCapability = other_value.uENetworkCapability();
  else field_uENetworkCapability.clean_up();
  if (other_value.additionalMobileIdentity().is_bound()) field_additionalMobileIdentity = other_value.additionalMobileIdentity();
  else field_additionalMobileIdentity.clean_up();
  if (other_value.oldRoutingAreaIdentification2().is_bound()) field_oldRoutingAreaIdentification2 = other_value.oldRoutingAreaIdentification2();
  else field_oldRoutingAreaIdentification2.clean_up();
  if (other_value.mobileStationClassmark2().is_bound()) field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
  else field_mobileStationClassmark2.clean_up();
  if (other_value.mobileStationClassmark3().is_bound()) field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
  else field_mobileStationClassmark3.clean_up();
  if (other_value.supportedCodecs().is_bound()) field_supportedCodecs = other_value.supportedCodecs();
  else field_supportedCodecs.clean_up();
  if (other_value.voiceDomainUEUsageSetting().is_bound()) field_voiceDomainUEUsageSetting = other_value.voiceDomainUEUsageSetting();
  else field_voiceDomainUEUsageSetting.clean_up();
  if (other_value.p__TMSI__Type().is_bound()) field_p__TMSI__Type = other_value.p__TMSI__Type();
  else field_p__TMSI__Type.clean_up();
  if (other_value.deviceProperties().is_bound()) field_deviceProperties = other_value.deviceProperties();
  else field_deviceProperties.clean_up();
  if (other_value.mS__NetworkFeatureSupport().is_bound()) field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
  else field_mS__NetworkFeatureSupport.clean_up();
  if (other_value.oldLocationAreaIdentification().is_bound()) field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
  else field_oldLocationAreaIdentification.clean_up();
  if (other_value.additionalUpdateType().is_bound()) field_additionalUpdateType = other_value.additionalUpdateType();
  else field_additionalUpdateType.clean_up();
  if (other_value.tMSIBasedNRIcontainer().is_bound()) field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
  else field_tMSIBasedNRIcontainer.clean_up();
  if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
  else field_t3324.clean_up();
  if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
  else field_t3312__ExtendedValue.clean_up();
  if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
  else field_extendedDRXParameters.clean_up();
}
return *this;
}

boolean PDU__GMM__RoutingAreaUpdateRequest::operator==(const PDU__GMM__RoutingAreaUpdateRequest& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_updateType==other_value.field_updateType
  && field_gprsCKSN==other_value.field_gprsCKSN
  && field_oldRoutingAreaId==other_value.field_oldRoutingAreaId
  && field_msRACap==other_value.field_msRACap
  && field_oldPTMSISignature==other_value.field_oldPTMSISignature
  && field_readyTimerValue==other_value.field_readyTimerValue
  && field_drxParameter==other_value.field_drxParameter
  && field_tmsiStatus==other_value.field_tmsiStatus
  && field_ptmsi==other_value.field_ptmsi
  && field_mSNetworkCapability==other_value.field_mSNetworkCapability
  && field_pdpContextStatus==other_value.field_pdpContextStatus
  && field_pC__LCSCapability==other_value.field_pC__LCSCapability
  && field_mBMS__ContextStatus==other_value.field_mBMS__ContextStatus
  && field_uENetworkCapability==other_value.field_uENetworkCapability
  && field_additionalMobileIdentity==other_value.field_additionalMobileIdentity
  && field_oldRoutingAreaIdentification2==other_value.field_oldRoutingAreaIdentification2
  && field_mobileStationClassmark2==other_value.field_mobileStationClassmark2
  && field_mobileStationClassmark3==other_value.field_mobileStationClassmark3
  && field_supportedCodecs==other_value.field_supportedCodecs
  && field_voiceDomainUEUsageSetting==other_value.field_voiceDomainUEUsageSetting
  && field_p__TMSI__Type==other_value.field_p__TMSI__Type
  && field_deviceProperties==other_value.field_deviceProperties
  && field_mS__NetworkFeatureSupport==other_value.field_mS__NetworkFeatureSupport
  && field_oldLocationAreaIdentification==other_value.field_oldLocationAreaIdentification
  && field_additionalUpdateType==other_value.field_additionalUpdateType
  && field_tMSIBasedNRIcontainer==other_value.field_tMSIBasedNRIcontainer
  && field_t3324==other_value.field_t3324
  && field_t3312__ExtendedValue==other_value.field_t3312__ExtendedValue
  && field_extendedDRXParameters==other_value.field_extendedDRXParameters;
}

boolean PDU__GMM__RoutingAreaUpdateRequest::is_bound() const
{
return (field_messageType.is_bound())
  || (field_updateType.is_bound())
  || (field_gprsCKSN.is_bound())
  || (field_oldRoutingAreaId.is_bound())
  || (field_msRACap.is_bound())
  || (OPTIONAL_OMIT == field_oldPTMSISignature.get_selection() || field_oldPTMSISignature.is_bound())
  || (OPTIONAL_OMIT == field_readyTimerValue.get_selection() || field_readyTimerValue.is_bound())
  || (OPTIONAL_OMIT == field_drxParameter.get_selection() || field_drxParameter.is_bound())
  || (OPTIONAL_OMIT == field_tmsiStatus.get_selection() || field_tmsiStatus.is_bound())
  || (OPTIONAL_OMIT == field_ptmsi.get_selection() || field_ptmsi.is_bound())
  || (OPTIONAL_OMIT == field_mSNetworkCapability.get_selection() || field_mSNetworkCapability.is_bound())
  || (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_pC__LCSCapability.get_selection() || field_pC__LCSCapability.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_uENetworkCapability.get_selection() || field_uENetworkCapability.is_bound())
  || (OPTIONAL_OMIT == field_additionalMobileIdentity.get_selection() || field_additionalMobileIdentity.is_bound())
  || (OPTIONAL_OMIT == field_oldRoutingAreaIdentification2.get_selection() || field_oldRoutingAreaIdentification2.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark2.get_selection() || field_mobileStationClassmark2.is_bound())
  || (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_bound())
  || (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_bound())
  || (OPTIONAL_OMIT == field_voiceDomainUEUsageSetting.get_selection() || field_voiceDomainUEUsageSetting.is_bound())
  || (OPTIONAL_OMIT == field_p__TMSI__Type.get_selection() || field_p__TMSI__Type.is_bound())
  || (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_bound())
  || (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_oldLocationAreaIdentification.get_selection() || field_oldLocationAreaIdentification.is_bound())
  || (OPTIONAL_OMIT == field_additionalUpdateType.get_selection() || field_additionalUpdateType.is_bound())
  || (OPTIONAL_OMIT == field_tMSIBasedNRIcontainer.get_selection() || field_tMSIBasedNRIcontainer.is_bound())
  || (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_bound())
  || (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_bound())
  || (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_bound());
}
boolean PDU__GMM__RoutingAreaUpdateRequest::is_value() const
{
return field_messageType.is_value()
  && field_updateType.is_value()
  && field_gprsCKSN.is_value()
  && field_oldRoutingAreaId.is_value()
  && field_msRACap.is_value()
  && (OPTIONAL_OMIT == field_oldPTMSISignature.get_selection() || field_oldPTMSISignature.is_value())
  && (OPTIONAL_OMIT == field_readyTimerValue.get_selection() || field_readyTimerValue.is_value())
  && (OPTIONAL_OMIT == field_drxParameter.get_selection() || field_drxParameter.is_value())
  && (OPTIONAL_OMIT == field_tmsiStatus.get_selection() || field_tmsiStatus.is_value())
  && (OPTIONAL_OMIT == field_ptmsi.get_selection() || field_ptmsi.is_value())
  && (OPTIONAL_OMIT == field_mSNetworkCapability.get_selection() || field_mSNetworkCapability.is_value())
  && (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_value())
  && (OPTIONAL_OMIT == field_pC__LCSCapability.get_selection() || field_pC__LCSCapability.is_value())
  && (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_value())
  && (OPTIONAL_OMIT == field_uENetworkCapability.get_selection() || field_uENetworkCapability.is_value())
  && (OPTIONAL_OMIT == field_additionalMobileIdentity.get_selection() || field_additionalMobileIdentity.is_value())
  && (OPTIONAL_OMIT == field_oldRoutingAreaIdentification2.get_selection() || field_oldRoutingAreaIdentification2.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark2.get_selection() || field_mobileStationClassmark2.is_value())
  && (OPTIONAL_OMIT == field_mobileStationClassmark3.get_selection() || field_mobileStationClassmark3.is_value())
  && (OPTIONAL_OMIT == field_supportedCodecs.get_selection() || field_supportedCodecs.is_value())
  && (OPTIONAL_OMIT == field_voiceDomainUEUsageSetting.get_selection() || field_voiceDomainUEUsageSetting.is_value())
  && (OPTIONAL_OMIT == field_p__TMSI__Type.get_selection() || field_p__TMSI__Type.is_value())
  && (OPTIONAL_OMIT == field_deviceProperties.get_selection() || field_deviceProperties.is_value())
  && (OPTIONAL_OMIT == field_mS__NetworkFeatureSupport.get_selection() || field_mS__NetworkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_oldLocationAreaIdentification.get_selection() || field_oldLocationAreaIdentification.is_value())
  && (OPTIONAL_OMIT == field_additionalUpdateType.get_selection() || field_additionalUpdateType.is_value())
  && (OPTIONAL_OMIT == field_tMSIBasedNRIcontainer.get_selection() || field_tMSIBasedNRIcontainer.is_value())
  && (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_value())
  && (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_value())
  && (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_value());
}
int PDU__GMM__RoutingAreaUpdateRequest::size_of() const
{
  int ret_val = 5;
  if (field_oldPTMSISignature.ispresent()) ret_val++;
  if (field_readyTimerValue.ispresent()) ret_val++;
  if (field_drxParameter.ispresent()) ret_val++;
  if (field_tmsiStatus.ispresent()) ret_val++;
  if (field_ptmsi.ispresent()) ret_val++;
  if (field_mSNetworkCapability.ispresent()) ret_val++;
  if (field_pdpContextStatus.ispresent()) ret_val++;
  if (field_pC__LCSCapability.ispresent()) ret_val++;
  if (field_mBMS__ContextStatus.ispresent()) ret_val++;
  if (field_uENetworkCapability.ispresent()) ret_val++;
  if (field_additionalMobileIdentity.ispresent()) ret_val++;
  if (field_oldRoutingAreaIdentification2.ispresent()) ret_val++;
  if (field_mobileStationClassmark2.ispresent()) ret_val++;
  if (field_mobileStationClassmark3.ispresent()) ret_val++;
  if (field_supportedCodecs.ispresent()) ret_val++;
  if (field_voiceDomainUEUsageSetting.ispresent()) ret_val++;
  if (field_p__TMSI__Type.ispresent()) ret_val++;
  if (field_deviceProperties.ispresent()) ret_val++;
  if (field_mS__NetworkFeatureSupport.ispresent()) ret_val++;
  if (field_oldLocationAreaIdentification.ispresent()) ret_val++;
  if (field_additionalUpdateType.ispresent()) ret_val++;
  if (field_tMSIBasedNRIcontainer.ispresent()) ret_val++;
  if (field_t3324.ispresent()) ret_val++;
  if (field_t3312__ExtendedValue.ispresent()) ret_val++;
  if (field_extendedDRXParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__RoutingAreaUpdateRequest::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", updateType := ");
field_updateType.log();
TTCN_Logger::log_event_str(", gprsCKSN := ");
field_gprsCKSN.log();
TTCN_Logger::log_event_str(", oldRoutingAreaId := ");
field_oldRoutingAreaId.log();
TTCN_Logger::log_event_str(", msRACap := ");
field_msRACap.log();
TTCN_Logger::log_event_str(", oldPTMSISignature := ");
field_oldPTMSISignature.log();
TTCN_Logger::log_event_str(", readyTimerValue := ");
field_readyTimerValue.log();
TTCN_Logger::log_event_str(", drxParameter := ");
field_drxParameter.log();
TTCN_Logger::log_event_str(", tmsiStatus := ");
field_tmsiStatus.log();
TTCN_Logger::log_event_str(", ptmsi := ");
field_ptmsi.log();
TTCN_Logger::log_event_str(", mSNetworkCapability := ");
field_mSNetworkCapability.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", uENetworkCapability := ");
field_uENetworkCapability.log();
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(", oldRoutingAreaIdentification2 := ");
field_oldRoutingAreaIdentification2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
field_supportedCodecs.log();
TTCN_Logger::log_event_str(", voiceDomainUEUsageSetting := ");
field_voiceDomainUEUsageSetting.log();
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
field_deviceProperties.log();
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(", additionalUpdateType := ");
field_additionalUpdateType.log();
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(", t3324 := ");
field_t3324.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
field_extendedDRXParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__RoutingAreaUpdateRequest::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (updateType().is_bound()) updateType().set_implicit_omit();
if (gprsCKSN().is_bound()) gprsCKSN().set_implicit_omit();
if (oldRoutingAreaId().is_bound()) oldRoutingAreaId().set_implicit_omit();
if (msRACap().is_bound()) msRACap().set_implicit_omit();
if (!oldPTMSISignature().is_bound()) oldPTMSISignature() = OMIT_VALUE;
else oldPTMSISignature().set_implicit_omit();
if (!readyTimerValue().is_bound()) readyTimerValue() = OMIT_VALUE;
else readyTimerValue().set_implicit_omit();
if (!drxParameter().is_bound()) drxParameter() = OMIT_VALUE;
else drxParameter().set_implicit_omit();
if (!tmsiStatus().is_bound()) tmsiStatus() = OMIT_VALUE;
else tmsiStatus().set_implicit_omit();
if (!ptmsi().is_bound()) ptmsi() = OMIT_VALUE;
else ptmsi().set_implicit_omit();
if (!mSNetworkCapability().is_bound()) mSNetworkCapability() = OMIT_VALUE;
else mSNetworkCapability().set_implicit_omit();
if (!pdpContextStatus().is_bound()) pdpContextStatus() = OMIT_VALUE;
else pdpContextStatus().set_implicit_omit();
if (!pC__LCSCapability().is_bound()) pC__LCSCapability() = OMIT_VALUE;
else pC__LCSCapability().set_implicit_omit();
if (!mBMS__ContextStatus().is_bound()) mBMS__ContextStatus() = OMIT_VALUE;
else mBMS__ContextStatus().set_implicit_omit();
if (!uENetworkCapability().is_bound()) uENetworkCapability() = OMIT_VALUE;
else uENetworkCapability().set_implicit_omit();
if (!additionalMobileIdentity().is_bound()) additionalMobileIdentity() = OMIT_VALUE;
else additionalMobileIdentity().set_implicit_omit();
if (!oldRoutingAreaIdentification2().is_bound()) oldRoutingAreaIdentification2() = OMIT_VALUE;
else oldRoutingAreaIdentification2().set_implicit_omit();
if (!mobileStationClassmark2().is_bound()) mobileStationClassmark2() = OMIT_VALUE;
else mobileStationClassmark2().set_implicit_omit();
if (!mobileStationClassmark3().is_bound()) mobileStationClassmark3() = OMIT_VALUE;
else mobileStationClassmark3().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!voiceDomainUEUsageSetting().is_bound()) voiceDomainUEUsageSetting() = OMIT_VALUE;
else voiceDomainUEUsageSetting().set_implicit_omit();
if (!p__TMSI__Type().is_bound()) p__TMSI__Type() = OMIT_VALUE;
else p__TMSI__Type().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
if (!mS__NetworkFeatureSupport().is_bound()) mS__NetworkFeatureSupport() = OMIT_VALUE;
else mS__NetworkFeatureSupport().set_implicit_omit();
if (!oldLocationAreaIdentification().is_bound()) oldLocationAreaIdentification() = OMIT_VALUE;
else oldLocationAreaIdentification().set_implicit_omit();
if (!additionalUpdateType().is_bound()) additionalUpdateType() = OMIT_VALUE;
else additionalUpdateType().set_implicit_omit();
if (!tMSIBasedNRIcontainer().is_bound()) tMSIBasedNRIcontainer() = OMIT_VALUE;
else tMSIBasedNRIcontainer().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__RoutingAreaUpdateRequest::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_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest has 30 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) updateType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gprsCKSN().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaId().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) msRACap().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) oldPTMSISignature().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) readyTimerValue().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) drxParameter().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tmsiStatus().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) mSNetworkCapability().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapability().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapability().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) additionalMobileIdentity().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaIdentification2().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) voiceDomainUEUsageSetting().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__Type().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) oldLocationAreaIdentification().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateType().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) tMSIBasedNRIcontainer().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(28));
    if (param.get_size()>29 && param.get_elem(29)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(29));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsCKSN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsCKSN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRACap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldPTMSISignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldPTMSISignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "drxParameter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          drxParameter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tmsiStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tmsiStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mSNetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mSNetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pC_LCSCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uENetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalMobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalMobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaIdentification2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaIdentification2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "voiceDomainUEUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainUEUsageSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_NetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__NetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldLocationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldLocationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSIBasedNRIcontainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSIBasedNRIcontainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
  }
}

void PDU__GMM__RoutingAreaUpdateRequest::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_updateType.encode_text(text_buf);
field_gprsCKSN.encode_text(text_buf);
field_oldRoutingAreaId.encode_text(text_buf);
field_msRACap.encode_text(text_buf);
field_oldPTMSISignature.encode_text(text_buf);
field_readyTimerValue.encode_text(text_buf);
field_drxParameter.encode_text(text_buf);
field_tmsiStatus.encode_text(text_buf);
field_ptmsi.encode_text(text_buf);
field_mSNetworkCapability.encode_text(text_buf);
field_pdpContextStatus.encode_text(text_buf);
field_pC__LCSCapability.encode_text(text_buf);
field_mBMS__ContextStatus.encode_text(text_buf);
field_uENetworkCapability.encode_text(text_buf);
field_additionalMobileIdentity.encode_text(text_buf);
field_oldRoutingAreaIdentification2.encode_text(text_buf);
field_mobileStationClassmark2.encode_text(text_buf);
field_mobileStationClassmark3.encode_text(text_buf);
field_supportedCodecs.encode_text(text_buf);
field_voiceDomainUEUsageSetting.encode_text(text_buf);
field_p__TMSI__Type.encode_text(text_buf);
field_deviceProperties.encode_text(text_buf);
field_mS__NetworkFeatureSupport.encode_text(text_buf);
field_oldLocationAreaIdentification.encode_text(text_buf);
field_additionalUpdateType.encode_text(text_buf);
field_tMSIBasedNRIcontainer.encode_text(text_buf);
field_t3324.encode_text(text_buf);
field_t3312__ExtendedValue.encode_text(text_buf);
field_extendedDRXParameters.encode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateRequest::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_updateType.decode_text(text_buf);
field_gprsCKSN.decode_text(text_buf);
field_oldRoutingAreaId.decode_text(text_buf);
field_msRACap.decode_text(text_buf);
field_oldPTMSISignature.decode_text(text_buf);
field_readyTimerValue.decode_text(text_buf);
field_drxParameter.decode_text(text_buf);
field_tmsiStatus.decode_text(text_buf);
field_ptmsi.decode_text(text_buf);
field_mSNetworkCapability.decode_text(text_buf);
field_pdpContextStatus.decode_text(text_buf);
field_pC__LCSCapability.decode_text(text_buf);
field_mBMS__ContextStatus.decode_text(text_buf);
field_uENetworkCapability.decode_text(text_buf);
field_additionalMobileIdentity.decode_text(text_buf);
field_oldRoutingAreaIdentification2.decode_text(text_buf);
field_mobileStationClassmark2.decode_text(text_buf);
field_mobileStationClassmark3.decode_text(text_buf);
field_supportedCodecs.decode_text(text_buf);
field_voiceDomainUEUsageSetting.decode_text(text_buf);
field_p__TMSI__Type.decode_text(text_buf);
field_deviceProperties.decode_text(text_buf);
field_mS__NetworkFeatureSupport.decode_text(text_buf);
field_oldLocationAreaIdentification.decode_text(text_buf);
field_additionalUpdateType.decode_text(text_buf);
field_tMSIBasedNRIcontainer.decode_text(text_buf);
field_t3324.decode_text(text_buf);
field_t3312__ExtendedValue.decode_text(text_buf);
field_extendedDRXParameters.decode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateRequest::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__RoutingAreaUpdateRequest::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__RoutingAreaUpdateRequest::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, UpdateTypeV_descr_.raw->forceomit);
  decoded_field_length = field_updateType.RAW_decode(UpdateTypeV_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, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw->forceomit);
  decoded_field_length = field_gprsCKSN.RAW_decode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_oldRoutingAreaId.RAW_decode(RoutingAreaIdentificationV_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, MSRadioAccessCapabilityLV_descr_.raw->forceomit);
  decoded_field_length = field_msRACap.RAW_decode(MSRadioAccessCapabilityLV_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){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_oldPTMSISignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_oldPTMSISignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_oldPTMSISignature = 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_oldPTMSISignature=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_readyTimerValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, GPRSTimerTV_descr_.raw->forceomit);
  decoded_field_length = field_readyTimerValue().RAW_decode(GPRSTimerTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_readyTimerValue = 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_readyTimerValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_drxParameter = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, DRXParameterTV_descr_.raw->forceomit);
  decoded_field_length = field_drxParameter().RAW_decode(DRXParameterTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_drxParameter = 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_drxParameter=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_tmsiStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, TMSIStatusTV_descr_.raw->forceomit);
  decoded_field_length = field_tmsiStatus().RAW_decode(TMSIStatusTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_tmsiStatus = 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_tmsiStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_ptmsi = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsi().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsi = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_ptmsi.ispresent() || field_ptmsi().elementIdentifier() !=  bs_26){
  field_ptmsi=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_ptmsi=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_mSNetworkCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, MSNetworkCapabilityTLV_descr_.raw->forceomit);
  decoded_field_length = field_mSNetworkCapability().RAW_decode(MSNetworkCapabilityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_mSNetworkCapability = 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_mSNetworkCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_pdpContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, PDPContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_pdpContextStatus().RAW_decode(PDPContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_pdpContextStatus = 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_pdpContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_pC__LCSCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, PC__LCSCapability_descr_.raw->forceomit);
  decoded_field_length = field_pC__LCSCapability().RAW_decode(PC__LCSCapability_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_pC__LCSCapability = 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_pC__LCSCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_mBMS__ContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, MBMS__ContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__ContextStatus().RAW_decode(MBMS__ContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__ContextStatus = 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_mBMS__ContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_uENetworkCapability = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, UENetworkCapabilityTLV_descr_.raw->forceomit);
  decoded_field_length = field_uENetworkCapability().RAW_decode(UENetworkCapabilityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_uENetworkCapability = 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_uENetworkCapability=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_additionalMobileIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_additionalMobileIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_additionalMobileIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_additionalMobileIdentity.ispresent() || field_additionalMobileIdentity().elementIdentifier() !=  bs_23){
  field_additionalMobileIdentity=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_additionalMobileIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_oldRoutingAreaIdentification2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw->forceomit);
  decoded_field_length = field_oldRoutingAreaIdentification2().RAW_decode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_oldRoutingAreaIdentification2 = 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_oldRoutingAreaIdentification2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_mobileStationClassmark2 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark2().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark2 = 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_mobileStationClassmark2=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_mobileStationClassmark3 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_.raw->forceomit);
  decoded_field_length = field_mobileStationClassmark3().RAW_decode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_mobileStationClassmark3 = 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_mobileStationClassmark3=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_supportedCodecs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw->forceomit);
  decoded_field_length = field_supportedCodecs().RAW_decode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_supportedCodecs = 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_supportedCodecs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_voiceDomainUEUsageSetting = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, VoiceDomainPreferenceandUEsUsageSettingTLV_descr_.raw->forceomit);
  decoded_field_length = field_voiceDomainUEUsageSetting().RAW_decode(VoiceDomainPreferenceandUEsUsageSettingTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_voiceDomainUEUsageSetting = 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_voiceDomainUEUsageSetting=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_p__TMSI__Type = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw->forceomit);
  decoded_field_length = field_p__TMSI__Type().RAW_decode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_p__TMSI__Type = 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_p__TMSI__Type=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_deviceProperties = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw->forceomit);
  decoded_field_length = field_deviceProperties().RAW_decode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_deviceProperties = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24){
  field_deviceProperties=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_deviceProperties=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_mS__NetworkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw->forceomit);
  decoded_field_length = field_mS__NetworkFeatureSupport().RAW_decode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_mS__NetworkFeatureSupport = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_mS__NetworkFeatureSupport.ispresent() || field_mS__NetworkFeatureSupport().elementIdentifier() !=  bs_21){
  field_mS__NetworkFeatureSupport=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_mS__NetworkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_oldLocationAreaIdentification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, LocationAreaIdentification2__TLV_descr_.raw->forceomit);
  decoded_field_length = field_oldLocationAreaIdentification().RAW_decode(LocationAreaIdentification2__TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_oldLocationAreaIdentification = 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_oldLocationAreaIdentification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(25)) {
    field_additionalUpdateType = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_25_force_omit(25, force_omit, AdditionalUpdateTypeTV_descr_.raw->forceomit);
  decoded_field_length = field_additionalUpdateType().RAW_decode(AdditionalUpdateTypeTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_25_force_omit);
  if (decoded_field_length < 1) {
  field_additionalUpdateType = 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_additionalUpdateType=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(26)) {
    field_tMSIBasedNRIcontainer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_26_force_omit(26, force_omit, NetworkResourceIdentifierContainerTLV_descr_.raw->forceomit);
  decoded_field_length = field_tMSIBasedNRIcontainer().RAW_decode(NetworkResourceIdentifierContainerTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_26_force_omit);
  if (decoded_field_length < 1) {
  field_tMSIBasedNRIcontainer = 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_tMSIBasedNRIcontainer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(27)) {
    field_t3324 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_27_force_omit(27, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3324().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_27_force_omit);
  if (decoded_field_length < 1) {
  field_t3324 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31){
  field_t3324=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_t3324=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(28)) {
    field_t3312__ExtendedValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_28_force_omit(28, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3312__ExtendedValue().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_28_force_omit);
  if (decoded_field_length < 1) {
  field_t3312__ExtendedValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17){
  field_t3312__ExtendedValue=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_t3312__ExtendedValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(29)) {
    field_extendedDRXParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_29_force_omit(29, force_omit, ExtendedDRXParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_extendedDRXParameters().RAW_decode(ExtendedDRXParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_29_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDRXParameters = 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_extendedDRXParameters=OMIT_VALUE;
  if (field_messageType !=  bs_40) 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__GMM__RoutingAreaUpdateRequest::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 = 30;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(30);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, UpdateTypeV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, RoutingAreaIdentificationV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, MSRadioAccessCapabilityLV_descr_.raw);
  if (field_oldPTMSISignature.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_readyTimerValue.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, GPRSTimerTV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_drxParameter.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, DRXParameterTV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_tmsiStatus.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, TMSIStatusTV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_ptmsi.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_mSNetworkCapability.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, MSNetworkCapabilityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_pdpContextStatus.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, PDPContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_pC__LCSCapability.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, PC__LCSCapability_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_mBMS__ContextStatus.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MBMS__ContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_uENetworkCapability.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, UENetworkCapabilityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_additionalMobileIdentity.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_oldRoutingAreaIdentification2.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_mobileStationClassmark2.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_mobileStationClassmark3.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_supportedCodecs.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, MobileL3__CommonIE__Types::SupportedCodecList_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_voiceDomainUEUsageSetting.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, VoiceDomainPreferenceandUEsUsageSettingTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_p__TMSI__Type.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_deviceProperties.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, MobileL3__CommonIE__Types::DevicePropertiesTV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_oldLocationAreaIdentification.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, LocationAreaIdentification2__TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  if (field_additionalUpdateType.ispresent()) {
  myleaf.body.node.nodes[25] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 25, AdditionalUpdateTypeTV_descr_.raw);
  }
  else myleaf.body.node.nodes[25] = NULL;
  if (field_tMSIBasedNRIcontainer.ispresent()) {
  myleaf.body.node.nodes[26] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 26, NetworkResourceIdentifierContainerTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[26] = NULL;
  if (field_t3324.ispresent()) {
  myleaf.body.node.nodes[27] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 27, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[27] = NULL;
  if (field_t3312__ExtendedValue.ispresent()) {
  myleaf.body.node.nodes[28] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 28, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[28] = NULL;
  if (field_extendedDRXParameters.ispresent()) {
  myleaf.body.node.nodes[29] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 29, ExtendedDRXParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[29] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_updateType.RAW_encode(UpdateTypeV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_gprsCKSN.RAW_encode(MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_oldRoutingAreaId.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_msRACap.RAW_encode(MSRadioAccessCapabilityLV_descr_, *myleaf.body.node.nodes[4]);
  if (field_oldPTMSISignature.ispresent()) {
  encoded_length += field_oldPTMSISignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_readyTimerValue.ispresent()) {
  encoded_length += field_readyTimerValue().RAW_encode(GPRSTimerTV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_drxParameter.ispresent()) {
  encoded_length += field_drxParameter().RAW_encode(DRXParameterTV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_tmsiStatus.ispresent()) {
  encoded_length += field_tmsiStatus().RAW_encode(TMSIStatusTV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_ptmsi.ispresent()) {
  encoded_length += field_ptmsi().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_mSNetworkCapability.ispresent()) {
  encoded_length += field_mSNetworkCapability().RAW_encode(MSNetworkCapabilityTLV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_pdpContextStatus.ispresent()) {
  encoded_length += field_pdpContextStatus().RAW_encode(PDPContextStatusTLV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_pC__LCSCapability.ispresent()) {
  encoded_length += field_pC__LCSCapability().RAW_encode(PC__LCSCapability_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_mBMS__ContextStatus.ispresent()) {
  encoded_length += field_mBMS__ContextStatus().RAW_encode(MBMS__ContextStatusTLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_uENetworkCapability.ispresent()) {
  encoded_length += field_uENetworkCapability().RAW_encode(UENetworkCapabilityTLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_additionalMobileIdentity.ispresent()) {
  encoded_length += field_additionalMobileIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_oldRoutingAreaIdentification2.ispresent()) {
  encoded_length += field_oldRoutingAreaIdentification2().RAW_encode(MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_mobileStationClassmark2.ispresent()) {
  encoded_length += field_mobileStationClassmark2().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_mobileStationClassmark3.ispresent()) {
  encoded_length += field_mobileStationClassmark3().RAW_encode(MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_supportedCodecs.ispresent()) {
  encoded_length += field_supportedCodecs().RAW_encode(MobileL3__CommonIE__Types::SupportedCodecList_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_voiceDomainUEUsageSetting.ispresent()) {
  encoded_length += field_voiceDomainUEUsageSetting().RAW_encode(VoiceDomainPreferenceandUEsUsageSettingTLV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_p__TMSI__Type.ispresent()) {
  encoded_length += field_p__TMSI__Type().RAW_encode(MobileL3__CommonIE__Types::P__TMSI__TypeTV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_deviceProperties.ispresent()) {
  encoded_length += field_deviceProperties().RAW_encode(MobileL3__CommonIE__Types::DevicePropertiesTV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_mS__NetworkFeatureSupport.ispresent()) {
  encoded_length += field_mS__NetworkFeatureSupport().RAW_encode(MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_oldLocationAreaIdentification.ispresent()) {
  encoded_length += field_oldLocationAreaIdentification().RAW_encode(LocationAreaIdentification2__TLV_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_additionalUpdateType.ispresent()) {
  encoded_length += field_additionalUpdateType().RAW_encode(AdditionalUpdateTypeTV_descr_, *myleaf.body.node.nodes[25]);
  }
  if (field_tMSIBasedNRIcontainer.ispresent()) {
  encoded_length += field_tMSIBasedNRIcontainer().RAW_encode(NetworkResourceIdentifierContainerTLV_descr_, *myleaf.body.node.nodes[26]);
  }
  if (field_t3324.ispresent()) {
  encoded_length += field_t3324().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[27]);
  }
  if (field_t3312__ExtendedValue.ispresent()) {
  encoded_length += field_t3312__ExtendedValue().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[28]);
  }
  if (field_extendedDRXParameters.ispresent()) {
  encoded_length += field_extendedDRXParameters().RAW_encode(ExtendedDRXParametersTLV_descr_, *myleaf.body.node.nodes[29]);
  }
  if (field_ptmsi.ispresent() && (!field_ptmsi.ispresent() || field_ptmsi().elementIdentifier() !=  bs_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={9,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT7_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_additionalMobileIdentity.ispresent() && (!field_additionalMobileIdentity.ispresent() || field_additionalMobileIdentity().elementIdentifier() !=  bs_23)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={15,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_23.RAW_encode(General__Types::BIT7_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_deviceProperties.ispresent() && (!field_deviceProperties.ispresent() || field_deviceProperties().elementIdentifier() !=  bs_24)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={22,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_24.RAW_encode(General__Types::BIT4_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_mS__NetworkFeatureSupport.ispresent() && (!field_mS__NetworkFeatureSupport.ispresent() || field_mS__NetworkFeatureSupport().elementIdentifier() !=  bs_21)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={23,2};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_21.RAW_encode(General__Types::BIT4_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_t3324.ispresent() && (!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={27,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_31.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);
  }
  }
  if (field_t3312__ExtendedValue.ispresent() && (!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={28,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.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);
  }
  }
  if (field_messageType !=  bs_40) {
  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_40.RAW_encode(General__Types::BIT8_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__GMM__RoutingAreaUpdateRequest_template::single_value_struct {
BITSTRING_template field_messageType;
UpdateTypeV_template field_updateType;
MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template field_gprsCKSN;
RoutingAreaIdentificationV_template field_oldRoutingAreaId;
MSRadioAccessCapabilityLV_template field_msRACap;
P__TMSISignatureTV_template field_oldPTMSISignature;
GPRSTimerTV_template field_readyTimerValue;
DRXParameterTV_template field_drxParameter;
TMSIStatusTV_template field_tmsiStatus;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_ptmsi;
MSNetworkCapabilityTLV_template field_mSNetworkCapability;
PDPContextStatusTLV_template field_pdpContextStatus;
PC__LCSCapability_template field_pC__LCSCapability;
MBMS__ContextStatusTLV_template field_mBMS__ContextStatus;
UENetworkCapabilityTLV_template field_uENetworkCapability;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_additionalMobileIdentity;
MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template field_oldRoutingAreaIdentification2;
MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template field_mobileStationClassmark2;
MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template field_mobileStationClassmark3;
MobileL3__CommonIE__Types::SupportedCodecList_template field_supportedCodecs;
VoiceDomainPreferenceandUEsUsageSettingTLV_template field_voiceDomainUEUsageSetting;
MobileL3__CommonIE__Types::P__TMSI__TypeTV_template field_p__TMSI__Type;
MobileL3__CommonIE__Types::DevicePropertiesTV_template field_deviceProperties;
MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template field_mS__NetworkFeatureSupport;
LocationAreaIdentification2__TLV_template field_oldLocationAreaIdentification;
AdditionalUpdateTypeTV_template field_additionalUpdateType;
NetworkResourceIdentifierContainerTLV_template field_tMSIBasedNRIcontainer;
GPRSTimer2TLV_template field_t3324;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_t3312__ExtendedValue;
ExtendedDRXParametersTLV_template field_extendedDRXParameters;
};

void PDU__GMM__RoutingAreaUpdateRequest_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_messageType = ANY_VALUE;
single_value->field_updateType = ANY_VALUE;
single_value->field_gprsCKSN = ANY_VALUE;
single_value->field_oldRoutingAreaId = ANY_VALUE;
single_value->field_msRACap = ANY_VALUE;
single_value->field_oldPTMSISignature = ANY_OR_OMIT;
single_value->field_readyTimerValue = ANY_OR_OMIT;
single_value->field_drxParameter = ANY_OR_OMIT;
single_value->field_tmsiStatus = ANY_OR_OMIT;
single_value->field_ptmsi = ANY_OR_OMIT;
single_value->field_mSNetworkCapability = ANY_OR_OMIT;
single_value->field_pdpContextStatus = ANY_OR_OMIT;
single_value->field_pC__LCSCapability = ANY_OR_OMIT;
single_value->field_mBMS__ContextStatus = ANY_OR_OMIT;
single_value->field_uENetworkCapability = ANY_OR_OMIT;
single_value->field_additionalMobileIdentity = ANY_OR_OMIT;
single_value->field_oldRoutingAreaIdentification2 = ANY_OR_OMIT;
single_value->field_mobileStationClassmark2 = ANY_OR_OMIT;
single_value->field_mobileStationClassmark3 = ANY_OR_OMIT;
single_value->field_supportedCodecs = ANY_OR_OMIT;
single_value->field_voiceDomainUEUsageSetting = ANY_OR_OMIT;
single_value->field_p__TMSI__Type = ANY_OR_OMIT;
single_value->field_deviceProperties = ANY_OR_OMIT;
single_value->field_mS__NetworkFeatureSupport = ANY_OR_OMIT;
single_value->field_oldLocationAreaIdentification = ANY_OR_OMIT;
single_value->field_additionalUpdateType = ANY_OR_OMIT;
single_value->field_tMSIBasedNRIcontainer = ANY_OR_OMIT;
single_value->field_t3324 = ANY_OR_OMIT;
single_value->field_t3312__ExtendedValue = ANY_OR_OMIT;
single_value->field_extendedDRXParameters = ANY_OR_OMIT;
}
}
}

void PDU__GMM__RoutingAreaUpdateRequest_template::copy_value(const PDU__GMM__RoutingAreaUpdateRequest& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.updateType().is_bound()) {
  single_value->field_updateType = other_value.updateType();
} else {
  single_value->field_updateType.clean_up();
}
if (other_value.gprsCKSN().is_bound()) {
  single_value->field_gprsCKSN = other_value.gprsCKSN();
} else {
  single_value->field_gprsCKSN.clean_up();
}
if (other_value.oldRoutingAreaId().is_bound()) {
  single_value->field_oldRoutingAreaId = other_value.oldRoutingAreaId();
} else {
  single_value->field_oldRoutingAreaId.clean_up();
}
if (other_value.msRACap().is_bound()) {
  single_value->field_msRACap = other_value.msRACap();
} else {
  single_value->field_msRACap.clean_up();
}
if (other_value.oldPTMSISignature().is_bound()) {
  if (other_value.oldPTMSISignature().ispresent()) single_value->field_oldPTMSISignature = other_value.oldPTMSISignature()();
  else single_value->field_oldPTMSISignature = OMIT_VALUE;
} else {
  single_value->field_oldPTMSISignature.clean_up();
}
if (other_value.readyTimerValue().is_bound()) {
  if (other_value.readyTimerValue().ispresent()) single_value->field_readyTimerValue = other_value.readyTimerValue()();
  else single_value->field_readyTimerValue = OMIT_VALUE;
} else {
  single_value->field_readyTimerValue.clean_up();
}
if (other_value.drxParameter().is_bound()) {
  if (other_value.drxParameter().ispresent()) single_value->field_drxParameter = other_value.drxParameter()();
  else single_value->field_drxParameter = OMIT_VALUE;
} else {
  single_value->field_drxParameter.clean_up();
}
if (other_value.tmsiStatus().is_bound()) {
  if (other_value.tmsiStatus().ispresent()) single_value->field_tmsiStatus = other_value.tmsiStatus()();
  else single_value->field_tmsiStatus = OMIT_VALUE;
} else {
  single_value->field_tmsiStatus.clean_up();
}
if (other_value.ptmsi().is_bound()) {
  if (other_value.ptmsi().ispresent()) single_value->field_ptmsi = other_value.ptmsi()();
  else single_value->field_ptmsi = OMIT_VALUE;
} else {
  single_value->field_ptmsi.clean_up();
}
if (other_value.mSNetworkCapability().is_bound()) {
  if (other_value.mSNetworkCapability().ispresent()) single_value->field_mSNetworkCapability = other_value.mSNetworkCapability()();
  else single_value->field_mSNetworkCapability = OMIT_VALUE;
} else {
  single_value->field_mSNetworkCapability.clean_up();
}
if (other_value.pdpContextStatus().is_bound()) {
  if (other_value.pdpContextStatus().ispresent()) single_value->field_pdpContextStatus = other_value.pdpContextStatus()();
  else single_value->field_pdpContextStatus = OMIT_VALUE;
} else {
  single_value->field_pdpContextStatus.clean_up();
}
if (other_value.pC__LCSCapability().is_bound()) {
  if (other_value.pC__LCSCapability().ispresent()) single_value->field_pC__LCSCapability = other_value.pC__LCSCapability()();
  else single_value->field_pC__LCSCapability = OMIT_VALUE;
} else {
  single_value->field_pC__LCSCapability.clean_up();
}
if (other_value.mBMS__ContextStatus().is_bound()) {
  if (other_value.mBMS__ContextStatus().ispresent()) single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus()();
  else single_value->field_mBMS__ContextStatus = OMIT_VALUE;
} else {
  single_value->field_mBMS__ContextStatus.clean_up();
}
if (other_value.uENetworkCapability().is_bound()) {
  if (other_value.uENetworkCapability().ispresent()) single_value->field_uENetworkCapability = other_value.uENetworkCapability()();
  else single_value->field_uENetworkCapability = OMIT_VALUE;
} else {
  single_value->field_uENetworkCapability.clean_up();
}
if (other_value.additionalMobileIdentity().is_bound()) {
  if (other_value.additionalMobileIdentity().ispresent()) single_value->field_additionalMobileIdentity = other_value.additionalMobileIdentity()();
  else single_value->field_additionalMobileIdentity = OMIT_VALUE;
} else {
  single_value->field_additionalMobileIdentity.clean_up();
}
if (other_value.oldRoutingAreaIdentification2().is_bound()) {
  if (other_value.oldRoutingAreaIdentification2().ispresent()) single_value->field_oldRoutingAreaIdentification2 = other_value.oldRoutingAreaIdentification2()();
  else single_value->field_oldRoutingAreaIdentification2 = OMIT_VALUE;
} else {
  single_value->field_oldRoutingAreaIdentification2.clean_up();
}
if (other_value.mobileStationClassmark2().is_bound()) {
  if (other_value.mobileStationClassmark2().ispresent()) single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2()();
  else single_value->field_mobileStationClassmark2 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark2.clean_up();
}
if (other_value.mobileStationClassmark3().is_bound()) {
  if (other_value.mobileStationClassmark3().ispresent()) single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3()();
  else single_value->field_mobileStationClassmark3 = OMIT_VALUE;
} else {
  single_value->field_mobileStationClassmark3.clean_up();
}
if (other_value.supportedCodecs().is_bound()) {
  if (other_value.supportedCodecs().ispresent()) single_value->field_supportedCodecs = other_value.supportedCodecs()();
  else single_value->field_supportedCodecs = OMIT_VALUE;
} else {
  single_value->field_supportedCodecs.clean_up();
}
if (other_value.voiceDomainUEUsageSetting().is_bound()) {
  if (other_value.voiceDomainUEUsageSetting().ispresent()) single_value->field_voiceDomainUEUsageSetting = other_value.voiceDomainUEUsageSetting()();
  else single_value->field_voiceDomainUEUsageSetting = OMIT_VALUE;
} else {
  single_value->field_voiceDomainUEUsageSetting.clean_up();
}
if (other_value.p__TMSI__Type().is_bound()) {
  if (other_value.p__TMSI__Type().ispresent()) single_value->field_p__TMSI__Type = other_value.p__TMSI__Type()();
  else single_value->field_p__TMSI__Type = OMIT_VALUE;
} else {
  single_value->field_p__TMSI__Type.clean_up();
}
if (other_value.deviceProperties().is_bound()) {
  if (other_value.deviceProperties().ispresent()) single_value->field_deviceProperties = other_value.deviceProperties()();
  else single_value->field_deviceProperties = OMIT_VALUE;
} else {
  single_value->field_deviceProperties.clean_up();
}
if (other_value.mS__NetworkFeatureSupport().is_bound()) {
  if (other_value.mS__NetworkFeatureSupport().ispresent()) single_value->field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport()();
  else single_value->field_mS__NetworkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_mS__NetworkFeatureSupport.clean_up();
}
if (other_value.oldLocationAreaIdentification().is_bound()) {
  if (other_value.oldLocationAreaIdentification().ispresent()) single_value->field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification()();
  else single_value->field_oldLocationAreaIdentification = OMIT_VALUE;
} else {
  single_value->field_oldLocationAreaIdentification.clean_up();
}
if (other_value.additionalUpdateType().is_bound()) {
  if (other_value.additionalUpdateType().ispresent()) single_value->field_additionalUpdateType = other_value.additionalUpdateType()();
  else single_value->field_additionalUpdateType = OMIT_VALUE;
} else {
  single_value->field_additionalUpdateType.clean_up();
}
if (other_value.tMSIBasedNRIcontainer().is_bound()) {
  if (other_value.tMSIBasedNRIcontainer().ispresent()) single_value->field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer()();
  else single_value->field_tMSIBasedNRIcontainer = OMIT_VALUE;
} else {
  single_value->field_tMSIBasedNRIcontainer.clean_up();
}
if (other_value.t3324().is_bound()) {
  if (other_value.t3324().ispresent()) single_value->field_t3324 = other_value.t3324()();
  else single_value->field_t3324 = OMIT_VALUE;
} else {
  single_value->field_t3324.clean_up();
}
if (other_value.t3312__ExtendedValue().is_bound()) {
  if (other_value.t3312__ExtendedValue().ispresent()) single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue()();
  else single_value->field_t3312__ExtendedValue = OMIT_VALUE;
} else {
  single_value->field_t3312__ExtendedValue.clean_up();
}
if (other_value.extendedDRXParameters().is_bound()) {
  if (other_value.extendedDRXParameters().ispresent()) single_value->field_extendedDRXParameters = other_value.extendedDRXParameters()();
  else single_value->field_extendedDRXParameters = OMIT_VALUE;
} else {
  single_value->field_extendedDRXParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__RoutingAreaUpdateRequest_template::copy_template(const PDU__GMM__RoutingAreaUpdateRequest_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.updateType().get_selection()) {
single_value->field_updateType = other_value.updateType();
} else {
single_value->field_updateType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gprsCKSN().get_selection()) {
single_value->field_gprsCKSN = other_value.gprsCKSN();
} else {
single_value->field_gprsCKSN.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldRoutingAreaId().get_selection()) {
single_value->field_oldRoutingAreaId = other_value.oldRoutingAreaId();
} else {
single_value->field_oldRoutingAreaId.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msRACap().get_selection()) {
single_value->field_msRACap = other_value.msRACap();
} else {
single_value->field_msRACap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldPTMSISignature().get_selection()) {
single_value->field_oldPTMSISignature = other_value.oldPTMSISignature();
} else {
single_value->field_oldPTMSISignature.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.readyTimerValue().get_selection()) {
single_value->field_readyTimerValue = other_value.readyTimerValue();
} else {
single_value->field_readyTimerValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.drxParameter().get_selection()) {
single_value->field_drxParameter = other_value.drxParameter();
} else {
single_value->field_drxParameter.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tmsiStatus().get_selection()) {
single_value->field_tmsiStatus = other_value.tmsiStatus();
} else {
single_value->field_tmsiStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsi().get_selection()) {
single_value->field_ptmsi = other_value.ptmsi();
} else {
single_value->field_ptmsi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mSNetworkCapability().get_selection()) {
single_value->field_mSNetworkCapability = other_value.mSNetworkCapability();
} else {
single_value->field_mSNetworkCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pdpContextStatus().get_selection()) {
single_value->field_pdpContextStatus = other_value.pdpContextStatus();
} else {
single_value->field_pdpContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pC__LCSCapability().get_selection()) {
single_value->field_pC__LCSCapability = other_value.pC__LCSCapability();
} else {
single_value->field_pC__LCSCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__ContextStatus().get_selection()) {
single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
} else {
single_value->field_mBMS__ContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.uENetworkCapability().get_selection()) {
single_value->field_uENetworkCapability = other_value.uENetworkCapability();
} else {
single_value->field_uENetworkCapability.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalMobileIdentity().get_selection()) {
single_value->field_additionalMobileIdentity = other_value.additionalMobileIdentity();
} else {
single_value->field_additionalMobileIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldRoutingAreaIdentification2().get_selection()) {
single_value->field_oldRoutingAreaIdentification2 = other_value.oldRoutingAreaIdentification2();
} else {
single_value->field_oldRoutingAreaIdentification2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark2().get_selection()) {
single_value->field_mobileStationClassmark2 = other_value.mobileStationClassmark2();
} else {
single_value->field_mobileStationClassmark2.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mobileStationClassmark3().get_selection()) {
single_value->field_mobileStationClassmark3 = other_value.mobileStationClassmark3();
} else {
single_value->field_mobileStationClassmark3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.supportedCodecs().get_selection()) {
single_value->field_supportedCodecs = other_value.supportedCodecs();
} else {
single_value->field_supportedCodecs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.voiceDomainUEUsageSetting().get_selection()) {
single_value->field_voiceDomainUEUsageSetting = other_value.voiceDomainUEUsageSetting();
} else {
single_value->field_voiceDomainUEUsageSetting.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.p__TMSI__Type().get_selection()) {
single_value->field_p__TMSI__Type = other_value.p__TMSI__Type();
} else {
single_value->field_p__TMSI__Type.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.deviceProperties().get_selection()) {
single_value->field_deviceProperties = other_value.deviceProperties();
} else {
single_value->field_deviceProperties.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mS__NetworkFeatureSupport().get_selection()) {
single_value->field_mS__NetworkFeatureSupport = other_value.mS__NetworkFeatureSupport();
} else {
single_value->field_mS__NetworkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.oldLocationAreaIdentification().get_selection()) {
single_value->field_oldLocationAreaIdentification = other_value.oldLocationAreaIdentification();
} else {
single_value->field_oldLocationAreaIdentification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalUpdateType().get_selection()) {
single_value->field_additionalUpdateType = other_value.additionalUpdateType();
} else {
single_value->field_additionalUpdateType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tMSIBasedNRIcontainer().get_selection()) {
single_value->field_tMSIBasedNRIcontainer = other_value.tMSIBasedNRIcontainer();
} else {
single_value->field_tMSIBasedNRIcontainer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3324().get_selection()) {
single_value->field_t3324 = other_value.t3324();
} else {
single_value->field_t3324.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3312__ExtendedValue().get_selection()) {
single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
} else {
single_value->field_t3312__ExtendedValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDRXParameters().get_selection()) {
single_value->field_extendedDRXParameters = other_value.extendedDRXParameters();
} else {
single_value->field_extendedDRXParameters.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__GMM__RoutingAreaUpdateRequest_template[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__GMM__RoutingAreaUpdateRequest_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__RoutingAreaUpdateRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
break;
}
set_selection(other_value);
}

PDU__GMM__RoutingAreaUpdateRequest_template::PDU__GMM__RoutingAreaUpdateRequest_template()
{
}

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

PDU__GMM__RoutingAreaUpdateRequest_template::PDU__GMM__RoutingAreaUpdateRequest_template(const PDU__GMM__RoutingAreaUpdateRequest& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__RoutingAreaUpdateRequest_template& PDU__GMM__RoutingAreaUpdateRequest_template::operator=(const OPTIONAL<PDU__GMM__RoutingAreaUpdateRequest>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__RoutingAreaUpdateRequest&)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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
}
return *this;
}

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

boolean PDU__GMM__RoutingAreaUpdateRequest_template::match(const PDU__GMM__RoutingAreaUpdateRequest& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.updateType().is_bound()) return FALSE;
if(!single_value->field_updateType.match(other_value.updateType(), legacy))return FALSE;
if(!other_value.gprsCKSN().is_bound()) return FALSE;
if(!single_value->field_gprsCKSN.match(other_value.gprsCKSN(), legacy))return FALSE;
if(!other_value.oldRoutingAreaId().is_bound()) return FALSE;
if(!single_value->field_oldRoutingAreaId.match(other_value.oldRoutingAreaId(), legacy))return FALSE;
if(!other_value.msRACap().is_bound()) return FALSE;
if(!single_value->field_msRACap.match(other_value.msRACap(), legacy))return FALSE;
if(!other_value.oldPTMSISignature().is_bound()) return FALSE;
if((other_value.oldPTMSISignature().ispresent() ? !single_value->field_oldPTMSISignature.match((const P__TMSISignatureTV&)other_value.oldPTMSISignature(), legacy) : !single_value->field_oldPTMSISignature.match_omit(legacy)))return FALSE;
if(!other_value.readyTimerValue().is_bound()) return FALSE;
if((other_value.readyTimerValue().ispresent() ? !single_value->field_readyTimerValue.match((const GPRSTimerTV&)other_value.readyTimerValue(), legacy) : !single_value->field_readyTimerValue.match_omit(legacy)))return FALSE;
if(!other_value.drxParameter().is_bound()) return FALSE;
if((other_value.drxParameter().ispresent() ? !single_value->field_drxParameter.match((const DRXParameterTV&)other_value.drxParameter(), legacy) : !single_value->field_drxParameter.match_omit(legacy)))return FALSE;
if(!other_value.tmsiStatus().is_bound()) return FALSE;
if((other_value.tmsiStatus().ispresent() ? !single_value->field_tmsiStatus.match((const TMSIStatusTV&)other_value.tmsiStatus(), legacy) : !single_value->field_tmsiStatus.match_omit(legacy)))return FALSE;
if(!other_value.ptmsi().is_bound()) return FALSE;
if((other_value.ptmsi().ispresent() ? !single_value->field_ptmsi.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.ptmsi(), legacy) : !single_value->field_ptmsi.match_omit(legacy)))return FALSE;
if(!other_value.mSNetworkCapability().is_bound()) return FALSE;
if((other_value.mSNetworkCapability().ispresent() ? !single_value->field_mSNetworkCapability.match((const MSNetworkCapabilityTLV&)other_value.mSNetworkCapability(), legacy) : !single_value->field_mSNetworkCapability.match_omit(legacy)))return FALSE;
if(!other_value.pdpContextStatus().is_bound()) return FALSE;
if((other_value.pdpContextStatus().ispresent() ? !single_value->field_pdpContextStatus.match((const PDPContextStatusTLV&)other_value.pdpContextStatus(), legacy) : !single_value->field_pdpContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.pC__LCSCapability().is_bound()) return FALSE;
if((other_value.pC__LCSCapability().ispresent() ? !single_value->field_pC__LCSCapability.match((const PC__LCSCapability&)other_value.pC__LCSCapability(), legacy) : !single_value->field_pC__LCSCapability.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__ContextStatus().is_bound()) return FALSE;
if((other_value.mBMS__ContextStatus().ispresent() ? !single_value->field_mBMS__ContextStatus.match((const MBMS__ContextStatusTLV&)other_value.mBMS__ContextStatus(), legacy) : !single_value->field_mBMS__ContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.uENetworkCapability().is_bound()) return FALSE;
if((other_value.uENetworkCapability().ispresent() ? !single_value->field_uENetworkCapability.match((const UENetworkCapabilityTLV&)other_value.uENetworkCapability(), legacy) : !single_value->field_uENetworkCapability.match_omit(legacy)))return FALSE;
if(!other_value.additionalMobileIdentity().is_bound()) return FALSE;
if((other_value.additionalMobileIdentity().ispresent() ? !single_value->field_additionalMobileIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.additionalMobileIdentity(), legacy) : !single_value->field_additionalMobileIdentity.match_omit(legacy)))return FALSE;
if(!other_value.oldRoutingAreaIdentification2().is_bound()) return FALSE;
if((other_value.oldRoutingAreaIdentification2().ispresent() ? !single_value->field_oldRoutingAreaIdentification2.match((const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV&)other_value.oldRoutingAreaIdentification2(), legacy) : !single_value->field_oldRoutingAreaIdentification2.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark2().is_bound()) return FALSE;
if((other_value.mobileStationClassmark2().ispresent() ? !single_value->field_mobileStationClassmark2.match((const MobileL3__CommonIE__Types::MobileStationClassmark2__TLV&)other_value.mobileStationClassmark2(), legacy) : !single_value->field_mobileStationClassmark2.match_omit(legacy)))return FALSE;
if(!other_value.mobileStationClassmark3().is_bound()) return FALSE;
if((other_value.mobileStationClassmark3().ispresent() ? !single_value->field_mobileStationClassmark3.match((const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV&)other_value.mobileStationClassmark3(), legacy) : !single_value->field_mobileStationClassmark3.match_omit(legacy)))return FALSE;
if(!other_value.supportedCodecs().is_bound()) return FALSE;
if((other_value.supportedCodecs().ispresent() ? !single_value->field_supportedCodecs.match((const MobileL3__CommonIE__Types::SupportedCodecList&)other_value.supportedCodecs(), legacy) : !single_value->field_supportedCodecs.match_omit(legacy)))return FALSE;
if(!other_value.voiceDomainUEUsageSetting().is_bound()) return FALSE;
if((other_value.voiceDomainUEUsageSetting().ispresent() ? !single_value->field_voiceDomainUEUsageSetting.match((const VoiceDomainPreferenceandUEsUsageSettingTLV&)other_value.voiceDomainUEUsageSetting(), legacy) : !single_value->field_voiceDomainUEUsageSetting.match_omit(legacy)))return FALSE;
if(!other_value.p__TMSI__Type().is_bound()) return FALSE;
if((other_value.p__TMSI__Type().ispresent() ? !single_value->field_p__TMSI__Type.match((const MobileL3__CommonIE__Types::P__TMSI__TypeTV&)other_value.p__TMSI__Type(), legacy) : !single_value->field_p__TMSI__Type.match_omit(legacy)))return FALSE;
if(!other_value.deviceProperties().is_bound()) return FALSE;
if((other_value.deviceProperties().ispresent() ? !single_value->field_deviceProperties.match((const MobileL3__CommonIE__Types::DevicePropertiesTV&)other_value.deviceProperties(), legacy) : !single_value->field_deviceProperties.match_omit(legacy)))return FALSE;
if(!other_value.mS__NetworkFeatureSupport().is_bound()) return FALSE;
if((other_value.mS__NetworkFeatureSupport().ispresent() ? !single_value->field_mS__NetworkFeatureSupport.match((const MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV&)other_value.mS__NetworkFeatureSupport(), legacy) : !single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.oldLocationAreaIdentification().is_bound()) return FALSE;
if((other_value.oldLocationAreaIdentification().ispresent() ? !single_value->field_oldLocationAreaIdentification.match((const LocationAreaIdentification2__TLV&)other_value.oldLocationAreaIdentification(), legacy) : !single_value->field_oldLocationAreaIdentification.match_omit(legacy)))return FALSE;
if(!other_value.additionalUpdateType().is_bound()) return FALSE;
if((other_value.additionalUpdateType().ispresent() ? !single_value->field_additionalUpdateType.match((const AdditionalUpdateTypeTV&)other_value.additionalUpdateType(), legacy) : !single_value->field_additionalUpdateType.match_omit(legacy)))return FALSE;
if(!other_value.tMSIBasedNRIcontainer().is_bound()) return FALSE;
if((other_value.tMSIBasedNRIcontainer().ispresent() ? !single_value->field_tMSIBasedNRIcontainer.match((const NetworkResourceIdentifierContainerTLV&)other_value.tMSIBasedNRIcontainer(), legacy) : !single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)))return FALSE;
if(!other_value.t3324().is_bound()) return FALSE;
if((other_value.t3324().ispresent() ? !single_value->field_t3324.match((const GPRSTimer2TLV&)other_value.t3324(), legacy) : !single_value->field_t3324.match_omit(legacy)))return FALSE;
if(!other_value.t3312__ExtendedValue().is_bound()) return FALSE;
if((other_value.t3312__ExtendedValue().ispresent() ? !single_value->field_t3312__ExtendedValue.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.t3312__ExtendedValue(), legacy) : !single_value->field_t3312__ExtendedValue.match_omit(legacy)))return FALSE;
if(!other_value.extendedDRXParameters().is_bound()) return FALSE;
if((other_value.extendedDRXParameters().ispresent() ? !single_value->field_extendedDRXParameters.match((const ExtendedDRXParametersTLV&)other_value.extendedDRXParameters(), legacy) : !single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
}
return FALSE;
}

boolean PDU__GMM__RoutingAreaUpdateRequest_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_updateType.is_bound()
 || single_value->field_gprsCKSN.is_bound()
 || single_value->field_oldRoutingAreaId.is_bound()
 || single_value->field_msRACap.is_bound()
 || (single_value->field_oldPTMSISignature.is_omit() || single_value->field_oldPTMSISignature.is_bound())
 || (single_value->field_readyTimerValue.is_omit() || single_value->field_readyTimerValue.is_bound())
 || (single_value->field_drxParameter.is_omit() || single_value->field_drxParameter.is_bound())
 || (single_value->field_tmsiStatus.is_omit() || single_value->field_tmsiStatus.is_bound())
 || (single_value->field_ptmsi.is_omit() || single_value->field_ptmsi.is_bound())
 || (single_value->field_mSNetworkCapability.is_omit() || single_value->field_mSNetworkCapability.is_bound())
 || (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_bound())
 || (single_value->field_pC__LCSCapability.is_omit() || single_value->field_pC__LCSCapability.is_bound())
 || (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_bound())
 || (single_value->field_uENetworkCapability.is_omit() || single_value->field_uENetworkCapability.is_bound())
 || (single_value->field_additionalMobileIdentity.is_omit() || single_value->field_additionalMobileIdentity.is_bound())
 || (single_value->field_oldRoutingAreaIdentification2.is_omit() || single_value->field_oldRoutingAreaIdentification2.is_bound())
 || (single_value->field_mobileStationClassmark2.is_omit() || single_value->field_mobileStationClassmark2.is_bound())
 || (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_bound())
 || (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_bound())
 || (single_value->field_voiceDomainUEUsageSetting.is_omit() || single_value->field_voiceDomainUEUsageSetting.is_bound())
 || (single_value->field_p__TMSI__Type.is_omit() || single_value->field_p__TMSI__Type.is_bound())
 || (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_bound())
 || (single_value->field_mS__NetworkFeatureSupport.is_omit() || single_value->field_mS__NetworkFeatureSupport.is_bound())
 || (single_value->field_oldLocationAreaIdentification.is_omit() || single_value->field_oldLocationAreaIdentification.is_bound())
 || (single_value->field_additionalUpdateType.is_omit() || single_value->field_additionalUpdateType.is_bound())
 || (single_value->field_tMSIBasedNRIcontainer.is_omit() || single_value->field_tMSIBasedNRIcontainer.is_bound())
 || (single_value->field_t3324.is_omit() || single_value->field_t3324.is_bound())
 || (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_bound())
 || (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_bound());
}

boolean PDU__GMM__RoutingAreaUpdateRequest_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_updateType.is_value()
 && single_value->field_gprsCKSN.is_value()
 && single_value->field_oldRoutingAreaId.is_value()
 && single_value->field_msRACap.is_value()
 && (single_value->field_oldPTMSISignature.is_omit() || single_value->field_oldPTMSISignature.is_value())
 && (single_value->field_readyTimerValue.is_omit() || single_value->field_readyTimerValue.is_value())
 && (single_value->field_drxParameter.is_omit() || single_value->field_drxParameter.is_value())
 && (single_value->field_tmsiStatus.is_omit() || single_value->field_tmsiStatus.is_value())
 && (single_value->field_ptmsi.is_omit() || single_value->field_ptmsi.is_value())
 && (single_value->field_mSNetworkCapability.is_omit() || single_value->field_mSNetworkCapability.is_value())
 && (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_value())
 && (single_value->field_pC__LCSCapability.is_omit() || single_value->field_pC__LCSCapability.is_value())
 && (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_value())
 && (single_value->field_uENetworkCapability.is_omit() || single_value->field_uENetworkCapability.is_value())
 && (single_value->field_additionalMobileIdentity.is_omit() || single_value->field_additionalMobileIdentity.is_value())
 && (single_value->field_oldRoutingAreaIdentification2.is_omit() || single_value->field_oldRoutingAreaIdentification2.is_value())
 && (single_value->field_mobileStationClassmark2.is_omit() || single_value->field_mobileStationClassmark2.is_value())
 && (single_value->field_mobileStationClassmark3.is_omit() || single_value->field_mobileStationClassmark3.is_value())
 && (single_value->field_supportedCodecs.is_omit() || single_value->field_supportedCodecs.is_value())
 && (single_value->field_voiceDomainUEUsageSetting.is_omit() || single_value->field_voiceDomainUEUsageSetting.is_value())
 && (single_value->field_p__TMSI__Type.is_omit() || single_value->field_p__TMSI__Type.is_value())
 && (single_value->field_deviceProperties.is_omit() || single_value->field_deviceProperties.is_value())
 && (single_value->field_mS__NetworkFeatureSupport.is_omit() || single_value->field_mS__NetworkFeatureSupport.is_value())
 && (single_value->field_oldLocationAreaIdentification.is_omit() || single_value->field_oldLocationAreaIdentification.is_value())
 && (single_value->field_additionalUpdateType.is_omit() || single_value->field_additionalUpdateType.is_value())
 && (single_value->field_tMSIBasedNRIcontainer.is_omit() || single_value->field_tMSIBasedNRIcontainer.is_value())
 && (single_value->field_t3324.is_omit() || single_value->field_t3324.is_value())
 && (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_value())
 && (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_value());
}

void PDU__GMM__RoutingAreaUpdateRequest_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__GMM__RoutingAreaUpdateRequest PDU__GMM__RoutingAreaUpdateRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
PDU__GMM__RoutingAreaUpdateRequest ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_updateType.is_bound()) {
ret_val.updateType() = single_value->field_updateType.valueof();
}
if (single_value->field_gprsCKSN.is_bound()) {
ret_val.gprsCKSN() = single_value->field_gprsCKSN.valueof();
}
if (single_value->field_oldRoutingAreaId.is_bound()) {
ret_val.oldRoutingAreaId() = single_value->field_oldRoutingAreaId.valueof();
}
if (single_value->field_msRACap.is_bound()) {
ret_val.msRACap() = single_value->field_msRACap.valueof();
}
if (single_value->field_oldPTMSISignature.is_omit()) ret_val.oldPTMSISignature() = OMIT_VALUE;
else if (single_value->field_oldPTMSISignature.is_bound()) {
ret_val.oldPTMSISignature() = single_value->field_oldPTMSISignature.valueof();
}
if (single_value->field_readyTimerValue.is_omit()) ret_val.readyTimerValue() = OMIT_VALUE;
else if (single_value->field_readyTimerValue.is_bound()) {
ret_val.readyTimerValue() = single_value->field_readyTimerValue.valueof();
}
if (single_value->field_drxParameter.is_omit()) ret_val.drxParameter() = OMIT_VALUE;
else if (single_value->field_drxParameter.is_bound()) {
ret_val.drxParameter() = single_value->field_drxParameter.valueof();
}
if (single_value->field_tmsiStatus.is_omit()) ret_val.tmsiStatus() = OMIT_VALUE;
else if (single_value->field_tmsiStatus.is_bound()) {
ret_val.tmsiStatus() = single_value->field_tmsiStatus.valueof();
}
if (single_value->field_ptmsi.is_omit()) ret_val.ptmsi() = OMIT_VALUE;
else if (single_value->field_ptmsi.is_bound()) {
ret_val.ptmsi() = single_value->field_ptmsi.valueof();
}
if (single_value->field_mSNetworkCapability.is_omit()) ret_val.mSNetworkCapability() = OMIT_VALUE;
else if (single_value->field_mSNetworkCapability.is_bound()) {
ret_val.mSNetworkCapability() = single_value->field_mSNetworkCapability.valueof();
}
if (single_value->field_pdpContextStatus.is_omit()) ret_val.pdpContextStatus() = OMIT_VALUE;
else if (single_value->field_pdpContextStatus.is_bound()) {
ret_val.pdpContextStatus() = single_value->field_pdpContextStatus.valueof();
}
if (single_value->field_pC__LCSCapability.is_omit()) ret_val.pC__LCSCapability() = OMIT_VALUE;
else if (single_value->field_pC__LCSCapability.is_bound()) {
ret_val.pC__LCSCapability() = single_value->field_pC__LCSCapability.valueof();
}
if (single_value->field_mBMS__ContextStatus.is_omit()) ret_val.mBMS__ContextStatus() = OMIT_VALUE;
else if (single_value->field_mBMS__ContextStatus.is_bound()) {
ret_val.mBMS__ContextStatus() = single_value->field_mBMS__ContextStatus.valueof();
}
if (single_value->field_uENetworkCapability.is_omit()) ret_val.uENetworkCapability() = OMIT_VALUE;
else if (single_value->field_uENetworkCapability.is_bound()) {
ret_val.uENetworkCapability() = single_value->field_uENetworkCapability.valueof();
}
if (single_value->field_additionalMobileIdentity.is_omit()) ret_val.additionalMobileIdentity() = OMIT_VALUE;
else if (single_value->field_additionalMobileIdentity.is_bound()) {
ret_val.additionalMobileIdentity() = single_value->field_additionalMobileIdentity.valueof();
}
if (single_value->field_oldRoutingAreaIdentification2.is_omit()) ret_val.oldRoutingAreaIdentification2() = OMIT_VALUE;
else if (single_value->field_oldRoutingAreaIdentification2.is_bound()) {
ret_val.oldRoutingAreaIdentification2() = single_value->field_oldRoutingAreaIdentification2.valueof();
}
if (single_value->field_mobileStationClassmark2.is_omit()) ret_val.mobileStationClassmark2() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark2.is_bound()) {
ret_val.mobileStationClassmark2() = single_value->field_mobileStationClassmark2.valueof();
}
if (single_value->field_mobileStationClassmark3.is_omit()) ret_val.mobileStationClassmark3() = OMIT_VALUE;
else if (single_value->field_mobileStationClassmark3.is_bound()) {
ret_val.mobileStationClassmark3() = single_value->field_mobileStationClassmark3.valueof();
}
if (single_value->field_supportedCodecs.is_omit()) ret_val.supportedCodecs() = OMIT_VALUE;
else if (single_value->field_supportedCodecs.is_bound()) {
ret_val.supportedCodecs() = single_value->field_supportedCodecs.valueof();
}
if (single_value->field_voiceDomainUEUsageSetting.is_omit()) ret_val.voiceDomainUEUsageSetting() = OMIT_VALUE;
else if (single_value->field_voiceDomainUEUsageSetting.is_bound()) {
ret_val.voiceDomainUEUsageSetting() = single_value->field_voiceDomainUEUsageSetting.valueof();
}
if (single_value->field_p__TMSI__Type.is_omit()) ret_val.p__TMSI__Type() = OMIT_VALUE;
else if (single_value->field_p__TMSI__Type.is_bound()) {
ret_val.p__TMSI__Type() = single_value->field_p__TMSI__Type.valueof();
}
if (single_value->field_deviceProperties.is_omit()) ret_val.deviceProperties() = OMIT_VALUE;
else if (single_value->field_deviceProperties.is_bound()) {
ret_val.deviceProperties() = single_value->field_deviceProperties.valueof();
}
if (single_value->field_mS__NetworkFeatureSupport.is_omit()) ret_val.mS__NetworkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_mS__NetworkFeatureSupport.is_bound()) {
ret_val.mS__NetworkFeatureSupport() = single_value->field_mS__NetworkFeatureSupport.valueof();
}
if (single_value->field_oldLocationAreaIdentification.is_omit()) ret_val.oldLocationAreaIdentification() = OMIT_VALUE;
else if (single_value->field_oldLocationAreaIdentification.is_bound()) {
ret_val.oldLocationAreaIdentification() = single_value->field_oldLocationAreaIdentification.valueof();
}
if (single_value->field_additionalUpdateType.is_omit()) ret_val.additionalUpdateType() = OMIT_VALUE;
else if (single_value->field_additionalUpdateType.is_bound()) {
ret_val.additionalUpdateType() = single_value->field_additionalUpdateType.valueof();
}
if (single_value->field_tMSIBasedNRIcontainer.is_omit()) ret_val.tMSIBasedNRIcontainer() = OMIT_VALUE;
else if (single_value->field_tMSIBasedNRIcontainer.is_bound()) {
ret_val.tMSIBasedNRIcontainer() = single_value->field_tMSIBasedNRIcontainer.valueof();
}
if (single_value->field_t3324.is_omit()) ret_val.t3324() = OMIT_VALUE;
else if (single_value->field_t3324.is_bound()) {
ret_val.t3324() = single_value->field_t3324.valueof();
}
if (single_value->field_t3312__ExtendedValue.is_omit()) ret_val.t3312__ExtendedValue() = OMIT_VALUE;
else if (single_value->field_t3312__ExtendedValue.is_bound()) {
ret_val.t3312__ExtendedValue() = single_value->field_t3312__ExtendedValue.valueof();
}
if (single_value->field_extendedDRXParameters.is_omit()) ret_val.extendedDRXParameters() = OMIT_VALUE;
else if (single_value->field_extendedDRXParameters.is_bound()) {
ret_val.extendedDRXParameters() = single_value->field_extendedDRXParameters.valueof();
}
return ret_val;
}

void PDU__GMM__RoutingAreaUpdateRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__RoutingAreaUpdateRequest_template[list_length];
}

PDU__GMM__RoutingAreaUpdateRequest_template& PDU__GMM__RoutingAreaUpdateRequest_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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__RoutingAreaUpdateRequest_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__RoutingAreaUpdateRequest_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_messageType;
}

UpdateTypeV_template& PDU__GMM__RoutingAreaUpdateRequest_template::updateType()
{
set_specific();
return single_value->field_updateType;
}

const UpdateTypeV_template& PDU__GMM__RoutingAreaUpdateRequest_template::updateType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field updateType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_updateType;
}

MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__RoutingAreaUpdateRequest_template::gprsCKSN()
{
set_specific();
return single_value->field_gprsCKSN;
}

const MobileL3__CommonIE__Types::CipheringKeySequenceNumberV_template& PDU__GMM__RoutingAreaUpdateRequest_template::gprsCKSN() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gprsCKSN of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_gprsCKSN;
}

RoutingAreaIdentificationV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldRoutingAreaId()
{
set_specific();
return single_value->field_oldRoutingAreaId;
}

const RoutingAreaIdentificationV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldRoutingAreaId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldRoutingAreaId of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_oldRoutingAreaId;
}

MSRadioAccessCapabilityLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::msRACap()
{
set_specific();
return single_value->field_msRACap;
}

const MSRadioAccessCapabilityLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::msRACap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msRACap of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_msRACap;
}

P__TMSISignatureTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldPTMSISignature()
{
set_specific();
return single_value->field_oldPTMSISignature;
}

const P__TMSISignatureTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldPTMSISignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldPTMSISignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_oldPTMSISignature;
}

GPRSTimerTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::readyTimerValue()
{
set_specific();
return single_value->field_readyTimerValue;
}

const GPRSTimerTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::readyTimerValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field readyTimerValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_readyTimerValue;
}

DRXParameterTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::drxParameter()
{
set_specific();
return single_value->field_drxParameter;
}

const DRXParameterTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::drxParameter() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field drxParameter of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_drxParameter;
}

TMSIStatusTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::tmsiStatus()
{
set_specific();
return single_value->field_tmsiStatus;
}

const TMSIStatusTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::tmsiStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tmsiStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_tmsiStatus;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::ptmsi()
{
set_specific();
return single_value->field_ptmsi;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::ptmsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsi of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_ptmsi;
}

MSNetworkCapabilityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mSNetworkCapability()
{
set_specific();
return single_value->field_mSNetworkCapability;
}

const MSNetworkCapabilityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mSNetworkCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mSNetworkCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mSNetworkCapability;
}

PDPContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::pdpContextStatus()
{
set_specific();
return single_value->field_pdpContextStatus;
}

const PDPContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::pdpContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_pdpContextStatus;
}

PC__LCSCapability_template& PDU__GMM__RoutingAreaUpdateRequest_template::pC__LCSCapability()
{
set_specific();
return single_value->field_pC__LCSCapability;
}

const PC__LCSCapability_template& PDU__GMM__RoutingAreaUpdateRequest_template::pC__LCSCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pC_LCSCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_pC__LCSCapability;
}

MBMS__ContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mBMS__ContextStatus()
{
set_specific();
return single_value->field_mBMS__ContextStatus;
}

const MBMS__ContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mBMS__ContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_ContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mBMS__ContextStatus;
}

UENetworkCapabilityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::uENetworkCapability()
{
set_specific();
return single_value->field_uENetworkCapability;
}

const UENetworkCapabilityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::uENetworkCapability() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field uENetworkCapability of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_uENetworkCapability;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::additionalMobileIdentity()
{
set_specific();
return single_value->field_additionalMobileIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::additionalMobileIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalMobileIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_additionalMobileIdentity;
}

MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldRoutingAreaIdentification2()
{
set_specific();
return single_value->field_oldRoutingAreaIdentification2;
}

const MobileL3__CommonIE__Types::RoutingAreaIdentification2TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldRoutingAreaIdentification2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldRoutingAreaIdentification2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_oldRoutingAreaIdentification2;
}

MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mobileStationClassmark2()
{
set_specific();
return single_value->field_mobileStationClassmark2;
}

const MobileL3__CommonIE__Types::MobileStationClassmark2__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mobileStationClassmark2() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark2 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mobileStationClassmark2;
}

MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mobileStationClassmark3()
{
set_specific();
return single_value->field_mobileStationClassmark3;
}

const MobileL3__CommonIE__Types::MobileStationClassmark3__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mobileStationClassmark3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mobileStationClassmark3 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mobileStationClassmark3;
}

MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__GMM__RoutingAreaUpdateRequest_template::supportedCodecs()
{
set_specific();
return single_value->field_supportedCodecs;
}

const MobileL3__CommonIE__Types::SupportedCodecList_template& PDU__GMM__RoutingAreaUpdateRequest_template::supportedCodecs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field supportedCodecs of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_supportedCodecs;
}

VoiceDomainPreferenceandUEsUsageSettingTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::voiceDomainUEUsageSetting()
{
set_specific();
return single_value->field_voiceDomainUEUsageSetting;
}

const VoiceDomainPreferenceandUEsUsageSettingTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::voiceDomainUEUsageSetting() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field voiceDomainUEUsageSetting of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_voiceDomainUEUsageSetting;
}

MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::p__TMSI__Type()
{
set_specific();
return single_value->field_p__TMSI__Type;
}

const MobileL3__CommonIE__Types::P__TMSI__TypeTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::p__TMSI__Type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field p_TMSI_Type of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_p__TMSI__Type;
}

MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::deviceProperties()
{
set_specific();
return single_value->field_deviceProperties;
}

const MobileL3__CommonIE__Types::DevicePropertiesTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::deviceProperties() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field deviceProperties of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_deviceProperties;
}

MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mS__NetworkFeatureSupport()
{
set_specific();
return single_value->field_mS__NetworkFeatureSupport;
}

const MobileL3__CommonIE__Types::MS__NetworkFeatureSupportTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::mS__NetworkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mS_NetworkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_mS__NetworkFeatureSupport;
}

LocationAreaIdentification2__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldLocationAreaIdentification()
{
set_specific();
return single_value->field_oldLocationAreaIdentification;
}

const LocationAreaIdentification2__TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::oldLocationAreaIdentification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field oldLocationAreaIdentification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_oldLocationAreaIdentification;
}

AdditionalUpdateTypeTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::additionalUpdateType()
{
set_specific();
return single_value->field_additionalUpdateType;
}

const AdditionalUpdateTypeTV_template& PDU__GMM__RoutingAreaUpdateRequest_template::additionalUpdateType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalUpdateType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_additionalUpdateType;
}

NetworkResourceIdentifierContainerTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::tMSIBasedNRIcontainer()
{
set_specific();
return single_value->field_tMSIBasedNRIcontainer;
}

const NetworkResourceIdentifierContainerTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::tMSIBasedNRIcontainer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tMSIBasedNRIcontainer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_tMSIBasedNRIcontainer;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::t3324()
{
set_specific();
return single_value->field_t3324;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::t3324() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3324 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_t3324;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::t3312__ExtendedValue()
{
set_specific();
return single_value->field_t3312__ExtendedValue;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::t3312__ExtendedValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3312_ExtendedValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_t3312__ExtendedValue;
}

ExtendedDRXParametersTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::extendedDRXParameters()
{
set_specific();
return single_value->field_extendedDRXParameters;
}

const ExtendedDRXParametersTLV_template& PDU__GMM__RoutingAreaUpdateRequest_template::extendedDRXParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDRXParameters of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
return single_value->field_extendedDRXParameters;
}

int PDU__GMM__RoutingAreaUpdateRequest_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_oldPTMSISignature.is_present()) ret_val++;
      if (single_value->field_readyTimerValue.is_present()) ret_val++;
      if (single_value->field_drxParameter.is_present()) ret_val++;
      if (single_value->field_tmsiStatus.is_present()) ret_val++;
      if (single_value->field_ptmsi.is_present()) ret_val++;
      if (single_value->field_mSNetworkCapability.is_present()) ret_val++;
      if (single_value->field_pdpContextStatus.is_present()) ret_val++;
      if (single_value->field_pC__LCSCapability.is_present()) ret_val++;
      if (single_value->field_mBMS__ContextStatus.is_present()) ret_val++;
      if (single_value->field_uENetworkCapability.is_present()) ret_val++;
      if (single_value->field_additionalMobileIdentity.is_present()) ret_val++;
      if (single_value->field_oldRoutingAreaIdentification2.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark2.is_present()) ret_val++;
      if (single_value->field_mobileStationClassmark3.is_present()) ret_val++;
      if (single_value->field_supportedCodecs.is_present()) ret_val++;
      if (single_value->field_voiceDomainUEUsageSetting.is_present()) ret_val++;
      if (single_value->field_p__TMSI__Type.is_present()) ret_val++;
      if (single_value->field_deviceProperties.is_present()) ret_val++;
      if (single_value->field_mS__NetworkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_oldLocationAreaIdentification.is_present()) ret_val++;
      if (single_value->field_additionalUpdateType.is_present()) ret_val++;
      if (single_value->field_tMSIBasedNRIcontainer.is_present()) ret_val++;
      if (single_value->field_t3324.is_present()) ret_val++;
      if (single_value->field_t3312__ExtendedValue.is_present()) ret_val++;
      if (single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest 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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
  }
  return 0;
}

void PDU__GMM__RoutingAreaUpdateRequest_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", updateType := ");
single_value->field_updateType.log();
TTCN_Logger::log_event_str(", gprsCKSN := ");
single_value->field_gprsCKSN.log();
TTCN_Logger::log_event_str(", oldRoutingAreaId := ");
single_value->field_oldRoutingAreaId.log();
TTCN_Logger::log_event_str(", msRACap := ");
single_value->field_msRACap.log();
TTCN_Logger::log_event_str(", oldPTMSISignature := ");
single_value->field_oldPTMSISignature.log();
TTCN_Logger::log_event_str(", readyTimerValue := ");
single_value->field_readyTimerValue.log();
TTCN_Logger::log_event_str(", drxParameter := ");
single_value->field_drxParameter.log();
TTCN_Logger::log_event_str(", tmsiStatus := ");
single_value->field_tmsiStatus.log();
TTCN_Logger::log_event_str(", ptmsi := ");
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(", mSNetworkCapability := ");
single_value->field_mSNetworkCapability.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
single_value->field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", uENetworkCapability := ");
single_value->field_uENetworkCapability.log();
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
single_value->field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(", oldRoutingAreaIdentification2 := ");
single_value->field_oldRoutingAreaIdentification2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(", supportedCodecs := ");
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(", voiceDomainUEUsageSetting := ");
single_value->field_voiceDomainUEUsageSetting.log();
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
single_value->field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(", deviceProperties := ");
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
single_value->field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
single_value->field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(", additionalUpdateType := ");
single_value->field_additionalUpdateType.log();
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
single_value->field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(", t3324 := ");
single_value->field_t3324.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
single_value->field_extendedDRXParameters.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__GMM__RoutingAreaUpdateRequest_template::log_match(const PDU__GMM__RoutingAreaUpdateRequest& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_updateType.match(match_value.updateType(), legacy)){
TTCN_Logger::log_logmatch_info(".updateType");
single_value->field_updateType.log_match(match_value.updateType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_gprsCKSN.match(match_value.gprsCKSN(), legacy)){
TTCN_Logger::log_logmatch_info(".gprsCKSN");
single_value->field_gprsCKSN.log_match(match_value.gprsCKSN(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_oldRoutingAreaId.match(match_value.oldRoutingAreaId(), legacy)){
TTCN_Logger::log_logmatch_info(".oldRoutingAreaId");
single_value->field_oldRoutingAreaId.log_match(match_value.oldRoutingAreaId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_msRACap.match(match_value.msRACap(), legacy)){
TTCN_Logger::log_logmatch_info(".msRACap");
single_value->field_msRACap.log_match(match_value.msRACap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.oldPTMSISignature().ispresent()){
if(!single_value->field_oldPTMSISignature.match(match_value.oldPTMSISignature(), legacy)){
TTCN_Logger::log_logmatch_info(".oldPTMSISignature");
single_value->field_oldPTMSISignature.log_match(match_value.oldPTMSISignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_oldPTMSISignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".oldPTMSISignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_oldPTMSISignature.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.readyTimerValue().ispresent()){
if(!single_value->field_readyTimerValue.match(match_value.readyTimerValue(), legacy)){
TTCN_Logger::log_logmatch_info(".readyTimerValue");
single_value->field_readyTimerValue.log_match(match_value.readyTimerValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_readyTimerValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".readyTimerValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_readyTimerValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.drxParameter().ispresent()){
if(!single_value->field_drxParameter.match(match_value.drxParameter(), legacy)){
TTCN_Logger::log_logmatch_info(".drxParameter");
single_value->field_drxParameter.log_match(match_value.drxParameter(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_drxParameter.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".drxParameter := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_drxParameter.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tmsiStatus().ispresent()){
if(!single_value->field_tmsiStatus.match(match_value.tmsiStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".tmsiStatus");
single_value->field_tmsiStatus.log_match(match_value.tmsiStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tmsiStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tmsiStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tmsiStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.ptmsi().ispresent()){
if(!single_value->field_ptmsi.match(match_value.ptmsi(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsi");
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsi.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsi := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsi.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mSNetworkCapability().ispresent()){
if(!single_value->field_mSNetworkCapability.match(match_value.mSNetworkCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".mSNetworkCapability");
single_value->field_mSNetworkCapability.log_match(match_value.mSNetworkCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mSNetworkCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mSNetworkCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mSNetworkCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pdpContextStatus().ispresent()){
if(!single_value->field_pdpContextStatus.match(match_value.pdpContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpContextStatus");
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pdpContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pdpContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pC__LCSCapability().ispresent()){
if(!single_value->field_pC__LCSCapability.match(match_value.pC__LCSCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".pC_LCSCapability");
single_value->field_pC__LCSCapability.log_match(match_value.pC__LCSCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pC__LCSCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pC_LCSCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pC__LCSCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__ContextStatus().ispresent()){
if(!single_value->field_mBMS__ContextStatus.match(match_value.mBMS__ContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus");
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__ContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.uENetworkCapability().ispresent()){
if(!single_value->field_uENetworkCapability.match(match_value.uENetworkCapability(), legacy)){
TTCN_Logger::log_logmatch_info(".uENetworkCapability");
single_value->field_uENetworkCapability.log_match(match_value.uENetworkCapability(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_uENetworkCapability.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".uENetworkCapability := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_uENetworkCapability.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalMobileIdentity().ispresent()){
if(!single_value->field_additionalMobileIdentity.match(match_value.additionalMobileIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalMobileIdentity");
single_value->field_additionalMobileIdentity.log_match(match_value.additionalMobileIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalMobileIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalMobileIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalMobileIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.oldRoutingAreaIdentification2().ispresent()){
if(!single_value->field_oldRoutingAreaIdentification2.match(match_value.oldRoutingAreaIdentification2(), legacy)){
TTCN_Logger::log_logmatch_info(".oldRoutingAreaIdentification2");
single_value->field_oldRoutingAreaIdentification2.log_match(match_value.oldRoutingAreaIdentification2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_oldRoutingAreaIdentification2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".oldRoutingAreaIdentification2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_oldRoutingAreaIdentification2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark2().ispresent()){
if(!single_value->field_mobileStationClassmark2.match(match_value.mobileStationClassmark2(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark2");
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark2.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark2 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark2.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mobileStationClassmark3().ispresent()){
if(!single_value->field_mobileStationClassmark3.match(match_value.mobileStationClassmark3(), legacy)){
TTCN_Logger::log_logmatch_info(".mobileStationClassmark3");
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mobileStationClassmark3.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mobileStationClassmark3 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mobileStationClassmark3.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.supportedCodecs().ispresent()){
if(!single_value->field_supportedCodecs.match(match_value.supportedCodecs(), legacy)){
TTCN_Logger::log_logmatch_info(".supportedCodecs");
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_supportedCodecs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".supportedCodecs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_supportedCodecs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.voiceDomainUEUsageSetting().ispresent()){
if(!single_value->field_voiceDomainUEUsageSetting.match(match_value.voiceDomainUEUsageSetting(), legacy)){
TTCN_Logger::log_logmatch_info(".voiceDomainUEUsageSetting");
single_value->field_voiceDomainUEUsageSetting.log_match(match_value.voiceDomainUEUsageSetting(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_voiceDomainUEUsageSetting.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".voiceDomainUEUsageSetting := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_voiceDomainUEUsageSetting.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.p__TMSI__Type().ispresent()){
if(!single_value->field_p__TMSI__Type.match(match_value.p__TMSI__Type(), legacy)){
TTCN_Logger::log_logmatch_info(".p_TMSI_Type");
single_value->field_p__TMSI__Type.log_match(match_value.p__TMSI__Type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_p__TMSI__Type.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".p_TMSI_Type := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_p__TMSI__Type.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.deviceProperties().ispresent()){
if(!single_value->field_deviceProperties.match(match_value.deviceProperties(), legacy)){
TTCN_Logger::log_logmatch_info(".deviceProperties");
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_deviceProperties.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".deviceProperties := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_deviceProperties.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mS__NetworkFeatureSupport().ispresent()){
if(!single_value->field_mS__NetworkFeatureSupport.match(match_value.mS__NetworkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".mS_NetworkFeatureSupport");
single_value->field_mS__NetworkFeatureSupport.log_match(match_value.mS__NetworkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mS_NetworkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mS__NetworkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.oldLocationAreaIdentification().ispresent()){
if(!single_value->field_oldLocationAreaIdentification.match(match_value.oldLocationAreaIdentification(), legacy)){
TTCN_Logger::log_logmatch_info(".oldLocationAreaIdentification");
single_value->field_oldLocationAreaIdentification.log_match(match_value.oldLocationAreaIdentification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_oldLocationAreaIdentification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".oldLocationAreaIdentification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_oldLocationAreaIdentification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalUpdateType().ispresent()){
if(!single_value->field_additionalUpdateType.match(match_value.additionalUpdateType(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalUpdateType");
single_value->field_additionalUpdateType.log_match(match_value.additionalUpdateType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalUpdateType.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalUpdateType := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalUpdateType.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.tMSIBasedNRIcontainer().ispresent()){
if(!single_value->field_tMSIBasedNRIcontainer.match(match_value.tMSIBasedNRIcontainer(), legacy)){
TTCN_Logger::log_logmatch_info(".tMSIBasedNRIcontainer");
single_value->field_tMSIBasedNRIcontainer.log_match(match_value.tMSIBasedNRIcontainer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".tMSIBasedNRIcontainer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_tMSIBasedNRIcontainer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3324().ispresent()){
if(!single_value->field_t3324.match(match_value.t3324(), legacy)){
TTCN_Logger::log_logmatch_info(".t3324");
single_value->field_t3324.log_match(match_value.t3324(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3324.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3324 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3324.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3312__ExtendedValue().ispresent()){
if(!single_value->field_t3312__ExtendedValue.match(match_value.t3312__ExtendedValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue");
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3312__ExtendedValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedDRXParameters().ispresent()){
if(!single_value->field_extendedDRXParameters.match(match_value.extendedDRXParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDRXParameters");
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDRXParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDRXParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDRXParameters.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", updateType := ");
single_value->field_updateType.log_match(match_value.updateType(), legacy);
TTCN_Logger::log_event_str(", gprsCKSN := ");
single_value->field_gprsCKSN.log_match(match_value.gprsCKSN(), legacy);
TTCN_Logger::log_event_str(", oldRoutingAreaId := ");
single_value->field_oldRoutingAreaId.log_match(match_value.oldRoutingAreaId(), legacy);
TTCN_Logger::log_event_str(", msRACap := ");
single_value->field_msRACap.log_match(match_value.msRACap(), legacy);
TTCN_Logger::log_event_str(", oldPTMSISignature := ");
if (match_value.oldPTMSISignature().ispresent()) {
single_value->field_oldPTMSISignature.log_match(match_value.oldPTMSISignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_oldPTMSISignature.log();
if (single_value->field_oldPTMSISignature.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", readyTimerValue := ");
if (match_value.readyTimerValue().ispresent()) {
single_value->field_readyTimerValue.log_match(match_value.readyTimerValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_readyTimerValue.log();
if (single_value->field_readyTimerValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", drxParameter := ");
if (match_value.drxParameter().ispresent()) {
single_value->field_drxParameter.log_match(match_value.drxParameter(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_drxParameter.log();
if (single_value->field_drxParameter.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tmsiStatus := ");
if (match_value.tmsiStatus().ispresent()) {
single_value->field_tmsiStatus.log_match(match_value.tmsiStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tmsiStatus.log();
if (single_value->field_tmsiStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", ptmsi := ");
if (match_value.ptmsi().ispresent()) {
single_value->field_ptmsi.log_match(match_value.ptmsi(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsi.log();
if (single_value->field_ptmsi.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mSNetworkCapability := ");
if (match_value.mSNetworkCapability().ispresent()) {
single_value->field_mSNetworkCapability.log_match(match_value.mSNetworkCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mSNetworkCapability.log();
if (single_value->field_mSNetworkCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pdpContextStatus := ");
if (match_value.pdpContextStatus().ispresent()) {
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pdpContextStatus.log();
if (single_value->field_pdpContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pC_LCSCapability := ");
if (match_value.pC__LCSCapability().ispresent()) {
single_value->field_pC__LCSCapability.log_match(match_value.pC__LCSCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pC__LCSCapability.log();
if (single_value->field_pC__LCSCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
if (match_value.mBMS__ContextStatus().ispresent()) {
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__ContextStatus.log();
if (single_value->field_mBMS__ContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", uENetworkCapability := ");
if (match_value.uENetworkCapability().ispresent()) {
single_value->field_uENetworkCapability.log_match(match_value.uENetworkCapability(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_uENetworkCapability.log();
if (single_value->field_uENetworkCapability.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalMobileIdentity := ");
if (match_value.additionalMobileIdentity().ispresent()) {
single_value->field_additionalMobileIdentity.log_match(match_value.additionalMobileIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalMobileIdentity.log();
if (single_value->field_additionalMobileIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", oldRoutingAreaIdentification2 := ");
if (match_value.oldRoutingAreaIdentification2().ispresent()) {
single_value->field_oldRoutingAreaIdentification2.log_match(match_value.oldRoutingAreaIdentification2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_oldRoutingAreaIdentification2.log();
if (single_value->field_oldRoutingAreaIdentification2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark2 := ");
if (match_value.mobileStationClassmark2().ispresent()) {
single_value->field_mobileStationClassmark2.log_match(match_value.mobileStationClassmark2(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark2.log();
if (single_value->field_mobileStationClassmark2.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mobileStationClassmark3 := ");
if (match_value.mobileStationClassmark3().ispresent()) {
single_value->field_mobileStationClassmark3.log_match(match_value.mobileStationClassmark3(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mobileStationClassmark3.log();
if (single_value->field_mobileStationClassmark3.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", supportedCodecs := ");
if (match_value.supportedCodecs().ispresent()) {
single_value->field_supportedCodecs.log_match(match_value.supportedCodecs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_supportedCodecs.log();
if (single_value->field_supportedCodecs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", voiceDomainUEUsageSetting := ");
if (match_value.voiceDomainUEUsageSetting().ispresent()) {
single_value->field_voiceDomainUEUsageSetting.log_match(match_value.voiceDomainUEUsageSetting(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_voiceDomainUEUsageSetting.log();
if (single_value->field_voiceDomainUEUsageSetting.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", p_TMSI_Type := ");
if (match_value.p__TMSI__Type().ispresent()) {
single_value->field_p__TMSI__Type.log_match(match_value.p__TMSI__Type(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_p__TMSI__Type.log();
if (single_value->field_p__TMSI__Type.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", deviceProperties := ");
if (match_value.deviceProperties().ispresent()) {
single_value->field_deviceProperties.log_match(match_value.deviceProperties(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_deviceProperties.log();
if (single_value->field_deviceProperties.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mS_NetworkFeatureSupport := ");
if (match_value.mS__NetworkFeatureSupport().ispresent()) {
single_value->field_mS__NetworkFeatureSupport.log_match(match_value.mS__NetworkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mS__NetworkFeatureSupport.log();
if (single_value->field_mS__NetworkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", oldLocationAreaIdentification := ");
if (match_value.oldLocationAreaIdentification().ispresent()) {
single_value->field_oldLocationAreaIdentification.log_match(match_value.oldLocationAreaIdentification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_oldLocationAreaIdentification.log();
if (single_value->field_oldLocationAreaIdentification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalUpdateType := ");
if (match_value.additionalUpdateType().ispresent()) {
single_value->field_additionalUpdateType.log_match(match_value.additionalUpdateType(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalUpdateType.log();
if (single_value->field_additionalUpdateType.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tMSIBasedNRIcontainer := ");
if (match_value.tMSIBasedNRIcontainer().ispresent()) {
single_value->field_tMSIBasedNRIcontainer.log_match(match_value.tMSIBasedNRIcontainer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_tMSIBasedNRIcontainer.log();
if (single_value->field_tMSIBasedNRIcontainer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3324 := ");
if (match_value.t3324().ispresent()) {
single_value->field_t3324.log_match(match_value.t3324(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3324.log();
if (single_value->field_t3324.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
if (match_value.t3312__ExtendedValue().ispresent()) {
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3312__ExtendedValue.log();
if (single_value->field_t3312__ExtendedValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
if (match_value.extendedDRXParameters().ispresent()) {
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDRXParameters.log();
if (single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateRequest_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (updateType().is_bound()) updateType().set_implicit_omit();
if (gprsCKSN().is_bound()) gprsCKSN().set_implicit_omit();
if (oldRoutingAreaId().is_bound()) oldRoutingAreaId().set_implicit_omit();
if (msRACap().is_bound()) msRACap().set_implicit_omit();
if (!oldPTMSISignature().is_bound()) oldPTMSISignature() = OMIT_VALUE;
else oldPTMSISignature().set_implicit_omit();
if (!readyTimerValue().is_bound()) readyTimerValue() = OMIT_VALUE;
else readyTimerValue().set_implicit_omit();
if (!drxParameter().is_bound()) drxParameter() = OMIT_VALUE;
else drxParameter().set_implicit_omit();
if (!tmsiStatus().is_bound()) tmsiStatus() = OMIT_VALUE;
else tmsiStatus().set_implicit_omit();
if (!ptmsi().is_bound()) ptmsi() = OMIT_VALUE;
else ptmsi().set_implicit_omit();
if (!mSNetworkCapability().is_bound()) mSNetworkCapability() = OMIT_VALUE;
else mSNetworkCapability().set_implicit_omit();
if (!pdpContextStatus().is_bound()) pdpContextStatus() = OMIT_VALUE;
else pdpContextStatus().set_implicit_omit();
if (!pC__LCSCapability().is_bound()) pC__LCSCapability() = OMIT_VALUE;
else pC__LCSCapability().set_implicit_omit();
if (!mBMS__ContextStatus().is_bound()) mBMS__ContextStatus() = OMIT_VALUE;
else mBMS__ContextStatus().set_implicit_omit();
if (!uENetworkCapability().is_bound()) uENetworkCapability() = OMIT_VALUE;
else uENetworkCapability().set_implicit_omit();
if (!additionalMobileIdentity().is_bound()) additionalMobileIdentity() = OMIT_VALUE;
else additionalMobileIdentity().set_implicit_omit();
if (!oldRoutingAreaIdentification2().is_bound()) oldRoutingAreaIdentification2() = OMIT_VALUE;
else oldRoutingAreaIdentification2().set_implicit_omit();
if (!mobileStationClassmark2().is_bound()) mobileStationClassmark2() = OMIT_VALUE;
else mobileStationClassmark2().set_implicit_omit();
if (!mobileStationClassmark3().is_bound()) mobileStationClassmark3() = OMIT_VALUE;
else mobileStationClassmark3().set_implicit_omit();
if (!supportedCodecs().is_bound()) supportedCodecs() = OMIT_VALUE;
else supportedCodecs().set_implicit_omit();
if (!voiceDomainUEUsageSetting().is_bound()) voiceDomainUEUsageSetting() = OMIT_VALUE;
else voiceDomainUEUsageSetting().set_implicit_omit();
if (!p__TMSI__Type().is_bound()) p__TMSI__Type() = OMIT_VALUE;
else p__TMSI__Type().set_implicit_omit();
if (!deviceProperties().is_bound()) deviceProperties() = OMIT_VALUE;
else deviceProperties().set_implicit_omit();
if (!mS__NetworkFeatureSupport().is_bound()) mS__NetworkFeatureSupport() = OMIT_VALUE;
else mS__NetworkFeatureSupport().set_implicit_omit();
if (!oldLocationAreaIdentification().is_bound()) oldLocationAreaIdentification() = OMIT_VALUE;
else oldLocationAreaIdentification().set_implicit_omit();
if (!additionalUpdateType().is_bound()) additionalUpdateType() = OMIT_VALUE;
else additionalUpdateType().set_implicit_omit();
if (!tMSIBasedNRIcontainer().is_bound()) tMSIBasedNRIcontainer() = OMIT_VALUE;
else tMSIBasedNRIcontainer().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__RoutingAreaUpdateRequest_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_updateType.encode_text(text_buf);
single_value->field_gprsCKSN.encode_text(text_buf);
single_value->field_oldRoutingAreaId.encode_text(text_buf);
single_value->field_msRACap.encode_text(text_buf);
single_value->field_oldPTMSISignature.encode_text(text_buf);
single_value->field_readyTimerValue.encode_text(text_buf);
single_value->field_drxParameter.encode_text(text_buf);
single_value->field_tmsiStatus.encode_text(text_buf);
single_value->field_ptmsi.encode_text(text_buf);
single_value->field_mSNetworkCapability.encode_text(text_buf);
single_value->field_pdpContextStatus.encode_text(text_buf);
single_value->field_pC__LCSCapability.encode_text(text_buf);
single_value->field_mBMS__ContextStatus.encode_text(text_buf);
single_value->field_uENetworkCapability.encode_text(text_buf);
single_value->field_additionalMobileIdentity.encode_text(text_buf);
single_value->field_oldRoutingAreaIdentification2.encode_text(text_buf);
single_value->field_mobileStationClassmark2.encode_text(text_buf);
single_value->field_mobileStationClassmark3.encode_text(text_buf);
single_value->field_supportedCodecs.encode_text(text_buf);
single_value->field_voiceDomainUEUsageSetting.encode_text(text_buf);
single_value->field_p__TMSI__Type.encode_text(text_buf);
single_value->field_deviceProperties.encode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.encode_text(text_buf);
single_value->field_oldLocationAreaIdentification.encode_text(text_buf);
single_value->field_additionalUpdateType.encode_text(text_buf);
single_value->field_tMSIBasedNRIcontainer.encode_text(text_buf);
single_value->field_t3324.encode_text(text_buf);
single_value->field_t3312__ExtendedValue.encode_text(text_buf);
single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
}
}

void PDU__GMM__RoutingAreaUpdateRequest_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_messageType.decode_text(text_buf);
single_value->field_updateType.decode_text(text_buf);
single_value->field_gprsCKSN.decode_text(text_buf);
single_value->field_oldRoutingAreaId.decode_text(text_buf);
single_value->field_msRACap.decode_text(text_buf);
single_value->field_oldPTMSISignature.decode_text(text_buf);
single_value->field_readyTimerValue.decode_text(text_buf);
single_value->field_drxParameter.decode_text(text_buf);
single_value->field_tmsiStatus.decode_text(text_buf);
single_value->field_ptmsi.decode_text(text_buf);
single_value->field_mSNetworkCapability.decode_text(text_buf);
single_value->field_pdpContextStatus.decode_text(text_buf);
single_value->field_pC__LCSCapability.decode_text(text_buf);
single_value->field_mBMS__ContextStatus.decode_text(text_buf);
single_value->field_uENetworkCapability.decode_text(text_buf);
single_value->field_additionalMobileIdentity.decode_text(text_buf);
single_value->field_oldRoutingAreaIdentification2.decode_text(text_buf);
single_value->field_mobileStationClassmark2.decode_text(text_buf);
single_value->field_mobileStationClassmark3.decode_text(text_buf);
single_value->field_supportedCodecs.decode_text(text_buf);
single_value->field_voiceDomainUEUsageSetting.decode_text(text_buf);
single_value->field_p__TMSI__Type.decode_text(text_buf);
single_value->field_deviceProperties.decode_text(text_buf);
single_value->field_mS__NetworkFeatureSupport.decode_text(text_buf);
single_value->field_oldLocationAreaIdentification.decode_text(text_buf);
single_value->field_additionalUpdateType.decode_text(text_buf);
single_value->field_tMSIBasedNRIcontainer.decode_text(text_buf);
single_value->field_t3324.decode_text(text_buf);
single_value->field_t3312__ExtendedValue.decode_text(text_buf);
single_value->field_extendedDRXParameters.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__GMM__RoutingAreaUpdateRequest_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest.");
}
}

void PDU__GMM__RoutingAreaUpdateRequest_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__GMM__RoutingAreaUpdateRequest_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (30<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest has 30 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) updateType().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) gprsCKSN().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaId().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) msRACap().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) oldPTMSISignature().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) readyTimerValue().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) drxParameter().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) tmsiStatus().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) ptmsi().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) mSNetworkCapability().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) pC__LCSCapability().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) uENetworkCapability().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) additionalMobileIdentity().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) oldRoutingAreaIdentification2().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark2().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) mobileStationClassmark3().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) supportedCodecs().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) voiceDomainUEUsageSetting().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) p__TMSI__Type().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) deviceProperties().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) mS__NetworkFeatureSupport().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) oldLocationAreaIdentification().set_param(*param.get_elem(24));
    if (param.get_size()>25 && param.get_elem(25)->get_type()!=Module_Param::MP_NotUsed) additionalUpdateType().set_param(*param.get_elem(25));
    if (param.get_size()>26 && param.get_elem(26)->get_type()!=Module_Param::MP_NotUsed) tMSIBasedNRIcontainer().set_param(*param.get_elem(26));
    if (param.get_size()>27 && param.get_elem(27)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(27));
    if (param.get_size()>28 && param.get_elem(28)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(28));
    if (param.get_size()>29 && param.get_elem(29)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(29));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gprsCKSN")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gprsCKSN().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msRACap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msRACap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldPTMSISignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldPTMSISignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimerValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimerValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "drxParameter")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          drxParameter().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tmsiStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tmsiStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mSNetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mSNetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pC_LCSCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pC__LCSCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "uENetworkCapability")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          uENetworkCapability().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalMobileIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalMobileIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldRoutingAreaIdentification2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldRoutingAreaIdentification2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark2")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark2().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mobileStationClassmark3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mobileStationClassmark3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "supportedCodecs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          supportedCodecs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "voiceDomainUEUsageSetting")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          voiceDomainUEUsageSetting().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "p_TMSI_Type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          p__TMSI__Type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "deviceProperties")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          deviceProperties().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mS_NetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mS__NetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "oldLocationAreaIdentification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          oldLocationAreaIdentification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalUpdateType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalUpdateType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tMSIBasedNRIcontainer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tMSIBasedNRIcontainer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__RoutingAreaUpdateRequest_template* precondition = new PDU__GMM__RoutingAreaUpdateRequest_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__RoutingAreaUpdateRequest_template* implied_template = new PDU__GMM__RoutingAreaUpdateRequest_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__RoutingAreaUpdateRequest_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__RoutingAreaUpdateRequest_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_updateType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_gprsCKSN.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_oldRoutingAreaId.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_msRACap.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_oldPTMSISignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_readyTimerValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_drxParameter.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_tmsiStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_ptmsi.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mSNetworkCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_pdpContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_pC__LCSCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mBMS__ContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_uENetworkCapability.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_additionalMobileIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_oldRoutingAreaIdentification2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mobileStationClassmark2.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mobileStationClassmark3.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_supportedCodecs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_voiceDomainUEUsageSetting.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_p__TMSI__Type.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_deviceProperties.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_mS__NetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_oldLocationAreaIdentification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_additionalUpdateType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_tMSIBasedNRIcontainer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_t3324.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_t3312__ExtendedValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
single_value->field_extendedDRXParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateRequest");
}

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

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

PDU__GMM__RoutingAreaUpdateAccept::PDU__GMM__RoutingAreaUpdateAccept()
{
}

PDU__GMM__RoutingAreaUpdateAccept::PDU__GMM__RoutingAreaUpdateAccept(const BITSTRING& par_messageType,
    const ForceToStandbyV& par_forceToStandby,
    const UpdateResultV& par_updateResult,
    const GPRSTimerV& par_raUpdateTimer,
    const RoutingAreaIdentificationV& par_routingAreaId,
    const OPTIONAL< P__TMSISignatureTV >& par_ptmsiSignature,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_allocatedPTMSI,
    const OPTIONAL< MobileL3__CommonIE__Types::MobileIdentityTLV >& par_msIdentity,
    const OPTIONAL< ReceiveNPDUNumbersListTLV >& par_receiveNPDUNumbers,
    const OPTIONAL< GPRSTimerTV >& par_readyTimer,
    const OPTIONAL< GMM__CauseTV >& par_gmmCause,
    const OPTIONAL< GPRSTimer2TLV >& par_t3302,
    const OPTIONAL< CellNotificationT >& par_cellNotification,
    const OPTIONAL< MobileL3__CommonIE__Types::PLMNListTLV >& par_equivalentPLMNs,
    const OPTIONAL< PDPContextStatusTLV >& par_pdpContextStatus,
    const OPTIONAL< NetworkFeatureSupportTV >& par_networkFeatureSupport,
    const OPTIONAL< MobileL3__MM__Types::EmergencyNumberListTLV >& par_emergencyNumberList,
    const OPTIONAL< MBMS__ContextStatusTLV >& par_mBMS__ContextStatus,
    const OPTIONAL< RequestedMSInformationTV >& par_requestedMSInformation,
    const OPTIONAL< GPRSTimer2TLV >& par_t3319,
    const OPTIONAL< GPRSTimer2TLV >& par_t3323,
    const OPTIONAL< MobileL3__CommonIE__Types::GPRSTimer3TLV >& par_t3312__ExtendedValue,
    const OPTIONAL< AdditionalNetworkFeatureSupportTLV >& par_additionalNetworkFeatureSupport,
    const OPTIONAL< GPRSTimer2TLV >& par_t3324,
    const OPTIONAL< ExtendedDRXParametersTLV >& par_extendedDRXParameters)
  :   field_messageType(par_messageType),
  field_forceToStandby(par_forceToStandby),
  field_updateResult(par_updateResult),
  field_raUpdateTimer(par_raUpdateTimer),
  field_routingAreaId(par_routingAreaId),
  field_ptmsiSignature(par_ptmsiSignature),
  field_allocatedPTMSI(par_allocatedPTMSI),
  field_msIdentity(par_msIdentity),
  field_receiveNPDUNumbers(par_receiveNPDUNumbers),
  field_readyTimer(par_readyTimer),
  field_gmmCause(par_gmmCause),
  field_t3302(par_t3302),
  field_cellNotification(par_cellNotification),
  field_equivalentPLMNs(par_equivalentPLMNs),
  field_pdpContextStatus(par_pdpContextStatus),
  field_networkFeatureSupport(par_networkFeatureSupport),
  field_emergencyNumberList(par_emergencyNumberList),
  field_mBMS__ContextStatus(par_mBMS__ContextStatus),
  field_requestedMSInformation(par_requestedMSInformation),
  field_t3319(par_t3319),
  field_t3323(par_t3323),
  field_t3312__ExtendedValue(par_t3312__ExtendedValue),
  field_additionalNetworkFeatureSupport(par_additionalNetworkFeatureSupport),
  field_t3324(par_t3324),
  field_extendedDRXParameters(par_extendedDRXParameters)
{
}

PDU__GMM__RoutingAreaUpdateAccept::PDU__GMM__RoutingAreaUpdateAccept(const PDU__GMM__RoutingAreaUpdateAccept& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
else field_messageType.clean_up();
if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
else field_forceToStandby.clean_up();
if (other_value.updateResult().is_bound()) field_updateResult = other_value.updateResult();
else field_updateResult.clean_up();
if (other_value.raUpdateTimer().is_bound()) field_raUpdateTimer = other_value.raUpdateTimer();
else field_raUpdateTimer.clean_up();
if (other_value.routingAreaId().is_bound()) field_routingAreaId = other_value.routingAreaId();
else field_routingAreaId.clean_up();
if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
else field_ptmsiSignature.clean_up();
if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
else field_allocatedPTMSI.clean_up();
if (other_value.msIdentity().is_bound()) field_msIdentity = other_value.msIdentity();
else field_msIdentity.clean_up();
if (other_value.receiveNPDUNumbers().is_bound()) field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
else field_receiveNPDUNumbers.clean_up();
if (other_value.readyTimer().is_bound()) field_readyTimer = other_value.readyTimer();
else field_readyTimer.clean_up();
if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
else field_gmmCause.clean_up();
if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
else field_t3302.clean_up();
if (other_value.cellNotification().is_bound()) field_cellNotification = other_value.cellNotification();
else field_cellNotification.clean_up();
if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
else field_equivalentPLMNs.clean_up();
if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
else field_pdpContextStatus.clean_up();
if (other_value.networkFeatureSupport().is_bound()) field_networkFeatureSupport = other_value.networkFeatureSupport();
else field_networkFeatureSupport.clean_up();
if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
else field_emergencyNumberList.clean_up();
if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
else field_mBMS__ContextStatus.clean_up();
if (other_value.requestedMSInformation().is_bound()) field_requestedMSInformation = other_value.requestedMSInformation();
else field_requestedMSInformation.clean_up();
if (other_value.t3319().is_bound()) field_t3319 = other_value.t3319();
else field_t3319.clean_up();
if (other_value.t3323().is_bound()) field_t3323 = other_value.t3323();
else field_t3323.clean_up();
if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
else field_t3312__ExtendedValue.clean_up();
if (other_value.additionalNetworkFeatureSupport().is_bound()) field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
else field_additionalNetworkFeatureSupport.clean_up();
if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
else field_t3324.clean_up();
if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
else field_extendedDRXParameters.clean_up();
}

void PDU__GMM__RoutingAreaUpdateAccept::clean_up()
{
field_messageType.clean_up();
field_forceToStandby.clean_up();
field_updateResult.clean_up();
field_raUpdateTimer.clean_up();
field_routingAreaId.clean_up();
field_ptmsiSignature.clean_up();
field_allocatedPTMSI.clean_up();
field_msIdentity.clean_up();
field_receiveNPDUNumbers.clean_up();
field_readyTimer.clean_up();
field_gmmCause.clean_up();
field_t3302.clean_up();
field_cellNotification.clean_up();
field_equivalentPLMNs.clean_up();
field_pdpContextStatus.clean_up();
field_networkFeatureSupport.clean_up();
field_emergencyNumberList.clean_up();
field_mBMS__ContextStatus.clean_up();
field_requestedMSInformation.clean_up();
field_t3319.clean_up();
field_t3323.clean_up();
field_t3312__ExtendedValue.clean_up();
field_additionalNetworkFeatureSupport.clean_up();
field_t3324.clean_up();
field_extendedDRXParameters.clean_up();
}

const TTCN_Typedescriptor_t* PDU__GMM__RoutingAreaUpdateAccept::get_descriptor() const { return &PDU__GMM__RoutingAreaUpdateAccept_descr_; }
PDU__GMM__RoutingAreaUpdateAccept& PDU__GMM__RoutingAreaUpdateAccept::operator=(const PDU__GMM__RoutingAreaUpdateAccept& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
  if (other_value.messageType().is_bound()) field_messageType = other_value.messageType();
  else field_messageType.clean_up();
  if (other_value.forceToStandby().is_bound()) field_forceToStandby = other_value.forceToStandby();
  else field_forceToStandby.clean_up();
  if (other_value.updateResult().is_bound()) field_updateResult = other_value.updateResult();
  else field_updateResult.clean_up();
  if (other_value.raUpdateTimer().is_bound()) field_raUpdateTimer = other_value.raUpdateTimer();
  else field_raUpdateTimer.clean_up();
  if (other_value.routingAreaId().is_bound()) field_routingAreaId = other_value.routingAreaId();
  else field_routingAreaId.clean_up();
  if (other_value.ptmsiSignature().is_bound()) field_ptmsiSignature = other_value.ptmsiSignature();
  else field_ptmsiSignature.clean_up();
  if (other_value.allocatedPTMSI().is_bound()) field_allocatedPTMSI = other_value.allocatedPTMSI();
  else field_allocatedPTMSI.clean_up();
  if (other_value.msIdentity().is_bound()) field_msIdentity = other_value.msIdentity();
  else field_msIdentity.clean_up();
  if (other_value.receiveNPDUNumbers().is_bound()) field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
  else field_receiveNPDUNumbers.clean_up();
  if (other_value.readyTimer().is_bound()) field_readyTimer = other_value.readyTimer();
  else field_readyTimer.clean_up();
  if (other_value.gmmCause().is_bound()) field_gmmCause = other_value.gmmCause();
  else field_gmmCause.clean_up();
  if (other_value.t3302().is_bound()) field_t3302 = other_value.t3302();
  else field_t3302.clean_up();
  if (other_value.cellNotification().is_bound()) field_cellNotification = other_value.cellNotification();
  else field_cellNotification.clean_up();
  if (other_value.equivalentPLMNs().is_bound()) field_equivalentPLMNs = other_value.equivalentPLMNs();
  else field_equivalentPLMNs.clean_up();
  if (other_value.pdpContextStatus().is_bound()) field_pdpContextStatus = other_value.pdpContextStatus();
  else field_pdpContextStatus.clean_up();
  if (other_value.networkFeatureSupport().is_bound()) field_networkFeatureSupport = other_value.networkFeatureSupport();
  else field_networkFeatureSupport.clean_up();
  if (other_value.emergencyNumberList().is_bound()) field_emergencyNumberList = other_value.emergencyNumberList();
  else field_emergencyNumberList.clean_up();
  if (other_value.mBMS__ContextStatus().is_bound()) field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
  else field_mBMS__ContextStatus.clean_up();
  if (other_value.requestedMSInformation().is_bound()) field_requestedMSInformation = other_value.requestedMSInformation();
  else field_requestedMSInformation.clean_up();
  if (other_value.t3319().is_bound()) field_t3319 = other_value.t3319();
  else field_t3319.clean_up();
  if (other_value.t3323().is_bound()) field_t3323 = other_value.t3323();
  else field_t3323.clean_up();
  if (other_value.t3312__ExtendedValue().is_bound()) field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
  else field_t3312__ExtendedValue.clean_up();
  if (other_value.additionalNetworkFeatureSupport().is_bound()) field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
  else field_additionalNetworkFeatureSupport.clean_up();
  if (other_value.t3324().is_bound()) field_t3324 = other_value.t3324();
  else field_t3324.clean_up();
  if (other_value.extendedDRXParameters().is_bound()) field_extendedDRXParameters = other_value.extendedDRXParameters();
  else field_extendedDRXParameters.clean_up();
}
return *this;
}

boolean PDU__GMM__RoutingAreaUpdateAccept::operator==(const PDU__GMM__RoutingAreaUpdateAccept& other_value) const
{
return field_messageType==other_value.field_messageType
  && field_forceToStandby==other_value.field_forceToStandby
  && field_updateResult==other_value.field_updateResult
  && field_raUpdateTimer==other_value.field_raUpdateTimer
  && field_routingAreaId==other_value.field_routingAreaId
  && field_ptmsiSignature==other_value.field_ptmsiSignature
  && field_allocatedPTMSI==other_value.field_allocatedPTMSI
  && field_msIdentity==other_value.field_msIdentity
  && field_receiveNPDUNumbers==other_value.field_receiveNPDUNumbers
  && field_readyTimer==other_value.field_readyTimer
  && field_gmmCause==other_value.field_gmmCause
  && field_t3302==other_value.field_t3302
  && field_cellNotification==other_value.field_cellNotification
  && field_equivalentPLMNs==other_value.field_equivalentPLMNs
  && field_pdpContextStatus==other_value.field_pdpContextStatus
  && field_networkFeatureSupport==other_value.field_networkFeatureSupport
  && field_emergencyNumberList==other_value.field_emergencyNumberList
  && field_mBMS__ContextStatus==other_value.field_mBMS__ContextStatus
  && field_requestedMSInformation==other_value.field_requestedMSInformation
  && field_t3319==other_value.field_t3319
  && field_t3323==other_value.field_t3323
  && field_t3312__ExtendedValue==other_value.field_t3312__ExtendedValue
  && field_additionalNetworkFeatureSupport==other_value.field_additionalNetworkFeatureSupport
  && field_t3324==other_value.field_t3324
  && field_extendedDRXParameters==other_value.field_extendedDRXParameters;
}

boolean PDU__GMM__RoutingAreaUpdateAccept::is_bound() const
{
return (field_messageType.is_bound())
  || (field_forceToStandby.is_bound())
  || (field_updateResult.is_bound())
  || (field_raUpdateTimer.is_bound())
  || (field_routingAreaId.is_bound())
  || (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_bound())
  || (OPTIONAL_OMIT == field_allocatedPTMSI.get_selection() || field_allocatedPTMSI.is_bound())
  || (OPTIONAL_OMIT == field_msIdentity.get_selection() || field_msIdentity.is_bound())
  || (OPTIONAL_OMIT == field_receiveNPDUNumbers.get_selection() || field_receiveNPDUNumbers.is_bound())
  || (OPTIONAL_OMIT == field_readyTimer.get_selection() || field_readyTimer.is_bound())
  || (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_bound())
  || (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_bound())
  || (OPTIONAL_OMIT == field_cellNotification.get_selection() || field_cellNotification.is_bound())
  || (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_bound())
  || (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_networkFeatureSupport.get_selection() || field_networkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_bound())
  || (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_bound())
  || (OPTIONAL_OMIT == field_requestedMSInformation.get_selection() || field_requestedMSInformation.is_bound())
  || (OPTIONAL_OMIT == field_t3319.get_selection() || field_t3319.is_bound())
  || (OPTIONAL_OMIT == field_t3323.get_selection() || field_t3323.is_bound())
  || (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_bound())
  || (OPTIONAL_OMIT == field_additionalNetworkFeatureSupport.get_selection() || field_additionalNetworkFeatureSupport.is_bound())
  || (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_bound())
  || (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_bound());
}
boolean PDU__GMM__RoutingAreaUpdateAccept::is_value() const
{
return field_messageType.is_value()
  && field_forceToStandby.is_value()
  && field_updateResult.is_value()
  && field_raUpdateTimer.is_value()
  && field_routingAreaId.is_value()
  && (OPTIONAL_OMIT == field_ptmsiSignature.get_selection() || field_ptmsiSignature.is_value())
  && (OPTIONAL_OMIT == field_allocatedPTMSI.get_selection() || field_allocatedPTMSI.is_value())
  && (OPTIONAL_OMIT == field_msIdentity.get_selection() || field_msIdentity.is_value())
  && (OPTIONAL_OMIT == field_receiveNPDUNumbers.get_selection() || field_receiveNPDUNumbers.is_value())
  && (OPTIONAL_OMIT == field_readyTimer.get_selection() || field_readyTimer.is_value())
  && (OPTIONAL_OMIT == field_gmmCause.get_selection() || field_gmmCause.is_value())
  && (OPTIONAL_OMIT == field_t3302.get_selection() || field_t3302.is_value())
  && (OPTIONAL_OMIT == field_cellNotification.get_selection() || field_cellNotification.is_value())
  && (OPTIONAL_OMIT == field_equivalentPLMNs.get_selection() || field_equivalentPLMNs.is_value())
  && (OPTIONAL_OMIT == field_pdpContextStatus.get_selection() || field_pdpContextStatus.is_value())
  && (OPTIONAL_OMIT == field_networkFeatureSupport.get_selection() || field_networkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_emergencyNumberList.get_selection() || field_emergencyNumberList.is_value())
  && (OPTIONAL_OMIT == field_mBMS__ContextStatus.get_selection() || field_mBMS__ContextStatus.is_value())
  && (OPTIONAL_OMIT == field_requestedMSInformation.get_selection() || field_requestedMSInformation.is_value())
  && (OPTIONAL_OMIT == field_t3319.get_selection() || field_t3319.is_value())
  && (OPTIONAL_OMIT == field_t3323.get_selection() || field_t3323.is_value())
  && (OPTIONAL_OMIT == field_t3312__ExtendedValue.get_selection() || field_t3312__ExtendedValue.is_value())
  && (OPTIONAL_OMIT == field_additionalNetworkFeatureSupport.get_selection() || field_additionalNetworkFeatureSupport.is_value())
  && (OPTIONAL_OMIT == field_t3324.get_selection() || field_t3324.is_value())
  && (OPTIONAL_OMIT == field_extendedDRXParameters.get_selection() || field_extendedDRXParameters.is_value());
}
int PDU__GMM__RoutingAreaUpdateAccept::size_of() const
{
  int ret_val = 5;
  if (field_ptmsiSignature.ispresent()) ret_val++;
  if (field_allocatedPTMSI.ispresent()) ret_val++;
  if (field_msIdentity.ispresent()) ret_val++;
  if (field_receiveNPDUNumbers.ispresent()) ret_val++;
  if (field_readyTimer.ispresent()) ret_val++;
  if (field_gmmCause.ispresent()) ret_val++;
  if (field_t3302.ispresent()) ret_val++;
  if (field_cellNotification.ispresent()) ret_val++;
  if (field_equivalentPLMNs.ispresent()) ret_val++;
  if (field_pdpContextStatus.ispresent()) ret_val++;
  if (field_networkFeatureSupport.ispresent()) ret_val++;
  if (field_emergencyNumberList.ispresent()) ret_val++;
  if (field_mBMS__ContextStatus.ispresent()) ret_val++;
  if (field_requestedMSInformation.ispresent()) ret_val++;
  if (field_t3319.ispresent()) ret_val++;
  if (field_t3323.ispresent()) ret_val++;
  if (field_t3312__ExtendedValue.ispresent()) ret_val++;
  if (field_additionalNetworkFeatureSupport.ispresent()) ret_val++;
  if (field_t3324.ispresent()) ret_val++;
  if (field_extendedDRXParameters.ispresent()) ret_val++;
  return ret_val;
}

void PDU__GMM__RoutingAreaUpdateAccept::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ messageType := ");
field_messageType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
field_forceToStandby.log();
TTCN_Logger::log_event_str(", updateResult := ");
field_updateResult.log();
TTCN_Logger::log_event_str(", raUpdateTimer := ");
field_raUpdateTimer.log();
TTCN_Logger::log_event_str(", routingAreaId := ");
field_routingAreaId.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", msIdentity := ");
field_msIdentity.log();
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(", readyTimer := ");
field_readyTimer.log();
TTCN_Logger::log_event_str(", gmmCause := ");
field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
field_t3302.log();
TTCN_Logger::log_event_str(", cellNotification := ");
field_cellNotification.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", requestedMSInformation := ");
field_requestedMSInformation.log();
TTCN_Logger::log_event_str(", t3319 := ");
field_t3319.log();
TTCN_Logger::log_event_str(", t3323 := ");
field_t3323.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", t3324 := ");
field_t3324.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
field_extendedDRXParameters.log();
TTCN_Logger::log_event_str(" }");
}

void PDU__GMM__RoutingAreaUpdateAccept::set_implicit_omit()
{
if (messageType().is_bound()) messageType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (updateResult().is_bound()) updateResult().set_implicit_omit();
if (raUpdateTimer().is_bound()) raUpdateTimer().set_implicit_omit();
if (routingAreaId().is_bound()) routingAreaId().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!allocatedPTMSI().is_bound()) allocatedPTMSI() = OMIT_VALUE;
else allocatedPTMSI().set_implicit_omit();
if (!msIdentity().is_bound()) msIdentity() = OMIT_VALUE;
else msIdentity().set_implicit_omit();
if (!receiveNPDUNumbers().is_bound()) receiveNPDUNumbers() = OMIT_VALUE;
else receiveNPDUNumbers().set_implicit_omit();
if (!readyTimer().is_bound()) readyTimer() = OMIT_VALUE;
else readyTimer().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!cellNotification().is_bound()) cellNotification() = OMIT_VALUE;
else cellNotification().set_implicit_omit();
if (!equivalentPLMNs().is_bound()) equivalentPLMNs() = OMIT_VALUE;
else equivalentPLMNs().set_implicit_omit();
if (!pdpContextStatus().is_bound()) pdpContextStatus() = OMIT_VALUE;
else pdpContextStatus().set_implicit_omit();
if (!networkFeatureSupport().is_bound()) networkFeatureSupport() = OMIT_VALUE;
else networkFeatureSupport().set_implicit_omit();
if (!emergencyNumberList().is_bound()) emergencyNumberList() = OMIT_VALUE;
else emergencyNumberList().set_implicit_omit();
if (!mBMS__ContextStatus().is_bound()) mBMS__ContextStatus() = OMIT_VALUE;
else mBMS__ContextStatus().set_implicit_omit();
if (!requestedMSInformation().is_bound()) requestedMSInformation() = OMIT_VALUE;
else requestedMSInformation().set_implicit_omit();
if (!t3319().is_bound()) t3319() = OMIT_VALUE;
else t3319().set_implicit_omit();
if (!t3323().is_bound()) t3323() = OMIT_VALUE;
else t3323().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!additionalNetworkFeatureSupport().is_bound()) additionalNetworkFeatureSupport() = OMIT_VALUE;
else additionalNetworkFeatureSupport().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__RoutingAreaUpdateAccept::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 (25<param.get_size()) {
      param.error("record value of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept has 25 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) updateResult().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) raUpdateTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) routingAreaId().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) msIdentity().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) receiveNPDUNumbers().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) readyTimer().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) cellNotification().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) networkFeatureSupport().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) requestedMSInformation().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) t3319().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) t3323().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupport().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(24));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateResult")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateResult().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "raUpdateTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          raUpdateTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "receiveNPDUNumbers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          receiveNPDUNumbers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellNotification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellNotification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "equivalentPLMNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          equivalentPLMNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedMSInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedMSInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3319")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3319().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3323")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3323().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalNetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
  }
}

void PDU__GMM__RoutingAreaUpdateAccept::encode_text(Text_Buf& text_buf) const
{
field_messageType.encode_text(text_buf);
field_forceToStandby.encode_text(text_buf);
field_updateResult.encode_text(text_buf);
field_raUpdateTimer.encode_text(text_buf);
field_routingAreaId.encode_text(text_buf);
field_ptmsiSignature.encode_text(text_buf);
field_allocatedPTMSI.encode_text(text_buf);
field_msIdentity.encode_text(text_buf);
field_receiveNPDUNumbers.encode_text(text_buf);
field_readyTimer.encode_text(text_buf);
field_gmmCause.encode_text(text_buf);
field_t3302.encode_text(text_buf);
field_cellNotification.encode_text(text_buf);
field_equivalentPLMNs.encode_text(text_buf);
field_pdpContextStatus.encode_text(text_buf);
field_networkFeatureSupport.encode_text(text_buf);
field_emergencyNumberList.encode_text(text_buf);
field_mBMS__ContextStatus.encode_text(text_buf);
field_requestedMSInformation.encode_text(text_buf);
field_t3319.encode_text(text_buf);
field_t3323.encode_text(text_buf);
field_t3312__ExtendedValue.encode_text(text_buf);
field_additionalNetworkFeatureSupport.encode_text(text_buf);
field_t3324.encode_text(text_buf);
field_extendedDRXParameters.encode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateAccept::decode_text(Text_Buf& text_buf)
{
field_messageType.decode_text(text_buf);
field_forceToStandby.decode_text(text_buf);
field_updateResult.decode_text(text_buf);
field_raUpdateTimer.decode_text(text_buf);
field_routingAreaId.decode_text(text_buf);
field_ptmsiSignature.decode_text(text_buf);
field_allocatedPTMSI.decode_text(text_buf);
field_msIdentity.decode_text(text_buf);
field_receiveNPDUNumbers.decode_text(text_buf);
field_readyTimer.decode_text(text_buf);
field_gmmCause.decode_text(text_buf);
field_t3302.decode_text(text_buf);
field_cellNotification.decode_text(text_buf);
field_equivalentPLMNs.decode_text(text_buf);
field_pdpContextStatus.decode_text(text_buf);
field_networkFeatureSupport.decode_text(text_buf);
field_emergencyNumberList.decode_text(text_buf);
field_mBMS__ContextStatus.decode_text(text_buf);
field_requestedMSInformation.decode_text(text_buf);
field_t3319.decode_text(text_buf);
field_t3323.decode_text(text_buf);
field_t3312__ExtendedValue.decode_text(text_buf);
field_additionalNetworkFeatureSupport.decode_text(text_buf);
field_t3324.decode_text(text_buf);
field_extendedDRXParameters.decode_text(text_buf);
}

void PDU__GMM__RoutingAreaUpdateAccept::encode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...) const
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-encoding type '%s': ", p_td.name);
    unsigned BER_coding=va_arg(pvar, unsigned);
    BER_encode_chk_coding(BER_coding);
    ASN_BER_TLV_t *tlv=BER_encode_TLV(p_td, BER_coding);
    tlv->put_in_buffer(p_buf);
    ASN_BER_TLV_t::destruct(tlv);
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-encoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    RAW_enc_tr_pos rp;
    rp.level=0;
    rp.pos=NULL;
    RAW_enc_tree root(FALSE, NULL, &rp, 1, p_td.raw);
    RAW_encode(p_td, root);
    root.put_to_buf(p_buf);
    break;}
  case TTCN_EncDec::CT_TEXT: {
    TTCN_EncDec_ErrorContext ec("While TEXT-encoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
      ("No TEXT descriptor available for type '%s'.", p_td.name);
    TEXT_encode(p_td,p_buf);
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-encoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XER_encode(*(p_td.xer),p_buf, XER_coding, 0, 0, 0);
    p_buf.put_c('\n');
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-encoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok(va_arg(pvar, int) != 0);
    JSON_encode(p_td, tok, FALSE);
    p_buf.put_s(tok.get_buffer_length(), (const unsigned char*)tok.get_buffer());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-encoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
    OER_encode(p_td, p_buf);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-encoding type '%s': ", p_td.name);
    if (!p_td.per) TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    PER_encode(p_td, p_buf, opt);
    break; }
  default:
    TTCN_error("Unknown coding method requested to encode type '%s'", p_td.name);
  }
  va_end(pvar);
}

void PDU__GMM__RoutingAreaUpdateAccept::decode(const TTCN_Typedescriptor_t& p_td, TTCN_Buffer& p_buf, int p_coding, ...)
{
  va_list pvar;
  va_start(pvar, p_coding);
  switch(p_coding) {
  case TTCN_EncDec::CT_BER: {
    TTCN_EncDec_ErrorContext ec("While BER-decoding type '%s': ", p_td.name);
    unsigned L_form=va_arg(pvar, unsigned);
    ASN_BER_TLV_t tlv;
    BER_decode_str2TLV(p_buf, tlv, L_form);
    BER_decode_TLV(p_td, tlv, L_form);
    if(tlv.isComplete) p_buf.increase_pos(tlv.get_len());
    break;}
  case TTCN_EncDec::CT_RAW: {
    TTCN_EncDec_ErrorContext ec("While RAW-decoding type '%s': ", p_td.name);
    if(!p_td.raw)
      TTCN_EncDec_ErrorContext::error_internal
        ("No RAW descriptor available for type '%s'.", p_td.name);
    raw_order_t r_order;
    switch(p_td.raw->top_bit_order) {
    case TOP_BIT_LEFT:
      r_order=ORDER_LSB;
      break;
    case TOP_BIT_RIGHT:
    default:
      r_order=ORDER_MSB;
    }
    int rawr = RAW_decode(p_td, p_buf, p_buf.get_len()*8, r_order);
    if(rawr<0) switch (-rawr) {
    case TTCN_EncDec::ET_INCOMPL_MSG:
    case TTCN_EncDec::ET_LEN_ERR:
      ec.error((TTCN_EncDec::error_type_t)-rawr, "Can not decode type '%s', because incomplete message was received", p_td.name);
      break;
    case 1:
    default:
      ec.error(TTCN_EncDec::ET_INVAL_MSG, "Can not decode type '%s', because invalid message was received", p_td.name);
      break;
    }
    break;}
  case TTCN_EncDec::CT_TEXT: {
    Limit_Token_List limit;
    TTCN_EncDec_ErrorContext ec("While TEXT-decoding type '%s': ", p_td.name);
    if(!p_td.text)
      TTCN_EncDec_ErrorContext::error_internal
        ("No TEXT descriptor available for type '%s'.", p_td.name);
    const unsigned char *b_data=p_buf.get_data();
    int null_added=0;
    if(b_data[p_buf.get_len()-1]!='\0'){
      null_added=1;
      p_buf.set_pos(p_buf.get_len());
      p_buf.put_zero(8,ORDER_LSB);
      p_buf.rewind();
    }
    if(TEXT_decode(p_td,p_buf,limit)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    if(null_added){
      size_t actpos=p_buf.get_pos();
      p_buf.set_pos(p_buf.get_len()-1);
      p_buf.cut_end();
      p_buf.set_pos(actpos);
    }
    break;}
  case TTCN_EncDec::CT_XER: {
    TTCN_EncDec_ErrorContext ec("While XER-decoding type '%s': ", p_td.name);
    unsigned XER_coding=va_arg(pvar, unsigned);
    XER_encode_chk_coding(XER_coding, p_td);
    XmlReaderWrap reader(p_buf);
    for (int rd_ok=reader.Read(); rd_ok==1; rd_ok=reader.Read()) {
      if (reader.NodeType() == XML_READER_TYPE_ELEMENT) break;
    }
    XER_decode(*(p_td.xer), reader, XER_coding | XER_TOPLEVEL, XER_NONE, 0);
    size_t bytes = reader.ByteConsumed();
    p_buf.set_pos(bytes);
    break;}
  case TTCN_EncDec::CT_JSON: {
    TTCN_EncDec_ErrorContext ec("While JSON-decoding type '%s': ", p_td.name);
    if(!p_td.json)
      TTCN_EncDec_ErrorContext::error_internal
        ("No JSON descriptor available for type '%s'.", p_td.name);
    JSON_Tokenizer tok((const char*)p_buf.get_data(), p_buf.get_len());
    if(JSON_decode(p_td, tok, FALSE, FALSE)<0)
      ec.error(TTCN_EncDec::ET_INCOMPL_MSG,"Can not decode type '%s', because invalid or incomplete message was received", p_td.name);
    p_buf.set_pos(tok.get_buf_pos());
    break;}
  case TTCN_EncDec::CT_OER: {
    TTCN_EncDec_ErrorContext ec("While OER-decoding type '%s': ", p_td.name);
    if(!p_td.oer)
      TTCN_EncDec_ErrorContext::error_internal
        ("No OER descriptor available for type '%s'.", p_td.name);
     OER_struct p_oer;
    OER_decode(p_td, p_buf, p_oer);
    break;}
  case TTCN_EncDec::CT_PER: {
    TTCN_EncDec_ErrorContext ec("While PER-decoding type '%s': ", p_td.name);
    if(!p_td.per)  TTCN_EncDec_ErrorContext::error_internal(
      "No PER descriptor available for type '%s'.", p_td.name);
    int opt = va_arg(pvar, int);
    try {
      PER_decode(p_td, p_buf, opt);
      p_buf.PER_octet_align(FALSE);
    }
    catch (PER_Buffer_Exception) { }
    break; }
  default:
    TTCN_error("Unknown coding method requested to decode type '%s'", p_td.name);
  }
  va_end(pvar);
}

int PDU__GMM__RoutingAreaUpdateAccept::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::BIT8_descr_.raw->forceomit);
  decoded_field_length = field_messageType.RAW_decode(General__Types::BIT8_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, ForceToStandbyV_descr_.raw->forceomit);
  decoded_field_length = field_forceToStandby.RAW_decode(ForceToStandbyV_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, UpdateResultV_descr_.raw->forceomit);
  decoded_field_length = field_updateResult.RAW_decode(UpdateResultV_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, GPRSTimerV_descr_.raw->forceomit);
  decoded_field_length = field_raUpdateTimer.RAW_decode(GPRSTimerV_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, RoutingAreaIdentificationV_descr_.raw->forceomit);
  decoded_field_length = field_routingAreaId.RAW_decode(RoutingAreaIdentificationV_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){
  if (force_omit != NULL && (*force_omit)(5)) {
    field_ptmsiSignature = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_5_force_omit(5, force_omit, P__TMSISignatureTV_descr_.raw->forceomit);
  decoded_field_length = field_ptmsiSignature().RAW_decode(P__TMSISignatureTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_5_force_omit);
  if (decoded_field_length < 1) {
  field_ptmsiSignature = 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_ptmsiSignature=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(6)) {
    field_allocatedPTMSI = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_6_force_omit(6, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_allocatedPTMSI().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_6_force_omit);
  if (decoded_field_length < 1) {
  field_allocatedPTMSI = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_allocatedPTMSI.ispresent() || field_allocatedPTMSI().elementIdentifier() !=  bs_26){
  field_allocatedPTMSI=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_allocatedPTMSI=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(7)) {
    field_msIdentity = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_7_force_omit(7, force_omit, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw->forceomit);
  decoded_field_length = field_msIdentity().RAW_decode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_7_force_omit);
  if (decoded_field_length < 1) {
  field_msIdentity = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_msIdentity.ispresent() || field_msIdentity().elementIdentifier() !=  bs_27){
  field_msIdentity=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_msIdentity=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(8)) {
    field_receiveNPDUNumbers = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_8_force_omit(8, force_omit, ReceiveNPDUNumbersListTLV_descr_.raw->forceomit);
  decoded_field_length = field_receiveNPDUNumbers().RAW_decode(ReceiveNPDUNumbersListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_8_force_omit);
  if (decoded_field_length < 1) {
  field_receiveNPDUNumbers = 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_receiveNPDUNumbers=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(9)) {
    field_readyTimer = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_9_force_omit(9, force_omit, GPRSTimerTV_descr_.raw->forceomit);
  decoded_field_length = field_readyTimer().RAW_decode(GPRSTimerTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_9_force_omit);
  if (decoded_field_length < 1) {
  field_readyTimer = 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_readyTimer=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(10)) {
    field_gmmCause = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_10_force_omit(10, force_omit, GMM__CauseTV_descr_.raw->forceomit);
  decoded_field_length = field_gmmCause().RAW_decode(GMM__CauseTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_10_force_omit);
  if (decoded_field_length < 1) {
  field_gmmCause = 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_gmmCause=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(11)) {
    field_t3302 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_11_force_omit(11, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3302().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_11_force_omit);
  if (decoded_field_length < 1) {
  field_t3302 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32){
  field_t3302=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_t3302=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(12)) {
    field_cellNotification = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_12_force_omit(12, force_omit, CellNotificationT_descr_.raw->forceomit);
  decoded_field_length = field_cellNotification().RAW_decode(CellNotificationT_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_12_force_omit);
  if (decoded_field_length < 1) {
  field_cellNotification = 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_cellNotification=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(13)) {
    field_equivalentPLMNs = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_13_force_omit(13, force_omit, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw->forceomit);
  decoded_field_length = field_equivalentPLMNs().RAW_decode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_13_force_omit);
  if (decoded_field_length < 1) {
  field_equivalentPLMNs = 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_equivalentPLMNs=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(14)) {
    field_pdpContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_14_force_omit(14, force_omit, PDPContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_pdpContextStatus().RAW_decode(PDPContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_14_force_omit);
  if (decoded_field_length < 1) {
  field_pdpContextStatus = 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_pdpContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(15)) {
    field_networkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_15_force_omit(15, force_omit, NetworkFeatureSupportTV_descr_.raw->forceomit);
  decoded_field_length = field_networkFeatureSupport().RAW_decode(NetworkFeatureSupportTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_15_force_omit);
  if (decoded_field_length < 1) {
  field_networkFeatureSupport = 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_networkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(16)) {
    field_emergencyNumberList = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_16_force_omit(16, force_omit, MobileL3__MM__Types::EmergencyNumberListTLV_descr_.raw->forceomit);
  decoded_field_length = field_emergencyNumberList().RAW_decode(MobileL3__MM__Types::EmergencyNumberListTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_16_force_omit);
  if (decoded_field_length < 1) {
  field_emergencyNumberList = 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_emergencyNumberList=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(17)) {
    field_mBMS__ContextStatus = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_17_force_omit(17, force_omit, MBMS__ContextStatusTLV_descr_.raw->forceomit);
  decoded_field_length = field_mBMS__ContextStatus().RAW_decode(MBMS__ContextStatusTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_17_force_omit);
  if (decoded_field_length < 1) {
  field_mBMS__ContextStatus = 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_mBMS__ContextStatus=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(18)) {
    field_requestedMSInformation = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_18_force_omit(18, force_omit, RequestedMSInformationTV_descr_.raw->forceomit);
  decoded_field_length = field_requestedMSInformation().RAW_decode(RequestedMSInformationTV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_18_force_omit);
  if (decoded_field_length < 1) {
  field_requestedMSInformation = 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_requestedMSInformation=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(19)) {
    field_t3319 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_19_force_omit(19, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3319().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_19_force_omit);
  if (decoded_field_length < 1) {
  field_t3319 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3319.ispresent() || field_t3319().elementIdentifier() !=  os_33){
  field_t3319=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_t3319=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(20)) {
    field_t3323 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_20_force_omit(20, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3323().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_20_force_omit);
  if (decoded_field_length < 1) {
  field_t3323 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3323.ispresent() || field_t3323().elementIdentifier() !=  os_34){
  field_t3323=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_t3323=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(21)) {
    field_t3312__ExtendedValue = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_21_force_omit(21, force_omit, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3312__ExtendedValue().RAW_decode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_21_force_omit);
  if (decoded_field_length < 1) {
  field_t3312__ExtendedValue = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17){
  field_t3312__ExtendedValue=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_t3312__ExtendedValue=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(22)) {
    field_additionalNetworkFeatureSupport = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_22_force_omit(22, force_omit, AdditionalNetworkFeatureSupportTLV_descr_.raw->forceomit);
  decoded_field_length = field_additionalNetworkFeatureSupport().RAW_decode(AdditionalNetworkFeatureSupportTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_22_force_omit);
  if (decoded_field_length < 1) {
  field_additionalNetworkFeatureSupport = 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_additionalNetworkFeatureSupport=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(23)) {
    field_t3324 = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_23_force_omit(23, force_omit, GPRSTimer2TLV_descr_.raw->forceomit);
  decoded_field_length = field_t3324().RAW_decode(GPRSTimer2TLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_23_force_omit);
  if (decoded_field_length < 1) {
  field_t3324 = OMIT_VALUE;
  p_buf.set_pos_bit(fl_start_pos);
  } else {
       if(!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31){
  field_t3324=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_t3324=OMIT_VALUE;
  if (limit > 0){
  if (force_omit != NULL && (*force_omit)(24)) {
    field_extendedDRXParameters = OMIT_VALUE;
  }
  else {
  size_t fl_start_pos = p_buf.get_pos_bit();
  RAW_Force_Omit field_24_force_omit(24, force_omit, ExtendedDRXParametersTLV_descr_.raw->forceomit);
  decoded_field_length = field_extendedDRXParameters().RAW_decode(ExtendedDRXParametersTLV_descr_, p_buf, limit, local_top_order, TRUE, -1, TRUE, &field_24_force_omit);
  if (decoded_field_length < 1) {
  field_extendedDRXParameters = 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_extendedDRXParameters=OMIT_VALUE;
  if (field_messageType !=  bs_41) 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__GMM__RoutingAreaUpdateAccept::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 = 25;
  myleaf.body.node.nodes = init_nodes_of_enc_tree(25);
  myleaf.body.node.nodes[0] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 0, General__Types::BIT8_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, ForceToStandbyV_descr_.raw);
  myleaf.body.node.nodes[2] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 2, UpdateResultV_descr_.raw);
  myleaf.body.node.nodes[3] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 3, GPRSTimerV_descr_.raw);
  myleaf.body.node.nodes[4] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 4, RoutingAreaIdentificationV_descr_.raw);
  if (field_ptmsiSignature.ispresent()) {
  myleaf.body.node.nodes[5] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 5, P__TMSISignatureTV_descr_.raw);
  }
  else myleaf.body.node.nodes[5] = NULL;
  if (field_allocatedPTMSI.ispresent()) {
  myleaf.body.node.nodes[6] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 6, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[6] = NULL;
  if (field_msIdentity.ispresent()) {
  myleaf.body.node.nodes[7] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 7, MobileL3__CommonIE__Types::MobileIdentityTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[7] = NULL;
  if (field_receiveNPDUNumbers.ispresent()) {
  myleaf.body.node.nodes[8] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 8, ReceiveNPDUNumbersListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[8] = NULL;
  if (field_readyTimer.ispresent()) {
  myleaf.body.node.nodes[9] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 9, GPRSTimerTV_descr_.raw);
  }
  else myleaf.body.node.nodes[9] = NULL;
  if (field_gmmCause.ispresent()) {
  myleaf.body.node.nodes[10] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 10, GMM__CauseTV_descr_.raw);
  }
  else myleaf.body.node.nodes[10] = NULL;
  if (field_t3302.ispresent()) {
  myleaf.body.node.nodes[11] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 11, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[11] = NULL;
  if (field_cellNotification.ispresent()) {
  myleaf.body.node.nodes[12] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 12, CellNotificationT_descr_.raw);
  }
  else myleaf.body.node.nodes[12] = NULL;
  if (field_equivalentPLMNs.ispresent()) {
  myleaf.body.node.nodes[13] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 13, MobileL3__CommonIE__Types::PLMNListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[13] = NULL;
  if (field_pdpContextStatus.ispresent()) {
  myleaf.body.node.nodes[14] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 14, PDPContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[14] = NULL;
  if (field_networkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[15] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 15, NetworkFeatureSupportTV_descr_.raw);
  }
  else myleaf.body.node.nodes[15] = NULL;
  if (field_emergencyNumberList.ispresent()) {
  myleaf.body.node.nodes[16] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 16, MobileL3__MM__Types::EmergencyNumberListTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[16] = NULL;
  if (field_mBMS__ContextStatus.ispresent()) {
  myleaf.body.node.nodes[17] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 17, MBMS__ContextStatusTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[17] = NULL;
  if (field_requestedMSInformation.ispresent()) {
  myleaf.body.node.nodes[18] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 18, RequestedMSInformationTV_descr_.raw);
  }
  else myleaf.body.node.nodes[18] = NULL;
  if (field_t3319.ispresent()) {
  myleaf.body.node.nodes[19] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 19, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[19] = NULL;
  if (field_t3323.ispresent()) {
  myleaf.body.node.nodes[20] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 20, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[20] = NULL;
  if (field_t3312__ExtendedValue.ispresent()) {
  myleaf.body.node.nodes[21] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 21, MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[21] = NULL;
  if (field_additionalNetworkFeatureSupport.ispresent()) {
  myleaf.body.node.nodes[22] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 22, AdditionalNetworkFeatureSupportTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[22] = NULL;
  if (field_t3324.ispresent()) {
  myleaf.body.node.nodes[23] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 23, GPRSTimer2TLV_descr_.raw);
  }
  else myleaf.body.node.nodes[23] = NULL;
  if (field_extendedDRXParameters.ispresent()) {
  myleaf.body.node.nodes[24] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 24, ExtendedDRXParametersTLV_descr_.raw);
  }
  else myleaf.body.node.nodes[24] = NULL;
  encoded_length += field_messageType.RAW_encode(General__Types::BIT8_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_forceToStandby.RAW_encode(ForceToStandbyV_descr_, *myleaf.body.node.nodes[1]);
  encoded_length += field_updateResult.RAW_encode(UpdateResultV_descr_, *myleaf.body.node.nodes[2]);
  encoded_length += field_raUpdateTimer.RAW_encode(GPRSTimerV_descr_, *myleaf.body.node.nodes[3]);
  encoded_length += field_routingAreaId.RAW_encode(RoutingAreaIdentificationV_descr_, *myleaf.body.node.nodes[4]);
  if (field_ptmsiSignature.ispresent()) {
  encoded_length += field_ptmsiSignature().RAW_encode(P__TMSISignatureTV_descr_, *myleaf.body.node.nodes[5]);
  }
  if (field_allocatedPTMSI.ispresent()) {
  encoded_length += field_allocatedPTMSI().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[6]);
  }
  if (field_msIdentity.ispresent()) {
  encoded_length += field_msIdentity().RAW_encode(MobileL3__CommonIE__Types::MobileIdentityTLV_descr_, *myleaf.body.node.nodes[7]);
  }
  if (field_receiveNPDUNumbers.ispresent()) {
  encoded_length += field_receiveNPDUNumbers().RAW_encode(ReceiveNPDUNumbersListTLV_descr_, *myleaf.body.node.nodes[8]);
  }
  if (field_readyTimer.ispresent()) {
  encoded_length += field_readyTimer().RAW_encode(GPRSTimerTV_descr_, *myleaf.body.node.nodes[9]);
  }
  if (field_gmmCause.ispresent()) {
  encoded_length += field_gmmCause().RAW_encode(GMM__CauseTV_descr_, *myleaf.body.node.nodes[10]);
  }
  if (field_t3302.ispresent()) {
  encoded_length += field_t3302().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[11]);
  }
  if (field_cellNotification.ispresent()) {
  encoded_length += field_cellNotification().RAW_encode(CellNotificationT_descr_, *myleaf.body.node.nodes[12]);
  }
  if (field_equivalentPLMNs.ispresent()) {
  encoded_length += field_equivalentPLMNs().RAW_encode(MobileL3__CommonIE__Types::PLMNListTLV_descr_, *myleaf.body.node.nodes[13]);
  }
  if (field_pdpContextStatus.ispresent()) {
  encoded_length += field_pdpContextStatus().RAW_encode(PDPContextStatusTLV_descr_, *myleaf.body.node.nodes[14]);
  }
  if (field_networkFeatureSupport.ispresent()) {
  encoded_length += field_networkFeatureSupport().RAW_encode(NetworkFeatureSupportTV_descr_, *myleaf.body.node.nodes[15]);
  }
  if (field_emergencyNumberList.ispresent()) {
  encoded_length += field_emergencyNumberList().RAW_encode(MobileL3__MM__Types::EmergencyNumberListTLV_descr_, *myleaf.body.node.nodes[16]);
  }
  if (field_mBMS__ContextStatus.ispresent()) {
  encoded_length += field_mBMS__ContextStatus().RAW_encode(MBMS__ContextStatusTLV_descr_, *myleaf.body.node.nodes[17]);
  }
  if (field_requestedMSInformation.ispresent()) {
  encoded_length += field_requestedMSInformation().RAW_encode(RequestedMSInformationTV_descr_, *myleaf.body.node.nodes[18]);
  }
  if (field_t3319.ispresent()) {
  encoded_length += field_t3319().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[19]);
  }
  if (field_t3323.ispresent()) {
  encoded_length += field_t3323().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[20]);
  }
  if (field_t3312__ExtendedValue.ispresent()) {
  encoded_length += field_t3312__ExtendedValue().RAW_encode(MobileL3__CommonIE__Types::GPRSTimer3TLV_descr_, *myleaf.body.node.nodes[21]);
  }
  if (field_additionalNetworkFeatureSupport.ispresent()) {
  encoded_length += field_additionalNetworkFeatureSupport().RAW_encode(AdditionalNetworkFeatureSupportTLV_descr_, *myleaf.body.node.nodes[22]);
  }
  if (field_t3324.ispresent()) {
  encoded_length += field_t3324().RAW_encode(GPRSTimer2TLV_descr_, *myleaf.body.node.nodes[23]);
  }
  if (field_extendedDRXParameters.ispresent()) {
  encoded_length += field_extendedDRXParameters().RAW_encode(ExtendedDRXParametersTLV_descr_, *myleaf.body.node.nodes[24]);
  }
  if (field_allocatedPTMSI.ispresent() && (!field_allocatedPTMSI.ispresent() || field_allocatedPTMSI().elementIdentifier() !=  bs_26)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={6,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_26.RAW_encode(General__Types::BIT7_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_msIdentity.ispresent() && (!field_msIdentity.ispresent() || field_msIdentity().elementIdentifier() !=  bs_27)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={7,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   bs_27.RAW_encode(General__Types::BIT7_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_t3302.ispresent() && (!field_t3302.ispresent() || field_t3302().elementIdentifier() !=  os_32)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={11,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_32.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);
  }
  }
  if (field_t3319.ispresent() && (!field_t3319.ispresent() || field_t3319().elementIdentifier() !=  os_33)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={19,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_33.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);
  }
  }
  if (field_t3323.ispresent() && (!field_t3323.ispresent() || field_t3323().elementIdentifier() !=  os_34)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={20,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_34.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);
  }
  }
  if (field_t3312__ExtendedValue.ispresent() && (!field_t3312__ExtendedValue.ispresent() || field_t3312__ExtendedValue().elementIdentifier() !=  os_17)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={21,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_17.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);
  }
  }
  if (field_t3324.ispresent() && (!field_t3324.ispresent() || field_t3324().elementIdentifier() !=  os_31)) {
  RAW_enc_tree* temp_leaf;
  {
  RAW_enc_tr_pos pr_pos0;
  pr_pos0.level=myleaf.curr_pos.level+2;
  int new_pos0[]={23,0};
  pr_pos0.pos=init_new_tree_pos(myleaf.curr_pos,2,new_pos0);
  temp_leaf = myleaf.get_node(pr_pos0);
  if(temp_leaf != NULL){
   os_31.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);
  }
  }
  if (field_messageType !=  bs_41) {
  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_41.RAW_encode(General__Types::BIT8_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__GMM__RoutingAreaUpdateAccept_template::single_value_struct {
BITSTRING_template field_messageType;
ForceToStandbyV_template field_forceToStandby;
UpdateResultV_template field_updateResult;
GPRSTimerV_template field_raUpdateTimer;
RoutingAreaIdentificationV_template field_routingAreaId;
P__TMSISignatureTV_template field_ptmsiSignature;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_allocatedPTMSI;
MobileL3__CommonIE__Types::MobileIdentityTLV_template field_msIdentity;
ReceiveNPDUNumbersListTLV_template field_receiveNPDUNumbers;
GPRSTimerTV_template field_readyTimer;
GMM__CauseTV_template field_gmmCause;
GPRSTimer2TLV_template field_t3302;
CellNotificationT_template field_cellNotification;
MobileL3__CommonIE__Types::PLMNListTLV_template field_equivalentPLMNs;
PDPContextStatusTLV_template field_pdpContextStatus;
NetworkFeatureSupportTV_template field_networkFeatureSupport;
MobileL3__MM__Types::EmergencyNumberListTLV_template field_emergencyNumberList;
MBMS__ContextStatusTLV_template field_mBMS__ContextStatus;
RequestedMSInformationTV_template field_requestedMSInformation;
GPRSTimer2TLV_template field_t3319;
GPRSTimer2TLV_template field_t3323;
MobileL3__CommonIE__Types::GPRSTimer3TLV_template field_t3312__ExtendedValue;
AdditionalNetworkFeatureSupportTLV_template field_additionalNetworkFeatureSupport;
GPRSTimer2TLV_template field_t3324;
ExtendedDRXParametersTLV_template field_extendedDRXParameters;
};

void PDU__GMM__RoutingAreaUpdateAccept_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_messageType = ANY_VALUE;
single_value->field_forceToStandby = ANY_VALUE;
single_value->field_updateResult = ANY_VALUE;
single_value->field_raUpdateTimer = ANY_VALUE;
single_value->field_routingAreaId = ANY_VALUE;
single_value->field_ptmsiSignature = ANY_OR_OMIT;
single_value->field_allocatedPTMSI = ANY_OR_OMIT;
single_value->field_msIdentity = ANY_OR_OMIT;
single_value->field_receiveNPDUNumbers = ANY_OR_OMIT;
single_value->field_readyTimer = ANY_OR_OMIT;
single_value->field_gmmCause = ANY_OR_OMIT;
single_value->field_t3302 = ANY_OR_OMIT;
single_value->field_cellNotification = ANY_OR_OMIT;
single_value->field_equivalentPLMNs = ANY_OR_OMIT;
single_value->field_pdpContextStatus = ANY_OR_OMIT;
single_value->field_networkFeatureSupport = ANY_OR_OMIT;
single_value->field_emergencyNumberList = ANY_OR_OMIT;
single_value->field_mBMS__ContextStatus = ANY_OR_OMIT;
single_value->field_requestedMSInformation = ANY_OR_OMIT;
single_value->field_t3319 = ANY_OR_OMIT;
single_value->field_t3323 = ANY_OR_OMIT;
single_value->field_t3312__ExtendedValue = ANY_OR_OMIT;
single_value->field_additionalNetworkFeatureSupport = ANY_OR_OMIT;
single_value->field_t3324 = ANY_OR_OMIT;
single_value->field_extendedDRXParameters = ANY_OR_OMIT;
}
}
}

void PDU__GMM__RoutingAreaUpdateAccept_template::copy_value(const PDU__GMM__RoutingAreaUpdateAccept& other_value)
{
single_value = new single_value_struct;
if (other_value.messageType().is_bound()) {
  single_value->field_messageType = other_value.messageType();
} else {
  single_value->field_messageType.clean_up();
}
if (other_value.forceToStandby().is_bound()) {
  single_value->field_forceToStandby = other_value.forceToStandby();
} else {
  single_value->field_forceToStandby.clean_up();
}
if (other_value.updateResult().is_bound()) {
  single_value->field_updateResult = other_value.updateResult();
} else {
  single_value->field_updateResult.clean_up();
}
if (other_value.raUpdateTimer().is_bound()) {
  single_value->field_raUpdateTimer = other_value.raUpdateTimer();
} else {
  single_value->field_raUpdateTimer.clean_up();
}
if (other_value.routingAreaId().is_bound()) {
  single_value->field_routingAreaId = other_value.routingAreaId();
} else {
  single_value->field_routingAreaId.clean_up();
}
if (other_value.ptmsiSignature().is_bound()) {
  if (other_value.ptmsiSignature().ispresent()) single_value->field_ptmsiSignature = other_value.ptmsiSignature()();
  else single_value->field_ptmsiSignature = OMIT_VALUE;
} else {
  single_value->field_ptmsiSignature.clean_up();
}
if (other_value.allocatedPTMSI().is_bound()) {
  if (other_value.allocatedPTMSI().ispresent()) single_value->field_allocatedPTMSI = other_value.allocatedPTMSI()();
  else single_value->field_allocatedPTMSI = OMIT_VALUE;
} else {
  single_value->field_allocatedPTMSI.clean_up();
}
if (other_value.msIdentity().is_bound()) {
  if (other_value.msIdentity().ispresent()) single_value->field_msIdentity = other_value.msIdentity()();
  else single_value->field_msIdentity = OMIT_VALUE;
} else {
  single_value->field_msIdentity.clean_up();
}
if (other_value.receiveNPDUNumbers().is_bound()) {
  if (other_value.receiveNPDUNumbers().ispresent()) single_value->field_receiveNPDUNumbers = other_value.receiveNPDUNumbers()();
  else single_value->field_receiveNPDUNumbers = OMIT_VALUE;
} else {
  single_value->field_receiveNPDUNumbers.clean_up();
}
if (other_value.readyTimer().is_bound()) {
  if (other_value.readyTimer().ispresent()) single_value->field_readyTimer = other_value.readyTimer()();
  else single_value->field_readyTimer = OMIT_VALUE;
} else {
  single_value->field_readyTimer.clean_up();
}
if (other_value.gmmCause().is_bound()) {
  if (other_value.gmmCause().ispresent()) single_value->field_gmmCause = other_value.gmmCause()();
  else single_value->field_gmmCause = OMIT_VALUE;
} else {
  single_value->field_gmmCause.clean_up();
}
if (other_value.t3302().is_bound()) {
  if (other_value.t3302().ispresent()) single_value->field_t3302 = other_value.t3302()();
  else single_value->field_t3302 = OMIT_VALUE;
} else {
  single_value->field_t3302.clean_up();
}
if (other_value.cellNotification().is_bound()) {
  if (other_value.cellNotification().ispresent()) single_value->field_cellNotification = other_value.cellNotification()();
  else single_value->field_cellNotification = OMIT_VALUE;
} else {
  single_value->field_cellNotification.clean_up();
}
if (other_value.equivalentPLMNs().is_bound()) {
  if (other_value.equivalentPLMNs().ispresent()) single_value->field_equivalentPLMNs = other_value.equivalentPLMNs()();
  else single_value->field_equivalentPLMNs = OMIT_VALUE;
} else {
  single_value->field_equivalentPLMNs.clean_up();
}
if (other_value.pdpContextStatus().is_bound()) {
  if (other_value.pdpContextStatus().ispresent()) single_value->field_pdpContextStatus = other_value.pdpContextStatus()();
  else single_value->field_pdpContextStatus = OMIT_VALUE;
} else {
  single_value->field_pdpContextStatus.clean_up();
}
if (other_value.networkFeatureSupport().is_bound()) {
  if (other_value.networkFeatureSupport().ispresent()) single_value->field_networkFeatureSupport = other_value.networkFeatureSupport()();
  else single_value->field_networkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_networkFeatureSupport.clean_up();
}
if (other_value.emergencyNumberList().is_bound()) {
  if (other_value.emergencyNumberList().ispresent()) single_value->field_emergencyNumberList = other_value.emergencyNumberList()();
  else single_value->field_emergencyNumberList = OMIT_VALUE;
} else {
  single_value->field_emergencyNumberList.clean_up();
}
if (other_value.mBMS__ContextStatus().is_bound()) {
  if (other_value.mBMS__ContextStatus().ispresent()) single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus()();
  else single_value->field_mBMS__ContextStatus = OMIT_VALUE;
} else {
  single_value->field_mBMS__ContextStatus.clean_up();
}
if (other_value.requestedMSInformation().is_bound()) {
  if (other_value.requestedMSInformation().ispresent()) single_value->field_requestedMSInformation = other_value.requestedMSInformation()();
  else single_value->field_requestedMSInformation = OMIT_VALUE;
} else {
  single_value->field_requestedMSInformation.clean_up();
}
if (other_value.t3319().is_bound()) {
  if (other_value.t3319().ispresent()) single_value->field_t3319 = other_value.t3319()();
  else single_value->field_t3319 = OMIT_VALUE;
} else {
  single_value->field_t3319.clean_up();
}
if (other_value.t3323().is_bound()) {
  if (other_value.t3323().ispresent()) single_value->field_t3323 = other_value.t3323()();
  else single_value->field_t3323 = OMIT_VALUE;
} else {
  single_value->field_t3323.clean_up();
}
if (other_value.t3312__ExtendedValue().is_bound()) {
  if (other_value.t3312__ExtendedValue().ispresent()) single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue()();
  else single_value->field_t3312__ExtendedValue = OMIT_VALUE;
} else {
  single_value->field_t3312__ExtendedValue.clean_up();
}
if (other_value.additionalNetworkFeatureSupport().is_bound()) {
  if (other_value.additionalNetworkFeatureSupport().ispresent()) single_value->field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport()();
  else single_value->field_additionalNetworkFeatureSupport = OMIT_VALUE;
} else {
  single_value->field_additionalNetworkFeatureSupport.clean_up();
}
if (other_value.t3324().is_bound()) {
  if (other_value.t3324().ispresent()) single_value->field_t3324 = other_value.t3324()();
  else single_value->field_t3324 = OMIT_VALUE;
} else {
  single_value->field_t3324.clean_up();
}
if (other_value.extendedDRXParameters().is_bound()) {
  if (other_value.extendedDRXParameters().ispresent()) single_value->field_extendedDRXParameters = other_value.extendedDRXParameters()();
  else single_value->field_extendedDRXParameters = OMIT_VALUE;
} else {
  single_value->field_extendedDRXParameters.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PDU__GMM__RoutingAreaUpdateAccept_template::copy_template(const PDU__GMM__RoutingAreaUpdateAccept_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.messageType().get_selection()) {
single_value->field_messageType = other_value.messageType();
} else {
single_value->field_messageType.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.forceToStandby().get_selection()) {
single_value->field_forceToStandby = other_value.forceToStandby();
} else {
single_value->field_forceToStandby.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.updateResult().get_selection()) {
single_value->field_updateResult = other_value.updateResult();
} else {
single_value->field_updateResult.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.raUpdateTimer().get_selection()) {
single_value->field_raUpdateTimer = other_value.raUpdateTimer();
} else {
single_value->field_raUpdateTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.routingAreaId().get_selection()) {
single_value->field_routingAreaId = other_value.routingAreaId();
} else {
single_value->field_routingAreaId.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ptmsiSignature().get_selection()) {
single_value->field_ptmsiSignature = other_value.ptmsiSignature();
} else {
single_value->field_ptmsiSignature.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.allocatedPTMSI().get_selection()) {
single_value->field_allocatedPTMSI = other_value.allocatedPTMSI();
} else {
single_value->field_allocatedPTMSI.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.msIdentity().get_selection()) {
single_value->field_msIdentity = other_value.msIdentity();
} else {
single_value->field_msIdentity.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.receiveNPDUNumbers().get_selection()) {
single_value->field_receiveNPDUNumbers = other_value.receiveNPDUNumbers();
} else {
single_value->field_receiveNPDUNumbers.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.readyTimer().get_selection()) {
single_value->field_readyTimer = other_value.readyTimer();
} else {
single_value->field_readyTimer.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.gmmCause().get_selection()) {
single_value->field_gmmCause = other_value.gmmCause();
} else {
single_value->field_gmmCause.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3302().get_selection()) {
single_value->field_t3302 = other_value.t3302();
} else {
single_value->field_t3302.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cellNotification().get_selection()) {
single_value->field_cellNotification = other_value.cellNotification();
} else {
single_value->field_cellNotification.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.equivalentPLMNs().get_selection()) {
single_value->field_equivalentPLMNs = other_value.equivalentPLMNs();
} else {
single_value->field_equivalentPLMNs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.pdpContextStatus().get_selection()) {
single_value->field_pdpContextStatus = other_value.pdpContextStatus();
} else {
single_value->field_pdpContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.networkFeatureSupport().get_selection()) {
single_value->field_networkFeatureSupport = other_value.networkFeatureSupport();
} else {
single_value->field_networkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.emergencyNumberList().get_selection()) {
single_value->field_emergencyNumberList = other_value.emergencyNumberList();
} else {
single_value->field_emergencyNumberList.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mBMS__ContextStatus().get_selection()) {
single_value->field_mBMS__ContextStatus = other_value.mBMS__ContextStatus();
} else {
single_value->field_mBMS__ContextStatus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.requestedMSInformation().get_selection()) {
single_value->field_requestedMSInformation = other_value.requestedMSInformation();
} else {
single_value->field_requestedMSInformation.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3319().get_selection()) {
single_value->field_t3319 = other_value.t3319();
} else {
single_value->field_t3319.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3323().get_selection()) {
single_value->field_t3323 = other_value.t3323();
} else {
single_value->field_t3323.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3312__ExtendedValue().get_selection()) {
single_value->field_t3312__ExtendedValue = other_value.t3312__ExtendedValue();
} else {
single_value->field_t3312__ExtendedValue.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.additionalNetworkFeatureSupport().get_selection()) {
single_value->field_additionalNetworkFeatureSupport = other_value.additionalNetworkFeatureSupport();
} else {
single_value->field_additionalNetworkFeatureSupport.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t3324().get_selection()) {
single_value->field_t3324 = other_value.t3324();
} else {
single_value->field_t3324.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extendedDRXParameters().get_selection()) {
single_value->field_extendedDRXParameters = other_value.extendedDRXParameters();
} else {
single_value->field_extendedDRXParameters.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__GMM__RoutingAreaUpdateAccept_template[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__GMM__RoutingAreaUpdateAccept_template(*other_value.implication_.precondition);
implication_.implied_template = new PDU__GMM__RoutingAreaUpdateAccept_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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
break;
}
set_selection(other_value);
}

PDU__GMM__RoutingAreaUpdateAccept_template::PDU__GMM__RoutingAreaUpdateAccept_template()
{
}

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

PDU__GMM__RoutingAreaUpdateAccept_template::PDU__GMM__RoutingAreaUpdateAccept_template(const PDU__GMM__RoutingAreaUpdateAccept& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

PDU__GMM__RoutingAreaUpdateAccept_template& PDU__GMM__RoutingAreaUpdateAccept_template::operator=(const OPTIONAL<PDU__GMM__RoutingAreaUpdateAccept>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PDU__GMM__RoutingAreaUpdateAccept&)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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
}
return *this;
}

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

boolean PDU__GMM__RoutingAreaUpdateAccept_template::match(const PDU__GMM__RoutingAreaUpdateAccept& 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.messageType().is_bound()) return FALSE;
if(!single_value->field_messageType.match(other_value.messageType(), legacy))return FALSE;
if(!other_value.forceToStandby().is_bound()) return FALSE;
if(!single_value->field_forceToStandby.match(other_value.forceToStandby(), legacy))return FALSE;
if(!other_value.updateResult().is_bound()) return FALSE;
if(!single_value->field_updateResult.match(other_value.updateResult(), legacy))return FALSE;
if(!other_value.raUpdateTimer().is_bound()) return FALSE;
if(!single_value->field_raUpdateTimer.match(other_value.raUpdateTimer(), legacy))return FALSE;
if(!other_value.routingAreaId().is_bound()) return FALSE;
if(!single_value->field_routingAreaId.match(other_value.routingAreaId(), legacy))return FALSE;
if(!other_value.ptmsiSignature().is_bound()) return FALSE;
if((other_value.ptmsiSignature().ispresent() ? !single_value->field_ptmsiSignature.match((const P__TMSISignatureTV&)other_value.ptmsiSignature(), legacy) : !single_value->field_ptmsiSignature.match_omit(legacy)))return FALSE;
if(!other_value.allocatedPTMSI().is_bound()) return FALSE;
if((other_value.allocatedPTMSI().ispresent() ? !single_value->field_allocatedPTMSI.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.allocatedPTMSI(), legacy) : !single_value->field_allocatedPTMSI.match_omit(legacy)))return FALSE;
if(!other_value.msIdentity().is_bound()) return FALSE;
if((other_value.msIdentity().ispresent() ? !single_value->field_msIdentity.match((const MobileL3__CommonIE__Types::MobileIdentityTLV&)other_value.msIdentity(), legacy) : !single_value->field_msIdentity.match_omit(legacy)))return FALSE;
if(!other_value.receiveNPDUNumbers().is_bound()) return FALSE;
if((other_value.receiveNPDUNumbers().ispresent() ? !single_value->field_receiveNPDUNumbers.match((const ReceiveNPDUNumbersListTLV&)other_value.receiveNPDUNumbers(), legacy) : !single_value->field_receiveNPDUNumbers.match_omit(legacy)))return FALSE;
if(!other_value.readyTimer().is_bound()) return FALSE;
if((other_value.readyTimer().ispresent() ? !single_value->field_readyTimer.match((const GPRSTimerTV&)other_value.readyTimer(), legacy) : !single_value->field_readyTimer.match_omit(legacy)))return FALSE;
if(!other_value.gmmCause().is_bound()) return FALSE;
if((other_value.gmmCause().ispresent() ? !single_value->field_gmmCause.match((const GMM__CauseTV&)other_value.gmmCause(), legacy) : !single_value->field_gmmCause.match_omit(legacy)))return FALSE;
if(!other_value.t3302().is_bound()) return FALSE;
if((other_value.t3302().ispresent() ? !single_value->field_t3302.match((const GPRSTimer2TLV&)other_value.t3302(), legacy) : !single_value->field_t3302.match_omit(legacy)))return FALSE;
if(!other_value.cellNotification().is_bound()) return FALSE;
if((other_value.cellNotification().ispresent() ? !single_value->field_cellNotification.match((const CellNotificationT&)other_value.cellNotification(), legacy) : !single_value->field_cellNotification.match_omit(legacy)))return FALSE;
if(!other_value.equivalentPLMNs().is_bound()) return FALSE;
if((other_value.equivalentPLMNs().ispresent() ? !single_value->field_equivalentPLMNs.match((const MobileL3__CommonIE__Types::PLMNListTLV&)other_value.equivalentPLMNs(), legacy) : !single_value->field_equivalentPLMNs.match_omit(legacy)))return FALSE;
if(!other_value.pdpContextStatus().is_bound()) return FALSE;
if((other_value.pdpContextStatus().ispresent() ? !single_value->field_pdpContextStatus.match((const PDPContextStatusTLV&)other_value.pdpContextStatus(), legacy) : !single_value->field_pdpContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.networkFeatureSupport().is_bound()) return FALSE;
if((other_value.networkFeatureSupport().ispresent() ? !single_value->field_networkFeatureSupport.match((const NetworkFeatureSupportTV&)other_value.networkFeatureSupport(), legacy) : !single_value->field_networkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.emergencyNumberList().is_bound()) return FALSE;
if((other_value.emergencyNumberList().ispresent() ? !single_value->field_emergencyNumberList.match((const MobileL3__MM__Types::EmergencyNumberListTLV&)other_value.emergencyNumberList(), legacy) : !single_value->field_emergencyNumberList.match_omit(legacy)))return FALSE;
if(!other_value.mBMS__ContextStatus().is_bound()) return FALSE;
if((other_value.mBMS__ContextStatus().ispresent() ? !single_value->field_mBMS__ContextStatus.match((const MBMS__ContextStatusTLV&)other_value.mBMS__ContextStatus(), legacy) : !single_value->field_mBMS__ContextStatus.match_omit(legacy)))return FALSE;
if(!other_value.requestedMSInformation().is_bound()) return FALSE;
if((other_value.requestedMSInformation().ispresent() ? !single_value->field_requestedMSInformation.match((const RequestedMSInformationTV&)other_value.requestedMSInformation(), legacy) : !single_value->field_requestedMSInformation.match_omit(legacy)))return FALSE;
if(!other_value.t3319().is_bound()) return FALSE;
if((other_value.t3319().ispresent() ? !single_value->field_t3319.match((const GPRSTimer2TLV&)other_value.t3319(), legacy) : !single_value->field_t3319.match_omit(legacy)))return FALSE;
if(!other_value.t3323().is_bound()) return FALSE;
if((other_value.t3323().ispresent() ? !single_value->field_t3323.match((const GPRSTimer2TLV&)other_value.t3323(), legacy) : !single_value->field_t3323.match_omit(legacy)))return FALSE;
if(!other_value.t3312__ExtendedValue().is_bound()) return FALSE;
if((other_value.t3312__ExtendedValue().ispresent() ? !single_value->field_t3312__ExtendedValue.match((const MobileL3__CommonIE__Types::GPRSTimer3TLV&)other_value.t3312__ExtendedValue(), legacy) : !single_value->field_t3312__ExtendedValue.match_omit(legacy)))return FALSE;
if(!other_value.additionalNetworkFeatureSupport().is_bound()) return FALSE;
if((other_value.additionalNetworkFeatureSupport().ispresent() ? !single_value->field_additionalNetworkFeatureSupport.match((const AdditionalNetworkFeatureSupportTLV&)other_value.additionalNetworkFeatureSupport(), legacy) : !single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)))return FALSE;
if(!other_value.t3324().is_bound()) return FALSE;
if((other_value.t3324().ispresent() ? !single_value->field_t3324.match((const GPRSTimer2TLV&)other_value.t3324(), legacy) : !single_value->field_t3324.match_omit(legacy)))return FALSE;
if(!other_value.extendedDRXParameters().is_bound()) return FALSE;
if((other_value.extendedDRXParameters().ispresent() ? !single_value->field_extendedDRXParameters.match((const ExtendedDRXParametersTLV&)other_value.extendedDRXParameters(), legacy) : !single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
}
return FALSE;
}

boolean PDU__GMM__RoutingAreaUpdateAccept_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_messageType.is_bound()
 || single_value->field_forceToStandby.is_bound()
 || single_value->field_updateResult.is_bound()
 || single_value->field_raUpdateTimer.is_bound()
 || single_value->field_routingAreaId.is_bound()
 || (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_bound())
 || (single_value->field_allocatedPTMSI.is_omit() || single_value->field_allocatedPTMSI.is_bound())
 || (single_value->field_msIdentity.is_omit() || single_value->field_msIdentity.is_bound())
 || (single_value->field_receiveNPDUNumbers.is_omit() || single_value->field_receiveNPDUNumbers.is_bound())
 || (single_value->field_readyTimer.is_omit() || single_value->field_readyTimer.is_bound())
 || (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_bound())
 || (single_value->field_t3302.is_omit() || single_value->field_t3302.is_bound())
 || (single_value->field_cellNotification.is_omit() || single_value->field_cellNotification.is_bound())
 || (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_bound())
 || (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_bound())
 || (single_value->field_networkFeatureSupport.is_omit() || single_value->field_networkFeatureSupport.is_bound())
 || (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_bound())
 || (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_bound())
 || (single_value->field_requestedMSInformation.is_omit() || single_value->field_requestedMSInformation.is_bound())
 || (single_value->field_t3319.is_omit() || single_value->field_t3319.is_bound())
 || (single_value->field_t3323.is_omit() || single_value->field_t3323.is_bound())
 || (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_bound())
 || (single_value->field_additionalNetworkFeatureSupport.is_omit() || single_value->field_additionalNetworkFeatureSupport.is_bound())
 || (single_value->field_t3324.is_omit() || single_value->field_t3324.is_bound())
 || (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_bound());
}

boolean PDU__GMM__RoutingAreaUpdateAccept_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_messageType.is_value()
 && single_value->field_forceToStandby.is_value()
 && single_value->field_updateResult.is_value()
 && single_value->field_raUpdateTimer.is_value()
 && single_value->field_routingAreaId.is_value()
 && (single_value->field_ptmsiSignature.is_omit() || single_value->field_ptmsiSignature.is_value())
 && (single_value->field_allocatedPTMSI.is_omit() || single_value->field_allocatedPTMSI.is_value())
 && (single_value->field_msIdentity.is_omit() || single_value->field_msIdentity.is_value())
 && (single_value->field_receiveNPDUNumbers.is_omit() || single_value->field_receiveNPDUNumbers.is_value())
 && (single_value->field_readyTimer.is_omit() || single_value->field_readyTimer.is_value())
 && (single_value->field_gmmCause.is_omit() || single_value->field_gmmCause.is_value())
 && (single_value->field_t3302.is_omit() || single_value->field_t3302.is_value())
 && (single_value->field_cellNotification.is_omit() || single_value->field_cellNotification.is_value())
 && (single_value->field_equivalentPLMNs.is_omit() || single_value->field_equivalentPLMNs.is_value())
 && (single_value->field_pdpContextStatus.is_omit() || single_value->field_pdpContextStatus.is_value())
 && (single_value->field_networkFeatureSupport.is_omit() || single_value->field_networkFeatureSupport.is_value())
 && (single_value->field_emergencyNumberList.is_omit() || single_value->field_emergencyNumberList.is_value())
 && (single_value->field_mBMS__ContextStatus.is_omit() || single_value->field_mBMS__ContextStatus.is_value())
 && (single_value->field_requestedMSInformation.is_omit() || single_value->field_requestedMSInformation.is_value())
 && (single_value->field_t3319.is_omit() || single_value->field_t3319.is_value())
 && (single_value->field_t3323.is_omit() || single_value->field_t3323.is_value())
 && (single_value->field_t3312__ExtendedValue.is_omit() || single_value->field_t3312__ExtendedValue.is_value())
 && (single_value->field_additionalNetworkFeatureSupport.is_omit() || single_value->field_additionalNetworkFeatureSupport.is_value())
 && (single_value->field_t3324.is_omit() || single_value->field_t3324.is_value())
 && (single_value->field_extendedDRXParameters.is_omit() || single_value->field_extendedDRXParameters.is_value());
}

void PDU__GMM__RoutingAreaUpdateAccept_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__GMM__RoutingAreaUpdateAccept PDU__GMM__RoutingAreaUpdateAccept_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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
PDU__GMM__RoutingAreaUpdateAccept ret_val;
if (single_value->field_messageType.is_bound()) {
ret_val.messageType() = single_value->field_messageType.valueof();
}
if (single_value->field_forceToStandby.is_bound()) {
ret_val.forceToStandby() = single_value->field_forceToStandby.valueof();
}
if (single_value->field_updateResult.is_bound()) {
ret_val.updateResult() = single_value->field_updateResult.valueof();
}
if (single_value->field_raUpdateTimer.is_bound()) {
ret_val.raUpdateTimer() = single_value->field_raUpdateTimer.valueof();
}
if (single_value->field_routingAreaId.is_bound()) {
ret_val.routingAreaId() = single_value->field_routingAreaId.valueof();
}
if (single_value->field_ptmsiSignature.is_omit()) ret_val.ptmsiSignature() = OMIT_VALUE;
else if (single_value->field_ptmsiSignature.is_bound()) {
ret_val.ptmsiSignature() = single_value->field_ptmsiSignature.valueof();
}
if (single_value->field_allocatedPTMSI.is_omit()) ret_val.allocatedPTMSI() = OMIT_VALUE;
else if (single_value->field_allocatedPTMSI.is_bound()) {
ret_val.allocatedPTMSI() = single_value->field_allocatedPTMSI.valueof();
}
if (single_value->field_msIdentity.is_omit()) ret_val.msIdentity() = OMIT_VALUE;
else if (single_value->field_msIdentity.is_bound()) {
ret_val.msIdentity() = single_value->field_msIdentity.valueof();
}
if (single_value->field_receiveNPDUNumbers.is_omit()) ret_val.receiveNPDUNumbers() = OMIT_VALUE;
else if (single_value->field_receiveNPDUNumbers.is_bound()) {
ret_val.receiveNPDUNumbers() = single_value->field_receiveNPDUNumbers.valueof();
}
if (single_value->field_readyTimer.is_omit()) ret_val.readyTimer() = OMIT_VALUE;
else if (single_value->field_readyTimer.is_bound()) {
ret_val.readyTimer() = single_value->field_readyTimer.valueof();
}
if (single_value->field_gmmCause.is_omit()) ret_val.gmmCause() = OMIT_VALUE;
else if (single_value->field_gmmCause.is_bound()) {
ret_val.gmmCause() = single_value->field_gmmCause.valueof();
}
if (single_value->field_t3302.is_omit()) ret_val.t3302() = OMIT_VALUE;
else if (single_value->field_t3302.is_bound()) {
ret_val.t3302() = single_value->field_t3302.valueof();
}
if (single_value->field_cellNotification.is_omit()) ret_val.cellNotification() = OMIT_VALUE;
else if (single_value->field_cellNotification.is_bound()) {
ret_val.cellNotification() = single_value->field_cellNotification.valueof();
}
if (single_value->field_equivalentPLMNs.is_omit()) ret_val.equivalentPLMNs() = OMIT_VALUE;
else if (single_value->field_equivalentPLMNs.is_bound()) {
ret_val.equivalentPLMNs() = single_value->field_equivalentPLMNs.valueof();
}
if (single_value->field_pdpContextStatus.is_omit()) ret_val.pdpContextStatus() = OMIT_VALUE;
else if (single_value->field_pdpContextStatus.is_bound()) {
ret_val.pdpContextStatus() = single_value->field_pdpContextStatus.valueof();
}
if (single_value->field_networkFeatureSupport.is_omit()) ret_val.networkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_networkFeatureSupport.is_bound()) {
ret_val.networkFeatureSupport() = single_value->field_networkFeatureSupport.valueof();
}
if (single_value->field_emergencyNumberList.is_omit()) ret_val.emergencyNumberList() = OMIT_VALUE;
else if (single_value->field_emergencyNumberList.is_bound()) {
ret_val.emergencyNumberList() = single_value->field_emergencyNumberList.valueof();
}
if (single_value->field_mBMS__ContextStatus.is_omit()) ret_val.mBMS__ContextStatus() = OMIT_VALUE;
else if (single_value->field_mBMS__ContextStatus.is_bound()) {
ret_val.mBMS__ContextStatus() = single_value->field_mBMS__ContextStatus.valueof();
}
if (single_value->field_requestedMSInformation.is_omit()) ret_val.requestedMSInformation() = OMIT_VALUE;
else if (single_value->field_requestedMSInformation.is_bound()) {
ret_val.requestedMSInformation() = single_value->field_requestedMSInformation.valueof();
}
if (single_value->field_t3319.is_omit()) ret_val.t3319() = OMIT_VALUE;
else if (single_value->field_t3319.is_bound()) {
ret_val.t3319() = single_value->field_t3319.valueof();
}
if (single_value->field_t3323.is_omit()) ret_val.t3323() = OMIT_VALUE;
else if (single_value->field_t3323.is_bound()) {
ret_val.t3323() = single_value->field_t3323.valueof();
}
if (single_value->field_t3312__ExtendedValue.is_omit()) ret_val.t3312__ExtendedValue() = OMIT_VALUE;
else if (single_value->field_t3312__ExtendedValue.is_bound()) {
ret_val.t3312__ExtendedValue() = single_value->field_t3312__ExtendedValue.valueof();
}
if (single_value->field_additionalNetworkFeatureSupport.is_omit()) ret_val.additionalNetworkFeatureSupport() = OMIT_VALUE;
else if (single_value->field_additionalNetworkFeatureSupport.is_bound()) {
ret_val.additionalNetworkFeatureSupport() = single_value->field_additionalNetworkFeatureSupport.valueof();
}
if (single_value->field_t3324.is_omit()) ret_val.t3324() = OMIT_VALUE;
else if (single_value->field_t3324.is_bound()) {
ret_val.t3324() = single_value->field_t3324.valueof();
}
if (single_value->field_extendedDRXParameters.is_omit()) ret_val.extendedDRXParameters() = OMIT_VALUE;
else if (single_value->field_extendedDRXParameters.is_bound()) {
ret_val.extendedDRXParameters() = single_value->field_extendedDRXParameters.valueof();
}
return ret_val;
}

void PDU__GMM__RoutingAreaUpdateAccept_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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PDU__GMM__RoutingAreaUpdateAccept_template[list_length];
}

PDU__GMM__RoutingAreaUpdateAccept_template& PDU__GMM__RoutingAreaUpdateAccept_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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return value_list.list_value[list_index];
}

BITSTRING_template& PDU__GMM__RoutingAreaUpdateAccept_template::messageType()
{
set_specific();
return single_value->field_messageType;
}

const BITSTRING_template& PDU__GMM__RoutingAreaUpdateAccept_template::messageType() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field messageType of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_messageType;
}

ForceToStandbyV_template& PDU__GMM__RoutingAreaUpdateAccept_template::forceToStandby()
{
set_specific();
return single_value->field_forceToStandby;
}

const ForceToStandbyV_template& PDU__GMM__RoutingAreaUpdateAccept_template::forceToStandby() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field forceToStandby of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_forceToStandby;
}

UpdateResultV_template& PDU__GMM__RoutingAreaUpdateAccept_template::updateResult()
{
set_specific();
return single_value->field_updateResult;
}

const UpdateResultV_template& PDU__GMM__RoutingAreaUpdateAccept_template::updateResult() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field updateResult of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_updateResult;
}

GPRSTimerV_template& PDU__GMM__RoutingAreaUpdateAccept_template::raUpdateTimer()
{
set_specific();
return single_value->field_raUpdateTimer;
}

const GPRSTimerV_template& PDU__GMM__RoutingAreaUpdateAccept_template::raUpdateTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field raUpdateTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_raUpdateTimer;
}

RoutingAreaIdentificationV_template& PDU__GMM__RoutingAreaUpdateAccept_template::routingAreaId()
{
set_specific();
return single_value->field_routingAreaId;
}

const RoutingAreaIdentificationV_template& PDU__GMM__RoutingAreaUpdateAccept_template::routingAreaId() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field routingAreaId of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_routingAreaId;
}

P__TMSISignatureTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::ptmsiSignature()
{
set_specific();
return single_value->field_ptmsiSignature;
}

const P__TMSISignatureTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::ptmsiSignature() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ptmsiSignature of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_ptmsiSignature;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::allocatedPTMSI()
{
set_specific();
return single_value->field_allocatedPTMSI;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::allocatedPTMSI() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field allocatedPTMSI of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_allocatedPTMSI;
}

MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::msIdentity()
{
set_specific();
return single_value->field_msIdentity;
}

const MobileL3__CommonIE__Types::MobileIdentityTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::msIdentity() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msIdentity of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_msIdentity;
}

ReceiveNPDUNumbersListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::receiveNPDUNumbers()
{
set_specific();
return single_value->field_receiveNPDUNumbers;
}

const ReceiveNPDUNumbersListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::receiveNPDUNumbers() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field receiveNPDUNumbers of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_receiveNPDUNumbers;
}

GPRSTimerTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::readyTimer()
{
set_specific();
return single_value->field_readyTimer;
}

const GPRSTimerTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::readyTimer() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field readyTimer of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_readyTimer;
}

GMM__CauseTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::gmmCause()
{
set_specific();
return single_value->field_gmmCause;
}

const GMM__CauseTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::gmmCause() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field gmmCause of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_gmmCause;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3302()
{
set_specific();
return single_value->field_t3302;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3302() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3302 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3302;
}

CellNotificationT_template& PDU__GMM__RoutingAreaUpdateAccept_template::cellNotification()
{
set_specific();
return single_value->field_cellNotification;
}

const CellNotificationT_template& PDU__GMM__RoutingAreaUpdateAccept_template::cellNotification() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cellNotification of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_cellNotification;
}

MobileL3__CommonIE__Types::PLMNListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::equivalentPLMNs()
{
set_specific();
return single_value->field_equivalentPLMNs;
}

const MobileL3__CommonIE__Types::PLMNListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::equivalentPLMNs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field equivalentPLMNs of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_equivalentPLMNs;
}

PDPContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::pdpContextStatus()
{
set_specific();
return single_value->field_pdpContextStatus;
}

const PDPContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::pdpContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field pdpContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_pdpContextStatus;
}

NetworkFeatureSupportTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::networkFeatureSupport()
{
set_specific();
return single_value->field_networkFeatureSupport;
}

const NetworkFeatureSupportTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::networkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field networkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_networkFeatureSupport;
}

MobileL3__MM__Types::EmergencyNumberListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::emergencyNumberList()
{
set_specific();
return single_value->field_emergencyNumberList;
}

const MobileL3__MM__Types::EmergencyNumberListTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::emergencyNumberList() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field emergencyNumberList of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_emergencyNumberList;
}

MBMS__ContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::mBMS__ContextStatus()
{
set_specific();
return single_value->field_mBMS__ContextStatus;
}

const MBMS__ContextStatusTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::mBMS__ContextStatus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mBMS_ContextStatus of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_mBMS__ContextStatus;
}

RequestedMSInformationTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::requestedMSInformation()
{
set_specific();
return single_value->field_requestedMSInformation;
}

const RequestedMSInformationTV_template& PDU__GMM__RoutingAreaUpdateAccept_template::requestedMSInformation() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field requestedMSInformation of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_requestedMSInformation;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3319()
{
set_specific();
return single_value->field_t3319;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3319() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3319 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3319;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3323()
{
set_specific();
return single_value->field_t3323;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3323() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3323 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3323;
}

MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3312__ExtendedValue()
{
set_specific();
return single_value->field_t3312__ExtendedValue;
}

const MobileL3__CommonIE__Types::GPRSTimer3TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3312__ExtendedValue() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3312_ExtendedValue of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3312__ExtendedValue;
}

AdditionalNetworkFeatureSupportTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::additionalNetworkFeatureSupport()
{
set_specific();
return single_value->field_additionalNetworkFeatureSupport;
}

const AdditionalNetworkFeatureSupportTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::additionalNetworkFeatureSupport() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field additionalNetworkFeatureSupport of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_additionalNetworkFeatureSupport;
}

GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3324()
{
set_specific();
return single_value->field_t3324;
}

const GPRSTimer2TLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::t3324() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t3324 of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_t3324;
}

ExtendedDRXParametersTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::extendedDRXParameters()
{
set_specific();
return single_value->field_extendedDRXParameters;
}

const ExtendedDRXParametersTLV_template& PDU__GMM__RoutingAreaUpdateAccept_template::extendedDRXParameters() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extendedDRXParameters of a non-specific template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
return single_value->field_extendedDRXParameters;
}

int PDU__GMM__RoutingAreaUpdateAccept_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 5;
      if (single_value->field_ptmsiSignature.is_present()) ret_val++;
      if (single_value->field_allocatedPTMSI.is_present()) ret_val++;
      if (single_value->field_msIdentity.is_present()) ret_val++;
      if (single_value->field_receiveNPDUNumbers.is_present()) ret_val++;
      if (single_value->field_readyTimer.is_present()) ret_val++;
      if (single_value->field_gmmCause.is_present()) ret_val++;
      if (single_value->field_t3302.is_present()) ret_val++;
      if (single_value->field_cellNotification.is_present()) ret_val++;
      if (single_value->field_equivalentPLMNs.is_present()) ret_val++;
      if (single_value->field_pdpContextStatus.is_present()) ret_val++;
      if (single_value->field_networkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_emergencyNumberList.is_present()) ret_val++;
      if (single_value->field_mBMS__ContextStatus.is_present()) ret_val++;
      if (single_value->field_requestedMSInformation.is_present()) ret_val++;
      if (single_value->field_t3319.is_present()) ret_val++;
      if (single_value->field_t3323.is_present()) ret_val++;
      if (single_value->field_t3312__ExtendedValue.is_present()) ret_val++;
      if (single_value->field_additionalNetworkFeatureSupport.is_present()) ret_val++;
      if (single_value->field_t3324.is_present()) ret_val++;
      if (single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept 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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
  }
  return 0;
}

void PDU__GMM__RoutingAreaUpdateAccept_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ messageType := ");
single_value->field_messageType.log();
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log();
TTCN_Logger::log_event_str(", updateResult := ");
single_value->field_updateResult.log();
TTCN_Logger::log_event_str(", raUpdateTimer := ");
single_value->field_raUpdateTimer.log();
TTCN_Logger::log_event_str(", routingAreaId := ");
single_value->field_routingAreaId.log();
TTCN_Logger::log_event_str(", ptmsiSignature := ");
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(", msIdentity := ");
single_value->field_msIdentity.log();
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
single_value->field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(", readyTimer := ");
single_value->field_readyTimer.log();
TTCN_Logger::log_event_str(", gmmCause := ");
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(", t3302 := ");
single_value->field_t3302.log();
TTCN_Logger::log_event_str(", cellNotification := ");
single_value->field_cellNotification.log();
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(", pdpContextStatus := ");
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
single_value->field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(", emergencyNumberList := ");
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(", requestedMSInformation := ");
single_value->field_requestedMSInformation.log();
TTCN_Logger::log_event_str(", t3319 := ");
single_value->field_t3319.log();
TTCN_Logger::log_event_str(", t3323 := ");
single_value->field_t3323.log();
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
single_value->field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(", t3324 := ");
single_value->field_t3324.log();
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
single_value->field_extendedDRXParameters.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__GMM__RoutingAreaUpdateAccept_template::log_match(const PDU__GMM__RoutingAreaUpdateAccept& 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_messageType.match(match_value.messageType(), legacy)){
TTCN_Logger::log_logmatch_info(".messageType");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_forceToStandby.match(match_value.forceToStandby(), legacy)){
TTCN_Logger::log_logmatch_info(".forceToStandby");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_updateResult.match(match_value.updateResult(), legacy)){
TTCN_Logger::log_logmatch_info(".updateResult");
single_value->field_updateResult.log_match(match_value.updateResult(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_raUpdateTimer.match(match_value.raUpdateTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".raUpdateTimer");
single_value->field_raUpdateTimer.log_match(match_value.raUpdateTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_routingAreaId.match(match_value.routingAreaId(), legacy)){
TTCN_Logger::log_logmatch_info(".routingAreaId");
single_value->field_routingAreaId.log_match(match_value.routingAreaId(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.ptmsiSignature().ispresent()){
if(!single_value->field_ptmsiSignature.match(match_value.ptmsiSignature(), legacy)){
TTCN_Logger::log_logmatch_info(".ptmsiSignature");
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_ptmsiSignature.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".ptmsiSignature := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_ptmsiSignature.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.allocatedPTMSI().ispresent()){
if(!single_value->field_allocatedPTMSI.match(match_value.allocatedPTMSI(), legacy)){
TTCN_Logger::log_logmatch_info(".allocatedPTMSI");
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_allocatedPTMSI.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".allocatedPTMSI := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_allocatedPTMSI.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.msIdentity().ispresent()){
if(!single_value->field_msIdentity.match(match_value.msIdentity(), legacy)){
TTCN_Logger::log_logmatch_info(".msIdentity");
single_value->field_msIdentity.log_match(match_value.msIdentity(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_msIdentity.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".msIdentity := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_msIdentity.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.receiveNPDUNumbers().ispresent()){
if(!single_value->field_receiveNPDUNumbers.match(match_value.receiveNPDUNumbers(), legacy)){
TTCN_Logger::log_logmatch_info(".receiveNPDUNumbers");
single_value->field_receiveNPDUNumbers.log_match(match_value.receiveNPDUNumbers(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_receiveNPDUNumbers.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".receiveNPDUNumbers := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_receiveNPDUNumbers.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.readyTimer().ispresent()){
if(!single_value->field_readyTimer.match(match_value.readyTimer(), legacy)){
TTCN_Logger::log_logmatch_info(".readyTimer");
single_value->field_readyTimer.log_match(match_value.readyTimer(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_readyTimer.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".readyTimer := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_readyTimer.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.gmmCause().ispresent()){
if(!single_value->field_gmmCause.match(match_value.gmmCause(), legacy)){
TTCN_Logger::log_logmatch_info(".gmmCause");
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_gmmCause.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".gmmCause := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_gmmCause.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3302().ispresent()){
if(!single_value->field_t3302.match(match_value.t3302(), legacy)){
TTCN_Logger::log_logmatch_info(".t3302");
single_value->field_t3302.log_match(match_value.t3302(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3302.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3302 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3302.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.cellNotification().ispresent()){
if(!single_value->field_cellNotification.match(match_value.cellNotification(), legacy)){
TTCN_Logger::log_logmatch_info(".cellNotification");
single_value->field_cellNotification.log_match(match_value.cellNotification(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_cellNotification.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".cellNotification := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_cellNotification.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.equivalentPLMNs().ispresent()){
if(!single_value->field_equivalentPLMNs.match(match_value.equivalentPLMNs(), legacy)){
TTCN_Logger::log_logmatch_info(".equivalentPLMNs");
single_value->field_equivalentPLMNs.log_match(match_value.equivalentPLMNs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_equivalentPLMNs.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".equivalentPLMNs := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_equivalentPLMNs.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.pdpContextStatus().ispresent()){
if(!single_value->field_pdpContextStatus.match(match_value.pdpContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".pdpContextStatus");
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_pdpContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".pdpContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_pdpContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.networkFeatureSupport().ispresent()){
if(!single_value->field_networkFeatureSupport.match(match_value.networkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".networkFeatureSupport");
single_value->field_networkFeatureSupport.log_match(match_value.networkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_networkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".networkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_networkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.emergencyNumberList().ispresent()){
if(!single_value->field_emergencyNumberList.match(match_value.emergencyNumberList(), legacy)){
TTCN_Logger::log_logmatch_info(".emergencyNumberList");
single_value->field_emergencyNumberList.log_match(match_value.emergencyNumberList(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_emergencyNumberList.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".emergencyNumberList := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_emergencyNumberList.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.mBMS__ContextStatus().ispresent()){
if(!single_value->field_mBMS__ContextStatus.match(match_value.mBMS__ContextStatus(), legacy)){
TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus");
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mBMS__ContextStatus.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mBMS_ContextStatus := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mBMS__ContextStatus.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.requestedMSInformation().ispresent()){
if(!single_value->field_requestedMSInformation.match(match_value.requestedMSInformation(), legacy)){
TTCN_Logger::log_logmatch_info(".requestedMSInformation");
single_value->field_requestedMSInformation.log_match(match_value.requestedMSInformation(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_requestedMSInformation.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".requestedMSInformation := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_requestedMSInformation.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3319().ispresent()){
if(!single_value->field_t3319.match(match_value.t3319(), legacy)){
TTCN_Logger::log_logmatch_info(".t3319");
single_value->field_t3319.log_match(match_value.t3319(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3319.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3319 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3319.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3323().ispresent()){
if(!single_value->field_t3323.match(match_value.t3323(), legacy)){
TTCN_Logger::log_logmatch_info(".t3323");
single_value->field_t3323.log_match(match_value.t3323(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3323.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3323 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3323.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3312__ExtendedValue().ispresent()){
if(!single_value->field_t3312__ExtendedValue.match(match_value.t3312__ExtendedValue(), legacy)){
TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue");
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3312__ExtendedValue.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3312_ExtendedValue := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3312__ExtendedValue.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.additionalNetworkFeatureSupport().ispresent()){
if(!single_value->field_additionalNetworkFeatureSupport.match(match_value.additionalNetworkFeatureSupport(), legacy)){
TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupport");
single_value->field_additionalNetworkFeatureSupport.log_match(match_value.additionalNetworkFeatureSupport(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".additionalNetworkFeatureSupport := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_additionalNetworkFeatureSupport.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.t3324().ispresent()){
if(!single_value->field_t3324.match(match_value.t3324(), legacy)){
TTCN_Logger::log_logmatch_info(".t3324");
single_value->field_t3324.log_match(match_value.t3324(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_t3324.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".t3324 := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_t3324.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.extendedDRXParameters().ispresent()){
if(!single_value->field_extendedDRXParameters.match(match_value.extendedDRXParameters(), legacy)){
TTCN_Logger::log_logmatch_info(".extendedDRXParameters");
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extendedDRXParameters.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extendedDRXParameters := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extendedDRXParameters.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("{ messageType := ");
single_value->field_messageType.log_match(match_value.messageType(), legacy);
TTCN_Logger::log_event_str(", forceToStandby := ");
single_value->field_forceToStandby.log_match(match_value.forceToStandby(), legacy);
TTCN_Logger::log_event_str(", updateResult := ");
single_value->field_updateResult.log_match(match_value.updateResult(), legacy);
TTCN_Logger::log_event_str(", raUpdateTimer := ");
single_value->field_raUpdateTimer.log_match(match_value.raUpdateTimer(), legacy);
TTCN_Logger::log_event_str(", routingAreaId := ");
single_value->field_routingAreaId.log_match(match_value.routingAreaId(), legacy);
TTCN_Logger::log_event_str(", ptmsiSignature := ");
if (match_value.ptmsiSignature().ispresent()) {
single_value->field_ptmsiSignature.log_match(match_value.ptmsiSignature(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_ptmsiSignature.log();
if (single_value->field_ptmsiSignature.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", allocatedPTMSI := ");
if (match_value.allocatedPTMSI().ispresent()) {
single_value->field_allocatedPTMSI.log_match(match_value.allocatedPTMSI(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_allocatedPTMSI.log();
if (single_value->field_allocatedPTMSI.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", msIdentity := ");
if (match_value.msIdentity().ispresent()) {
single_value->field_msIdentity.log_match(match_value.msIdentity(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_msIdentity.log();
if (single_value->field_msIdentity.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", receiveNPDUNumbers := ");
if (match_value.receiveNPDUNumbers().ispresent()) {
single_value->field_receiveNPDUNumbers.log_match(match_value.receiveNPDUNumbers(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_receiveNPDUNumbers.log();
if (single_value->field_receiveNPDUNumbers.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", readyTimer := ");
if (match_value.readyTimer().ispresent()) {
single_value->field_readyTimer.log_match(match_value.readyTimer(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_readyTimer.log();
if (single_value->field_readyTimer.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", gmmCause := ");
if (match_value.gmmCause().ispresent()) {
single_value->field_gmmCause.log_match(match_value.gmmCause(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_gmmCause.log();
if (single_value->field_gmmCause.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3302 := ");
if (match_value.t3302().ispresent()) {
single_value->field_t3302.log_match(match_value.t3302(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3302.log();
if (single_value->field_t3302.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", cellNotification := ");
if (match_value.cellNotification().ispresent()) {
single_value->field_cellNotification.log_match(match_value.cellNotification(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_cellNotification.log();
if (single_value->field_cellNotification.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", equivalentPLMNs := ");
if (match_value.equivalentPLMNs().ispresent()) {
single_value->field_equivalentPLMNs.log_match(match_value.equivalentPLMNs(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_equivalentPLMNs.log();
if (single_value->field_equivalentPLMNs.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", pdpContextStatus := ");
if (match_value.pdpContextStatus().ispresent()) {
single_value->field_pdpContextStatus.log_match(match_value.pdpContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_pdpContextStatus.log();
if (single_value->field_pdpContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", networkFeatureSupport := ");
if (match_value.networkFeatureSupport().ispresent()) {
single_value->field_networkFeatureSupport.log_match(match_value.networkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_networkFeatureSupport.log();
if (single_value->field_networkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", emergencyNumberList := ");
if (match_value.emergencyNumberList().ispresent()) {
single_value->field_emergencyNumberList.log_match(match_value.emergencyNumberList(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_emergencyNumberList.log();
if (single_value->field_emergencyNumberList.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", mBMS_ContextStatus := ");
if (match_value.mBMS__ContextStatus().ispresent()) {
single_value->field_mBMS__ContextStatus.log_match(match_value.mBMS__ContextStatus(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mBMS__ContextStatus.log();
if (single_value->field_mBMS__ContextStatus.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", requestedMSInformation := ");
if (match_value.requestedMSInformation().ispresent()) {
single_value->field_requestedMSInformation.log_match(match_value.requestedMSInformation(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_requestedMSInformation.log();
if (single_value->field_requestedMSInformation.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3319 := ");
if (match_value.t3319().ispresent()) {
single_value->field_t3319.log_match(match_value.t3319(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3319.log();
if (single_value->field_t3319.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3323 := ");
if (match_value.t3323().ispresent()) {
single_value->field_t3323.log_match(match_value.t3323(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3323.log();
if (single_value->field_t3323.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3312_ExtendedValue := ");
if (match_value.t3312__ExtendedValue().ispresent()) {
single_value->field_t3312__ExtendedValue.log_match(match_value.t3312__ExtendedValue(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3312__ExtendedValue.log();
if (single_value->field_t3312__ExtendedValue.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", additionalNetworkFeatureSupport := ");
if (match_value.additionalNetworkFeatureSupport().ispresent()) {
single_value->field_additionalNetworkFeatureSupport.log_match(match_value.additionalNetworkFeatureSupport(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_additionalNetworkFeatureSupport.log();
if (single_value->field_additionalNetworkFeatureSupport.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t3324 := ");
if (match_value.t3324().ispresent()) {
single_value->field_t3324.log_match(match_value.t3324(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_t3324.log();
if (single_value->field_t3324.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", extendedDRXParameters := ");
if (match_value.extendedDRXParameters().ispresent()) {
single_value->field_extendedDRXParameters.log_match(match_value.extendedDRXParameters(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extendedDRXParameters.log();
if (single_value->field_extendedDRXParameters.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 PDU__GMM__RoutingAreaUpdateAccept_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (messageType().is_bound()) messageType().set_implicit_omit();
if (forceToStandby().is_bound()) forceToStandby().set_implicit_omit();
if (updateResult().is_bound()) updateResult().set_implicit_omit();
if (raUpdateTimer().is_bound()) raUpdateTimer().set_implicit_omit();
if (routingAreaId().is_bound()) routingAreaId().set_implicit_omit();
if (!ptmsiSignature().is_bound()) ptmsiSignature() = OMIT_VALUE;
else ptmsiSignature().set_implicit_omit();
if (!allocatedPTMSI().is_bound()) allocatedPTMSI() = OMIT_VALUE;
else allocatedPTMSI().set_implicit_omit();
if (!msIdentity().is_bound()) msIdentity() = OMIT_VALUE;
else msIdentity().set_implicit_omit();
if (!receiveNPDUNumbers().is_bound()) receiveNPDUNumbers() = OMIT_VALUE;
else receiveNPDUNumbers().set_implicit_omit();
if (!readyTimer().is_bound()) readyTimer() = OMIT_VALUE;
else readyTimer().set_implicit_omit();
if (!gmmCause().is_bound()) gmmCause() = OMIT_VALUE;
else gmmCause().set_implicit_omit();
if (!t3302().is_bound()) t3302() = OMIT_VALUE;
else t3302().set_implicit_omit();
if (!cellNotification().is_bound()) cellNotification() = OMIT_VALUE;
else cellNotification().set_implicit_omit();
if (!equivalentPLMNs().is_bound()) equivalentPLMNs() = OMIT_VALUE;
else equivalentPLMNs().set_implicit_omit();
if (!pdpContextStatus().is_bound()) pdpContextStatus() = OMIT_VALUE;
else pdpContextStatus().set_implicit_omit();
if (!networkFeatureSupport().is_bound()) networkFeatureSupport() = OMIT_VALUE;
else networkFeatureSupport().set_implicit_omit();
if (!emergencyNumberList().is_bound()) emergencyNumberList() = OMIT_VALUE;
else emergencyNumberList().set_implicit_omit();
if (!mBMS__ContextStatus().is_bound()) mBMS__ContextStatus() = OMIT_VALUE;
else mBMS__ContextStatus().set_implicit_omit();
if (!requestedMSInformation().is_bound()) requestedMSInformation() = OMIT_VALUE;
else requestedMSInformation().set_implicit_omit();
if (!t3319().is_bound()) t3319() = OMIT_VALUE;
else t3319().set_implicit_omit();
if (!t3323().is_bound()) t3323() = OMIT_VALUE;
else t3323().set_implicit_omit();
if (!t3312__ExtendedValue().is_bound()) t3312__ExtendedValue() = OMIT_VALUE;
else t3312__ExtendedValue().set_implicit_omit();
if (!additionalNetworkFeatureSupport().is_bound()) additionalNetworkFeatureSupport() = OMIT_VALUE;
else additionalNetworkFeatureSupport().set_implicit_omit();
if (!t3324().is_bound()) t3324() = OMIT_VALUE;
else t3324().set_implicit_omit();
if (!extendedDRXParameters().is_bound()) extendedDRXParameters() = OMIT_VALUE;
else extendedDRXParameters().set_implicit_omit();
}

void PDU__GMM__RoutingAreaUpdateAccept_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_messageType.encode_text(text_buf);
single_value->field_forceToStandby.encode_text(text_buf);
single_value->field_updateResult.encode_text(text_buf);
single_value->field_raUpdateTimer.encode_text(text_buf);
single_value->field_routingAreaId.encode_text(text_buf);
single_value->field_ptmsiSignature.encode_text(text_buf);
single_value->field_allocatedPTMSI.encode_text(text_buf);
single_value->field_msIdentity.encode_text(text_buf);
single_value->field_receiveNPDUNumbers.encode_text(text_buf);
single_value->field_readyTimer.encode_text(text_buf);
single_value->field_gmmCause.encode_text(text_buf);
single_value->field_t3302.encode_text(text_buf);
single_value->field_cellNotification.encode_text(text_buf);
single_value->field_equivalentPLMNs.encode_text(text_buf);
single_value->field_pdpContextStatus.encode_text(text_buf);
single_value->field_networkFeatureSupport.encode_text(text_buf);
single_value->field_emergencyNumberList.encode_text(text_buf);
single_value->field_mBMS__ContextStatus.encode_text(text_buf);
single_value->field_requestedMSInformation.encode_text(text_buf);
single_value->field_t3319.encode_text(text_buf);
single_value->field_t3323.encode_text(text_buf);
single_value->field_t3312__ExtendedValue.encode_text(text_buf);
single_value->field_additionalNetworkFeatureSupport.encode_text(text_buf);
single_value->field_t3324.encode_text(text_buf);
single_value->field_extendedDRXParameters.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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
}
}

void PDU__GMM__RoutingAreaUpdateAccept_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_messageType.decode_text(text_buf);
single_value->field_forceToStandby.decode_text(text_buf);
single_value->field_updateResult.decode_text(text_buf);
single_value->field_raUpdateTimer.decode_text(text_buf);
single_value->field_routingAreaId.decode_text(text_buf);
single_value->field_ptmsiSignature.decode_text(text_buf);
single_value->field_allocatedPTMSI.decode_text(text_buf);
single_value->field_msIdentity.decode_text(text_buf);
single_value->field_receiveNPDUNumbers.decode_text(text_buf);
single_value->field_readyTimer.decode_text(text_buf);
single_value->field_gmmCause.decode_text(text_buf);
single_value->field_t3302.decode_text(text_buf);
single_value->field_cellNotification.decode_text(text_buf);
single_value->field_equivalentPLMNs.decode_text(text_buf);
single_value->field_pdpContextStatus.decode_text(text_buf);
single_value->field_networkFeatureSupport.decode_text(text_buf);
single_value->field_emergencyNumberList.decode_text(text_buf);
single_value->field_mBMS__ContextStatus.decode_text(text_buf);
single_value->field_requestedMSInformation.decode_text(text_buf);
single_value->field_t3319.decode_text(text_buf);
single_value->field_t3323.decode_text(text_buf);
single_value->field_t3312__ExtendedValue.decode_text(text_buf);
single_value->field_additionalNetworkFeatureSupport.decode_text(text_buf);
single_value->field_t3324.decode_text(text_buf);
single_value->field_extendedDRXParameters.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__GMM__RoutingAreaUpdateAccept_template[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 @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept.");
}
}

void PDU__GMM__RoutingAreaUpdateAccept_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__GMM__RoutingAreaUpdateAccept_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (25<param.get_size()) {
      param.error("record template of type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept has 25 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) messageType().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) forceToStandby().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) updateResult().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) raUpdateTimer().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) routingAreaId().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) ptmsiSignature().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) allocatedPTMSI().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) msIdentity().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) receiveNPDUNumbers().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) readyTimer().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) gmmCause().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) t3302().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) cellNotification().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) equivalentPLMNs().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) pdpContextStatus().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) networkFeatureSupport().set_param(*param.get_elem(15));
    if (param.get_size()>16 && param.get_elem(16)->get_type()!=Module_Param::MP_NotUsed) emergencyNumberList().set_param(*param.get_elem(16));
    if (param.get_size()>17 && param.get_elem(17)->get_type()!=Module_Param::MP_NotUsed) mBMS__ContextStatus().set_param(*param.get_elem(17));
    if (param.get_size()>18 && param.get_elem(18)->get_type()!=Module_Param::MP_NotUsed) requestedMSInformation().set_param(*param.get_elem(18));
    if (param.get_size()>19 && param.get_elem(19)->get_type()!=Module_Param::MP_NotUsed) t3319().set_param(*param.get_elem(19));
    if (param.get_size()>20 && param.get_elem(20)->get_type()!=Module_Param::MP_NotUsed) t3323().set_param(*param.get_elem(20));
    if (param.get_size()>21 && param.get_elem(21)->get_type()!=Module_Param::MP_NotUsed) t3312__ExtendedValue().set_param(*param.get_elem(21));
    if (param.get_size()>22 && param.get_elem(22)->get_type()!=Module_Param::MP_NotUsed) additionalNetworkFeatureSupport().set_param(*param.get_elem(22));
    if (param.get_size()>23 && param.get_elem(23)->get_type()!=Module_Param::MP_NotUsed) t3324().set_param(*param.get_elem(23));
    if (param.get_size()>24 && param.get_elem(24)->get_type()!=Module_Param::MP_NotUsed) extendedDRXParameters().set_param(*param.get_elem(24));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "messageType")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          messageType().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "forceToStandby")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          forceToStandby().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "updateResult")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          updateResult().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "raUpdateTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          raUpdateTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "routingAreaId")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          routingAreaId().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ptmsiSignature")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ptmsiSignature().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "allocatedPTMSI")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          allocatedPTMSI().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "msIdentity")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          msIdentity().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "receiveNPDUNumbers")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          receiveNPDUNumbers().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "readyTimer")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          readyTimer().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "gmmCause")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          gmmCause().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3302")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3302().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cellNotification")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cellNotification().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "equivalentPLMNs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          equivalentPLMNs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "pdpContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          pdpContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "networkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          networkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "emergencyNumberList")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          emergencyNumberList().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mBMS_ContextStatus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mBMS__ContextStatus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "requestedMSInformation")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          requestedMSInformation().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3319")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3319().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3323")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3323().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3312_ExtendedValue")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3312__ExtendedValue().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "additionalNetworkFeatureSupport")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          additionalNetworkFeatureSupport().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t3324")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t3324().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "extendedDRXParameters")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extendedDRXParameters().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PDU__GMM__RoutingAreaUpdateAccept_template* precondition = new PDU__GMM__RoutingAreaUpdateAccept_template;
    precondition->set_param(*param.get_elem(0));
    PDU__GMM__RoutingAreaUpdateAccept_template* implied_template = new PDU__GMM__RoutingAreaUpdateAccept_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PDU__GMM__RoutingAreaUpdateAccept_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
  }
  is_ifpresent = param.get_ifpresent();
}

void PDU__GMM__RoutingAreaUpdateAccept_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_messageType.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_forceToStandby.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_updateResult.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_raUpdateTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_routingAreaId.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_ptmsiSignature.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_allocatedPTMSI.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_msIdentity.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_receiveNPDUNumbers.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_readyTimer.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_gmmCause.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3302.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_cellNotification.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_equivalentPLMNs.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_pdpContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_networkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_emergencyNumberList.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_mBMS__ContextStatus.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_requestedMSInformation.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3319.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3323.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3312__ExtendedValue.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_additionalNetworkFeatureSupport.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_t3324.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
single_value->field_extendedDRXParameters.check_restriction(t_res, t_name ? t_name : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
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 : "@MobileL3_GMM_SM_Types.PDU_GMM_RoutingAreaUpdateAccept");
}

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

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


} /* end of namespace */
