// 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 "Osmocom_Gb_Types.hh"

namespace Osmocom__Gb__Types {

/* Literal string constants */

const unsigned char bs_0_bits[] = { 0 },
bs_7_bits[] = { 0 },
bs_6_bits[] = { 0 },
bs_8_bits[] = { 0 },
bs_1_bits[] = { 0 },
bs_3_bits[] = { 0 },
bs_5_bits[] = { 8 },
bs_4_bits[] = { 4 },
bs_9_bits[] = { 2 },
bs_13_bits[] = { 6 },
bs_12_bits[] = { 30 },
bs_2_bits[] = { 1 },
bs_11_bits[] = { 1 },
bs_10_bits[] = { 3 };
extern const BITSTRING bs_0(1, bs_0_bits),
bs_7(2, bs_7_bits),
bs_6(3, bs_6_bits),
bs_8(4, bs_8_bits),
bs_1(6, bs_1_bits),
bs_3(7, bs_3_bits),
bs_5(4, bs_5_bits),
bs_4(3, bs_4_bits),
bs_9(3, bs_9_bits),
bs_13(4, bs_13_bits),
bs_12(5, bs_12_bits),
bs_2(1, bs_2_bits),
bs_11(2, bs_11_bits),
bs_10(2, bs_10_bits);
const unsigned char hs_0_nibbles[] = { 0 },
hs_1_nibbles[] = { 1 },
hs_2_nibbles[] = { 2 },
hs_3_nibbles[] = { 3 };
extern const HEXSTRING hs_0(1, hs_0_nibbles),
hs_1(1, hs_1_nibbles),
hs_2(1, hs_2_nibbles),
hs_3(1, hs_3_nibbles);
const unsigned char os_0_octets[] = { 0 },
os_11_octets[] = { 0, 0 },
os_73_octets[] = { 0, 0, 0, 0 },
os_72_octets[] = { 0, 1 },
os_39_octets[] = { 0, 80 },
os_2_octets[] = { 1 },
os_3_octets[] = { 2 },
os_5_octets[] = { 3 },
os_4_octets[] = { 4 },
os_6_octets[] = { 5 },
os_7_octets[] = { 6 },
os_8_octets[] = { 7 },
os_10_octets[] = { 8 },
os_13_octets[] = { 9 },
os_9_octets[] = { 10 },
os_1_octets[] = { 11 },
os_20_octets[] = { 12 },
os_17_octets[] = { 13 },
os_19_octets[] = { 14 },
os_15_octets[] = { 15 },
os_16_octets[] = { 16 },
os_18_octets[] = { 17 },
os_12_octets[] = { 18 },
os_14_octets[] = { 19 },
os_44_octets[] = { 20 },
os_38_octets[] = { 21 },
os_41_octets[] = { 22 },
os_40_octets[] = { 24 },
os_49_octets[] = { 25 },
os_27_octets[] = { 26 },
os_42_octets[] = { 27 },
os_33_octets[] = { 28 },
os_24_octets[] = { 29 },
os_26_octets[] = { 30 },
os_23_octets[] = { 31 },
os_25_octets[] = { 32 },
os_31_octets[] = { 33 },
os_28_octets[] = { 34 },
os_29_octets[] = { 35 },
os_30_octets[] = { 36 },
os_21_octets[] = { 37 },
os_32_octets[] = { 38 },
os_34_octets[] = { 39 },
os_35_octets[] = { 40 },
os_36_octets[] = { 41 },
os_46_octets[] = { 42 },
os_47_octets[] = { 43 },
os_48_octets[] = { 44 },
os_22_octets[] = { 62 },
os_50_octets[] = { 64 },
os_37_octets[] = { 65 },
os_51_octets[] = { 66 },
os_53_octets[] = { 75 },
os_54_octets[] = { 76 },
os_60_octets[] = { 77 },
os_61_octets[] = { 78 },
os_63_octets[] = { 79 },
os_65_octets[] = { 84 },
os_64_octets[] = { 85 },
os_62_octets[] = { 86 },
os_55_octets[] = { 87 },
os_56_octets[] = { 88 },
os_59_octets[] = { 89 },
os_57_octets[] = { 90 },
os_58_octets[] = { 91 },
os_68_octets[] = { 112 },
os_67_octets[] = { 113 },
os_69_octets[] = { 114 },
os_70_octets[] = { 115 },
os_71_octets[] = { 116 },
os_66_octets[] = { 132 },
os_52_octets[] = { 143 },
os_43_octets[] = { 147 },
os_45_octets[] = { 150 },
os_74_octets[] = { 192, 0, 0, 0 };
extern const OCTETSTRING os_0(1, os_0_octets),
os_11(2, os_11_octets),
os_73(4, os_73_octets),
os_72(2, os_72_octets),
os_39(2, os_39_octets),
os_2(1, os_2_octets),
os_3(1, os_3_octets),
os_5(1, os_5_octets),
os_4(1, os_4_octets),
os_6(1, os_6_octets),
os_7(1, os_7_octets),
os_8(1, os_8_octets),
os_10(1, os_10_octets),
os_13(1, os_13_octets),
os_9(1, os_9_octets),
os_1(1, os_1_octets),
os_20(1, os_20_octets),
os_17(1, os_17_octets),
os_19(1, os_19_octets),
os_15(1, os_15_octets),
os_16(1, os_16_octets),
os_18(1, os_18_octets),
os_12(1, os_12_octets),
os_14(1, os_14_octets),
os_44(1, os_44_octets),
os_38(1, os_38_octets),
os_41(1, os_41_octets),
os_40(1, os_40_octets),
os_49(1, os_49_octets),
os_27(1, os_27_octets),
os_42(1, os_42_octets),
os_33(1, os_33_octets),
os_24(1, os_24_octets),
os_26(1, os_26_octets),
os_23(1, os_23_octets),
os_25(1, os_25_octets),
os_31(1, os_31_octets),
os_28(1, os_28_octets),
os_29(1, os_29_octets),
os_30(1, os_30_octets),
os_21(1, os_21_octets),
os_32(1, os_32_octets),
os_34(1, os_34_octets),
os_35(1, os_35_octets),
os_36(1, os_36_octets),
os_46(1, os_46_octets),
os_47(1, os_47_octets),
os_48(1, os_48_octets),
os_22(1, os_22_octets),
os_50(1, os_50_octets),
os_37(1, os_37_octets),
os_51(1, os_51_octets),
os_53(1, os_53_octets),
os_54(1, os_54_octets),
os_60(1, os_60_octets),
os_61(1, os_61_octets),
os_63(1, os_63_octets),
os_65(1, os_65_octets),
os_64(1, os_64_octets),
os_62(1, os_62_octets),
os_55(1, os_55_octets),
os_56(1, os_56_octets),
os_59(1, os_59_octets),
os_57(1, os_57_octets),
os_58(1, os_58_octets),
os_68(1, os_68_octets),
os_67(1, os_67_octets),
os_69(1, os_69_octets),
os_70(1, os_70_octets),
os_71(1, os_71_octets),
os_66(1, os_66_octets),
os_52(1, os_52_octets),
os_43(1, os_43_octets),
os_45(1, os_45_octets),
os_74(4, os_74_octets);
extern const CHARSTRING cs_1('*'),
cs_2('?'),
cs_3(21, "Osmocom_Gb_Types.ttcn"),
cs_0(4, "omit");
const unsigned char module_checksum[] = { 0x65, 0xa1, 0xb6, 0x50, 0x2e, 0xa5, 0x93, 0x74, 0x27, 0x40, 0x31, 0xec, 0x39, 0x28, 0x06, 0xd2 };

/* Global variable definitions */

const XERdescriptor_t       Nsvci_xer_ = { {"Nsvci>\n", "Nsvci>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Nsvci_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Nsvci_descr_ = { "@Osmocom_Gb_Types.Nsvci", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &Nsvci_xer_, &INTEGER_json_, &Nsvci_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Nsvci_default_coding("RAW");
const XERdescriptor_t       Nsei_xer_ = { {"Nsei>\n", "Nsei>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t Nsei_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t Nsei_descr_ = { "@Osmocom_Gb_Types.Nsei", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &Nsei_xer_, &INTEGER_json_, &Nsei_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING Nsei_default_coding("RAW");
const XERdescriptor_t       BssgpBvci_xer_ = { {"BssgpBvci>\n", "BssgpBvci>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t BssgpBvci_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t BssgpBvci_descr_ = { "@Osmocom_Gb_Types.BssgpBvci", &INTEGER_ber_, &Osmocom__Types::uint16__t_raw_, &INTEGER_text_, &BssgpBvci_xer_, &INTEGER_json_, &BssgpBvci_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpBvci_default_coding("RAW");
INTEGER_template template_t__BssgpBvciUser;
const INTEGER_template& t__BssgpBvciUser = template_t__BssgpBvciUser;
const TTCN_RAWdescriptor_t OsmoNsDialect_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for OsmoNsDialect
const TTCN_Typedescriptor_t OsmoNsDialect_descr_ = { "@Osmocom_Gb_Types.OsmoNsDialect", NULL, &OsmoNsDialect_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING OsmoNsDialect_default_coding("RAW");
const TTCN_RAWdescriptor_t NsPduType_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for NsPduType
const TTCN_Typedescriptor_t NsPduType_descr_ = { "@Osmocom_Gb_Types.NsPduType", NULL, &NsPduType_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NsPduType_default_coding("RAW");
const TTCN_RAWdescriptor_t NsIEI_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for NsIEI
const TTCN_Typedescriptor_t NsIEI_descr_ = { "@Osmocom_Gb_Types.NsIEI", NULL, &NsIEI_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NsIEI_default_coding("RAW");
const TTCN_RAWdescriptor_t NsCause_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for NsCause
const TTCN_Typedescriptor_t NsCause_descr_ = { "@Osmocom_Gb_Types.NsCause", NULL, &NsCause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING NsCause_default_coding("RAW");
NS__Types::NS__SDU__ControlBits_template template_t__SduCtrlB;
const NS__Types::NS__SDU__ControlBits_template& t__SduCtrlB = template_t__SduCtrlB;
INTEGER const_ts__SNS__IPv4_sig__weight_defval;
const INTEGER& ts__SNS__IPv4_sig__weight_defval = const_ts__SNS__IPv4_sig__weight_defval;
INTEGER const_ts__SNS__IPv4_data__weight_defval;
const INTEGER& ts__SNS__IPv4_data__weight_defval = const_ts__SNS__IPv4_data__weight_defval;
INTEGER_template template_tr__SNS__IPv4_sig__weight_defval;
const INTEGER_template& tr__SNS__IPv4_sig__weight_defval = template_tr__SNS__IPv4_sig__weight_defval;
INTEGER_template template_tr__SNS__IPv4_data__weight_defval;
const INTEGER_template& tr__SNS__IPv4_data__weight_defval = template_tr__SNS__IPv4_data__weight_defval;
INTEGER const_ts__SNS__IPv6_sig__weight_defval;
const INTEGER& ts__SNS__IPv6_sig__weight_defval = const_ts__SNS__IPv6_sig__weight_defval;
INTEGER const_ts__SNS__IPv6_data__weight_defval;
const INTEGER& ts__SNS__IPv6_data__weight_defval = const_ts__SNS__IPv6_data__weight_defval;
INTEGER_template template_tr__SNS__IPv6_sig__weight_defval;
const INTEGER_template& tr__SNS__IPv6_sig__weight_defval = template_tr__SNS__IPv6_sig__weight_defval;
INTEGER_template template_tr__SNS__IPv6_data__weight_defval;
const INTEGER_template& tr__SNS__IPv6_data__weight_defval = template_tr__SNS__IPv6_data__weight_defval;
NS__Types::PDU__NS_template template_t__NS__UNBLOCK;
const NS__Types::PDU__NS_template& t__NS__UNBLOCK = template_t__NS__UNBLOCK;
NS__Types::PDU__NS_template template_t__NS__UNBLOCK__ACK;
const NS__Types::PDU__NS_template& t__NS__UNBLOCK__ACK = template_t__NS__UNBLOCK__ACK;
NS__Types::PDU__NS_template template_t__NS__ALIVE;
const NS__Types::PDU__NS_template& t__NS__ALIVE = template_t__NS__ALIVE;
NS__Types::PDU__NS_template template_t__NS__ALIVE__ACK;
const NS__Types::PDU__NS_template& t__NS__ALIVE__ACK = template_t__NS__ALIVE__ACK;
BOOLEAN const_ts__SNS__SIZE_rst__flag_defval;
const BOOLEAN& ts__SNS__SIZE_rst__flag_defval = const_ts__SNS__SIZE_rst__flag_defval;
INTEGER const_ts__SNS__SIZE_max__nsvcs_defval;
const INTEGER& ts__SNS__SIZE_max__nsvcs_defval = const_ts__SNS__SIZE_max__nsvcs_defval;
INTEGER_template template_ts__SNS__SIZE_num__v4_defval;
const INTEGER_template& ts__SNS__SIZE_num__v4_defval = template_ts__SNS__SIZE_num__v4_defval;
INTEGER_template template_ts__SNS__SIZE_num__v6_defval;
const INTEGER_template& ts__SNS__SIZE_num__v6_defval = template_ts__SNS__SIZE_num__v6_defval;
BOOLEAN_template template_tr__SNS__SIZE_rst__flag_defval;
const BOOLEAN_template& tr__SNS__SIZE_rst__flag_defval = template_tr__SNS__SIZE_rst__flag_defval;
INTEGER_template template_tr__SNS__SIZE_max__nsvcs_defval;
const INTEGER_template& tr__SNS__SIZE_max__nsvcs_defval = template_tr__SNS__SIZE_max__nsvcs_defval;
INTEGER_template template_tr__SNS__SIZE_num__v4_defval;
const INTEGER_template& tr__SNS__SIZE_num__v4_defval = template_tr__SNS__SIZE_num__v4_defval;
INTEGER_template template_tr__SNS__SIZE_num__v6_defval;
const INTEGER_template& tr__SNS__SIZE_num__v6_defval = template_tr__SNS__SIZE_num__v6_defval;
NS__Types::IP4__Elements_template template_ts__SNS__CONFIG_v4_defval;
const NS__Types::IP4__Elements_template& ts__SNS__CONFIG_v4_defval = template_ts__SNS__CONFIG_v4_defval;
NS__Types::IP6__Elements_template template_ts__SNS__CONFIG_v6_defval;
const NS__Types::IP6__Elements_template& ts__SNS__CONFIG_v6_defval = template_ts__SNS__CONFIG_v6_defval;
NS__Types::IP4__Elements_template template_tr__SNS__CONFIG_v4_defval;
const NS__Types::IP4__Elements_template& tr__SNS__CONFIG_v4_defval = template_tr__SNS__CONFIG_v4_defval;
NS__Types::IP6__Elements_template template_tr__SNS__CONFIG_v6_defval;
const NS__Types::IP6__Elements_template& tr__SNS__CONFIG_v6_defval = template_tr__SNS__CONFIG_v6_defval;
NS__Types::IP6__Elements_template template_ts__SNS__ADD_v6_defval;
const NS__Types::IP6__Elements_template& ts__SNS__ADD_v6_defval = template_ts__SNS__ADD_v6_defval;
NS__Types::IP6__Elements_template template_tr__SNS__ADD_v6_defval;
const NS__Types::IP6__Elements_template& tr__SNS__ADD_v6_defval = template_tr__SNS__ADD_v6_defval;
NS__Types::IP6__Elements_template template_ts__SNS__DEL_v6_defval;
const NS__Types::IP6__Elements_template& ts__SNS__DEL_v6_defval = template_ts__SNS__DEL_v6_defval;
NS__Types::IP6__Elements_template template_tr__SNS__DEL_v6_defval;
const NS__Types::IP6__Elements_template& tr__SNS__DEL_v6_defval = template_tr__SNS__DEL_v6_defval;
NS__Types::IP6__Elements_template template_ts__SNS__CHG__WEIGHT_v6_defval;
const NS__Types::IP6__Elements_template& ts__SNS__CHG__WEIGHT_v6_defval = template_ts__SNS__CHG__WEIGHT_v6_defval;
NS__Types::IP6__Elements_template template_tr__SNS__CHG__WEIGHT_v6_defval;
const NS__Types::IP6__Elements_template& tr__SNS__CHG__WEIGHT_v6_defval = template_tr__SNS__CHG__WEIGHT_v6_defval;
NsCause_template template_ts__SNS__ACK_cause_defval;
const NsCause_template& ts__SNS__ACK_cause_defval = template_ts__SNS__ACK_cause_defval;
NS__Types::IP4__Elements_template template_ts__SNS__ACK_v4_defval;
const NS__Types::IP4__Elements_template& ts__SNS__ACK_v4_defval = template_ts__SNS__ACK_v4_defval;
NS__Types::IP6__Elements_template template_ts__SNS__ACK_v6_defval;
const NS__Types::IP6__Elements_template& ts__SNS__ACK_v6_defval = template_ts__SNS__ACK_v6_defval;
INTEGER_template template_tr__SNS__ACK_trans__id_defval;
const INTEGER_template& tr__SNS__ACK_trans__id_defval = template_tr__SNS__ACK_trans__id_defval;
NsCause_template template_tr__SNS__ACK_cause_defval;
const NsCause_template& tr__SNS__ACK_cause_defval = template_tr__SNS__ACK_cause_defval;
NS__Types::IP4__Elements_template template_tr__SNS__ACK_v4_defval;
const NS__Types::IP4__Elements_template& tr__SNS__ACK_v4_defval = template_tr__SNS__ACK_v4_defval;
NS__Types::IP6__Elements_template template_tr__SNS__ACK_v6_defval;
const NS__Types::IP6__Elements_template& tr__SNS__ACK_v6_defval = template_tr__SNS__ACK_v6_defval;
UNIVERSAL_CHARSTRING BssgpCellId_ra__id_default_coding("RAW");
const XERdescriptor_t       BssgpCellId_cell__id_xer_ = { {"cell_id>\n", "cell_id>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t BssgpCellId_cell__id_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t BssgpCellId_cell__id_descr_ = { "@Osmocom_Gb_Types.BssgpCellId.cell_id", &INTEGER_ber_, &GSM__Types::CellIdentity_raw_, &INTEGER_text_, &BssgpCellId_cell__id_xer_, &INTEGER_json_, &BssgpCellId_cell__id_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpCellId_cell__id_default_coding("RAW");
const TTCN_RAWdescriptor_t BssgpCellId_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for BssgpCellId
const TTCN_Typedescriptor_t BssgpCellId_descr_ = { "@Osmocom_Gb_Types.BssgpCellId", NULL, &BssgpCellId_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpCellId_default_coding("RAW");
const TTCN_RAWdescriptor_t BssgpCause_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for BssgpCause
const TTCN_Typedescriptor_t BssgpCause_descr_ = { "@Osmocom_Gb_Types.BssgpCause", NULL, &BssgpCause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpCause_default_coding("RAW");
OCTETSTRING_template template_tr__BSSGP__LLC__PDU_pdu_defval;
const OCTETSTRING_template& tr__BSSGP__LLC__PDU_pdu_defval = template_tr__BSSGP__LLC__PDU_pdu_defval;
INTEGER_template template_tr__BVC__FC__BVC_bmax_defval;
const INTEGER_template& tr__BVC__FC__BVC_bmax_defval = template_tr__BVC__FC__BVC_bmax_defval;
INTEGER_template template_tr__BVC__FC__BVC_bucket__leak__rate_defval;
const INTEGER_template& tr__BVC__FC__BVC_bucket__leak__rate_defval = template_tr__BVC__FC__BVC_bucket__leak__rate_defval;
INTEGER_template template_tr__BVC__FC__BVC_bmax__default__ms_defval;
const INTEGER_template& tr__BVC__FC__BVC_bmax__default__ms_defval = template_tr__BVC__FC__BVC_bmax__default__ms_defval;
INTEGER_template template_tr__BVC__FC__BVC_r__default__ms_defval;
const INTEGER_template& tr__BVC__FC__BVC_r__default__ms_defval = template_tr__BVC__FC__BVC_r__default__ms_defval;
OCTETSTRING_template template_tr__BVC__FC__BVC_tag_defval;
const OCTETSTRING_template& tr__BVC__FC__BVC_tag_defval = template_tr__BVC__FC__BVC_tag_defval;
OCTETSTRING_template template_tr__BVC__FC__MS_tlli_defval;
const OCTETSTRING_template& tr__BVC__FC__MS_tlli_defval = template_tr__BVC__FC__MS_tlli_defval;
INTEGER_template template_tr__BVC__FC__MS_bmax_defval;
const INTEGER_template& tr__BVC__FC__MS_bmax_defval = template_tr__BVC__FC__MS_bmax_defval;
INTEGER_template template_tr__BVC__FC__MS_bucket__leak__rate_defval;
const INTEGER_template& tr__BVC__FC__MS_bucket__leak__rate_defval = template_tr__BVC__FC__MS_bucket__leak__rate_defval;
OCTETSTRING_template template_tr__BVC__FC__MS_tag_defval;
const OCTETSTRING_template& tr__BVC__FC__MS_tag_defval = template_tr__BVC__FC__MS_tag_defval;
OCTETSTRING_template template_tr__BVC__FC__MS__ACK_tag_defval;
const OCTETSTRING_template& tr__BVC__FC__MS__ACK_tag_defval = template_tr__BVC__FC__MS__ACK_tag_defval;
INTEGER_template template_tr__BSSGP__STATUS_bvci_defval;
const INTEGER_template& tr__BSSGP__STATUS_bvci_defval = template_tr__BSSGP__STATUS_bvci_defval;
BssgpCause_template template_tr__BSSGP__STATUS_cause_defval;
const BssgpCause_template& tr__BSSGP__STATUS_cause_defval = template_tr__BSSGP__STATUS_cause_defval;
OCTETSTRING_template template_tr__BSSGP__STATUS_pdu_defval;
const OCTETSTRING_template& tr__BSSGP__STATUS_pdu_defval = template_tr__BSSGP__STATUS_pdu_defval;
BITSTRING const_ts__RaCapRec__BSSGP_att_defval;
const BITSTRING& ts__RaCapRec__BSSGP_att_defval = const_ts__RaCapRec__BSSGP_att_defval;
BSSGP__Types::MultislotCap__GPRS__BSSGP_template template_ts__RaCapRec__BSSGP_mscap__gprs_defval;
const BSSGP__Types::MultislotCap__GPRS__BSSGP_template& ts__RaCapRec__BSSGP_mscap__gprs_defval = template_ts__RaCapRec__BSSGP_mscap__gprs_defval;
BSSGP__Types::MultislotCap__EGPRS__BSSGP_template template_ts__RaCapRec__BSSGP_mscap__egprs_defval;
const BSSGP__Types::MultislotCap__EGPRS__BSSGP_template& ts__RaCapRec__BSSGP_mscap__egprs_defval = template_ts__RaCapRec__BSSGP_mscap__egprs_defval;
BITSTRING_template template_tr__RaCapRec__BSSGP_att_defval;
const BITSTRING_template& tr__RaCapRec__BSSGP_att_defval = template_tr__RaCapRec__BSSGP_att_defval;
BSSGP__Types::MultislotCap__GPRS__BSSGP_template template_tr__RaCapRec__BSSGP_mscap__gprs_defval;
const BSSGP__Types::MultislotCap__GPRS__BSSGP_template& tr__RaCapRec__BSSGP_mscap__gprs_defval = template_tr__RaCapRec__BSSGP_mscap__gprs_defval;
BSSGP__Types::MultislotCap__EGPRS__BSSGP_template template_tr__RaCapRec__BSSGP_mscap__egprs_defval;
const BSSGP__Types::MultislotCap__EGPRS__BSSGP_template& tr__RaCapRec__BSSGP_mscap__egprs_defval = template_tr__RaCapRec__BSSGP_mscap__egprs_defval;
BSSGP__Types::QoS__Profile__V_template template_t__defaultQos;
const BSSGP__Types::QoS__Profile__V_template& t__defaultQos = template_t__defaultQos;
INTEGER const_t__DefaultLifetime_delay_defval;
const INTEGER& t__DefaultLifetime_delay_defval = const_t__DefaultLifetime_delay_defval;
BSSGP__Types::DRX__Parameters_template template_t__defaultDRXparam;
const BSSGP__Types::DRX__Parameters_template& t__defaultDRXparam = template_t__defaultDRXparam;
BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template template_ts__BSSGP__DL__UD_racap_defval;
const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& ts__BSSGP__DL__UD_racap_defval = template_ts__BSSGP__DL__UD_racap_defval;
BSSGP__Types::IMSI__BSSGP_template template_ts__BSSGP__DL__UD_imsi_defval;
const BSSGP__Types::IMSI__BSSGP_template& ts__BSSGP__DL__UD_imsi_defval = template_ts__BSSGP__DL__UD_imsi_defval;
BSSGP__Types::IMSI__BSSGP_template template_tr__BSSGP__DL__UD_imsi_defval;
const BSSGP__Types::IMSI__BSSGP_template& tr__BSSGP__DL__UD_imsi_defval = template_tr__BSSGP__DL__UD_imsi_defval;
OCTETSTRING_template template_tr__BSSGP__UL__UD_tlli_defval;
const OCTETSTRING_template& tr__BSSGP__UL__UD_tlli_defval = template_tr__BSSGP__UL__UD_tlli_defval;
BssgpCellId_template template_tr__BSSGP__UL__UD_cell__id_defval;
const BssgpCellId_template& tr__BSSGP__UL__UD_cell__id_defval = template_tr__BSSGP__UL__UD_cell__id_defval;
OCTETSTRING_template template_tr__BSSGP__UL__UD_payload_defval;
const OCTETSTRING_template& tr__BSSGP__UL__UD_payload_defval = template_tr__BSSGP__UL__UD_payload_defval;
BSSGP__Types::Paging__Field4_template template_ts__BssgpP4BssArea;
const BSSGP__Types::Paging__Field4_template& ts__BssgpP4BssArea = template_ts__BssgpP4BssArea;
INTEGER_template template_ts__BSSGP__FLUSH__LL_bvci__new_defval;
const INTEGER_template& ts__BSSGP__FLUSH__LL_bvci__new_defval = template_ts__BSSGP__FLUSH__LL_bvci__new_defval;
INTEGER_template template_ts__BSSGP__FLUSH__LL_nsei_defval;
const INTEGER_template& ts__BSSGP__FLUSH__LL_nsei_defval = template_ts__BSSGP__FLUSH__LL_nsei_defval;
INTEGER_template template_tr__BSSGP__FLUSH__LL_bvci__new_defval;
const INTEGER_template& tr__BSSGP__FLUSH__LL_bvci__new_defval = template_tr__BSSGP__FLUSH__LL_bvci__new_defval;
INTEGER_template template_tr__BSSGP__FLUSH__LL_nsei_defval;
const INTEGER_template& tr__BSSGP__FLUSH__LL_nsei_defval = template_tr__BSSGP__FLUSH__LL_nsei_defval;
INTEGER_template template_ts__BSSGP__FLUSH__LL__ACK_bvci__new_defval;
const INTEGER_template& ts__BSSGP__FLUSH__LL__ACK_bvci__new_defval = template_ts__BSSGP__FLUSH__LL__ACK_bvci__new_defval;
INTEGER_template template_ts__BSSGP__FLUSH__LL__ACK_nsei_defval;
const INTEGER_template& ts__BSSGP__FLUSH__LL__ACK_nsei_defval = template_ts__BSSGP__FLUSH__LL__ACK_nsei_defval;
INTEGER_template template_tr__BSSGP__FLUSH__LL__ACK_bvci__new_defval;
const INTEGER_template& tr__BSSGP__FLUSH__LL__ACK_bvci__new_defval = template_tr__BSSGP__FLUSH__LL__ACK_bvci__new_defval;
INTEGER_template template_tr__BSSGP__FLUSH__LL__ACK_nsei_defval;
const INTEGER_template& tr__BSSGP__FLUSH__LL__ACK_nsei_defval = template_tr__BSSGP__FLUSH__LL__ACK_nsei_defval;
BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template template_ts__BSSGP__RA__CAP_racap_defval;
const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& ts__BSSGP__RA__CAP_racap_defval = template_ts__BSSGP__RA__CAP_racap_defval;
BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template template_ts__BSSGP__RA__CAP__UPD__ACK_racap_defval;
const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& ts__BSSGP__RA__CAP__UPD__ACK_racap_defval = template_ts__BSSGP__RA__CAP__UPD__ACK_racap_defval;
BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template template_tr__BSSGP__RA__CAP__UPD__ACK_racap_defval;
const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& tr__BSSGP__RA__CAP__UPD__ACK_racap_defval = template_tr__BSSGP__RA__CAP__UPD__ACK_racap_defval;
const TTCN_RAWdescriptor_t BssgpRadioCause_raw_ = {8,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for BssgpRadioCause
const TTCN_Typedescriptor_t BssgpRadioCause_descr_ = { "@Osmocom_Gb_Types.BssgpRadioCause", NULL, &BssgpRadioCause_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING BssgpRadioCause_default_coding("RAW");
INTEGER_template template_ts__BSSGP__RADIO__STATUS_tmsi_defval;
const INTEGER_template& ts__BSSGP__RADIO__STATUS_tmsi_defval = template_ts__BSSGP__RADIO__STATUS_tmsi_defval;
HEXSTRING_template template_ts__BSSGP__RADIO__STATUS_imsi_defval;
const HEXSTRING_template& ts__BSSGP__RADIO__STATUS_imsi_defval = template_ts__BSSGP__RADIO__STATUS_imsi_defval;
INTEGER_template template_tr__BSSGP__RADIO__STATUS_tmsi_defval;
const INTEGER_template& tr__BSSGP__RADIO__STATUS_tmsi_defval = template_tr__BSSGP__RADIO__STATUS_tmsi_defval;
HEXSTRING_template template_tr__BSSGP__RADIO__STATUS_imsi_defval;
const HEXSTRING_template& tr__BSSGP__RADIO__STATUS_imsi_defval = template_tr__BSSGP__RADIO__STATUS_imsi_defval;
OCTETSTRING const_RIM__APP__ID__NACC;
const OCTETSTRING& RIM__APP__ID__NACC = const_RIM__APP__ID__NACC;
OCTETSTRING const_RIM__APP__ID__SI3;
const OCTETSTRING& RIM__APP__ID__SI3 = const_RIM__APP__ID__SI3;
OCTETSTRING const_RIM__APP__ID__MBMS__DATA__CH;
const OCTETSTRING& RIM__APP__ID__MBMS__DATA__CH = const_RIM__APP__ID__MBMS__DATA__CH;
OCTETSTRING const_RIM__APP__ID__SON__TRANSF;
const OCTETSTRING& RIM__APP__ID__SON__TRANSF = const_RIM__APP__ID__SON__TRANSF;
OCTETSTRING const_RIM__APP__ID__UTRA__SI;
const OCTETSTRING& RIM__APP__ID__UTRA__SI = const_RIM__APP__ID__UTRA__SI;
OCTETSTRING_template template_tr__RIM__Application__Identity_app__id_defval;
const OCTETSTRING_template& tr__RIM__Application__Identity_app__id_defval = template_tr__RIM__Application__Identity_app__id_defval;
INTEGER_template template_tr__RIM__Sequence__Number_seq_defval;
const INTEGER_template& tr__RIM__Sequence__Number_seq_defval = template_tr__RIM__Sequence__Number_seq_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_ts__RAN__Information__Request__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& ts__RAN__Information__Request__RIM__Container_ver_defval = template_ts__RAN__Information__Request__RIM__Container_ver_defval;
BSSGP__Types::RAN__Information__Request__Application__Container_template template_ts__RAN__Information__Request__RIM__Container_app__cont_defval;
const BSSGP__Types::RAN__Information__Request__Application__Container_template& ts__RAN__Information__Request__RIM__Container_app__cont_defval = template_ts__RAN__Information__Request__RIM__Container_app__cont_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_ts__RAN__Information__Request__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& ts__RAN__Information__Request__RIM__Container_son__app__id_defval = template_ts__RAN__Information__Request__RIM__Container_son__app__id_defval;
BSSGP__Types::RIM__Application__Identity_template template_tr__RAN__Information__Request__RIM__Container_app__id_defval;
const BSSGP__Types::RIM__Application__Identity_template& tr__RAN__Information__Request__RIM__Container_app__id_defval = template_tr__RAN__Information__Request__RIM__Container_app__id_defval;
BSSGP__Types::RIM__Sequence__Number_template template_tr__RAN__Information__Request__RIM__Container_seq_defval;
const BSSGP__Types::RIM__Sequence__Number_template& tr__RAN__Information__Request__RIM__Container_seq_defval = template_tr__RAN__Information__Request__RIM__Container_seq_defval;
BSSGP__Types::RIM__PDU__Indications_template template_tr__RAN__Information__Request__RIM__Container_ind_defval;
const BSSGP__Types::RIM__PDU__Indications_template& tr__RAN__Information__Request__RIM__Container_ind_defval = template_tr__RAN__Information__Request__RIM__Container_ind_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_tr__RAN__Information__Request__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& tr__RAN__Information__Request__RIM__Container_ver_defval = template_tr__RAN__Information__Request__RIM__Container_ver_defval;
BSSGP__Types::RAN__Information__Request__Application__Container_template template_tr__RAN__Information__Request__RIM__Container_app__cont_defval;
const BSSGP__Types::RAN__Information__Request__Application__Container_template& tr__RAN__Information__Request__RIM__Container_app__cont_defval = template_tr__RAN__Information__Request__RIM__Container_app__cont_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_tr__RAN__Information__Request__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& tr__RAN__Information__Request__RIM__Container_son__app__id_defval = template_tr__RAN__Information__Request__RIM__Container_son__app__id_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_ts__RAN__Information__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& ts__RAN__Information__RIM__Container_ver_defval = template_ts__RAN__Information__RIM__Container_ver_defval;
BSSGP__Types::ApplContainer__or__ApplErrContainer_template template_ts__RAN__Information__RIM__Container_app__cont__or__app__err_defval;
const BSSGP__Types::ApplContainer__or__ApplErrContainer_template& ts__RAN__Information__RIM__Container_app__cont__or__app__err_defval = template_ts__RAN__Information__RIM__Container_app__cont__or__app__err_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_ts__RAN__Information__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& ts__RAN__Information__RIM__Container_son__app__id_defval = template_ts__RAN__Information__RIM__Container_son__app__id_defval;
BSSGP__Types::RIM__Application__Identity_template template_tr__RAN__Information__RIM__Container_app__id_defval;
const BSSGP__Types::RIM__Application__Identity_template& tr__RAN__Information__RIM__Container_app__id_defval = template_tr__RAN__Information__RIM__Container_app__id_defval;
BSSGP__Types::RIM__Sequence__Number_template template_tr__RAN__Information__RIM__Container_seq_defval;
const BSSGP__Types::RIM__Sequence__Number_template& tr__RAN__Information__RIM__Container_seq_defval = template_tr__RAN__Information__RIM__Container_seq_defval;
BSSGP__Types::RIM__PDU__Indications_template template_tr__RAN__Information__RIM__Container_ind_defval;
const BSSGP__Types::RIM__PDU__Indications_template& tr__RAN__Information__RIM__Container_ind_defval = template_tr__RAN__Information__RIM__Container_ind_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_tr__RAN__Information__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& tr__RAN__Information__RIM__Container_ver_defval = template_tr__RAN__Information__RIM__Container_ver_defval;
BSSGP__Types::ApplContainer__or__ApplErrContainer_template template_tr__RAN__Information__RIM__Container_app__cont__or__app__err_defval;
const BSSGP__Types::ApplContainer__or__ApplErrContainer_template& tr__RAN__Information__RIM__Container_app__cont__or__app__err_defval = template_tr__RAN__Information__RIM__Container_app__cont__or__app__err_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_tr__RAN__Information__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& tr__RAN__Information__RIM__Container_son__app__id_defval = template_tr__RAN__Information__RIM__Container_son__app__id_defval;
BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template template_tru__ApplContainer__or__ApplErrContainer__NACC_cont_defval;
const BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template& tru__ApplContainer__or__ApplErrContainer__NACC_cont_defval = template_tru__ApplContainer__or__ApplErrContainer__NACC_cont_defval;
BssgpCellId_template template_tru__ApplContainer__NACC_cid_defval;
const BssgpCellId_template& tru__ApplContainer__NACC_cid_defval = template_tru__ApplContainer__NACC_cid_defval;
BOOLEAN_template template_tru__ApplContainer__NACC_psi__type_defval;
const BOOLEAN_template& tru__ApplContainer__NACC_psi__type_defval = template_tru__ApplContainer__NACC_psi__type_defval;
INTEGER_template template_tru__ApplContainer__NACC_si__psi__num_defval;
const INTEGER_template& tru__ApplContainer__NACC_si__psi__num_defval = template_tru__ApplContainer__NACC_si__psi__num_defval;
OCTETSTRING_template template_tru__ApplContainer__NACC_si__psi_defval;
const OCTETSTRING_template& tru__ApplContainer__NACC_si__psi_defval = template_tru__ApplContainer__NACC_si__psi_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_ts__RAN__Information__Ack__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& ts__RAN__Information__Ack__RIM__Container_ver_defval = template_ts__RAN__Information__Ack__RIM__Container_ver_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_ts__RAN__Information__Ack__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& ts__RAN__Information__Ack__RIM__Container_son__app__id_defval = template_ts__RAN__Information__Ack__RIM__Container_son__app__id_defval;
BSSGP__Types::RIM__Application__Identity_template template_tr__RAN__Information__Ack__RIM__Container_app__id_defval;
const BSSGP__Types::RIM__Application__Identity_template& tr__RAN__Information__Ack__RIM__Container_app__id_defval = template_tr__RAN__Information__Ack__RIM__Container_app__id_defval;
BSSGP__Types::RIM__Sequence__Number_template template_tr__RAN__Information__Ack__RIM__Container_seq_defval;
const BSSGP__Types::RIM__Sequence__Number_template& tr__RAN__Information__Ack__RIM__Container_seq_defval = template_tr__RAN__Information__Ack__RIM__Container_seq_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_tr__RAN__Information__Ack__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& tr__RAN__Information__Ack__RIM__Container_ver_defval = template_tr__RAN__Information__Ack__RIM__Container_ver_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_tr__RAN__Information__Ack__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& tr__RAN__Information__Ack__RIM__Container_son__app__id_defval = template_tr__RAN__Information__Ack__RIM__Container_son__app__id_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_ts__RAN__Information__Error__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& ts__RAN__Information__Error__RIM__Container_ver_defval = template_ts__RAN__Information__Error__RIM__Container_ver_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_ts__RAN__Information__Error__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& ts__RAN__Information__Error__RIM__Container_son__app__id_defval = template_ts__RAN__Information__Error__RIM__Container_son__app__id_defval;
BSSGP__Types::RIM__Application__Identity_template template_tr__RAN__Information__Error__RIM__Container_app__id_defval;
const BSSGP__Types::RIM__Application__Identity_template& tr__RAN__Information__Error__RIM__Container_app__id_defval = template_tr__RAN__Information__Error__RIM__Container_app__id_defval;
BSSGP__Types::Cause__BSSGP_template template_tr__RAN__Information__Error__RIM__Container_cause_defval;
const BSSGP__Types::Cause__BSSGP_template& tr__RAN__Information__Error__RIM__Container_cause_defval = template_tr__RAN__Information__Error__RIM__Container_cause_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_tr__RAN__Information__Error__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& tr__RAN__Information__Error__RIM__Container_ver_defval = template_tr__RAN__Information__Error__RIM__Container_ver_defval;
OCTETSTRING_template template_tr__RAN__Information__Error__RIM__Container_pdu_defval;
const OCTETSTRING_template& tr__RAN__Information__Error__RIM__Container_pdu_defval = template_tr__RAN__Information__Error__RIM__Container_pdu_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_tr__RAN__Information__Error__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& tr__RAN__Information__Error__RIM__Container_son__app__id_defval = template_tr__RAN__Information__Error__RIM__Container_son__app__id_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_ts__RAN__Information__Application__Error__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& ts__RAN__Information__Application__Error__RIM__Container_ver_defval = template_ts__RAN__Information__Application__Error__RIM__Container_ver_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_ts__RAN__Information__Application__Error__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& ts__RAN__Information__Application__Error__RIM__Container_son__app__id_defval = template_ts__RAN__Information__Application__Error__RIM__Container_son__app__id_defval;
BSSGP__Types::RIM__Application__Identity_template template_tr__RAN__Information__Application__Error__RIM__Container_app__id_defval;
const BSSGP__Types::RIM__Application__Identity_template& tr__RAN__Information__Application__Error__RIM__Container_app__id_defval = template_tr__RAN__Information__Application__Error__RIM__Container_app__id_defval;
BSSGP__Types::RIM__Sequence__Number_template template_tr__RAN__Information__Application__Error__RIM__Container_seq_defval;
const BSSGP__Types::RIM__Sequence__Number_template& tr__RAN__Information__Application__Error__RIM__Container_seq_defval = template_tr__RAN__Information__Application__Error__RIM__Container_seq_defval;
BSSGP__Types::RIM__PDU__Indications_template template_tr__RAN__Information__Application__Error__RIM__Container_ind_defval;
const BSSGP__Types::RIM__PDU__Indications_template& tr__RAN__Information__Application__Error__RIM__Container_ind_defval = template_tr__RAN__Information__Application__Error__RIM__Container_ind_defval;
BSSGP__Types::RIM__Protocol__Version__Number_template template_tr__RAN__Information__Application__Error__RIM__Container_ver_defval;
const BSSGP__Types::RIM__Protocol__Version__Number_template& tr__RAN__Information__Application__Error__RIM__Container_ver_defval = template_tr__RAN__Information__Application__Error__RIM__Container_ver_defval;
BSSGP__Types::Application__Error__Container_template template_tr__RAN__Information__Application__Error__RIM__Container_cont_defval;
const BSSGP__Types::Application__Error__Container_template& tr__RAN__Information__Application__Error__RIM__Container_cont_defval = template_tr__RAN__Information__Application__Error__RIM__Container_cont_defval;
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template template_tr__RAN__Information__Application__Error__RIM__Container_son__app__id_defval;
const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& tr__RAN__Information__Application__Error__RIM__Container_son__app__id_defval = template_tr__RAN__Information__Application__Error__RIM__Container_son__app__id_defval;
BssgpCellId_template template_tr__RAN__Information__Request__Application__Container__NACC_cid_defval;
const BssgpCellId_template& tr__RAN__Information__Request__Application__Container__NACC_cid_defval = template_tr__RAN__Information__Request__Application__Container__NACC_cid_defval;
BssgpCellId_template template_tr__RAN__Information__Application__Container__NACC_cid_defval;
const BssgpCellId_template& tr__RAN__Information__Application__Container__NACC_cid_defval = template_tr__RAN__Information__Application__Container__NACC_cid_defval;
BOOLEAN_template template_tr__RAN__Information__Application__Container__NACC_psi__type_defval;
const BOOLEAN_template& tr__RAN__Information__Application__Container__NACC_psi__type_defval = template_tr__RAN__Information__Application__Container__NACC_psi__type_defval;
INTEGER_template template_tr__RAN__Information__Application__Container__NACC_si__psi__num_defval;
const INTEGER_template& tr__RAN__Information__Application__Container__NACC_si__psi__num_defval = template_tr__RAN__Information__Application__Container__NACC_si__psi__num_defval;
OCTETSTRING_template template_tr__RAN__Information__Application__Container__NACC_si__psi_defval;
const OCTETSTRING_template& tr__RAN__Information__Application__Container__NACC_si__psi_defval = template_tr__RAN__Information__Application__Container__NACC_si__psi_defval;
BssgpCellId_template template_rsu__Application__Error__Container__NACC_cid_defval;
const BssgpCellId_template& rsu__Application__Error__Container__NACC_cid_defval = template_rsu__Application__Error__Container__NACC_cid_defval;
INTEGER_template template_rsu__Application__Error__Container__NACC_cause_defval;
const INTEGER_template& rsu__Application__Error__Container__NACC_cause_defval = template_rsu__Application__Error__Container__NACC_cause_defval;
BSSGP__Types::Application__Container__IE__NACC_template template_rsu__Application__Error__Container__NACC_app__cont_defval;
const BSSGP__Types::Application__Container__IE__NACC_template& rsu__Application__Error__Container__NACC_app__cont_defval = template_rsu__Application__Error__Container__NACC_app__cont_defval;
BssgpCellId_template template_tr__Application__Error__Container__NACC_cid_defval;
const BssgpCellId_template& tr__Application__Error__Container__NACC_cid_defval = template_tr__Application__Error__Container__NACC_cid_defval;
INTEGER_template template_tr__Application__Error__Container__NACC_cause_defval;
const INTEGER_template& tr__Application__Error__Container__NACC_cause_defval = template_tr__Application__Error__Container__NACC_cause_defval;
BSSGP__Types::Application__Container__IE__NACC_template template_tr__Application__Error__Container__NACC_app__cont_defval;
const BSSGP__Types::Application__Container__IE__NACC_template& tr__Application__Error__Container__NACC_app__cont_defval = template_tr__Application__Error__Container__NACC_app__cont_defval;
BssgpCellId_template template_rsu__Application__Container__IE__NACC__req_cid_defval;
const BssgpCellId_template& rsu__Application__Container__IE__NACC__req_cid_defval = template_rsu__Application__Container__IE__NACC__req_cid_defval;
BITSTRING const_RIM__PDU__TYPE__STOP;
const BITSTRING& RIM__PDU__TYPE__STOP = const_RIM__PDU__TYPE__STOP;
BITSTRING const_RIM__PDU__TYPE__SING__REP;
const BITSTRING& RIM__PDU__TYPE__SING__REP = const_RIM__PDU__TYPE__SING__REP;
BITSTRING const_RIM__PDU__TYPE__MULT__REP;
const BITSTRING& RIM__PDU__TYPE__MULT__REP = const_RIM__PDU__TYPE__MULT__REP;
BOOLEAN_template template_tr__RIM__PDU__Indications_ack_defval;
const BOOLEAN_template& tr__RIM__PDU__Indications_ack_defval = template_tr__RIM__PDU__Indications_ack_defval;
BITSTRING_template template_tr__RIM__PDU__Indications_type__ext_defval;
const BITSTRING_template& tr__RIM__PDU__Indications_type__ext_defval = template_tr__RIM__PDU__Indications_type__ext_defval;
INTEGER_template template_tr__RIM__Protocol__Version__Number_ver_defval;
const INTEGER_template& tr__RIM__Protocol__Version__Number_ver_defval = template_tr__RIM__Protocol__Version__Number_ver_defval;
HEXSTRING const_RIM__ADDR__GERAN__CELL__ID;
const HEXSTRING& RIM__ADDR__GERAN__CELL__ID = const_RIM__ADDR__GERAN__CELL__ID;
HEXSTRING const_RIM__ADDR__UTRAN__RNC__ID;
const HEXSTRING& RIM__ADDR__UTRAN__RNC__ID = const_RIM__ADDR__UTRAN__RNC__ID;
HEXSTRING const_RIM__ADDR__EUTRAN__NODEB__ID;
const HEXSTRING& RIM__ADDR__EUTRAN__NODEB__ID = const_RIM__ADDR__EUTRAN__NODEB__ID;
HEXSTRING const_RIM__ADDR__EHRPD__SECTOR__ID;
const HEXSTRING& RIM__ADDR__EHRPD__SECTOR__ID = const_RIM__ADDR__EHRPD__SECTOR__ID;
HEXSTRING_template template_tr__RIM__Routing__Information_addr__discr_defval;
const HEXSTRING_template& tr__RIM__Routing__Information_addr__discr_defval = template_tr__RIM__Routing__Information_addr__discr_defval;
BSSGP__Types::RIM__Routing__Address_template template_tr__RIM__Routing__Information_addr_defval;
const BSSGP__Types::RIM__Routing__Address_template& tr__RIM__Routing__Information_addr_defval = template_tr__RIM__Routing__Information_addr_defval;
BssgpCellId_template template_t__RIM__Routing__Address__cid_cid_defval;
const BssgpCellId_template& t__RIM__Routing__Address__cid_cid_defval = template_t__RIM__Routing__Address__cid_cid_defval;
BssgpCellId_template template_t__RIM__Routing__Address__rncid_cid_defval;
const BssgpCellId_template& t__RIM__Routing__Address__rncid_cid_defval = template_t__RIM__Routing__Address__rncid_cid_defval;
INTEGER_template template_t__RIM__Routing__Address__rncid_rnc__id_defval;
const INTEGER_template& t__RIM__Routing__Address__rncid_rnc__id_defval = template_t__RIM__Routing__Address__rncid_rnc__id_defval;
BssgpCellId_template template_t__RIM__Routing__Address__enbid_cid_defval;
const BssgpCellId_template& t__RIM__Routing__Address__enbid_cid_defval = template_t__RIM__Routing__Address__enbid_cid_defval;
INTEGER_template template_t__RIM__Routing__Address__enbid_tac_defval;
const INTEGER_template& t__RIM__Routing__Address__enbid_tac_defval = template_t__RIM__Routing__Address__enbid_tac_defval;
OCTETSTRING_template template_t__RIM__Routing__Address__enbid_gnbid_defval;
const OCTETSTRING_template& t__RIM__Routing__Address__enbid_gnbid_defval = template_t__RIM__Routing__Address__enbid_gnbid_defval;
OCTETSTRING_template template_t__RIM__Routing__Address__sector_sector_defval;
const OCTETSTRING_template& t__RIM__Routing__Address__sector_sector_defval = template_t__RIM__Routing__Address__sector_sector_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__RAN__INFORMATION__REQUEST_dst_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__RAN__INFORMATION__REQUEST_dst_defval = template_tr__RAN__INFORMATION__REQUEST_dst_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__RAN__INFORMATION__REQUEST_src_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__RAN__INFORMATION__REQUEST_src_defval = template_tr__RAN__INFORMATION__REQUEST_src_defval;
BSSGP__Types::RAN__Information__Request__RIM__Container_template template_tr__RAN__INFORMATION__REQUEST_cont_defval;
const BSSGP__Types::RAN__Information__Request__RIM__Container_template& tr__RAN__INFORMATION__REQUEST_cont_defval = template_tr__RAN__INFORMATION__REQUEST_cont_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__PDU__BSSGP__RAN__INFORMATION_dst_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__PDU__BSSGP__RAN__INFORMATION_dst_defval = template_tr__PDU__BSSGP__RAN__INFORMATION_dst_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__PDU__BSSGP__RAN__INFORMATION_src_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__PDU__BSSGP__RAN__INFORMATION_src_defval = template_tr__PDU__BSSGP__RAN__INFORMATION_src_defval;
BSSGP__Types::RAN__Information__RIM__Container_template template_tr__PDU__BSSGP__RAN__INFORMATION_cont_defval;
const BSSGP__Types::RAN__Information__RIM__Container_template& tr__PDU__BSSGP__RAN__INFORMATION_cont_defval = template_tr__PDU__BSSGP__RAN__INFORMATION_cont_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_dst_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__PDU__BSSGP__RAN__INFORMATION__ACK_dst_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_dst_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_src_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__PDU__BSSGP__RAN__INFORMATION__ACK_src_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_src_defval;
BSSGP__Types::RAN__Information__Ack__RIM__Container_template template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_cont_defval;
const BSSGP__Types::RAN__Information__Ack__RIM__Container_template& tr__PDU__BSSGP__RAN__INFORMATION__ACK_cont_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_cont_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_dst_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__PDU__BSSGP__RAN__INFORMATION__ERROR_dst_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_dst_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_src_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__PDU__BSSGP__RAN__INFORMATION__ERROR_src_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_src_defval;
BSSGP__Types::RAN__Information__Error__RIM__Container_template template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_cont_defval;
const BSSGP__Types::RAN__Information__Error__RIM__Container_template& tr__PDU__BSSGP__RAN__INFORMATION__ERROR_cont_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_cont_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_dst_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_dst_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_dst_defval;
BSSGP__Types::RIM__Routing__Information_template template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_src_defval;
const BSSGP__Types::RIM__Routing__Information_template& tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_src_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_src_defval;
BSSGP__Types::RAN__Information__Application__Error__RIM__Container_template template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_cont_defval;
const BSSGP__Types::RAN__Information__Application__Error__RIM__Container_template& tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_cont_defval = template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_cont_defval;
BSSGP__Types::PDU__BSSGP_template template_tr__BSSGP__PERMITTED__PTP__ONLY;
const BSSGP__Types::PDU__BSSGP_template& tr__BSSGP__PERMITTED__PTP__ONLY = template_tr__BSSGP__PERMITTED__PTP__ONLY;
BSSGP__Types::PDU__BSSGP_template template_tr__BSSGP__PERMITTED__PTP;
const BSSGP__Types::PDU__BSSGP_template& tr__BSSGP__PERMITTED__PTP = template_tr__BSSGP__PERMITTED__PTP;
BSSGP__Types::PDU__BSSGP_template template_tr__BSSGP__PERMITTED__SIGN__ONLY;
const BSSGP__Types::PDU__BSSGP_template& tr__BSSGP__PERMITTED__SIGN__ONLY = template_tr__BSSGP__PERMITTED__SIGN__ONLY;
BSSGP__Types::PDU__BSSGP_template template_tr__BSSGP__PERMITTED__SIGN;
const BSSGP__Types::PDU__BSSGP_template& tr__BSSGP__PERMITTED__SIGN = template_tr__BSSGP__PERMITTED__SIGN;
BSSGP__Types::PDU__BSSGP_template template_tr__BSSGP__PERMITTED__PTM__ONLY;
const BSSGP__Types::PDU__BSSGP_template& tr__BSSGP__PERMITTED__PTM__ONLY = template_tr__BSSGP__PERMITTED__PTM__ONLY;
BSSGP__Types::PDU__BSSGP_template template_tr__BSSGP__PERMITTED__PTM;
const BSSGP__Types::PDU__BSSGP_template& tr__BSSGP__PERMITTED__PTM = template_tr__BSSGP__PERMITTED__PTM;
BSSGP__Types::BVCI_template template_tr__BSSGP__IE__PtpBvci;
const BSSGP__Types::BVCI_template& tr__BSSGP__IE__PtpBvci = template_tr__BSSGP__IE__PtpBvci;
const TTCN_RAWdescriptor_t TlliType_raw_ = {0,SG_NO,ORDER_LSB,ORDER_LSB,ORDER_LSB,ORDER_LSB,EXT_BIT_NO,ORDER_LSB,ORDER_LSB,TOP_BIT_INHERITED,0,0,0,8,0,NULL,-1,CharCoding::UNKNOWN_CHAR_CODING,NULL,false};
// No XER for TlliType
const TTCN_Typedescriptor_t TlliType_descr_ = { "@Osmocom_Gb_Types.TlliType", NULL, &TlliType_raw_, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TlliType_default_coding("RAW");
TTCN_Module module_object("Osmocom_Gb_Types", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

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

/* Member functions of C++ classes */

OsmoNsDialect::OsmoNsDialect()
{
enum_value = UNBOUND_VALUE;
}

OsmoNsDialect::OsmoNsDialect(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Osmocom_Gb_Types.OsmoNsDialect with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

OsmoNsDialect::OsmoNsDialect(enum_type other_value)
{
enum_value = other_value;
}

OsmoNsDialect::OsmoNsDialect(const OsmoNsDialect& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
enum_value = other_value.enum_value;
}

OsmoNsDialect& OsmoNsDialect::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

OsmoNsDialect& OsmoNsDialect::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

OsmoNsDialect& OsmoNsDialect::operator=(const OsmoNsDialect& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
enum_value = other_value.enum_value;
return *this;
}

boolean OsmoNsDialect::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.OsmoNsDialect comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean OsmoNsDialect::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
return enum_value == other_value;
}

boolean OsmoNsDialect::operator==(const OsmoNsDialect& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
return enum_value == other_value.enum_value;
}

boolean OsmoNsDialect::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.OsmoNsDialect comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean OsmoNsDialect::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
return enum_value < other_value;
}

boolean OsmoNsDialect::operator<(const OsmoNsDialect& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
return enum_value < other_value.enum_value;
}

boolean OsmoNsDialect::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.OsmoNsDialect comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean OsmoNsDialect::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
return enum_value > other_value;
}

boolean OsmoNsDialect::operator>(const OsmoNsDialect& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
return enum_value > other_value.enum_value;
}

const char *OsmoNsDialect::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NS2__DIALECT__UNDEF: return "NS2_DIALECT_UNDEF";
case NS2__DIALECT__STATIC__ALIVE: return "NS2_DIALECT_STATIC_ALIVE";
case NS2__DIALECT__STATIC__RESETBLOCK: return "NS2_DIALECT_STATIC_RESETBLOCK";
case NS2__DIALECT__IPACCESS: return "NS2_DIALECT_IPACCESS";
case NS2__DIALECT__SNS: return "NS2_DIALECT_SNS";
default:
return "<unknown>";
}
}

OsmoNsDialect::enum_type OsmoNsDialect::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NS2_DIALECT_UNDEF")) return NS2__DIALECT__UNDEF;
if (!strcmp(str_par, "NS2_DIALECT_STATIC_ALIVE")) return NS2__DIALECT__STATIC__ALIVE;
if (!strcmp(str_par, "NS2_DIALECT_STATIC_RESETBLOCK")) return NS2__DIALECT__STATIC__RESETBLOCK;
if (!strcmp(str_par, "NS2_DIALECT_IPACCESS")) return NS2__DIALECT__IPACCESS;
if (!strcmp(str_par, "NS2_DIALECT_SNS")) return NS2__DIALECT__SNS;
}
return UNKNOWN_VALUE;
}

boolean OsmoNsDialect::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
return TRUE;
default:
return FALSE;
}
}

int OsmoNsDialect::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int OsmoNsDialect::enum2int(const OsmoNsDialect& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void OsmoNsDialect::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.", int_val);
enum_value = (enum_type)int_val;
}

OsmoNsDialect::operator OsmoNsDialect::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
return enum_value;
}

void OsmoNsDialect::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void OsmoNsDialect::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Osmocom_Gb_Types.OsmoNsDialect");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @Osmocom_Gb_Types.OsmoNsDialect.");
  }
}

void OsmoNsDialect::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
text_buf.push_int(enum_value);
}

void OsmoNsDialect::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Osmocom_Gb_Types.OsmoNsDialect.", enum_value);
}

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

void OsmoNsDialect::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 OsmoNsDialect::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int OsmoNsDialect::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void OsmoNsDialect_template::copy_template(const OsmoNsDialect_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new OsmoNsDialect_template[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 OsmoNsDialect_template(*other_value.implication_.precondition);
implication_.implied_template = new OsmoNsDialect_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
}
}

OsmoNsDialect_template::OsmoNsDialect_template()
{
}

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

OsmoNsDialect_template::OsmoNsDialect_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!OsmoNsDialect::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect with unknown numeric value %d.", other_value);
single_value = (OsmoNsDialect::enum_type)other_value;
}

OsmoNsDialect_template::OsmoNsDialect_template(OsmoNsDialect::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

OsmoNsDialect_template::OsmoNsDialect_template(const OsmoNsDialect& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == OsmoNsDialect::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
single_value = other_value.enum_value;
}

OsmoNsDialect_template::OsmoNsDialect_template(const OPTIONAL<OsmoNsDialect>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (OsmoNsDialect::enum_type)(const OsmoNsDialect&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect from an unbound optional field.");
}
}

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

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

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

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

boolean OsmoNsDialect_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean OsmoNsDialect_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != OsmoNsDialect::UNBOUND_VALUE;
}

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

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

OsmoNsDialect_template& OsmoNsDialect_template::operator=(int other_value)
{
if (!OsmoNsDialect::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (OsmoNsDialect::enum_type)other_value;
return *this;
}

OsmoNsDialect_template& OsmoNsDialect_template::operator=(OsmoNsDialect::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

OsmoNsDialect_template& OsmoNsDialect_template::operator=(const OsmoNsDialect& other_value)
{
if (other_value.enum_value == OsmoNsDialect::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.OsmoNsDialect to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

OsmoNsDialect_template& OsmoNsDialect_template::operator=(const OPTIONAL<OsmoNsDialect>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (OsmoNsDialect::enum_type)(const OsmoNsDialect&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
}
return *this;
}

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

boolean OsmoNsDialect_template::match(OsmoNsDialect::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
}
return FALSE;
}

boolean OsmoNsDialect_template::match(const OsmoNsDialect& other_value, boolean) const
{
if (other_value.enum_value == OsmoNsDialect::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect with an unbound value.");
return match(other_value.enum_value);
}

OsmoNsDialect::enum_type OsmoNsDialect_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
return single_value;
}

void OsmoNsDialect_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new OsmoNsDialect_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
}
}

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

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

void OsmoNsDialect_template::log_match(const OsmoNsDialect& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void OsmoNsDialect_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
}
}

void OsmoNsDialect_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (OsmoNsDialect::enum_type)text_buf.pull_int().get_val();
if (!OsmoNsDialect::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new OsmoNsDialect_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Osmocom_Gb_Types.OsmoNsDialect.");
}
}

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

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

void OsmoNsDialect_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    OsmoNsDialect_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    OsmoNsDialect::enum_type enum_val = OsmoNsDialect::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!OsmoNsDialect::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Osmocom_Gb_Types.OsmoNsDialect.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    OsmoNsDialect_template* precondition = new OsmoNsDialect_template;
    precondition->set_param(*m_p->get_elem(0));
    OsmoNsDialect_template* implied_template = new OsmoNsDialect_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = OsmoNsDialect_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Osmocom_Gb_Types.OsmoNsDialect");
  }
  is_ifpresent = param.get_ifpresent();
}

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

NsPduType::NsPduType()
{
enum_value = UNBOUND_VALUE;
}

NsPduType::NsPduType(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Osmocom_Gb_Types.NsPduType with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

NsPduType::NsPduType(enum_type other_value)
{
enum_value = other_value;
}

NsPduType::NsPduType(const NsPduType& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
enum_value = other_value.enum_value;
}

NsPduType& NsPduType::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.NsPduType.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

NsPduType& NsPduType::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

NsPduType& NsPduType::operator=(const NsPduType& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
enum_value = other_value.enum_value;
return *this;
}

boolean NsPduType::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsPduType comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean NsPduType::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
return enum_value == other_value;
}

boolean NsPduType::operator==(const NsPduType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
return enum_value == other_value.enum_value;
}

boolean NsPduType::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsPduType comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean NsPduType::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
return enum_value < other_value;
}

boolean NsPduType::operator<(const NsPduType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
return enum_value < other_value.enum_value;
}

boolean NsPduType::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsPduType comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean NsPduType::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
return enum_value > other_value;
}

boolean NsPduType::operator>(const NsPduType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
return enum_value > other_value.enum_value;
}

const char *NsPduType::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NS__PDUT__NS__UNITDATA: return "NS_PDUT_NS_UNITDATA";
case NS__PDUT__NS__RESET: return "NS_PDUT_NS_RESET";
case NS__PDUT__NS__RESET__ACK: return "NS_PDUT_NS_RESET_ACK";
case NS__PDUT__NS__BLOCK: return "NS_PDUT_NS_BLOCK";
case NS__PDUT__NS__BLOCK__ACK: return "NS_PDUT_NS_BLOCK_ACK";
case NS__PDUT__NS__UNBLOCK: return "NS_PDUT_NS_UNBLOCK";
case NS__PDUT__NS__UNBLOCK__ACK: return "NS_PDUT_NS_UNBLOCK_ACK";
case NS__PDUT__NS__STATUS: return "NS_PDUT_NS_STATUS";
case NS__PDUT__NS__ALIVE: return "NS_PDUT_NS_ALIVE";
case NS__PDUT__NS__ALIVE__ACK: return "NS_PDUT_NS_ALIVE_ACK";
default:
return "<unknown>";
}
}

NsPduType::enum_type NsPduType::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NS_PDUT_NS_UNITDATA")) return NS__PDUT__NS__UNITDATA;
if (!strcmp(str_par, "NS_PDUT_NS_RESET")) return NS__PDUT__NS__RESET;
if (!strcmp(str_par, "NS_PDUT_NS_RESET_ACK")) return NS__PDUT__NS__RESET__ACK;
if (!strcmp(str_par, "NS_PDUT_NS_BLOCK")) return NS__PDUT__NS__BLOCK;
if (!strcmp(str_par, "NS_PDUT_NS_BLOCK_ACK")) return NS__PDUT__NS__BLOCK__ACK;
if (!strcmp(str_par, "NS_PDUT_NS_UNBLOCK")) return NS__PDUT__NS__UNBLOCK;
if (!strcmp(str_par, "NS_PDUT_NS_UNBLOCK_ACK")) return NS__PDUT__NS__UNBLOCK__ACK;
if (!strcmp(str_par, "NS_PDUT_NS_STATUS")) return NS__PDUT__NS__STATUS;
if (!strcmp(str_par, "NS_PDUT_NS_ALIVE")) return NS__PDUT__NS__ALIVE;
if (!strcmp(str_par, "NS_PDUT_NS_ALIVE_ACK")) return NS__PDUT__NS__ALIVE__ACK;
}
return UNKNOWN_VALUE;
}

boolean NsPduType::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 10:
case 11:
return TRUE;
default:
return FALSE;
}
}

int NsPduType::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.NsPduType.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int NsPduType::enum2int(const NsPduType& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.NsPduType.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void NsPduType::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.NsPduType.", int_val);
enum_value = (enum_type)int_val;
}

NsPduType::operator NsPduType::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Osmocom_Gb_Types.NsPduType.");
return enum_value;
}

void NsPduType::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void NsPduType::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Osmocom_Gb_Types.NsPduType");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @Osmocom_Gb_Types.NsPduType.");
  }
}

void NsPduType::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
text_buf.push_int(enum_value);
}

void NsPduType::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Osmocom_Gb_Types.NsPduType.", enum_value);
}

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

void NsPduType::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 NsPduType::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 4, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int NsPduType::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 4);
}

void NsPduType_template::copy_template(const NsPduType_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NsPduType_template[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 NsPduType_template(*other_value.implication_.precondition);
implication_.implied_template = new NsPduType_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsPduType.");
}
}

NsPduType_template::NsPduType_template()
{
}

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

NsPduType_template::NsPduType_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!NsPduType::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Osmocom_Gb_Types.NsPduType with unknown numeric value %d.", other_value);
single_value = (NsPduType::enum_type)other_value;
}

NsPduType_template::NsPduType_template(NsPduType::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

NsPduType_template::NsPduType_template(const NsPduType& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == NsPduType::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType.");
single_value = other_value.enum_value;
}

NsPduType_template::NsPduType_template(const OPTIONAL<NsPduType>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (NsPduType::enum_type)(const NsPduType&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Osmocom_Gb_Types.NsPduType from an unbound optional field.");
}
}

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

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

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

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

boolean NsPduType_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean NsPduType_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != NsPduType::UNBOUND_VALUE;
}

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

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

NsPduType_template& NsPduType_template::operator=(int other_value)
{
if (!NsPduType::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Osmocom_Gb_Types.NsPduType.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (NsPduType::enum_type)other_value;
return *this;
}

NsPduType_template& NsPduType_template::operator=(NsPduType::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

NsPduType_template& NsPduType_template::operator=(const NsPduType& other_value)
{
if (other_value.enum_value == NsPduType::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.NsPduType to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

NsPduType_template& NsPduType_template::operator=(const OPTIONAL<NsPduType>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (NsPduType::enum_type)(const NsPduType&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Osmocom_Gb_Types.NsPduType.");
}
return *this;
}

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

boolean NsPduType_template::match(NsPduType::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsPduType.");
}
return FALSE;
}

boolean NsPduType_template::match(const NsPduType& other_value, boolean) const
{
if (other_value.enum_value == NsPduType::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Osmocom_Gb_Types.NsPduType with an unbound value.");
return match(other_value.enum_value);
}

NsPduType::enum_type NsPduType_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Osmocom_Gb_Types.NsPduType.");
return single_value;
}

void NsPduType_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NsPduType_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Osmocom_Gb_Types.NsPduType.");
}
}

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

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

void NsPduType_template::log_match(const NsPduType& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void NsPduType_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsPduType.");
}
}

void NsPduType_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (NsPduType::enum_type)text_buf.pull_int().get_val();
if (!NsPduType::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Osmocom_Gb_Types.NsPduType.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NsPduType_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Osmocom_Gb_Types.NsPduType.");
}
}

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

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

void NsPduType_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    NsPduType_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    NsPduType::enum_type enum_val = NsPduType::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!NsPduType::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Osmocom_Gb_Types.NsPduType.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    NsPduType_template* precondition = new NsPduType_template;
    precondition->set_param(*m_p->get_elem(0));
    NsPduType_template* implied_template = new NsPduType_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = NsPduType_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Osmocom_Gb_Types.NsPduType");
  }
  is_ifpresent = param.get_ifpresent();
}

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

NsIEI::NsIEI()
{
enum_value = UNBOUND_VALUE;
}

NsIEI::NsIEI(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Osmocom_Gb_Types.NsIEI with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

NsIEI::NsIEI(enum_type other_value)
{
enum_value = other_value;
}

NsIEI::NsIEI(const NsIEI& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
enum_value = other_value.enum_value;
}

NsIEI& NsIEI::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.NsIEI.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

NsIEI& NsIEI::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

NsIEI& NsIEI::operator=(const NsIEI& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
enum_value = other_value.enum_value;
return *this;
}

boolean NsIEI::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsIEI comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean NsIEI::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
return enum_value == other_value;
}

boolean NsIEI::operator==(const NsIEI& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
return enum_value == other_value.enum_value;
}

boolean NsIEI::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsIEI comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean NsIEI::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
return enum_value < other_value;
}

boolean NsIEI::operator<(const NsIEI& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
return enum_value < other_value.enum_value;
}

boolean NsIEI::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsIEI comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean NsIEI::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
return enum_value > other_value;
}

boolean NsIEI::operator>(const NsIEI& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
return enum_value > other_value.enum_value;
}

const char *NsIEI::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NS__IEI__CAUSE: return "NS_IEI_CAUSE";
case NS__IEI__NSVCI: return "NS_IEI_NSVCI";
case NS__IEI__NS__PDU: return "NS_IEI_NS_PDU";
case NS__IEI__BVCI: return "NS_IEI_BVCI";
case NS__IEI__NSEI: return "NS_IEI_NSEI";
case NS__IEI__LIST__IPv4: return "NS_IEI_LIST_IPv4";
case NS__IEI__LIST__IPv6: return "NS_IEI_LIST_IPv6";
case NS__IEI__MAX__NUM__NSVC: return "NS_IEI_MAX_NUM_NSVC";
case NS__IEI__NUM__IPv4__EP: return "NS_IEI_NUM_IPv4_EP";
case NS__IEI__NUM__IPv6__EP: return "NS_IEI_NUM_IPv6_EP";
case NS__IEI__RESET__FLAG: return "NS_IEI_RESET_FLAG";
case NS__IEI__IP__ADDRESS: return "NS_IEI_IP_ADDRESS";
default:
return "<unknown>";
}
}

NsIEI::enum_type NsIEI::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NS_IEI_CAUSE")) return NS__IEI__CAUSE;
if (!strcmp(str_par, "NS_IEI_NSVCI")) return NS__IEI__NSVCI;
if (!strcmp(str_par, "NS_IEI_NS_PDU")) return NS__IEI__NS__PDU;
if (!strcmp(str_par, "NS_IEI_BVCI")) return NS__IEI__BVCI;
if (!strcmp(str_par, "NS_IEI_NSEI")) return NS__IEI__NSEI;
if (!strcmp(str_par, "NS_IEI_LIST_IPv4")) return NS__IEI__LIST__IPv4;
if (!strcmp(str_par, "NS_IEI_LIST_IPv6")) return NS__IEI__LIST__IPv6;
if (!strcmp(str_par, "NS_IEI_MAX_NUM_NSVC")) return NS__IEI__MAX__NUM__NSVC;
if (!strcmp(str_par, "NS_IEI_NUM_IPv4_EP")) return NS__IEI__NUM__IPv4__EP;
if (!strcmp(str_par, "NS_IEI_NUM_IPv6_EP")) return NS__IEI__NUM__IPv6__EP;
if (!strcmp(str_par, "NS_IEI_RESET_FLAG")) return NS__IEI__RESET__FLAG;
if (!strcmp(str_par, "NS_IEI_IP_ADDRESS")) return NS__IEI__IP__ADDRESS;
}
return UNKNOWN_VALUE;
}

boolean NsIEI::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
return TRUE;
default:
return FALSE;
}
}

int NsIEI::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.NsIEI.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int NsIEI::enum2int(const NsIEI& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.NsIEI.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void NsIEI::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.NsIEI.", int_val);
enum_value = (enum_type)int_val;
}

NsIEI::operator NsIEI::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Osmocom_Gb_Types.NsIEI.");
return enum_value;
}

void NsIEI::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void NsIEI::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Osmocom_Gb_Types.NsIEI");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @Osmocom_Gb_Types.NsIEI.");
  }
}

void NsIEI::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
text_buf.push_int(enum_value);
}

void NsIEI::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Osmocom_Gb_Types.NsIEI.", enum_value);
}

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

void NsIEI::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 NsIEI::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 4, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int NsIEI::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 4);
}

void NsIEI_template::copy_template(const NsIEI_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NsIEI_template[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 NsIEI_template(*other_value.implication_.precondition);
implication_.implied_template = new NsIEI_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsIEI.");
}
}

NsIEI_template::NsIEI_template()
{
}

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

NsIEI_template::NsIEI_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!NsIEI::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Osmocom_Gb_Types.NsIEI with unknown numeric value %d.", other_value);
single_value = (NsIEI::enum_type)other_value;
}

NsIEI_template::NsIEI_template(NsIEI::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

NsIEI_template::NsIEI_template(const NsIEI& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == NsIEI::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI.");
single_value = other_value.enum_value;
}

NsIEI_template::NsIEI_template(const OPTIONAL<NsIEI>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (NsIEI::enum_type)(const NsIEI&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Osmocom_Gb_Types.NsIEI from an unbound optional field.");
}
}

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

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

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

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

boolean NsIEI_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean NsIEI_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != NsIEI::UNBOUND_VALUE;
}

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

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

NsIEI_template& NsIEI_template::operator=(int other_value)
{
if (!NsIEI::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Osmocom_Gb_Types.NsIEI.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (NsIEI::enum_type)other_value;
return *this;
}

NsIEI_template& NsIEI_template::operator=(NsIEI::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

NsIEI_template& NsIEI_template::operator=(const NsIEI& other_value)
{
if (other_value.enum_value == NsIEI::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.NsIEI to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

NsIEI_template& NsIEI_template::operator=(const OPTIONAL<NsIEI>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (NsIEI::enum_type)(const NsIEI&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Osmocom_Gb_Types.NsIEI.");
}
return *this;
}

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

boolean NsIEI_template::match(NsIEI::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsIEI.");
}
return FALSE;
}

boolean NsIEI_template::match(const NsIEI& other_value, boolean) const
{
if (other_value.enum_value == NsIEI::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Osmocom_Gb_Types.NsIEI with an unbound value.");
return match(other_value.enum_value);
}

NsIEI::enum_type NsIEI_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Osmocom_Gb_Types.NsIEI.");
return single_value;
}

void NsIEI_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NsIEI_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Osmocom_Gb_Types.NsIEI.");
}
}

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

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

void NsIEI_template::log_match(const NsIEI& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void NsIEI_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsIEI.");
}
}

void NsIEI_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (NsIEI::enum_type)text_buf.pull_int().get_val();
if (!NsIEI::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Osmocom_Gb_Types.NsIEI.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NsIEI_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Osmocom_Gb_Types.NsIEI.");
}
}

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

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

void NsIEI_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    NsIEI_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    NsIEI::enum_type enum_val = NsIEI::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!NsIEI::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Osmocom_Gb_Types.NsIEI.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    NsIEI_template* precondition = new NsIEI_template;
    precondition->set_param(*m_p->get_elem(0));
    NsIEI_template* implied_template = new NsIEI_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = NsIEI_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Osmocom_Gb_Types.NsIEI");
  }
  is_ifpresent = param.get_ifpresent();
}

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

NsCause::NsCause()
{
enum_value = UNBOUND_VALUE;
}

NsCause::NsCause(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Osmocom_Gb_Types.NsCause with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

NsCause::NsCause(enum_type other_value)
{
enum_value = other_value;
}

NsCause::NsCause(const NsCause& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
enum_value = other_value.enum_value;
}

NsCause& NsCause::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.NsCause.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

NsCause& NsCause::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

NsCause& NsCause::operator=(const NsCause& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
enum_value = other_value.enum_value;
return *this;
}

boolean NsCause::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsCause comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean NsCause::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
return enum_value == other_value;
}

boolean NsCause::operator==(const NsCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
return enum_value == other_value.enum_value;
}

boolean NsCause::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsCause comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean NsCause::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
return enum_value < other_value;
}

boolean NsCause::operator<(const NsCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
return enum_value < other_value.enum_value;
}

boolean NsCause::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.NsCause comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean NsCause::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
return enum_value > other_value;
}

boolean NsCause::operator>(const NsCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
return enum_value > other_value.enum_value;
}

const char *NsCause::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case NS__CAUSE__TRANSIT__NETWORK__FAILURE: return "NS_CAUSE_TRANSIT_NETWORK_FAILURE";
case NS__CAUSE__OM__INTERVENTION: return "NS_CAUSE_OM_INTERVENTION";
case NS__CAUSE__EQUIPMENT__FAILURE: return "NS_CAUSE_EQUIPMENT_FAILURE";
case NS__CAUSE__NSVC__BLOCKED: return "NS_CAUSE_NSVC_BLOCKED";
case NS__CAUSE__NSVC__UNKNOWN: return "NS_CAUSE_NSVC_UNKNOWN";
case NS__CAUSE__BVCI__UNKNOWN__AT__NSE: return "NS_CAUSE_BVCI_UNKNOWN_AT_NSE";
case NS__CAUSE__SEMANTICALLY__INCORRECT__PDU: return "NS_CAUSE_SEMANTICALLY_INCORRECT_PDU";
case NS__CAUSE__PDU__NOT__COMPATIBLE__WITH__PROTOCOL__STATE: return "NS_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE";
case NS__CAUSE__PROTOCOL__ERROR__UNSPECIFIED: return "NS_CAUSE_PROTOCOL_ERROR_UNSPECIFIED";
case NS__CAUSE__INVALID__ESSENTIAL__IE: return "NS_CAUSE_INVALID_ESSENTIAL_IE";
case NS__CAUSE__MISSING__ESSENTIAL__IE: return "NS_CAUSE_MISSING_ESSENTIAL_IE";
case NS__CAUSE__INVALID__NR__OF__IPv4__ENDPOINTS: return "NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS";
case NS__CAUSE__INVALID__NR__OF__IPv6__ENDPOINTS: return "NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS";
case NS__CAUSE__INVALID__NR__OF__NSVCS: return "NS_CAUSE_INVALID_NR_OF_NSVCS";
case NS__CAUSE__INVALID__WEIGHTS: return "NS_CAUSE_INVALID_WEIGHTS";
case NS__CAUSE__UNKNOWN__IP__ENDPOINT: return "NS_CAUSE_UNKNOWN_IP_ENDPOINT";
case NS__CAUSE__UNKNOWN__IP__ADDRESS: return "NS_CAUSE_UNKNOWN_IP_ADDRESS";
case NS__CAUSE__IP__TEST__FAILEDA: return "NS_CAUSE_IP_TEST_FAILEDA";
default:
return "<unknown>";
}
}

NsCause::enum_type NsCause::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "NS_CAUSE_TRANSIT_NETWORK_FAILURE")) return NS__CAUSE__TRANSIT__NETWORK__FAILURE;
if (!strcmp(str_par, "NS_CAUSE_OM_INTERVENTION")) return NS__CAUSE__OM__INTERVENTION;
if (!strcmp(str_par, "NS_CAUSE_EQUIPMENT_FAILURE")) return NS__CAUSE__EQUIPMENT__FAILURE;
if (!strcmp(str_par, "NS_CAUSE_NSVC_BLOCKED")) return NS__CAUSE__NSVC__BLOCKED;
if (!strcmp(str_par, "NS_CAUSE_NSVC_UNKNOWN")) return NS__CAUSE__NSVC__UNKNOWN;
if (!strcmp(str_par, "NS_CAUSE_BVCI_UNKNOWN_AT_NSE")) return NS__CAUSE__BVCI__UNKNOWN__AT__NSE;
if (!strcmp(str_par, "NS_CAUSE_SEMANTICALLY_INCORRECT_PDU")) return NS__CAUSE__SEMANTICALLY__INCORRECT__PDU;
if (!strcmp(str_par, "NS_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE")) return NS__CAUSE__PDU__NOT__COMPATIBLE__WITH__PROTOCOL__STATE;
if (!strcmp(str_par, "NS_CAUSE_PROTOCOL_ERROR_UNSPECIFIED")) return NS__CAUSE__PROTOCOL__ERROR__UNSPECIFIED;
if (!strcmp(str_par, "NS_CAUSE_INVALID_ESSENTIAL_IE")) return NS__CAUSE__INVALID__ESSENTIAL__IE;
if (!strcmp(str_par, "NS_CAUSE_MISSING_ESSENTIAL_IE")) return NS__CAUSE__MISSING__ESSENTIAL__IE;
if (!strcmp(str_par, "NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS")) return NS__CAUSE__INVALID__NR__OF__IPv4__ENDPOINTS;
if (!strcmp(str_par, "NS_CAUSE_INVALID_NR_OF_IPv6_ENDPOINTS")) return NS__CAUSE__INVALID__NR__OF__IPv6__ENDPOINTS;
if (!strcmp(str_par, "NS_CAUSE_INVALID_NR_OF_NSVCS")) return NS__CAUSE__INVALID__NR__OF__NSVCS;
if (!strcmp(str_par, "NS_CAUSE_INVALID_WEIGHTS")) return NS__CAUSE__INVALID__WEIGHTS;
if (!strcmp(str_par, "NS_CAUSE_UNKNOWN_IP_ENDPOINT")) return NS__CAUSE__UNKNOWN__IP__ENDPOINT;
if (!strcmp(str_par, "NS_CAUSE_UNKNOWN_IP_ADDRESS")) return NS__CAUSE__UNKNOWN__IP__ADDRESS;
if (!strcmp(str_par, "NS_CAUSE_IP_TEST_FAILEDA")) return NS__CAUSE__IP__TEST__FAILEDA;
}
return UNKNOWN_VALUE;
}

boolean NsCause::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 8:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
return TRUE;
default:
return FALSE;
}
}

int NsCause::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.NsCause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int NsCause::enum2int(const NsCause& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.NsCause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void NsCause::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.NsCause.", int_val);
enum_value = (enum_type)int_val;
}

NsCause::operator NsCause::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Osmocom_Gb_Types.NsCause.");
return enum_value;
}

void NsCause::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void NsCause::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Osmocom_Gb_Types.NsCause");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @Osmocom_Gb_Types.NsCause.");
  }
}

void NsCause::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
text_buf.push_int(enum_value);
}

void NsCause::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Osmocom_Gb_Types.NsCause.", enum_value);
}

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

void NsCause::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 NsCause::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 5, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int NsCause::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 5);
}

void NsCause_template::copy_template(const NsCause_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new NsCause_template[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 NsCause_template(*other_value.implication_.precondition);
implication_.implied_template = new NsCause_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsCause.");
}
}

NsCause_template::NsCause_template()
{
}

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

NsCause_template::NsCause_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!NsCause::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Osmocom_Gb_Types.NsCause with unknown numeric value %d.", other_value);
single_value = (NsCause::enum_type)other_value;
}

NsCause_template::NsCause_template(NsCause::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

NsCause_template::NsCause_template(const NsCause& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == NsCause::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Osmocom_Gb_Types.NsCause.");
single_value = other_value.enum_value;
}

NsCause_template::NsCause_template(const OPTIONAL<NsCause>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (NsCause::enum_type)(const NsCause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Osmocom_Gb_Types.NsCause from an unbound optional field.");
}
}

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

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

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

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

boolean NsCause_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean NsCause_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != NsCause::UNBOUND_VALUE;
}

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

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

NsCause_template& NsCause_template::operator=(int other_value)
{
if (!NsCause::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Osmocom_Gb_Types.NsCause.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (NsCause::enum_type)other_value;
return *this;
}

NsCause_template& NsCause_template::operator=(NsCause::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

NsCause_template& NsCause_template::operator=(const NsCause& other_value)
{
if (other_value.enum_value == NsCause::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.NsCause to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

NsCause_template& NsCause_template::operator=(const OPTIONAL<NsCause>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (NsCause::enum_type)(const NsCause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Osmocom_Gb_Types.NsCause.");
}
return *this;
}

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

boolean NsCause_template::match(NsCause::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsCause.");
}
return FALSE;
}

boolean NsCause_template::match(const NsCause& other_value, boolean) const
{
if (other_value.enum_value == NsCause::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Osmocom_Gb_Types.NsCause with an unbound value.");
return match(other_value.enum_value);
}

NsCause::enum_type NsCause_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Osmocom_Gb_Types.NsCause.");
return single_value;
}

void NsCause_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new NsCause_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Osmocom_Gb_Types.NsCause.");
}
}

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

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

void NsCause_template::log_match(const NsCause& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void NsCause_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.NsCause.");
}
}

void NsCause_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (NsCause::enum_type)text_buf.pull_int().get_val();
if (!NsCause::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Osmocom_Gb_Types.NsCause.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new NsCause_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Osmocom_Gb_Types.NsCause.");
}
}

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

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

void NsCause_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    NsCause_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    NsCause::enum_type enum_val = NsCause::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!NsCause::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Osmocom_Gb_Types.NsCause.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    NsCause_template* precondition = new NsCause_template;
    precondition->set_param(*m_p->get_elem(0));
    NsCause_template* implied_template = new NsCause_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = NsCause_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Osmocom_Gb_Types.NsCause");
  }
  is_ifpresent = param.get_ifpresent();
}

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

BssgpCellId::BssgpCellId()
{
}

BssgpCellId::BssgpCellId(const GSM__Types::RoutingAreaIdentification& par_ra__id,
    const INTEGER& par_cell__id)
  :   field_ra__id(par_ra__id),
  field_cell__id(par_cell__id)
{
}

BssgpCellId::BssgpCellId(const BssgpCellId& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @Osmocom_Gb_Types.BssgpCellId.");
if (other_value.ra__id().is_bound()) field_ra__id = other_value.ra__id();
else field_ra__id.clean_up();
if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
else field_cell__id.clean_up();
}

void BssgpCellId::clean_up()
{
field_ra__id.clean_up();
field_cell__id.clean_up();
}

const TTCN_Typedescriptor_t* BssgpCellId::get_descriptor() const { return &BssgpCellId_descr_; }
BssgpCellId& BssgpCellId::operator=(const BssgpCellId& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @Osmocom_Gb_Types.BssgpCellId.");
  if (other_value.ra__id().is_bound()) field_ra__id = other_value.ra__id();
  else field_ra__id.clean_up();
  if (other_value.cell__id().is_bound()) field_cell__id = other_value.cell__id();
  else field_cell__id.clean_up();
}
return *this;
}

boolean BssgpCellId::operator==(const BssgpCellId& other_value) const
{
return field_ra__id==other_value.field_ra__id
  && field_cell__id==other_value.field_cell__id;
}

boolean BssgpCellId::is_bound() const
{
return (field_ra__id.is_bound())
  || (field_cell__id.is_bound());
}
boolean BssgpCellId::is_value() const
{
return field_ra__id.is_value()
  && field_cell__id.is_value();
}
void BssgpCellId::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ ra_id := ");
field_ra__id.log();
TTCN_Logger::log_event_str(", cell_id := ");
field_cell__id.log();
TTCN_Logger::log_event_str(" }");
}

void BssgpCellId::set_implicit_omit()
{
if (ra__id().is_bound()) ra__id().set_implicit_omit();
if (cell__id().is_bound()) cell__id().set_implicit_omit();
}

void BssgpCellId::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 @Osmocom_Gb_Types.BssgpCellId 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) ra__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cell__id().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(), "ra_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ra__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().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 @Osmocom_Gb_Types.BssgpCellId: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@Osmocom_Gb_Types.BssgpCellId");
  }
}

void BssgpCellId::encode_text(Text_Buf& text_buf) const
{
field_ra__id.encode_text(text_buf);
field_cell__id.encode_text(text_buf);
}

void BssgpCellId::decode_text(Text_Buf& text_buf)
{
field_ra__id.decode_text(text_buf);
field_cell__id.decode_text(text_buf);
}

void BssgpCellId::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 BssgpCellId::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 BssgpCellId::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, GSM__Types::RoutingAreaIdentification_descr_.raw->forceomit);
  decoded_field_length = field_ra__id.RAW_decode(GSM__Types::RoutingAreaIdentification_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, GSM__Types::CellIdentity_descr_.raw->forceomit);
  decoded_field_length = field_cell__id.RAW_decode(GSM__Types::CellIdentity_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 BssgpCellId::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, GSM__Types::RoutingAreaIdentification_descr_.raw);
  myleaf.body.node.nodes[1] = new RAW_enc_tree(TRUE, &myleaf, &(myleaf.curr_pos), 1, GSM__Types::CellIdentity_descr_.raw);
  encoded_length += field_ra__id.RAW_encode(GSM__Types::RoutingAreaIdentification_descr_, *myleaf.body.node.nodes[0]);
  encoded_length += field_cell__id.RAW_encode(GSM__Types::CellIdentity_descr_, *myleaf.body.node.nodes[1]);
  return myleaf.length = encoded_length;
}

struct BssgpCellId_template::single_value_struct {
GSM__Types::RoutingAreaIdentification_template field_ra__id;
INTEGER_template field_cell__id;
};

void BssgpCellId_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_ra__id = ANY_VALUE;
single_value->field_cell__id = ANY_VALUE;
}
}
}

void BssgpCellId_template::copy_value(const BssgpCellId& other_value)
{
single_value = new single_value_struct;
if (other_value.ra__id().is_bound()) {
  single_value->field_ra__id = other_value.ra__id();
} else {
  single_value->field_ra__id.clean_up();
}
if (other_value.cell__id().is_bound()) {
  single_value->field_cell__id = other_value.cell__id();
} else {
  single_value->field_cell__id.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void BssgpCellId_template::copy_template(const BssgpCellId_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.ra__id().get_selection()) {
single_value->field_ra__id = other_value.ra__id();
} else {
single_value->field_ra__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cell__id().get_selection()) {
single_value->field_cell__id = other_value.cell__id();
} else {
single_value->field_cell__id.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 BssgpCellId_template[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 BssgpCellId_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpCellId_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 @Osmocom_Gb_Types.BssgpCellId.");
break;
}
set_selection(other_value);
}

BssgpCellId_template::BssgpCellId_template()
{
}

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

BssgpCellId_template::BssgpCellId_template(const BssgpCellId& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

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

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

boolean BssgpCellId_template::match(const BssgpCellId& 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.ra__id().is_bound()) return FALSE;
if(!single_value->field_ra__id.match(other_value.ra__id(), legacy))return FALSE;
if(!other_value.cell__id().is_bound()) return FALSE;
if(!single_value->field_cell__id.match(other_value.cell__id(), 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 @Osmocom_Gb_Types.BssgpCellId.");
}
return FALSE;
}

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

boolean BssgpCellId_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_ra__id.is_value()
 && single_value->field_cell__id.is_value();
}

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

BssgpCellId BssgpCellId_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 @Osmocom_Gb_Types.BssgpCellId.");
BssgpCellId ret_val;
if (single_value->field_ra__id.is_bound()) {
ret_val.ra__id() = single_value->field_ra__id.valueof();
}
if (single_value->field_cell__id.is_bound()) {
ret_val.cell__id() = single_value->field_cell__id.valueof();
}
return ret_val;
}

void BssgpCellId_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 @Osmocom_Gb_Types.BssgpCellId.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpCellId_template[list_length];
}

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

GSM__Types::RoutingAreaIdentification_template& BssgpCellId_template::ra__id()
{
set_specific();
return single_value->field_ra__id;
}

const GSM__Types::RoutingAreaIdentification_template& BssgpCellId_template::ra__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ra_id of a non-specific template of type @Osmocom_Gb_Types.BssgpCellId.");
return single_value->field_ra__id;
}

INTEGER_template& BssgpCellId_template::cell__id()
{
set_specific();
return single_value->field_cell__id;
}

const INTEGER_template& BssgpCellId_template::cell__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cell_id of a non-specific template of type @Osmocom_Gb_Types.BssgpCellId.");
return single_value->field_cell__id;
}

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

void BssgpCellId_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ ra_id := ");
single_value->field_ra__id.log();
TTCN_Logger::log_event_str(", cell_id := ");
single_value->field_cell__id.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 BssgpCellId_template::log_match(const BssgpCellId& 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_ra__id.match(match_value.ra__id(), legacy)){
TTCN_Logger::log_logmatch_info(".ra_id");
single_value->field_ra__id.log_match(match_value.ra__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cell__id.match(match_value.cell__id(), legacy)){
TTCN_Logger::log_logmatch_info(".cell_id");
single_value->field_cell__id.log_match(match_value.cell__id(), 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("{ ra_id := ");
single_value->field_ra__id.log_match(match_value.ra__id(), legacy);
TTCN_Logger::log_event_str(", cell_id := ");
single_value->field_cell__id.log_match(match_value.cell__id(), 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 BssgpCellId_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (ra__id().is_bound()) ra__id().set_implicit_omit();
if (cell__id().is_bound()) cell__id().set_implicit_omit();
}

void BssgpCellId_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_ra__id.encode_text(text_buf);
single_value->field_cell__id.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 @Osmocom_Gb_Types.BssgpCellId.");
}
}

void BssgpCellId_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_ra__id.decode_text(text_buf);
single_value->field_cell__id.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 BssgpCellId_template[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 @Osmocom_Gb_Types.BssgpCellId.");
}
}

void BssgpCellId_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: {
    BssgpCellId_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 @Osmocom_Gb_Types.BssgpCellId 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) ra__id().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) cell__id().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(), "ra_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ra__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cell_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cell__id().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 @Osmocom_Gb_Types.BssgpCellId: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    BssgpCellId_template* precondition = new BssgpCellId_template;
    precondition->set_param(*param.get_elem(0));
    BssgpCellId_template* implied_template = new BssgpCellId_template;
    implied_template->set_param(*param.get_elem(1));
    *this = BssgpCellId_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@Osmocom_Gb_Types.BssgpCellId");
  }
  is_ifpresent = param.get_ifpresent();
}

void BssgpCellId_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_ra__id.check_restriction(t_res, t_name ? t_name : "@Osmocom_Gb_Types.BssgpCellId");
single_value->field_cell__id.check_restriction(t_res, t_name ? t_name : "@Osmocom_Gb_Types.BssgpCellId");
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 : "@Osmocom_Gb_Types.BssgpCellId");
}

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

boolean BssgpCellId_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;
}

BssgpCause::BssgpCause()
{
enum_value = UNBOUND_VALUE;
}

BssgpCause::BssgpCause(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Osmocom_Gb_Types.BssgpCause with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

BssgpCause::BssgpCause(enum_type other_value)
{
enum_value = other_value;
}

BssgpCause::BssgpCause(const BssgpCause& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
enum_value = other_value.enum_value;
}

BssgpCause& BssgpCause::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.BssgpCause.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

BssgpCause& BssgpCause::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

BssgpCause& BssgpCause::operator=(const BssgpCause& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
enum_value = other_value.enum_value;
return *this;
}

boolean BssgpCause::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.BssgpCause comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean BssgpCause::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
return enum_value == other_value;
}

boolean BssgpCause::operator==(const BssgpCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
return enum_value == other_value.enum_value;
}

boolean BssgpCause::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.BssgpCause comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean BssgpCause::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
return enum_value < other_value;
}

boolean BssgpCause::operator<(const BssgpCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
return enum_value < other_value.enum_value;
}

boolean BssgpCause::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.BssgpCause comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean BssgpCause::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
return enum_value > other_value;
}

boolean BssgpCause::operator>(const BssgpCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
return enum_value > other_value.enum_value;
}

const char *BssgpCause::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case BSSGP__CAUSE__PROC__OVERLOAD: return "BSSGP_CAUSE_PROC_OVERLOAD";
case BSSGP__CAUSE__EQUIMENT__FAILURE: return "BSSGP_CAUSE_EQUIMENT_FAILURE";
case BSSGP__CAUSE__TRANSIT__NETWORK__FAILURE: return "BSSGP_CAUSE_TRANSIT_NETWORK_FAILURE";
case BSSGP__CAUSE__NET__SV__CAP__MOD__GT__ZERO__KBPS: return "BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS";
case BSSGP__CAUSE__UNKNOWN__MS: return "BSSGP_CAUSE_UNKNOWN_MS";
case BSSGP__CAUSE__BVCI__UNKNOWN: return "BSSGP_CAUSE_BVCI_UNKNOWN";
case BSSGP__CAUSE__CELL__TRAFFIC__CONGESTION: return "BSSGP_CAUSE_CELL_TRAFFIC_CONGESTION";
case BSSGP__CAUSE__SGSN__CONGESTION: return "BSSGP_CAUSE_SGSN_CONGESTION";
case BSSGP__CAUSE__OM__INTERVENTION: return "BSSGP_CAUSE_OM_INTERVENTION";
case BSSGP__CAUSE__BVCI__BLOCKED: return "BSSGP_CAUSE_BVCI_BLOCKED";
case BSSGP__CAUSE__PFC__CREATE__FAILURE: return "BSSGP_CAUSE_PFC_CREATE_FAILURE";
case BSSGP__CAUSE__PFC__PREEMPTED: return "BSSGP_CAUSE_PFC_PREEMPTED";
case BSSGP__CAUSE__ABQP__NO__MORE__SUPPORTED: return "BSSGP_CAUSE_ABQP_NO_MORE_SUPPORTED";
case BSSGP__CAUSE__SEMANTICALLY__INCORRECT__PDU: return "BSSGP_CAUSE_SEMANTICALLY_INCORRECT_PDU";
case BSSGP__CAUSE__INVALID__MANDATORY__IE: return "BSSGP_CAUSE_INVALID_MANDATORY_IE";
case BSSGP__CAUSE__MISSING__MANDATORY__IE: return "BSSGP_CAUSE_MISSING_MANDATORY_IE";
case BSSGP__CAUSE__MISSING__CONDITIONAL__IE: return "BSSGP_CAUSE_MISSING_CONDITIONAL_IE";
case BSSGP__CAUSE__UNEXPECTED__CONDITIONAL__IE: return "BSSGP_CAUSE_UNEXPECTED_CONDITIONAL_IE";
case BSSGP__CAUSE__CONDITIONAL__IE__ERROR: return "BSSGP_CAUSE_CONDITIONAL_IE_ERROR";
case BSSGP__CAUSE__PDU__NOT__COMPATIBLE__WITH__PROTOCOL__STATE: return "BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE";
case BSSGP__CAUSE__PROTOCOL__ERROR__UNSPECIFIED: return "BSSGP_CAUSE_PROTOCOL_ERROR_UNSPECIFIED";
case BSSGP__CAUSE__PDU__NOT__COMPATIBLE__WITH__FEATURE__SET: return "BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_FEATURE_SET";
case BSSGP__CAUSE__REQUESTED__INFO__NOT__AVAILABLE: return "BSSGP_CAUSE_REQUESTED_INFO_NOT_AVAILABLE";
case BSSGP__CAUSE__UNKNOWN__DESTINATION__ADDRESS: return "BSSGP_CAUSE_UNKNOWN_DESTINATION_ADDRESS";
case BSSGP__CAUSE__UNKNOWN__RIM__APP__IDENTITY: return "BSSGP_CAUSE_UNKNOWN_RIM_APP_IDENTITY";
case BSSGP__CAUSE__INVALID__CONTAINER__UNIT__INFO: return "BSSGP_CAUSE_INVALID_CONTAINER_UNIT_INFO";
case BSSGP__CAUSE__PFC__QUEUING: return "BSSGP_CAUSE_PFC_QUEUING";
case BSSGP__CAUSE__PFC__CREATED__SUCCESSFULLY: return "BSSGP_CAUSE_PFC_CREATED_SUCCESSFULLY";
case BSSGP__CAUSE__T12__EXPIRY: return "BSSGP_CAUSE_T12_EXPIRY";
case BSSGP__CAUSE__MS__UNDER__PS__HANDOVER__TREATMENT: return "BSSGP_CAUSE_MS_UNDER_PS_HANDOVER_TREATMENT";
case BSSGP__CAUSE__UPLINK__QUALITY: return "BSSGP_CAUSE_UPLINK_QUALITY";
case BSSGP__CAUSE__UPLINK__STRENGTH: return "BSSGP_CAUSE_UPLINK_STRENGTH";
case BSSGP__CAUSE__DOWNLINK__QUALITY: return "BSSGP_CAUSE_DOWNLINK_QUALITY";
case BSSGP__CAUSE__DOWNLINK__STRENGTH: return "BSSGP_CAUSE_DOWNLINK_STRENGTH";
case BSSGP__CAUSE__DISTANCE: return "BSSGP_CAUSE_DISTANCE";
case BSSGP__CAUSE__BETTER__CELL: return "BSSGP_CAUSE_BETTER_CELL";
case BSSGP__CAUSE__TRAFFIC: return "BSSGP_CAUSE_TRAFFIC";
case BSSGP__CAUSE__OM__INTERVENTION2: return "BSSGP_CAUSE_OM_INTERVENTION2";
case BSSGP__CAUSE__MS__BACK__ON__OLD__CHANNEL: return "BSSGP_CAUSE_MS_BACK_ON_OLD_CHANNEL";
case BSSGP__CAUSE__T13__EXPIRY: return "BSSGP_CAUSE_T13_EXPIRY";
case BSSGP__CAUSE__T14__EXPIRY: return "BSSGP_CAUSE_T14_EXPIRY";
case BSSGP__CAUSE__NOT__ALL__REQUESTED__PFC__CREATED: return "BSSGP_CAUSE_NOT_ALL_REQUESTED_PFC_CREATED";
default:
return "<unknown>";
}
}

BssgpCause::enum_type BssgpCause::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "BSSGP_CAUSE_PROC_OVERLOAD")) return BSSGP__CAUSE__PROC__OVERLOAD;
if (!strcmp(str_par, "BSSGP_CAUSE_EQUIMENT_FAILURE")) return BSSGP__CAUSE__EQUIMENT__FAILURE;
if (!strcmp(str_par, "BSSGP_CAUSE_TRANSIT_NETWORK_FAILURE")) return BSSGP__CAUSE__TRANSIT__NETWORK__FAILURE;
if (!strcmp(str_par, "BSSGP_CAUSE_NET_SV_CAP_MOD_GT_ZERO_KBPS")) return BSSGP__CAUSE__NET__SV__CAP__MOD__GT__ZERO__KBPS;
if (!strcmp(str_par, "BSSGP_CAUSE_UNKNOWN_MS")) return BSSGP__CAUSE__UNKNOWN__MS;
if (!strcmp(str_par, "BSSGP_CAUSE_BVCI_UNKNOWN")) return BSSGP__CAUSE__BVCI__UNKNOWN;
if (!strcmp(str_par, "BSSGP_CAUSE_CELL_TRAFFIC_CONGESTION")) return BSSGP__CAUSE__CELL__TRAFFIC__CONGESTION;
if (!strcmp(str_par, "BSSGP_CAUSE_SGSN_CONGESTION")) return BSSGP__CAUSE__SGSN__CONGESTION;
if (!strcmp(str_par, "BSSGP_CAUSE_OM_INTERVENTION")) return BSSGP__CAUSE__OM__INTERVENTION;
if (!strcmp(str_par, "BSSGP_CAUSE_BVCI_BLOCKED")) return BSSGP__CAUSE__BVCI__BLOCKED;
if (!strcmp(str_par, "BSSGP_CAUSE_PFC_CREATE_FAILURE")) return BSSGP__CAUSE__PFC__CREATE__FAILURE;
if (!strcmp(str_par, "BSSGP_CAUSE_PFC_PREEMPTED")) return BSSGP__CAUSE__PFC__PREEMPTED;
if (!strcmp(str_par, "BSSGP_CAUSE_ABQP_NO_MORE_SUPPORTED")) return BSSGP__CAUSE__ABQP__NO__MORE__SUPPORTED;
if (!strcmp(str_par, "BSSGP_CAUSE_SEMANTICALLY_INCORRECT_PDU")) return BSSGP__CAUSE__SEMANTICALLY__INCORRECT__PDU;
if (!strcmp(str_par, "BSSGP_CAUSE_INVALID_MANDATORY_IE")) return BSSGP__CAUSE__INVALID__MANDATORY__IE;
if (!strcmp(str_par, "BSSGP_CAUSE_MISSING_MANDATORY_IE")) return BSSGP__CAUSE__MISSING__MANDATORY__IE;
if (!strcmp(str_par, "BSSGP_CAUSE_MISSING_CONDITIONAL_IE")) return BSSGP__CAUSE__MISSING__CONDITIONAL__IE;
if (!strcmp(str_par, "BSSGP_CAUSE_UNEXPECTED_CONDITIONAL_IE")) return BSSGP__CAUSE__UNEXPECTED__CONDITIONAL__IE;
if (!strcmp(str_par, "BSSGP_CAUSE_CONDITIONAL_IE_ERROR")) return BSSGP__CAUSE__CONDITIONAL__IE__ERROR;
if (!strcmp(str_par, "BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE")) return BSSGP__CAUSE__PDU__NOT__COMPATIBLE__WITH__PROTOCOL__STATE;
if (!strcmp(str_par, "BSSGP_CAUSE_PROTOCOL_ERROR_UNSPECIFIED")) return BSSGP__CAUSE__PROTOCOL__ERROR__UNSPECIFIED;
if (!strcmp(str_par, "BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_FEATURE_SET")) return BSSGP__CAUSE__PDU__NOT__COMPATIBLE__WITH__FEATURE__SET;
if (!strcmp(str_par, "BSSGP_CAUSE_REQUESTED_INFO_NOT_AVAILABLE")) return BSSGP__CAUSE__REQUESTED__INFO__NOT__AVAILABLE;
if (!strcmp(str_par, "BSSGP_CAUSE_UNKNOWN_DESTINATION_ADDRESS")) return BSSGP__CAUSE__UNKNOWN__DESTINATION__ADDRESS;
if (!strcmp(str_par, "BSSGP_CAUSE_UNKNOWN_RIM_APP_IDENTITY")) return BSSGP__CAUSE__UNKNOWN__RIM__APP__IDENTITY;
if (!strcmp(str_par, "BSSGP_CAUSE_INVALID_CONTAINER_UNIT_INFO")) return BSSGP__CAUSE__INVALID__CONTAINER__UNIT__INFO;
if (!strcmp(str_par, "BSSGP_CAUSE_PFC_QUEUING")) return BSSGP__CAUSE__PFC__QUEUING;
if (!strcmp(str_par, "BSSGP_CAUSE_PFC_CREATED_SUCCESSFULLY")) return BSSGP__CAUSE__PFC__CREATED__SUCCESSFULLY;
if (!strcmp(str_par, "BSSGP_CAUSE_T12_EXPIRY")) return BSSGP__CAUSE__T12__EXPIRY;
if (!strcmp(str_par, "BSSGP_CAUSE_MS_UNDER_PS_HANDOVER_TREATMENT")) return BSSGP__CAUSE__MS__UNDER__PS__HANDOVER__TREATMENT;
if (!strcmp(str_par, "BSSGP_CAUSE_UPLINK_QUALITY")) return BSSGP__CAUSE__UPLINK__QUALITY;
if (!strcmp(str_par, "BSSGP_CAUSE_UPLINK_STRENGTH")) return BSSGP__CAUSE__UPLINK__STRENGTH;
if (!strcmp(str_par, "BSSGP_CAUSE_DOWNLINK_QUALITY")) return BSSGP__CAUSE__DOWNLINK__QUALITY;
if (!strcmp(str_par, "BSSGP_CAUSE_DOWNLINK_STRENGTH")) return BSSGP__CAUSE__DOWNLINK__STRENGTH;
if (!strcmp(str_par, "BSSGP_CAUSE_DISTANCE")) return BSSGP__CAUSE__DISTANCE;
if (!strcmp(str_par, "BSSGP_CAUSE_BETTER_CELL")) return BSSGP__CAUSE__BETTER__CELL;
if (!strcmp(str_par, "BSSGP_CAUSE_TRAFFIC")) return BSSGP__CAUSE__TRAFFIC;
if (!strcmp(str_par, "BSSGP_CAUSE_OM_INTERVENTION2")) return BSSGP__CAUSE__OM__INTERVENTION2;
if (!strcmp(str_par, "BSSGP_CAUSE_MS_BACK_ON_OLD_CHANNEL")) return BSSGP__CAUSE__MS__BACK__ON__OLD__CHANNEL;
if (!strcmp(str_par, "BSSGP_CAUSE_T13_EXPIRY")) return BSSGP__CAUSE__T13__EXPIRY;
if (!strcmp(str_par, "BSSGP_CAUSE_T14_EXPIRY")) return BSSGP__CAUSE__T14__EXPIRY;
if (!strcmp(str_par, "BSSGP_CAUSE_NOT_ALL_REQUESTED_PFC_CREATED")) return BSSGP__CAUSE__NOT__ALL__REQUESTED__PFC__CREATED;
}
return UNKNOWN_VALUE;
}

boolean BssgpCause::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 48:
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
case 58:
case 59:
case 60:
return TRUE;
default:
return FALSE;
}
}

int BssgpCause::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.BssgpCause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int BssgpCause::enum2int(const BssgpCause& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.BssgpCause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void BssgpCause::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.BssgpCause.", int_val);
enum_value = (enum_type)int_val;
}

BssgpCause::operator BssgpCause::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Osmocom_Gb_Types.BssgpCause.");
return enum_value;
}

void BssgpCause::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void BssgpCause::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Osmocom_Gb_Types.BssgpCause");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @Osmocom_Gb_Types.BssgpCause.");
  }
}

void BssgpCause::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
text_buf.push_int(enum_value);
}

void BssgpCause::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Osmocom_Gb_Types.BssgpCause.", enum_value);
}

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

void BssgpCause::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 BssgpCause::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 6, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int BssgpCause::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 6);
}

void BssgpCause_template::copy_template(const BssgpCause_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new BssgpCause_template[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 BssgpCause_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpCause_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.BssgpCause.");
}
}

BssgpCause_template::BssgpCause_template()
{
}

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

BssgpCause_template::BssgpCause_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!BssgpCause::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Osmocom_Gb_Types.BssgpCause with unknown numeric value %d.", other_value);
single_value = (BssgpCause::enum_type)other_value;
}

BssgpCause_template::BssgpCause_template(BssgpCause::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

BssgpCause_template::BssgpCause_template(const BssgpCause& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == BssgpCause::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause.");
single_value = other_value.enum_value;
}

BssgpCause_template::BssgpCause_template(const OPTIONAL<BssgpCause>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (BssgpCause::enum_type)(const BssgpCause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Osmocom_Gb_Types.BssgpCause from an unbound optional field.");
}
}

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

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

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

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

boolean BssgpCause_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean BssgpCause_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != BssgpCause::UNBOUND_VALUE;
}

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

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

BssgpCause_template& BssgpCause_template::operator=(int other_value)
{
if (!BssgpCause::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Osmocom_Gb_Types.BssgpCause.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (BssgpCause::enum_type)other_value;
return *this;
}

BssgpCause_template& BssgpCause_template::operator=(BssgpCause::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

BssgpCause_template& BssgpCause_template::operator=(const BssgpCause& other_value)
{
if (other_value.enum_value == BssgpCause::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.BssgpCause to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

BssgpCause_template& BssgpCause_template::operator=(const OPTIONAL<BssgpCause>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (BssgpCause::enum_type)(const BssgpCause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Osmocom_Gb_Types.BssgpCause.");
}
return *this;
}

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

boolean BssgpCause_template::match(BssgpCause::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.BssgpCause.");
}
return FALSE;
}

boolean BssgpCause_template::match(const BssgpCause& other_value, boolean) const
{
if (other_value.enum_value == BssgpCause::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Osmocom_Gb_Types.BssgpCause with an unbound value.");
return match(other_value.enum_value);
}

BssgpCause::enum_type BssgpCause_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Osmocom_Gb_Types.BssgpCause.");
return single_value;
}

void BssgpCause_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpCause_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Osmocom_Gb_Types.BssgpCause.");
}
}

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

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

void BssgpCause_template::log_match(const BssgpCause& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void BssgpCause_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.BssgpCause.");
}
}

void BssgpCause_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (BssgpCause::enum_type)text_buf.pull_int().get_val();
if (!BssgpCause::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Osmocom_Gb_Types.BssgpCause.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new BssgpCause_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Osmocom_Gb_Types.BssgpCause.");
}
}

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

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

void BssgpCause_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    BssgpCause_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    BssgpCause::enum_type enum_val = BssgpCause::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!BssgpCause::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Osmocom_Gb_Types.BssgpCause.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    BssgpCause_template* precondition = new BssgpCause_template;
    precondition->set_param(*m_p->get_elem(0));
    BssgpCause_template* implied_template = new BssgpCause_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = BssgpCause_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Osmocom_Gb_Types.BssgpCause");
  }
  is_ifpresent = param.get_ifpresent();
}

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

BssgpRadioCause::BssgpRadioCause()
{
enum_value = UNBOUND_VALUE;
}

BssgpRadioCause::BssgpRadioCause(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Osmocom_Gb_Types.BssgpRadioCause with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

BssgpRadioCause::BssgpRadioCause(enum_type other_value)
{
enum_value = other_value;
}

BssgpRadioCause::BssgpRadioCause(const BssgpRadioCause& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
enum_value = other_value.enum_value;
}

BssgpRadioCause& BssgpRadioCause::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

BssgpRadioCause& BssgpRadioCause::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

BssgpRadioCause& BssgpRadioCause::operator=(const BssgpRadioCause& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
enum_value = other_value.enum_value;
return *this;
}

boolean BssgpRadioCause::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.BssgpRadioCause comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean BssgpRadioCause::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
return enum_value == other_value;
}

boolean BssgpRadioCause::operator==(const BssgpRadioCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
return enum_value == other_value.enum_value;
}

boolean BssgpRadioCause::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.BssgpRadioCause comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean BssgpRadioCause::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
return enum_value < other_value;
}

boolean BssgpRadioCause::operator<(const BssgpRadioCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
return enum_value < other_value.enum_value;
}

boolean BssgpRadioCause::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.BssgpRadioCause comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean BssgpRadioCause::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
return enum_value > other_value;
}

boolean BssgpRadioCause::operator>(const BssgpRadioCause& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
return enum_value > other_value.enum_value;
}

const char *BssgpRadioCause::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case BSSGP__RADIO__CAUSE__CONTACT__LOST: return "BSSGP_RADIO_CAUSE_CONTACT_LOST";
case BSSGP__RADIO__CAUSE__LINK__QUAL__INSUFF: return "BSSGP_RADIO_CAUSE_LINK_QUAL_INSUFF";
case BSSGP__RADIO__CAUSE__CELL__RESEL__ORDERED: return "BSSGP_RADIO_CAUSE_CELL_RESEL_ORDERED";
case BSSGP__RADIO__CAUSE__CELL__RESEL__PREPARE: return "BSSGP_RADIO_CAUSE_CELL_RESEL_PREPARE";
case BSSGP__RADIO__CAUSE__CELL__RESEL__FAILURE: return "BSSGP_RADIO_CAUSE_CELL_RESEL_FAILURE";
default:
return "<unknown>";
}
}

BssgpRadioCause::enum_type BssgpRadioCause::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "BSSGP_RADIO_CAUSE_CONTACT_LOST")) return BSSGP__RADIO__CAUSE__CONTACT__LOST;
if (!strcmp(str_par, "BSSGP_RADIO_CAUSE_LINK_QUAL_INSUFF")) return BSSGP__RADIO__CAUSE__LINK__QUAL__INSUFF;
if (!strcmp(str_par, "BSSGP_RADIO_CAUSE_CELL_RESEL_ORDERED")) return BSSGP__RADIO__CAUSE__CELL__RESEL__ORDERED;
if (!strcmp(str_par, "BSSGP_RADIO_CAUSE_CELL_RESEL_PREPARE")) return BSSGP__RADIO__CAUSE__CELL__RESEL__PREPARE;
if (!strcmp(str_par, "BSSGP_RADIO_CAUSE_CELL_RESEL_FAILURE")) return BSSGP__RADIO__CAUSE__CELL__RESEL__FAILURE;
}
return UNKNOWN_VALUE;
}

boolean BssgpRadioCause::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
return TRUE;
default:
return FALSE;
}
}

int BssgpRadioCause::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int BssgpRadioCause::enum2int(const BssgpRadioCause& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void BssgpRadioCause::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.", int_val);
enum_value = (enum_type)int_val;
}

BssgpRadioCause::operator BssgpRadioCause::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
return enum_value;
}

void BssgpRadioCause::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void BssgpRadioCause::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Osmocom_Gb_Types.BssgpRadioCause");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @Osmocom_Gb_Types.BssgpRadioCause.");
  }
}

void BssgpRadioCause::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
text_buf.push_int(enum_value);
}

void BssgpRadioCause::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Osmocom_Gb_Types.BssgpRadioCause.", enum_value);
}

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

void BssgpRadioCause::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 BssgpRadioCause::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int BssgpRadioCause::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void BssgpRadioCause_template::copy_template(const BssgpRadioCause_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new BssgpRadioCause_template[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 BssgpRadioCause_template(*other_value.implication_.precondition);
implication_.implied_template = new BssgpRadioCause_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
}
}

BssgpRadioCause_template::BssgpRadioCause_template()
{
}

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

BssgpRadioCause_template::BssgpRadioCause_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!BssgpRadioCause::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause with unknown numeric value %d.", other_value);
single_value = (BssgpRadioCause::enum_type)other_value;
}

BssgpRadioCause_template::BssgpRadioCause_template(BssgpRadioCause::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

BssgpRadioCause_template::BssgpRadioCause_template(const BssgpRadioCause& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == BssgpRadioCause::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
single_value = other_value.enum_value;
}

BssgpRadioCause_template::BssgpRadioCause_template(const OPTIONAL<BssgpRadioCause>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (BssgpRadioCause::enum_type)(const BssgpRadioCause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause from an unbound optional field.");
}
}

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

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

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

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

boolean BssgpRadioCause_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean BssgpRadioCause_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != BssgpRadioCause::UNBOUND_VALUE;
}

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

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

BssgpRadioCause_template& BssgpRadioCause_template::operator=(int other_value)
{
if (!BssgpRadioCause::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (BssgpRadioCause::enum_type)other_value;
return *this;
}

BssgpRadioCause_template& BssgpRadioCause_template::operator=(BssgpRadioCause::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

BssgpRadioCause_template& BssgpRadioCause_template::operator=(const BssgpRadioCause& other_value)
{
if (other_value.enum_value == BssgpRadioCause::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.BssgpRadioCause to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

BssgpRadioCause_template& BssgpRadioCause_template::operator=(const OPTIONAL<BssgpRadioCause>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (BssgpRadioCause::enum_type)(const BssgpRadioCause&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
}
return *this;
}

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

boolean BssgpRadioCause_template::match(BssgpRadioCause::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
}
return FALSE;
}

boolean BssgpRadioCause_template::match(const BssgpRadioCause& other_value, boolean) const
{
if (other_value.enum_value == BssgpRadioCause::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause with an unbound value.");
return match(other_value.enum_value);
}

BssgpRadioCause::enum_type BssgpRadioCause_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
return single_value;
}

void BssgpRadioCause_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new BssgpRadioCause_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
}
}

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

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

void BssgpRadioCause_template::log_match(const BssgpRadioCause& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void BssgpRadioCause_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
}
}

void BssgpRadioCause_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (BssgpRadioCause::enum_type)text_buf.pull_int().get_val();
if (!BssgpRadioCause::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new BssgpRadioCause_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Osmocom_Gb_Types.BssgpRadioCause.");
}
}

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

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

void BssgpRadioCause_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    BssgpRadioCause_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    BssgpRadioCause::enum_type enum_val = BssgpRadioCause::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!BssgpRadioCause::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Osmocom_Gb_Types.BssgpRadioCause.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    BssgpRadioCause_template* precondition = new BssgpRadioCause_template;
    precondition->set_param(*m_p->get_elem(0));
    BssgpRadioCause_template* implied_template = new BssgpRadioCause_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = BssgpRadioCause_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Osmocom_Gb_Types.BssgpRadioCause");
  }
  is_ifpresent = param.get_ifpresent();
}

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

TlliType::TlliType()
{
enum_value = UNBOUND_VALUE;
}

TlliType::TlliType(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Initializing a variable of enumerated type @Osmocom_Gb_Types.TlliType with invalid numeric value %d.", other_value);
enum_value = (enum_type)other_value;
}

TlliType::TlliType(enum_type other_value)
{
enum_value = other_value;
}

TlliType::TlliType(const TlliType& other_value)
: Base_Type()
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Copying an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
enum_value = other_value.enum_value;
}

TlliType& TlliType::operator=(int other_value)
{
if (!is_valid_enum(other_value)) TTCN_error("Assigning unknown numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.TlliType.", other_value);
enum_value = (enum_type)other_value;
return *this;
}

TlliType& TlliType::operator=(enum_type other_value)
{
enum_value = other_value;
return *this;
}

TlliType& TlliType::operator=(const TlliType& other_value)
{
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
enum_value = other_value.enum_value;
return *this;
}

boolean TlliType::operator==(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.TlliType comparison is an unknown numeric value %d", other_value);
return enum_value == other_value;
}

boolean TlliType::operator==(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
return enum_value == other_value;
}

boolean TlliType::operator==(const TlliType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
return enum_value == other_value.enum_value;
}

boolean TlliType::operator<(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.TlliType comparison is an unknown numeric value %d", other_value);
return enum_value < other_value;
}

boolean TlliType::operator<(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
return enum_value < other_value;
}

boolean TlliType::operator<(const TlliType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
return enum_value < other_value.enum_value;
}

boolean TlliType::operator>(int other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
if (!is_valid_enum(other_value)) TTCN_error("The right operand of enumerated type @Osmocom_Gb_Types.TlliType comparison is an unknown numeric value %d", other_value);
return enum_value > other_value;
}

boolean TlliType::operator>(enum_type other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
return enum_value > other_value;
}

boolean TlliType::operator>(const TlliType& other_value) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
if (other_value.enum_value == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
return enum_value > other_value.enum_value;
}

const char *TlliType::enum_to_str(enum_type enum_par)
{
switch (enum_par) {
case TLLI__LOCAL: return "TLLI_LOCAL";
case TLLI__FOREIGN: return "TLLI_FOREIGN";
case TLLI__RANDOM: return "TLLI_RANDOM";
case TLLI__AUXILIARY: return "TLLI_AUXILIARY";
case TLLI__RESERVED: return "TLLI_RESERVED";
case TLLI__G__RNTI: return "TLLI_G_RNTI";
case TLLI__RAND__G__RNTI: return "TLLI_RAND_G_RNTI";
default:
return "<unknown>";
}
}

TlliType::enum_type TlliType::str_to_enum(const char *str_par, const int* int_par, const int* int_par2)
{
if (int_par == NULL && int_par2 == NULL) {
if (!strcmp(str_par, "TLLI_LOCAL")) return TLLI__LOCAL;
if (!strcmp(str_par, "TLLI_FOREIGN")) return TLLI__FOREIGN;
if (!strcmp(str_par, "TLLI_RANDOM")) return TLLI__RANDOM;
if (!strcmp(str_par, "TLLI_AUXILIARY")) return TLLI__AUXILIARY;
if (!strcmp(str_par, "TLLI_RESERVED")) return TLLI__RESERVED;
if (!strcmp(str_par, "TLLI_G_RNTI")) return TLLI__G__RNTI;
if (!strcmp(str_par, "TLLI_RAND_G_RNTI")) return TLLI__RAND__G__RNTI;
}
return UNKNOWN_VALUE;
}

boolean TlliType::is_valid_enum(int int_par)
{
switch (int_par) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
return TRUE;
default:
return FALSE;
}
}

int TlliType::enum2int(enum_type enum_par)
{
if (enum_par==UNBOUND_VALUE || enum_par==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.TlliType.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par;
}

int TlliType::enum2int(const TlliType& enum_par)
{
if (enum_par.enum_value==UNBOUND_VALUE || enum_par.enum_value==UNKNOWN_VALUE) TTCN_error("The argument of function enum2int() is an %s value of enumerated type @Osmocom_Gb_Types.TlliType.", enum_par==UNBOUND_VALUE?"unbound":"invalid");
return enum_par.enum_value;
}

void TlliType::int2enum(int int_val)
{
if (!is_valid_enum(int_val)) TTCN_error("Assigning invalid numeric value %d to a variable of enumerated type @Osmocom_Gb_Types.TlliType.", int_val);
enum_value = (enum_type)int_val;
}

TlliType::operator TlliType::enum_type() const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Using the value of an unbound variable of enumerated type @Osmocom_Gb_Types.TlliType.");
return enum_value;
}

void TlliType::log() const
{
if (enum_value != UNBOUND_VALUE) TTCN_Logger::log_event_enum(enum_to_str(enum_value), enum_value);
else TTCN_Logger::log_event_unbound();
}

void TlliType::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "enumerated value");
  if (param.get_type()!=Module_Param::MP_Enumerated) param.type_error("enumerated value", "@Osmocom_Gb_Types.TlliType");
  enum_value = str_to_enum(param.get_enumerated(), param.get_enumerated_value());
  if (!is_valid_enum(enum_value)) {
    param.error("Invalid enumerated value for type @Osmocom_Gb_Types.TlliType.");
  }
}

void TlliType::encode_text(Text_Buf& text_buf) const
{
if (enum_value == UNBOUND_VALUE) TTCN_error("Text encoder: Encoding an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
text_buf.push_int(enum_value);
}

void TlliType::decode_text(Text_Buf& text_buf)
{
enum_value = (enum_type)text_buf.pull_int().get_val();
if (!is_valid_enum(enum_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for enumerated type @Osmocom_Gb_Types.TlliType.", enum_value);
}

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

void TlliType::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 TlliType::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*)
{
  int decoded_value = 0;
  int decoded_length = RAW_decode_enum_type(p_td, p_buf, limit, top_bit_ord, decoded_value, 3, no_err);
  if (decoded_length < 0) return decoded_length;
  if (is_valid_enum(decoded_value)) enum_value = (enum_type)decoded_value;
  else {
    if(no_err){
     return -1;
    } else {
    TTCN_EncDec_ErrorContext::error
      (TTCN_EncDec::ET_ENC_ENUM, "Invalid enum value '%d' for '%s': ",decoded_value, p_td.name);
    enum_value = UNKNOWN_VALUE;
    }
  }
  return decoded_length;
}

int TlliType::RAW_encode(const TTCN_Typedescriptor_t& p_td, RAW_enc_tree& myleaf) const
{
  return RAW_encode_enum_type(p_td, myleaf, (int)enum_value, 3);
}

void TlliType_template::copy_template(const TlliType_template& other_value)
{
set_selection(other_value);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TlliType_template[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 TlliType_template(*other_value.implication_.precondition);
implication_.implied_template = new TlliType_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.TlliType.");
}
}

TlliType_template::TlliType_template()
{
}

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

TlliType_template::TlliType_template(int other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (!TlliType::is_valid_enum(other_value)) TTCN_error("Initializing a template of enumerated type @Osmocom_Gb_Types.TlliType with unknown numeric value %d.", other_value);
single_value = (TlliType::enum_type)other_value;
}

TlliType_template::TlliType_template(TlliType::enum_type other_value)
 : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

TlliType_template::TlliType_template(const TlliType& other_value)
 : Base_Template(SPECIFIC_VALUE)
{
if (other_value.enum_value == TlliType::UNBOUND_VALUE) TTCN_error("Creating a template from an unbound value of enumerated type @Osmocom_Gb_Types.TlliType.");
single_value = other_value.enum_value;
}

TlliType_template::TlliType_template(const OPTIONAL<TlliType>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (TlliType::enum_type)(const TlliType&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of enumerated type @Osmocom_Gb_Types.TlliType from an unbound optional field.");
}
}

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

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

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

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

boolean TlliType_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
return TRUE;
}

boolean TlliType_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value != TlliType::UNBOUND_VALUE;
}

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

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

TlliType_template& TlliType_template::operator=(int other_value)
{
if (!TlliType::is_valid_enum(other_value)) TTCN_warning("Assigning unknown numeric value %d to a template of enumerated type @Osmocom_Gb_Types.TlliType.", other_value);
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = (TlliType::enum_type)other_value;
return *this;
}

TlliType_template& TlliType_template::operator=(TlliType::enum_type other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;
}

TlliType_template& TlliType_template::operator=(const TlliType& other_value)
{
if (other_value.enum_value == TlliType::UNBOUND_VALUE) TTCN_error("Assignment of an unbound value of enumerated type @Osmocom_Gb_Types.TlliType to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.enum_value;
return *this;
}

TlliType_template& TlliType_template::operator=(const OPTIONAL<TlliType>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
set_selection(SPECIFIC_VALUE);
single_value = (TlliType::enum_type)(const TlliType&)other_value;
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of enumerated type @Osmocom_Gb_Types.TlliType.");
}
return *this;
}

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

boolean TlliType_template::match(TlliType::enum_type other_value, boolean) const
{
switch (template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.TlliType.");
}
return FALSE;
}

boolean TlliType_template::match(const TlliType& other_value, boolean) const
{
if (other_value.enum_value == TlliType::UNBOUND_VALUE) TTCN_error("Matching a template of enumerated type @Osmocom_Gb_Types.TlliType with an unbound value.");
return match(other_value.enum_value);
}

TlliType::enum_type TlliType_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of enumerated type @Osmocom_Gb_Types.TlliType.");
return single_value;
}

void TlliType_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TlliType_template[list_length];
break;
default:
TTCN_error("Setting an invalid type for a template of enumerated type @Osmocom_Gb_Types.TlliType.");
}
}

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

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

void TlliType_template::log_match(const TlliType& match_value, boolean) const
{
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void TlliType_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of enumerated type @Osmocom_Gb_Types.TlliType.");
}
}

void TlliType_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = (TlliType::enum_type)text_buf.pull_int().get_val();
if (!TlliType::is_valid_enum(single_value)) TTCN_error("Text decoder: Unknown numeric value %d was received for a template of enumerated type @Osmocom_Gb_Types.TlliType.", single_value);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TlliType_template[value_list.n_values];
for (unsigned int elem_count = 0; elem_count < value_list.n_values; elem_count++)
value_list.list_value[elem_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of enumerated type @Osmocom_Gb_Types.TlliType.");
}
}

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

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

void TlliType_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "enumerated template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TlliType_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Enumerated: {
    TlliType::enum_type enum_val = TlliType::str_to_enum(m_p->get_enumerated(), m_p->get_enumerated_value());
    if (!TlliType::is_valid_enum(enum_val)) {
      param.error("Invalid enumerated value for type @Osmocom_Gb_Types.TlliType.");
    }
    *this = enum_val;
  } break;
  case Module_Param::MP_Implication_Template: {
    TlliType_template* precondition = new TlliType_template;
    precondition->set_param(*m_p->get_elem(0));
    TlliType_template* implied_template = new TlliType_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TlliType_template(precondition, implied_template);
  } break;
  default:
    param.type_error("enumerated template", "@Osmocom_Gb_Types.TlliType");
  }
  is_ifpresent = param.get_ifpresent();
}

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


/* Bodies of functions, altsteps and testcases */

void OsmoNsDialect_encoder(const OsmoNsDialect& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.OsmoNsDialect' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(OsmoNsDialect_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER OsmoNsDialect_decoder(OCTETSTRING& input_stream, OsmoNsDialect& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.OsmoNsDialect' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(OsmoNsDialect_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void NsPduType_encoder(const NsPduType& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.NsPduType' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(NsPduType_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NsPduType_decoder(OCTETSTRING& input_stream, NsPduType& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.NsPduType' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(NsPduType_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void NsIEI_encoder(const NsIEI& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.NsIEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(NsIEI_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NsIEI_decoder(OCTETSTRING& input_stream, NsIEI& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.NsIEI' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(NsIEI_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

void NsCause_encoder(const NsCause& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.NsCause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(NsCause_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER NsCause_decoder(OCTETSTRING& input_stream, NsCause& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.NsCause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(NsCause_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

NS__Types::CauseNS_template ts__NS__IE__CAUSE(const NsCause& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 87, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_IE_CAUSE");
NS__Types::CauseNS_template ret_val;
ret_val.iEI() = os_0;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.cause() = int2oct(NsCause::enum2int(cause), 1);
return ret_val;
}

NS__Types::CauseNS_template ts__NS__IE__CAUSE__omit(const NsCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 95, TTCN_Location::LOCATION_FUNCTION, "ts_NS_IE_CAUSE_omit");
current_location.update_lineno(96);
/* Osmocom_Gb_Types.ttcn, line 96 */
NS__Types::CauseNS_template ret;
current_location.update_lineno(97);
/* Osmocom_Gb_Types.ttcn, line 97 */
if (cause.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(98);
/* Osmocom_Gb_Types.ttcn, line 98 */
return NS__Types::CauseNS_template(OMIT_VALUE);
}
else {
current_location.update_lineno(100);
/* Osmocom_Gb_Types.ttcn, line 100 */
ret.iEI() = os_0;
ret.ext() = bs_2;
ret.lengthIndicator().length1() = 1;
ret.cause() = int2oct(NsCause::enum2int(cause.valueof()), 1);
current_location.update_lineno(108);
/* Osmocom_Gb_Types.ttcn, line 108 */
return ret;
}
}

NS__Types::CauseNS_template tr__NS__IE__CAUSE(const NsCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 112, TTCN_Location::LOCATION_FUNCTION, "tr_NS_IE_CAUSE");
current_location.update_lineno(113);
/* Osmocom_Gb_Types.ttcn, line 113 */
NS__Types::CauseNS_template ret;
current_location.update_lineno(114);
/* Osmocom_Gb_Types.ttcn, line 114 */
ret.iEI() = os_0;
current_location.update_lineno(115);
/* Osmocom_Gb_Types.ttcn, line 115 */
ret.ext() = bs_2;
current_location.update_lineno(116);
/* Osmocom_Gb_Types.ttcn, line 116 */
{
NS__Types::LIN1__2_template& tmp_4 = ret.lengthIndicator();
tmp_4.length1() = 1;
}
current_location.update_lineno(117);
/* Osmocom_Gb_Types.ttcn, line 117 */
if (cause.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(118);
/* Osmocom_Gb_Types.ttcn, line 118 */
return NS__Types::CauseNS_template(OMIT_VALUE);
}
else {
current_location.update_lineno(119);
/* Osmocom_Gb_Types.ttcn, line 119 */
if (cause.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(120);
/* Osmocom_Gb_Types.ttcn, line 120 */
return NS__Types::CauseNS_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(121);
/* Osmocom_Gb_Types.ttcn, line 121 */
if (cause.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(122);
/* Osmocom_Gb_Types.ttcn, line 122 */
ret.cause() = ANY_VALUE;
}
else {
current_location.update_lineno(124);
/* Osmocom_Gb_Types.ttcn, line 124 */
ret.cause() = int2oct(NsCause::enum2int(cause.valueof()), 1);
}
}
}
current_location.update_lineno(126);
/* Osmocom_Gb_Types.ttcn, line 126 */
return ret;
}

NS__Types::IP__Address__NS_template ts__SNS__IP__ADDR(const NS__Types::IPAddress_template& ip)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 129, TTCN_Location::LOCATION_FUNCTION, "ts_SNS_IP_ADDR");
current_location.update_lineno(130);
/* Osmocom_Gb_Types.ttcn, line 130 */
NS__Types::IP__Address__NS_template ret;
current_location.update_lineno(131);
/* Osmocom_Gb_Types.ttcn, line 131 */
if (ip.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(132);
/* Osmocom_Gb_Types.ttcn, line 132 */
return NS__Types::IP__Address__NS_template(OMIT_VALUE);
}
else {
current_location.update_lineno(134);
/* Osmocom_Gb_Types.ttcn, line 134 */
ret.iEI() = os_1;
current_location.update_lineno(135);
/* Osmocom_Gb_Types.ttcn, line 135 */
ret.ipAddress() = ip;
current_location.update_lineno(136);
/* Osmocom_Gb_Types.ttcn, line 136 */
if (ip.ischosen(NS__Types::IPAddress::ALT_ip4Address)) {
current_location.update_lineno(137);
/* Osmocom_Gb_Types.ttcn, line 137 */
ret.addressType() = os_2;
}
else {
current_location.update_lineno(139);
/* Osmocom_Gb_Types.ttcn, line 139 */
ret.addressType() = os_3;
}
}
current_location.update_lineno(142);
/* Osmocom_Gb_Types.ttcn, line 142 */
return ret;
}

NS__Types::IP__Address__NS_template tr__SNS__IP__ADDR(const NS__Types::IPAddress_template& ip)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 144, TTCN_Location::LOCATION_FUNCTION, "tr_SNS_IP_ADDR");
current_location.update_lineno(145);
/* Osmocom_Gb_Types.ttcn, line 145 */
NS__Types::IP__Address__NS_template ret;
current_location.update_lineno(146);
/* Osmocom_Gb_Types.ttcn, line 146 */
ret.iEI() = os_1;
current_location.update_lineno(147);
/* Osmocom_Gb_Types.ttcn, line 147 */
if (ip.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(148);
/* Osmocom_Gb_Types.ttcn, line 148 */
return NS__Types::IP__Address__NS_template(OMIT_VALUE);
}
else {
current_location.update_lineno(149);
/* Osmocom_Gb_Types.ttcn, line 149 */
if (ip.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(150);
/* Osmocom_Gb_Types.ttcn, line 150 */
return NS__Types::IP__Address__NS_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(151);
/* Osmocom_Gb_Types.ttcn, line 151 */
if (ip.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(152);
/* Osmocom_Gb_Types.ttcn, line 152 */
return NS__Types::IP__Address__NS_template(ANY_VALUE);
}
else {
current_location.update_lineno(154);
/* Osmocom_Gb_Types.ttcn, line 154 */
ret.ipAddress() = ip;
current_location.update_lineno(155);
/* Osmocom_Gb_Types.ttcn, line 155 */
if (ip.ischosen(NS__Types::IPAddress::ALT_ip4Address)) {
current_location.update_lineno(156);
/* Osmocom_Gb_Types.ttcn, line 156 */
ret.addressType() = os_2;
}
else {
current_location.update_lineno(158);
/* Osmocom_Gb_Types.ttcn, line 158 */
ret.addressType() = os_3;
}
}
}
}
current_location.update_lineno(161);
/* Osmocom_Gb_Types.ttcn, line 161 */
return ret;
}

NS__Types::NS__VCI_template ts__NS__IE__NSVCI(const INTEGER& nsvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 164, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_IE_NSVCI");
NS__Types::NS__VCI_template ret_val;
ret_val.iEI() = os_2;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.nS__VCI() = int2oct(nsvci, 2);
return ret_val;
}

NS__Types::NS__VCI_template tr__NS__IE__NSVCI(const INTEGER_template& nsvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 172, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_IE_NSVCI");
NS__Types::NS__VCI_template ret_val;
ret_val.iEI() = os_2;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.nS__VCI() = Osmocom__Types::int2oct__tmpl(nsvci, 2);
return ret_val;
}

NS__Types::NSEI__NS_template ts__NS__IE__NSEI(const INTEGER& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 181, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_IE_NSEI");
NS__Types::NSEI__NS_template ret_val;
ret_val.iEI() = os_4;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.nSEI() = int2oct(nsei, 2);
return ret_val;
}

NS__Types::NSEI__NS_template tr__NS__IE__NSEI(const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 189, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_IE_NSEI");
NS__Types::NSEI__NS_template ret_val;
ret_val.iEI() = os_4;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.nSEI() = Osmocom__Types::int2oct__tmpl(nsei, 2);
return ret_val;
}

NS__Types::IP4__Element_template ts__SNS__IPv4(const CHARSTRING& ip, const INTEGER& udp__port, const INTEGER& sig__weight, const INTEGER& data__weight)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 198, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_IPv4");
NS__Types::IP4__Element_template ret_val;
ret_val.ipAddress() = Native__Functions::f__inet__addr(ip);
ret_val.uDP__Port() = int2oct(udp__port, 2);
ret_val.signallingWeight() = int2oct(sig__weight, 1);
ret_val.dataWeight() = int2oct(data__weight, 1);
return ret_val;
}

NS__Types::IP4__Element_template tr__SNS__IPv4(const CHARSTRING_template& ip, const INTEGER_template& udp__port, const INTEGER_template& sig__weight, const INTEGER_template& data__weight)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 205, TTCN_Location::LOCATION_FUNCTION, "tr_SNS_IPv4");
current_location.update_lineno(208);
/* Osmocom_Gb_Types.ttcn, line 208 */
NS__Types::IP4__Element_template e;
current_location.update_lineno(209);
/* Osmocom_Gb_Types.ttcn, line 209 */
if (ip.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(210);
/* Osmocom_Gb_Types.ttcn, line 210 */
e.ipAddress() = ANY_VALUE;
}
else {
current_location.update_lineno(212);
/* Osmocom_Gb_Types.ttcn, line 212 */
e.ipAddress() = Native__Functions::f__inet__addr(ip.valueof());
}
current_location.update_lineno(214);
/* Osmocom_Gb_Types.ttcn, line 214 */
if (udp__port.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(215);
/* Osmocom_Gb_Types.ttcn, line 215 */
e.uDP__Port() = ANY_VALUE;
}
else {
current_location.update_lineno(217);
/* Osmocom_Gb_Types.ttcn, line 217 */
e.uDP__Port() = int2oct(udp__port.valueof(), 2);
}
current_location.update_lineno(219);
/* Osmocom_Gb_Types.ttcn, line 219 */
if (sig__weight.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(220);
/* Osmocom_Gb_Types.ttcn, line 220 */
e.signallingWeight() = ANY_VALUE;
}
else {
current_location.update_lineno(222);
/* Osmocom_Gb_Types.ttcn, line 222 */
e.signallingWeight() = int2oct(sig__weight.valueof(), 1);
}
current_location.update_lineno(224);
/* Osmocom_Gb_Types.ttcn, line 224 */
if (data__weight.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(225);
/* Osmocom_Gb_Types.ttcn, line 225 */
e.dataWeight() = ANY_VALUE;
}
else {
current_location.update_lineno(227);
/* Osmocom_Gb_Types.ttcn, line 227 */
e.dataWeight() = int2oct(data__weight.valueof(), 1);
}
current_location.update_lineno(229);
/* Osmocom_Gb_Types.ttcn, line 229 */
return e;
}

NS__Types::IP6__Element_template ts__SNS__IPv6(const CHARSTRING& ip, const INTEGER& udp__port, const INTEGER& sig__weight, const INTEGER& data__weight)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 232, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_IPv6");
NS__Types::IP6__Element_template ret_val;
ret_val.ipAddress() = Native__Functions::f__inet6__addr(ip);
ret_val.uDP__Port() = int2oct(udp__port, 2);
ret_val.signallingWeight() = int2oct(sig__weight, 1);
ret_val.dataWeight() = int2oct(data__weight, 1);
return ret_val;
}

NS__Types::IP6__Element_template tr__SNS__IPv6(const CHARSTRING_template& ip, const INTEGER_template& udp__port, const INTEGER_template& sig__weight, const INTEGER_template& data__weight)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 239, TTCN_Location::LOCATION_FUNCTION, "tr_SNS_IPv6");
current_location.update_lineno(242);
/* Osmocom_Gb_Types.ttcn, line 242 */
NS__Types::IP6__Element_template e;
current_location.update_lineno(243);
/* Osmocom_Gb_Types.ttcn, line 243 */
if (ip.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(244);
/* Osmocom_Gb_Types.ttcn, line 244 */
e.ipAddress() = ANY_VALUE;
}
else {
current_location.update_lineno(246);
/* Osmocom_Gb_Types.ttcn, line 246 */
e.ipAddress() = Native__Functions::f__inet6__addr(ip.valueof());
}
current_location.update_lineno(248);
/* Osmocom_Gb_Types.ttcn, line 248 */
if (udp__port.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(249);
/* Osmocom_Gb_Types.ttcn, line 249 */
e.uDP__Port() = ANY_VALUE;
}
else {
current_location.update_lineno(251);
/* Osmocom_Gb_Types.ttcn, line 251 */
e.uDP__Port() = int2oct(udp__port.valueof(), 2);
}
current_location.update_lineno(253);
/* Osmocom_Gb_Types.ttcn, line 253 */
if (sig__weight.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(254);
/* Osmocom_Gb_Types.ttcn, line 254 */
e.signallingWeight() = ANY_VALUE;
}
else {
current_location.update_lineno(256);
/* Osmocom_Gb_Types.ttcn, line 256 */
e.signallingWeight() = int2oct(sig__weight.valueof(), 1);
}
current_location.update_lineno(258);
/* Osmocom_Gb_Types.ttcn, line 258 */
if (data__weight.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(259);
/* Osmocom_Gb_Types.ttcn, line 259 */
e.dataWeight() = ANY_VALUE;
}
else {
current_location.update_lineno(261);
/* Osmocom_Gb_Types.ttcn, line 261 */
e.dataWeight() = int2oct(data__weight.valueof(), 1);
}
current_location.update_lineno(263);
/* Osmocom_Gb_Types.ttcn, line 263 */
return e;
}

NS__Types::PDU__NS_template ts__NS__RESET(const NsCause& cause, const INTEGER& nsvci, const INTEGER& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 267, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_RESET");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Reset_template& tmp_31 = ret_val.pDU__NS__Reset();
tmp_31.nsPduType() = os_3;
tmp_31.causeNS() = ts__NS__IE__CAUSE(cause);
tmp_31.nS__VCI() = ts__NS__IE__NSVCI(nsvci);
tmp_31.nSEI__NS() = ts__NS__IE__NSEI(nsei);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__NS__RESET(const NsCause_template& cause, const INTEGER_template& nsvci, const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 275, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_RESET");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Reset_template& tmp_32 = ret_val.pDU__NS__Reset();
tmp_32.nsPduType() = os_3;
tmp_32.causeNS() = tr__NS__IE__CAUSE(cause);
tmp_32.nS__VCI() = tr__NS__IE__NSVCI(nsvci);
tmp_32.nSEI__NS() = tr__NS__IE__NSEI(nsei);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__NS__RESET__ACK(const INTEGER& nsvci, const INTEGER& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 284, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_RESET_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Reset__Ack_template& tmp_33 = ret_val.pDU__NS__Reset__Ack();
tmp_33.nsPduType() = os_5;
tmp_33.nS__VCI() = ts__NS__IE__NSVCI(nsvci);
tmp_33.nSEI__NS() = ts__NS__IE__NSEI(nsei);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__NS__RESET__ACK(const INTEGER_template& nsvci, const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 291, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_RESET_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Reset__Ack_template& tmp_34 = ret_val.pDU__NS__Reset__Ack();
tmp_34.nsPduType() = os_5;
tmp_34.nS__VCI() = tr__NS__IE__NSVCI(nsvci);
tmp_34.nSEI__NS() = tr__NS__IE__NSEI(nsei);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__NS__BLOCK(const NsCause& cause, const INTEGER& nsvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 299, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_BLOCK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Block_template& tmp_35 = ret_val.pDU__NS__Block();
tmp_35.nsPduType() = os_4;
tmp_35.causeNS() = ts__NS__IE__CAUSE(cause);
tmp_35.nS__VCI() = ts__NS__IE__NSVCI(nsvci);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__NS__BLOCK(const NsCause_template& cause, const INTEGER_template& nsvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 306, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_BLOCK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Block_template& tmp_36 = ret_val.pDU__NS__Block();
tmp_36.nsPduType() = os_4;
tmp_36.causeNS() = tr__NS__IE__CAUSE(cause);
tmp_36.nS__VCI() = tr__NS__IE__NSVCI(nsvci);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__NS__BLOCK__ACK(const INTEGER& nsvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 314, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_BLOCK_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Block__Ack_template& tmp_37 = ret_val.pDU__NS__Block__Ack();
tmp_37.nsPduType() = os_6;
tmp_37.nS__VCI() = ts__NS__IE__NSVCI(nsvci);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__NS__BLOCK__ACK(const INTEGER_template& nsvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 320, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_BLOCK_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Block__Ack_template& tmp_38 = ret_val.pDU__NS__Block__Ack();
tmp_38.nsPduType() = os_6;
tmp_38.nS__VCI() = tr__NS__IE__NSVCI(nsvci);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__NS__STATUS(const NsCause& cause, const NS__Types::PDU__NS& pdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 351, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_STATUS");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Status_template& tmp_39 = ret_val.pDU__NS__Status();
tmp_39.nsPduType() = os_10;
tmp_39.causeNS() = ts__NS__IE__CAUSE(cause);
tmp_39.nS__VCI() = OMIT_VALUE;
{
NS__Types::NS__PDU_template& tmp_40 = tmp_39.nS__PDU();
tmp_40.iEI() = os_3;
tmp_40.ext() = bs_2;
tmp_40.lengthIndicator().length1() = 0;
tmp_40.ns__PDU() = NS__Types::enc__PDU__NS(pdu);
}
tmp_39.bVCI__NS() = OMIT_VALUE;
tmp_39.listofIP4Elements() = OMIT_VALUE;
tmp_39.listofIP6Elements() = OMIT_VALUE;
}
return ret_val;
}

NS__Types::PDU__NS_template tr__NS__STATUS(const NsCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 370, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_STATUS");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Status_template& tmp_41 = ret_val.pDU__NS__Status();
tmp_41.nsPduType() = os_10;
tmp_41.causeNS() = tr__NS__IE__CAUSE(cause);
tmp_41.nS__VCI() = ANY_OR_OMIT;
tmp_41.nS__PDU() = ANY_OR_OMIT;
tmp_41.bVCI__NS() = ANY_OR_OMIT;
tmp_41.listofIP4Elements() = ANY_OR_OMIT;
tmp_41.listofIP6Elements() = ANY_OR_OMIT;
}
return ret_val;
}

NS__Types::PDU__NS_template ts__NS__UNITDATA(const NS__Types::NS__SDU__ControlBits_template& bits, const INTEGER& bvci, const OCTETSTRING& sdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 382, TTCN_Location::LOCATION_TEMPLATE, "ts_NS_UNITDATA");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Unitdata_template& tmp_42 = ret_val.pDU__NS__Unitdata();
tmp_42.nsPduType() = os_0;
tmp_42.nS__SDU__ControlBits() = bits;
tmp_42.bVCI() = int2oct(bvci, 2);
tmp_42.nS__SDU() = sdu;
}
return ret_val;
}

NS__Types::PDU__NS_template tr__NS__UNITDATA(const NS__Types::NS__SDU__ControlBits_template& bits, const INTEGER_template& bvci, const OCTETSTRING_template& sdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 390, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_UNITDATA");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Unitdata_template& tmp_43 = ret_val.pDU__NS__Unitdata();
tmp_43.nsPduType() = os_0;
tmp_43.nS__SDU__ControlBits() = bits;
tmp_43.bVCI() = Osmocom__Types::int2oct__tmpl(bvci, 2);
tmp_43.nS__SDU() = sdu;
}
return ret_val;
}

NS__Types::PDU__NS_template tr__NS__UNITDATA__User(const NS__Types::NS__SDU__ControlBits_template& bits, const OCTETSTRING_template& sdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 399, TTCN_Location::LOCATION_TEMPLATE, "tr_NS_UNITDATA_User");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__NS__Unitdata_template& tmp_44 = ret_val.pDU__NS__Unitdata();
tmp_44.nsPduType() = os_0;
tmp_44.nS__SDU__ControlBits() = bits;
{
OCTETSTRING_template& tmp_45 = tmp_44.bVCI();
tmp_45.set_type(COMPLEMENTED_LIST, 1);
tmp_45.list_item(0) = os_11;
}
tmp_44.nS__SDU() = sdu;
}
return ret_val;
}

NS__Types::NumberOfIP__Endpoints_template ts__num__of__ep(const OCTETSTRING& iei, const INTEGER_template& num__ep)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 410, TTCN_Location::LOCATION_FUNCTION, "ts_num_of_ep");
current_location.update_lineno(412);
/* Osmocom_Gb_Types.ttcn, line 412 */
NS__Types::NumberOfIP__Endpoints_template t;
current_location.update_lineno(413);
/* Osmocom_Gb_Types.ttcn, line 413 */
if (num__ep.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(414);
/* Osmocom_Gb_Types.ttcn, line 414 */
return NS__Types::NumberOfIP__Endpoints_template(OMIT_VALUE);
}
else {
current_location.update_lineno(416);
/* Osmocom_Gb_Types.ttcn, line 416 */
t.iEI() = iei;
current_location.update_lineno(417);
/* Osmocom_Gb_Types.ttcn, line 417 */
t.numberOfIP__Endpoints() = int2oct(num__ep.valueof(), 2);
current_location.update_lineno(418);
/* Osmocom_Gb_Types.ttcn, line 418 */
return t;
}
}

NS__Types::NumberOfIP__Endpoints_template tr__num__of__ep(const OCTETSTRING& iei, const INTEGER_template& num__ep)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 421, TTCN_Location::LOCATION_FUNCTION, "tr_num_of_ep");
current_location.update_lineno(423);
/* Osmocom_Gb_Types.ttcn, line 423 */
NS__Types::NumberOfIP__Endpoints_template t;
current_location.update_lineno(424);
/* Osmocom_Gb_Types.ttcn, line 424 */
if (num__ep.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(425);
/* Osmocom_Gb_Types.ttcn, line 425 */
return NS__Types::NumberOfIP__Endpoints_template(OMIT_VALUE);
}
else {
current_location.update_lineno(426);
/* Osmocom_Gb_Types.ttcn, line 426 */
if (num__ep.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(427);
/* Osmocom_Gb_Types.ttcn, line 427 */
return NS__Types::NumberOfIP__Endpoints_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(428);
/* Osmocom_Gb_Types.ttcn, line 428 */
if (num__ep.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(429);
/* Osmocom_Gb_Types.ttcn, line 429 */
return NS__Types::NumberOfIP__Endpoints_template(ANY_VALUE);
}
else {
current_location.update_lineno(431);
/* Osmocom_Gb_Types.ttcn, line 431 */
t.iEI() = iei;
current_location.update_lineno(432);
/* Osmocom_Gb_Types.ttcn, line 432 */
t.numberOfIP__Endpoints() = int2oct(num__ep.valueof(), 2);
current_location.update_lineno(433);
/* Osmocom_Gb_Types.ttcn, line 433 */
return t;
}
}
}
}

NS__Types::ResetFlag_template ts__SNS__IE__ResetFlag(const BOOLEAN& rst)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 438, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_IE_ResetFlag");
NS__Types::ResetFlag_template ret_val;
ret_val.iEI() = os_9;
ret_val.resetBIT() = Osmocom__Types::bool2bit(rst);
ret_val.spare() = bs_3;
return ret_val;
}

NS__Types::ResetFlag_template tr__SNS__IE__ResetFlag(const BOOLEAN_template& rst)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 443, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_IE_ResetFlag");
NS__Types::ResetFlag_template ret_val;
ret_val.iEI() = os_9;
ret_val.resetBIT() = Osmocom__Types::bool2bit__tmpl(rst);
ret_val.spare() = bs_3;
return ret_val;
}

NS__Types::EndFlag_template ts__SNS__IE__EndFlag(const BOOLEAN& end)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 449, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_IE_EndFlag");
NS__Types::EndFlag_template ret_val;
ret_val.eBIT() = Osmocom__Types::bool2bit(end);
ret_val.spare() = bs_3;
return ret_val;
}

NS__Types::EndFlag_template tr__SNS__IE__EndFlag(const BOOLEAN_template& end)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 453, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_IE_EndFlag");
NS__Types::EndFlag_template ret_val;
ret_val.eBIT() = Osmocom__Types::bool2bit__tmpl(end);
ret_val.spare() = bs_3;
return ret_val;
}

NS__Types::MaxNumberOfNSVCs_template ts__SNS__IE__MaxNumOfNSVCs(const INTEGER& num)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 458, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_IE_MaxNumOfNSVCs");
NS__Types::MaxNumberOfNSVCs_template ret_val;
ret_val.iEI() = os_8;
ret_val.maxNumberOfNSVCs() = int2oct(num, 2);
return ret_val;
}

NS__Types::MaxNumberOfNSVCs_template tr__SNS__IE__MaxNumOfNSVCs(const INTEGER_template& num)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 462, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_IE_MaxNumOfNSVCs");
NS__Types::MaxNumberOfNSVCs_template ret_val;
ret_val.iEI() = os_8;
ret_val.maxNumberOfNSVCs() = Osmocom__Types::int2oct__tmpl(num, 2);
return ret_val;
}

NS__Types::PDU__NS_template ts__SNS__SIZE(const INTEGER& nsei, const BOOLEAN& rst__flag, const INTEGER& max__nsvcs, const INTEGER_template& num__v4, const INTEGER_template& num__v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 467, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_SIZE");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Size_template& tmp_50 = ret_val.pDU__SNS__Size();
tmp_50.nsPduType() = os_12;
tmp_50.nSEI__NS() = ts__NS__IE__NSEI(nsei);
tmp_50.resetFlag() = ts__SNS__IE__ResetFlag(rst__flag);
tmp_50.maxNumberOfNSVCs() = ts__SNS__IE__MaxNumOfNSVCs(max__nsvcs);
tmp_50.numberOfIP4__Endpoints() = ts__num__of__ep(os_10, num__v4);
tmp_50.numberOfIP6__Endpoints() = ts__num__of__ep(os_13, num__v6);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS__SIZE(const INTEGER_template& nsei, const BOOLEAN_template& rst__flag, const INTEGER_template& max__nsvcs, const INTEGER_template& num__v4, const INTEGER_template& num__v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 480, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_SIZE");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Size_template& tmp_51 = ret_val.pDU__SNS__Size();
tmp_51.nsPduType() = os_12;
tmp_51.nSEI__NS() = tr__NS__IE__NSEI(nsei);
tmp_51.resetFlag() = tr__SNS__IE__ResetFlag(rst__flag);
tmp_51.maxNumberOfNSVCs() = tr__SNS__IE__MaxNumOfNSVCs(max__nsvcs);
tmp_51.numberOfIP4__Endpoints() = tr__num__of__ep(os_10, num__v4);
tmp_51.numberOfIP6__Endpoints() = tr__num__of__ep(os_13, num__v6);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__SNS__SIZE__ACK(const INTEGER& nsei, const NsCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 494, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_SIZE_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Size__Ack_template& tmp_52 = ret_val.pDU__SNS__Size__Ack();
tmp_52.nsPduType() = os_14;
tmp_52.nSEI__NS() = ts__NS__IE__NSEI(nsei);
tmp_52.causeNS() = ts__NS__IE__CAUSE__omit(cause);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS__SIZE__ACK(const INTEGER_template& nsei, const NsCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 501, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_SIZE_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Size__Ack_template& tmp_53 = ret_val.pDU__SNS__Size__Ack();
tmp_53.nsPduType() = os_14;
tmp_53.nSEI__NS() = tr__NS__IE__NSEI(nsei);
tmp_53.causeNS() = tr__NS__IE__CAUSE(cause);
}
return ret_val;
}

NS__Types::ListofIP4Elements_template ts__SNS__IE__ListIP4(const NS__Types::IP4__Elements_template& elem)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 509, TTCN_Location::LOCATION_FUNCTION, "ts_SNS_IE_ListIP4");
current_location.update_lineno(511);
/* Osmocom_Gb_Types.ttcn, line 511 */
NS__Types::ListofIP4Elements_template r;
current_location.update_lineno(512);
/* Osmocom_Gb_Types.ttcn, line 512 */
if (elem.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(513);
/* Osmocom_Gb_Types.ttcn, line 513 */
return NS__Types::ListofIP4Elements_template(OMIT_VALUE);
}
else {
current_location.update_lineno(515);
/* Osmocom_Gb_Types.ttcn, line 515 */
r.iEI() = os_6;
r.ext() = bs_2;
r.lengthIndicator().length1() = 0;
r.iP4__Elements() = elem;
current_location.update_lineno(523);
/* Osmocom_Gb_Types.ttcn, line 523 */
return r;
}
}

NS__Types::ListofIP4Elements_template tr__SNS__IE__ListIP4(const NS__Types::IP4__Elements_template& elem)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 526, TTCN_Location::LOCATION_FUNCTION, "tr_SNS_IE_ListIP4");
current_location.update_lineno(528);
/* Osmocom_Gb_Types.ttcn, line 528 */
NS__Types::ListofIP4Elements_template r;
current_location.update_lineno(529);
/* Osmocom_Gb_Types.ttcn, line 529 */
if (elem.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(530);
/* Osmocom_Gb_Types.ttcn, line 530 */
return NS__Types::ListofIP4Elements_template(OMIT_VALUE);
}
else {
current_location.update_lineno(531);
/* Osmocom_Gb_Types.ttcn, line 531 */
if (elem.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(532);
/* Osmocom_Gb_Types.ttcn, line 532 */
return NS__Types::ListofIP4Elements_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(533);
/* Osmocom_Gb_Types.ttcn, line 533 */
if (elem.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(534);
/* Osmocom_Gb_Types.ttcn, line 534 */
return NS__Types::ListofIP4Elements_template(ANY_VALUE);
}
else {
current_location.update_lineno(536);
/* Osmocom_Gb_Types.ttcn, line 536 */
r.iEI() = os_6;
r.ext() = bs_2;
r.lengthIndicator().length1() = ANY_VALUE;
r.iP4__Elements() = elem;
current_location.update_lineno(544);
/* Osmocom_Gb_Types.ttcn, line 544 */
return r;
}
}
}
}

NS__Types::ListofIP6Elements_template ts__SNS__IE__ListIP6(const NS__Types::IP6__Elements_template& elem)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 548, TTCN_Location::LOCATION_FUNCTION, "ts_SNS_IE_ListIP6");
current_location.update_lineno(550);
/* Osmocom_Gb_Types.ttcn, line 550 */
NS__Types::ListofIP6Elements_template r;
current_location.update_lineno(551);
/* Osmocom_Gb_Types.ttcn, line 551 */
if (elem.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(552);
/* Osmocom_Gb_Types.ttcn, line 552 */
return NS__Types::ListofIP6Elements_template(OMIT_VALUE);
}
else {
current_location.update_lineno(554);
/* Osmocom_Gb_Types.ttcn, line 554 */
r.iEI() = os_7;
r.ext() = bs_2;
r.lengthIndicator().length1() = 0;
r.iP6__Elements() = elem;
current_location.update_lineno(562);
/* Osmocom_Gb_Types.ttcn, line 562 */
return r;
}
}

NS__Types::ListofIP6Elements_template tr__SNS__IE__ListIP6(const NS__Types::IP6__Elements_template& elem)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 565, TTCN_Location::LOCATION_FUNCTION, "tr_SNS_IE_ListIP6");
current_location.update_lineno(567);
/* Osmocom_Gb_Types.ttcn, line 567 */
NS__Types::ListofIP6Elements_template r;
current_location.update_lineno(568);
/* Osmocom_Gb_Types.ttcn, line 568 */
if (elem.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(569);
/* Osmocom_Gb_Types.ttcn, line 569 */
return NS__Types::ListofIP6Elements_template(OMIT_VALUE);
}
else {
current_location.update_lineno(570);
/* Osmocom_Gb_Types.ttcn, line 570 */
if (elem.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(571);
/* Osmocom_Gb_Types.ttcn, line 571 */
return NS__Types::ListofIP6Elements_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(572);
/* Osmocom_Gb_Types.ttcn, line 572 */
if (elem.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(573);
/* Osmocom_Gb_Types.ttcn, line 573 */
return NS__Types::ListofIP6Elements_template(ANY_VALUE);
}
else {
current_location.update_lineno(575);
/* Osmocom_Gb_Types.ttcn, line 575 */
r.iEI() = os_7;
r.ext() = bs_2;
r.lengthIndicator().length1() = ANY_VALUE;
r.iP6__Elements() = elem;
current_location.update_lineno(583);
/* Osmocom_Gb_Types.ttcn, line 583 */
return r;
}
}
}
}

NS__Types::PDU__NS_template ts__SNS__CONFIG(const INTEGER& nsei, const BOOLEAN& end__flag, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 587, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_CONFIG");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Config_template& tmp_58 = ret_val.pDU__SNS__Config();
tmp_58.nsPduType() = os_15;
tmp_58.endFlag() = ts__SNS__IE__EndFlag(end__flag);
tmp_58.nSEI__NS() = ts__NS__IE__NSEI(nsei);
tmp_58.listofIP4Elements() = ts__SNS__IE__ListIP4(v4);
tmp_58.listofIP6Elements() = ts__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS__CONFIG(const INTEGER_template& nsei, const BOOLEAN_template& end__flag, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 598, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_CONFIG");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Config_template& tmp_59 = ret_val.pDU__SNS__Config();
tmp_59.nsPduType() = os_15;
tmp_59.endFlag() = tr__SNS__IE__EndFlag(end__flag);
tmp_59.nSEI__NS() = tr__NS__IE__NSEI(nsei);
tmp_59.listofIP4Elements() = tr__SNS__IE__ListIP4(v4);
tmp_59.listofIP6Elements() = tr__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__SNS__CONFIG__ACK(const INTEGER& nsei, const NsCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 610, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_CONFIG_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Config__Ack_template& tmp_60 = ret_val.pDU__SNS__Config__Ack();
tmp_60.nsPduType() = os_16;
tmp_60.nSEI__NS() = ts__NS__IE__NSEI(nsei);
tmp_60.causeNS() = ts__NS__IE__CAUSE__omit(cause);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS__CONFIG__ACK(const INTEGER_template& nsei, const NsCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 617, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_CONFIG_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Config__Ack_template& tmp_61 = ret_val.pDU__SNS__Config__Ack();
tmp_61.nsPduType() = os_16;
tmp_61.nSEI__NS() = tr__NS__IE__NSEI(nsei);
tmp_61.causeNS() = tr__NS__IE__CAUSE(cause);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__SNS__ADD(const INTEGER& nsei, const INTEGER& trans__id, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 625, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_ADD");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Add_template& tmp_62 = ret_val.pDU__SNS__Add();
tmp_62.nsPduType() = os_17;
tmp_62.nSEI__NS() = ts__NS__IE__NSEI(nsei);
tmp_62.transactionID() = trans__id;
tmp_62.listofIP4Elements() = ts__SNS__IE__ListIP4(v4);
tmp_62.listofIP6Elements() = ts__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS__ADD(const INTEGER_template& nsei, const INTEGER_template& trans__id, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 636, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_ADD");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Add_template& tmp_63 = ret_val.pDU__SNS__Add();
tmp_63.nsPduType() = os_17;
tmp_63.nSEI__NS() = tr__NS__IE__NSEI(nsei);
tmp_63.transactionID() = trans__id;
tmp_63.listofIP4Elements() = tr__SNS__IE__ListIP4(v4);
tmp_63.listofIP6Elements() = tr__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__SNS__DEL(const INTEGER& nsei, const INTEGER& trans__id, const NS__Types::IPAddress_template& ip__sns, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 648, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_DEL");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Delete_template& tmp_64 = ret_val.pDU__SNS__Delete();
tmp_64.nsPduType() = os_18;
tmp_64.nSEI__NS() = ts__NS__IE__NSEI(nsei);
tmp_64.transactionID() = trans__id;
tmp_64.iP__Address__NS() = ts__SNS__IP__ADDR(ip__sns);
tmp_64.listofIP4Elements() = ts__SNS__IE__ListIP4(v4);
tmp_64.listofIP6Elements() = ts__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS__DEL(const INTEGER_template& nsei, const INTEGER_template& trans__id, const NS__Types::IPAddress_template& ip__sns, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 661, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_DEL");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Delete_template& tmp_65 = ret_val.pDU__SNS__Delete();
tmp_65.nsPduType() = os_18;
tmp_65.nSEI__NS() = tr__NS__IE__NSEI(nsei);
tmp_65.transactionID() = trans__id;
tmp_65.iP__Address__NS() = tr__SNS__IP__ADDR(ip__sns);
tmp_65.listofIP4Elements() = tr__SNS__IE__ListIP4(v4);
tmp_65.listofIP6Elements() = tr__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__SNS__CHG__WEIGHT(const INTEGER& nsei, const INTEGER& trans__id, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 675, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_CHG_WEIGHT");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__ChangeWeight_template& tmp_66 = ret_val.pDU__SNS__ChangeWeight();
tmp_66.nsPduType() = os_19;
tmp_66.nSEI__NS() = ts__NS__IE__NSEI(nsei);
tmp_66.transactionID() = trans__id;
tmp_66.listofIP4Elements() = ts__SNS__IE__ListIP4(v4);
tmp_66.listofIP6Elements() = ts__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS__CHG__WEIGHT(const INTEGER_template& nsei, const INTEGER_template& trans__id, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 686, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_CHG_WEIGHT");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__ChangeWeight_template& tmp_67 = ret_val.pDU__SNS__ChangeWeight();
tmp_67.nsPduType() = os_19;
tmp_67.nSEI__NS() = tr__NS__IE__NSEI(nsei);
tmp_67.transactionID() = trans__id;
tmp_67.listofIP4Elements() = tr__SNS__IE__ListIP4(v4);
tmp_67.listofIP6Elements() = tr__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template ts__SNS__ACK(const INTEGER& nsei, const INTEGER& trans__id, const NsCause_template& cause, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 699, TTCN_Location::LOCATION_TEMPLATE, "ts_SNS_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Ack_template& tmp_68 = ret_val.pDU__SNS__Ack();
tmp_68.nsPduType() = os_20;
tmp_68.nSEI__NS() = ts__NS__IE__NSEI(nsei);
tmp_68.transactionID() = trans__id;
tmp_68.causeNS() = ts__NS__IE__CAUSE__omit(cause);
tmp_68.iP__Address__NS() = OMIT_VALUE;
tmp_68.listofIP4Elements() = ts__SNS__IE__ListIP4(v4);
tmp_68.listofIP6Elements() = ts__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS__ACK(const INTEGER_template& nsei, const INTEGER_template& trans__id, const NsCause_template& cause, const NS__Types::IP4__Elements_template& v4, const NS__Types::IP6__Elements_template& v6)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 713, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS_ACK");
NS__Types::PDU__NS_template ret_val;
{
NS__Types::PDU__SNS__Ack_template& tmp_69 = ret_val.pDU__SNS__Ack();
tmp_69.nsPduType() = os_20;
tmp_69.nSEI__NS() = tr__NS__IE__NSEI(nsei);
tmp_69.transactionID() = trans__id;
tmp_69.causeNS() = tr__NS__IE__CAUSE(cause);
tmp_69.iP__Address__NS() = OMIT_VALUE;
tmp_69.listofIP4Elements() = tr__SNS__IE__ListIP4(v4);
tmp_69.listofIP6Elements() = tr__SNS__IE__ListIP6(v6);
}
return ret_val;
}

NS__Types::PDU__NS_template tr__SNS(const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 728, TTCN_Location::LOCATION_TEMPLATE, "tr_SNS");
NS__Types::PDU__NS_template ret_val;
ret_val.set_type(VALUE_LIST, 8);
ret_val.list_item(0) = tr__SNS__SIZE(nsei, tr__SNS__SIZE_rst__flag_defval, tr__SNS__SIZE_max__nsvcs_defval, tr__SNS__SIZE_num__v4_defval, tr__SNS__SIZE_num__v6_defval);
ret_val.list_item(1) = tr__SNS__SIZE__ACK(nsei, NsCause_template(ANY_OR_OMIT));
ret_val.list_item(2) = tr__SNS__CONFIG(nsei, BOOLEAN_template(ANY_VALUE), NS__Types::IP4__Elements_template(ANY_OR_OMIT), NS__Types::IP6__Elements_template(ANY_OR_OMIT));
ret_val.list_item(3) = tr__SNS__CONFIG__ACK(nsei, NsCause_template(ANY_OR_OMIT));
ret_val.list_item(4) = tr__SNS__ADD(nsei, INTEGER_template(ANY_VALUE), NS__Types::IP4__Elements_template(ANY_OR_OMIT), NS__Types::IP6__Elements_template(ANY_OR_OMIT));
ret_val.list_item(5) = tr__SNS__DEL(nsei, INTEGER_template(ANY_VALUE), NS__Types::IPAddress_template(ANY_OR_OMIT), NS__Types::IP4__Elements_template(ANY_OR_OMIT), tr__SNS__DEL_v6_defval);
ret_val.list_item(6) = tr__SNS__CHG__WEIGHT(nsei, INTEGER_template(ANY_VALUE), NS__Types::IP4__Elements_template(ANY_OR_OMIT), NS__Types::IP6__Elements_template(ANY_OR_OMIT));
ret_val.list_item(7) = tr__SNS__ACK(nsei, INTEGER_template(ANY_VALUE), NsCause_template(ANY_OR_OMIT), NS__Types::IP4__Elements_template(ANY_OR_OMIT), NS__Types::IP6__Elements_template(ANY_OR_OMIT));
return ret_val;
}

void BssgpCellId_encoder(const BssgpCellId& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.BssgpCellId' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(BssgpCellId_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER BssgpCellId_decoder(OCTETSTRING& input_stream, BssgpCellId& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.BssgpCellId' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(BssgpCellId_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

BssgpCellId_template ts__BssgpCellId(const GSM__Types::RoutingAreaIdentification_template& rai, const INTEGER& cell__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 747, TTCN_Location::LOCATION_TEMPLATE, "ts_BssgpCellId");
BssgpCellId_template ret_val;
ret_val.ra__id() = rai;
ret_val.cell__id() = cell__id;
return ret_val;
}

void BssgpCause_encoder(const BssgpCause& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.BssgpCause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(BssgpCause_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER BssgpCause_decoder(OCTETSTRING& input_stream, BssgpCause& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.BssgpCause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(BssgpCause_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

BSSGP__Types::Flush__Action_template tr__FLUSH__ACTION(const OCTETSTRING_template& act)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 797, TTCN_Location::LOCATION_FUNCTION, "tr_FLUSH_ACTION");
current_location.update_lineno(799);
/* Osmocom_Gb_Types.ttcn, line 799 */
BSSGP__Types::Flush__Action_template r;
current_location.update_lineno(800);
/* Osmocom_Gb_Types.ttcn, line 800 */
if (act.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(801);
/* Osmocom_Gb_Types.ttcn, line 801 */
return BSSGP__Types::Flush__Action_template(OMIT_VALUE);
}
else {
current_location.update_lineno(802);
/* Osmocom_Gb_Types.ttcn, line 802 */
if (act.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(803);
/* Osmocom_Gb_Types.ttcn, line 803 */
return BSSGP__Types::Flush__Action_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(805);
/* Osmocom_Gb_Types.ttcn, line 805 */
r.iEI() = os_20;
r.ext() = bs_2;
r.lengthIndicator().length1() = 1;
r.actionValue() = act;
current_location.update_lineno(813);
/* Osmocom_Gb_Types.ttcn, line 813 */
return r;
}
}
}

BSSGP__Types::Flush__Action_template ts__FLUSH__ACTION(const OCTETSTRING_template& act)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 816, TTCN_Location::LOCATION_TEMPLATE, "ts_FLUSH_ACTION");
BSSGP__Types::Flush__Action_template ret_val;
ret_val.iEI() = os_20;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.actionValue() = act;
return ret_val;
}

BSSGP__Types::Number__of__octets__affected_template tr__NO__OCT__AFF(const INTEGER_template& oct__aff)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 825, TTCN_Location::LOCATION_FUNCTION, "tr_NO_OCT_AFF");
current_location.update_lineno(827);
/* Osmocom_Gb_Types.ttcn, line 827 */
BSSGP__Types::Number__of__octets__affected_template r;
current_location.update_lineno(828);
/* Osmocom_Gb_Types.ttcn, line 828 */
if (oct__aff.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(829);
/* Osmocom_Gb_Types.ttcn, line 829 */
return BSSGP__Types::Number__of__octets__affected_template(OMIT_VALUE);
}
else {
current_location.update_lineno(830);
/* Osmocom_Gb_Types.ttcn, line 830 */
if (oct__aff.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(831);
/* Osmocom_Gb_Types.ttcn, line 831 */
return BSSGP__Types::Number__of__octets__affected_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(833);
/* Osmocom_Gb_Types.ttcn, line 833 */
r.iEI() = os_21;
r.ext() = bs_2;
r.lengthIndicator().length1() = 3;
r.number__of__octets__transfered__or__deleted() = Osmocom__Types::int2oct__tmpl(oct__aff, 3);
current_location.update_lineno(841);
/* Osmocom_Gb_Types.ttcn, line 841 */
return r;
}
}
}

BSSGP__Types::Number__of__octets__affected_template ts__NO__OCT__AFF(const INTEGER_template& oct__aff)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 844, TTCN_Location::LOCATION_TEMPLATE, "ts_NO_OCT_AFF");
BSSGP__Types::Number__of__octets__affected_template ret_val;
ret_val.iEI() = os_21;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 3;
ret_val.number__of__octets__transfered__or__deleted() = int2oct(oct__aff.valueof(), 3);
return ret_val;
}

BSSGP__Types::LLC__Frames__Discarded_template tr__LLC__FRAMES__DISCARDED(const INTEGER_template& frames__discarded)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 853, TTCN_Location::LOCATION_FUNCTION, "tr_LLC_FRAMES_DISCARDED");
current_location.update_lineno(855);
/* Osmocom_Gb_Types.ttcn, line 855 */
BSSGP__Types::LLC__Frames__Discarded_template r;
current_location.update_lineno(856);
/* Osmocom_Gb_Types.ttcn, line 856 */
if (frames__discarded.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(857);
/* Osmocom_Gb_Types.ttcn, line 857 */
return BSSGP__Types::LLC__Frames__Discarded_template(OMIT_VALUE);
}
else {
current_location.update_lineno(858);
/* Osmocom_Gb_Types.ttcn, line 858 */
if (frames__discarded.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(859);
/* Osmocom_Gb_Types.ttcn, line 859 */
return BSSGP__Types::LLC__Frames__Discarded_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(861);
/* Osmocom_Gb_Types.ttcn, line 861 */
r.iEI() = os_15;
r.ext() = bs_2;
r.lengthIndicator().length1() = 1;
r.number__of__frames__discarded() = Osmocom__Types::int2hex__tmpl(frames__discarded, 2);
current_location.update_lineno(869);
/* Osmocom_Gb_Types.ttcn, line 869 */
return r;
}
}
}

BSSGP__Types::LLC__Frames__Discarded_template ts__LLC__FRAMES__DISCARDED(const INTEGER_template& frames__discarded)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 872, TTCN_Location::LOCATION_TEMPLATE, "ts_LLC_FRAMES_DISCARDED");
BSSGP__Types::LLC__Frames__Discarded_template ret_val;
ret_val.iEI() = os_15;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.number__of__frames__discarded() = int2hex(frames__discarded.valueof(), 2);
return ret_val;
}

BSSGP__Types::BVCI_template tr__BSSGP__BVCI(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 882, TTCN_Location::LOCATION_FUNCTION, "tr_BSSGP_BVCI");
current_location.update_lineno(884);
/* Osmocom_Gb_Types.ttcn, line 884 */
BSSGP__Types::BVCI_template r;
current_location.update_lineno(885);
/* Osmocom_Gb_Types.ttcn, line 885 */
if (bvci.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(886);
/* Osmocom_Gb_Types.ttcn, line 886 */
return BSSGP__Types::BVCI_template(OMIT_VALUE);
}
else {
current_location.update_lineno(887);
/* Osmocom_Gb_Types.ttcn, line 887 */
if (bvci.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(888);
/* Osmocom_Gb_Types.ttcn, line 888 */
return BSSGP__Types::BVCI_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(890);
/* Osmocom_Gb_Types.ttcn, line 890 */
r.iEI() = os_4;
r.ext() = bs_2;
r.lengthIndicator().length1() = 2;
r.unstructured__value() = Osmocom__Types::int2oct__tmpl(bvci, 2);
current_location.update_lineno(898);
/* Osmocom_Gb_Types.ttcn, line 898 */
return r;
}
}
}

BSSGP__Types::BVCI_template ts__BSSGP__BVCI(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 901, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_BVCI");
BSSGP__Types::BVCI_template ret_val;
ret_val.iEI() = os_4;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.unstructured__value() = int2oct(bvci.valueof(), 2);
return ret_val;
}

BSSGP__Types::BVCI_template f__ts__BSSGP__BVCI(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 909, TTCN_Location::LOCATION_FUNCTION, "f_ts_BSSGP_BVCI");
current_location.update_lineno(911);
/* Osmocom_Gb_Types.ttcn, line 911 */
if (bvci.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(912);
/* Osmocom_Gb_Types.ttcn, line 912 */
return BSSGP__Types::BVCI_template(OMIT_VALUE);
}
else {
current_location.update_lineno(914);
/* Osmocom_Gb_Types.ttcn, line 914 */
return ts__BSSGP__BVCI(INTEGER_template(bvci.valueof()));
}
}

BSSGP__Types::NSEI__BSSGP_template t__BSSGP__NSEI(const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 918, TTCN_Location::LOCATION_FUNCTION, "t_BSSGP_NSEI");
current_location.update_lineno(920);
/* Osmocom_Gb_Types.ttcn, line 920 */
BSSGP__Types::NSEI__BSSGP_template r;
current_location.update_lineno(921);
/* Osmocom_Gb_Types.ttcn, line 921 */
if (nsei.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(922);
/* Osmocom_Gb_Types.ttcn, line 922 */
return BSSGP__Types::NSEI__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(923);
/* Osmocom_Gb_Types.ttcn, line 923 */
if (nsei.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(924);
/* Osmocom_Gb_Types.ttcn, line 924 */
return BSSGP__Types::NSEI__BSSGP_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(926);
/* Osmocom_Gb_Types.ttcn, line 926 */
r.iEI() = os_22;
r.ext() = bs_2;
r.lengthIndicator().length1() = 2;
r.nSEI() = Osmocom__Types::int2oct__tmpl(nsei, 2);
current_location.update_lineno(934);
/* Osmocom_Gb_Types.ttcn, line 934 */
return r;
}
}
}

BSSGP__Types::NSEI__BSSGP_template ts__BSSGP__NSEI(const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 937, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_NSEI");
BSSGP__Types::NSEI__BSSGP_template ret_val;
ret_val.iEI() = os_22;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.nSEI() = int2oct(nsei.valueof(), 2);
return ret_val;
}

BSSGP__Types::NSEI__BSSGP_template f__ts__BSSGP__NSEI(const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 945, TTCN_Location::LOCATION_FUNCTION, "f_ts_BSSGP_NSEI");
current_location.update_lineno(947);
/* Osmocom_Gb_Types.ttcn, line 947 */
if (nsei.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(948);
/* Osmocom_Gb_Types.ttcn, line 948 */
return BSSGP__Types::NSEI__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(950);
/* Osmocom_Gb_Types.ttcn, line 950 */
return ts__BSSGP__NSEI(INTEGER_template(nsei.valueof()));
}
}

BSSGP__Types::TLLI__BSSGP_template ts__BSSGP__TLLI(const OCTETSTRING_template& tlli)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 954, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_TLLI");
BSSGP__Types::TLLI__BSSGP_template ret_val;
ret_val.iEI() = os_23;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 4;
ret_val.tLLI__Value() = tlli;
return ret_val;
}

BSSGP__Types::TLLI__BSSGP_template tr__BSSGP__TLLI(const OCTETSTRING_template& tlli)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 962, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_TLLI");
BSSGP__Types::TLLI__BSSGP_template ret_val;
ret_val.iEI() = os_23;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 4;
ret_val.tLLI__Value() = tlli;
return ret_val;
}

BSSGP__Types::TLLI__BSSGP_template f__ts__BSSGP__TLLI(const OCTETSTRING_template& tlli)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 970, TTCN_Location::LOCATION_FUNCTION, "f_ts_BSSGP_TLLI");
current_location.update_lineno(971);
/* Osmocom_Gb_Types.ttcn, line 971 */
if (tlli.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(972);
/* Osmocom_Gb_Types.ttcn, line 972 */
return BSSGP__Types::TLLI__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(974);
/* Osmocom_Gb_Types.ttcn, line 974 */
return ts__BSSGP__TLLI(OCTETSTRING_template(tlli.valueof()));
}
}

BSSGP__Types::TLLI__BSSGP_template f__tr__BSSGP__TLLI(const OCTETSTRING_template& tlli)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 977, TTCN_Location::LOCATION_FUNCTION, "f_tr_BSSGP_TLLI");
current_location.update_lineno(978);
/* Osmocom_Gb_Types.ttcn, line 978 */
if (tlli.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(979);
/* Osmocom_Gb_Types.ttcn, line 979 */
return BSSGP__Types::TLLI__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(980);
/* Osmocom_Gb_Types.ttcn, line 980 */
if (tlli.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(981);
/* Osmocom_Gb_Types.ttcn, line 981 */
return BSSGP__Types::TLLI__BSSGP_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(983);
/* Osmocom_Gb_Types.ttcn, line 983 */
return tr__BSSGP__TLLI(OCTETSTRING_template(tlli.valueof()));
}
}
}

BSSGP__Types::Suspend__Reference__Number_template ts__BSSGP__SUSP__REF(const OCTETSTRING_template& susp__ref)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 987, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_SUSP_REF");
BSSGP__Types::Suspend__Reference__Number_template ret_val;
ret_val.iEI() = os_24;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.suspend__Reference__Number__value() = susp__ref;
return ret_val;
}

BSSGP__Types::Suspend__Reference__Number_template tr__BSSGP__SUSP__REF(const OCTETSTRING_template& susp__ref)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 995, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_SUSP_REF");
BSSGP__Types::Suspend__Reference__Number_template ret_val;
ret_val.iEI() = os_24;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.suspend__Reference__Number__value() = susp__ref;
return ret_val;
}

BSSGP__Types::IMSI__BSSGP_template tr__BSSGP__IMSI(const HEXSTRING_template& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1004, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_IMSI");
BSSGP__Types::IMSI__BSSGP_template ret_val;
ret_val.iEI() = os_17;
ret_val.ext() = bs_2;
ret_val.lengthIndicator() = ANY_VALUE;
ret_val.type__of__Identity() = bs_4;
ret_val.oddevenIndicator() = ANY_VALUE;
ret_val.digits() = imsi;
return ret_val;
}

BSSGP__Types::IMSI__BSSGP_template ts__BSSGP__IMSI(const HEXSTRING& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1013, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_IMSI");
BSSGP__Types::IMSI__BSSGP_template ret_val;
ret_val.iEI() = os_17;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.type__of__Identity() = bs_4;
ret_val.oddevenIndicator() = GSM__Types::f__hex__is__odd__length(imsi);
ret_val.digits() = imsi;
return ret_val;
}

BSSGP__Types::IMSI__BSSGP_template f__ts__BSSGP__IMSI(const HEXSTRING_template& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1021, TTCN_Location::LOCATION_FUNCTION, "f_ts_BSSGP_IMSI");
current_location.update_lineno(1022);
/* Osmocom_Gb_Types.ttcn, line 1022 */
if (imsi.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1023);
/* Osmocom_Gb_Types.ttcn, line 1023 */
return BSSGP__Types::IMSI__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(1025);
/* Osmocom_Gb_Types.ttcn, line 1025 */
return ts__BSSGP__IMSI(imsi.valueof());
}
}

BSSGP__Types::IMSI__BSSGP_template f__tr__BSSGP__IMSI(const HEXSTRING_template& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1028, TTCN_Location::LOCATION_FUNCTION, "f_tr_BSSGP_IMSI");
current_location.update_lineno(1029);
/* Osmocom_Gb_Types.ttcn, line 1029 */
if (imsi.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1030);
/* Osmocom_Gb_Types.ttcn, line 1030 */
return BSSGP__Types::IMSI__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(1031);
/* Osmocom_Gb_Types.ttcn, line 1031 */
if (imsi.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(1032);
/* Osmocom_Gb_Types.ttcn, line 1032 */
return BSSGP__Types::IMSI__BSSGP_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(1034);
/* Osmocom_Gb_Types.ttcn, line 1034 */
HEXSTRING_template tmp_75;
tmp_75 = imsi;
tmp_75.check_restriction(TR_PRESENT);
return tr__BSSGP__IMSI(tmp_75);
}
}
}

BSSGP__Types::TMSI__BSSGP_template tr__BSSGP__TMSI(const INTEGER& tmsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1038, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_TMSI");
BSSGP__Types::TMSI__BSSGP_template ret_val;
ret_val.iEI() = os_25;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 4;
ret_val.tMSI__Value() = int2oct(tmsi, 4);
return ret_val;
}

BSSGP__Types::TMSI__BSSGP_template ts__BSSGP__TMSI(const INTEGER& tmsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1045, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_TMSI");
BSSGP__Types::TMSI__BSSGP_template ret_val;
ret_val.iEI() = os_25;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 4;
ret_val.tMSI__Value() = int2oct(tmsi, 4);
return ret_val;
}

BSSGP__Types::TMSI__BSSGP_template f__ts__BSSGP__TMSI(const INTEGER_template& tmsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1051, TTCN_Location::LOCATION_FUNCTION, "f_ts_BSSGP_TMSI");
current_location.update_lineno(1052);
/* Osmocom_Gb_Types.ttcn, line 1052 */
if (tmsi.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1053);
/* Osmocom_Gb_Types.ttcn, line 1053 */
return BSSGP__Types::TMSI__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(1055);
/* Osmocom_Gb_Types.ttcn, line 1055 */
return ts__BSSGP__TMSI(tmsi.valueof());
}
}

BSSGP__Types::TMSI__BSSGP_template f__tr__BSSGP__TMSI(const INTEGER_template& tmsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1058, TTCN_Location::LOCATION_FUNCTION, "f_tr_BSSGP_TMSI");
current_location.update_lineno(1059);
/* Osmocom_Gb_Types.ttcn, line 1059 */
if (tmsi.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1060);
/* Osmocom_Gb_Types.ttcn, line 1060 */
return BSSGP__Types::TMSI__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(1061);
/* Osmocom_Gb_Types.ttcn, line 1061 */
if (tmsi.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(1062);
/* Osmocom_Gb_Types.ttcn, line 1062 */
return BSSGP__Types::TMSI__BSSGP_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(1063);
/* Osmocom_Gb_Types.ttcn, line 1063 */
if (tmsi.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(1064);
/* Osmocom_Gb_Types.ttcn, line 1064 */
return BSSGP__Types::TMSI__BSSGP_template(ANY_VALUE);
}
else {
current_location.update_lineno(1066);
/* Osmocom_Gb_Types.ttcn, line 1066 */
return tr__BSSGP__TMSI(tmsi.valueof());
}
}
}
}

BSSGP__Types::LIN2__2a f__bssgp__length__ind(const INTEGER& len)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1070, TTCN_Location::LOCATION_FUNCTION, "f_bssgp_length_ind");
current_location.update_lineno(1071);
/* Osmocom_Gb_Types.ttcn, line 1071 */
BSSGP__Types::LIN2__2a ret;
current_location.update_lineno(1072);
/* Osmocom_Gb_Types.ttcn, line 1072 */
if ((len > 255)) {
current_location.update_lineno(1073);
/* Osmocom_Gb_Types.ttcn, line 1073 */
ret.length2() = len;
}
else {
current_location.update_lineno(1075);
/* Osmocom_Gb_Types.ttcn, line 1075 */
ret.length1() = len;
}
current_location.update_lineno(1077);
/* Osmocom_Gb_Types.ttcn, line 1077 */
return ret;
}

BSSGP__Types::LLC__PDU_template ts__BSSGP__LLC__PDU(const OCTETSTRING& pdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1080, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_LLC_PDU");
BSSGP__Types::LLC__PDU_template ret_val;
ret_val.iEI() = os_19;
ret_val.ext() = bs_2;
ret_val.lengthIndicator() = f__bssgp__length__ind(pdu.lengthof());
ret_val.lLC__PDU() = pdu;
return ret_val;
}

BSSGP__Types::LLC__PDU_template tr__BSSGP__LLC__PDU(const OCTETSTRING_template& pdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1087, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_LLC_PDU");
BSSGP__Types::LLC__PDU_template ret_val;
ret_val.iEI() = os_19;
ret_val.ext() = ANY_VALUE;
ret_val.lengthIndicator() = ANY_VALUE;
ret_val.lLC__PDU() = pdu;
return ret_val;
}

BSSGP__Types::Cause__BSSGP_template ts__BSSGP__CAUSE(const BssgpCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1094, TTCN_Location::LOCATION_FUNCTION, "ts_BSSGP_CAUSE");
current_location.update_lineno(1095);
/* Osmocom_Gb_Types.ttcn, line 1095 */
BSSGP__Types::Cause__BSSGP_template ret;
current_location.update_lineno(1096);
/* Osmocom_Gb_Types.ttcn, line 1096 */
if (cause.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1097);
/* Osmocom_Gb_Types.ttcn, line 1097 */
ret = OMIT_VALUE;
}
else {
current_location.update_lineno(1099);
/* Osmocom_Gb_Types.ttcn, line 1099 */
ret.iEI() = os_8;
current_location.update_lineno(1100);
/* Osmocom_Gb_Types.ttcn, line 1100 */
ret.ext() = bs_2;
current_location.update_lineno(1101);
/* Osmocom_Gb_Types.ttcn, line 1101 */
{
BSSGP__Types::LIN2__2a_template& tmp_82 = ret.lengthIndicator();
tmp_82.length1() = 1;
}
current_location.update_lineno(1102);
/* Osmocom_Gb_Types.ttcn, line 1102 */
ret.cause__Value() = int2oct(BssgpCause::enum2int(cause.valueof()), 1);
}
current_location.update_lineno(1104);
/* Osmocom_Gb_Types.ttcn, line 1104 */
return ret;
}

BSSGP__Types::Cause__BSSGP_template tr__BSSGP__CAUSE(const BssgpCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1106, TTCN_Location::LOCATION_FUNCTION, "tr_BSSGP_CAUSE");
current_location.update_lineno(1107);
/* Osmocom_Gb_Types.ttcn, line 1107 */
BSSGP__Types::Cause__BSSGP_template ret;
current_location.update_lineno(1108);
/* Osmocom_Gb_Types.ttcn, line 1108 */
ret.iEI() = os_8;
current_location.update_lineno(1109);
/* Osmocom_Gb_Types.ttcn, line 1109 */
ret.ext() = bs_2;
current_location.update_lineno(1110);
/* Osmocom_Gb_Types.ttcn, line 1110 */
{
BSSGP__Types::LIN2__2a_template& tmp_87 = ret.lengthIndicator();
tmp_87.length1() = 1;
}
current_location.update_lineno(1111);
/* Osmocom_Gb_Types.ttcn, line 1111 */
if (cause.is_value()) {
current_location.update_lineno(1112);
/* Osmocom_Gb_Types.ttcn, line 1112 */
ret.cause__Value() = int2oct(BssgpCause::enum2int(cause.valueof()), 1);
}
else {
current_location.update_lineno(1114);
/* Osmocom_Gb_Types.ttcn, line 1114 */
ret.cause__Value() = ANY_VALUE;
}
current_location.update_lineno(1116);
/* Osmocom_Gb_Types.ttcn, line 1116 */
return ret;
}

BSSGP__Types::Cell__Identifier_template tr__BSSGP__IE__CellId(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1119, TTCN_Location::LOCATION_FUNCTION, "tr_BSSGP_IE_CellId");
current_location.update_lineno(1120);
/* Osmocom_Gb_Types.ttcn, line 1120 */
BSSGP__Types::Cell__Identifier_template ret;
ret.iEI() = os_10;
ret.ext() = bs_2;
ret.lengthIndicator().length1() = 8;
ret.mccDigit1() = ANY_VALUE;
ret.mccDigit2() = ANY_VALUE;
ret.mccDigit3() = ANY_VALUE;
ret.mncDigit3() = ANY_VALUE;
ret.mncDigit1() = ANY_VALUE;
ret.mncDigit2() = ANY_VALUE;
ret.lac() = ANY_VALUE;
ret.rac() = ANY_VALUE;
ret.cI__value() = ANY_VALUE;
current_location.update_lineno(1134);
/* Osmocom_Gb_Types.ttcn, line 1134 */
if (cid.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1135);
/* Osmocom_Gb_Types.ttcn, line 1135 */
return BSSGP__Types::Cell__Identifier_template(OMIT_VALUE);
}
else {
current_location.update_lineno(1136);
/* Osmocom_Gb_Types.ttcn, line 1136 */
if (cid.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(1137);
/* Osmocom_Gb_Types.ttcn, line 1137 */
return BSSGP__Types::Cell__Identifier_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(1138);
/* Osmocom_Gb_Types.ttcn, line 1138 */
if (cid.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(1139);
/* Osmocom_Gb_Types.ttcn, line 1139 */
return BSSGP__Types::Cell__Identifier_template(ANY_VALUE);
}
}
}
current_location.update_lineno(1141);
/* Osmocom_Gb_Types.ttcn, line 1141 */
{
boolean tmp_90;
{
boolean tmp_91;
tmp_91 = cid.is_value();
if (tmp_91) {
boolean tmp_92 = cid.is_bound();
if(tmp_92) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_92 = FALSE;
break;
case ANY_VALUE:
tmp_92 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_92) {
const BssgpCellId_template& tmp_93 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_94 = tmp_93.ra__id();
tmp_92 = tmp_94.is_value();
}
break;}
default:
tmp_92 = FALSE;
break;
}
}
tmp_91 = tmp_92;
}
tmp_90 = tmp_91;
}
if (tmp_90) {
boolean tmp_95 = cid.is_bound();
if(tmp_95) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_95 = FALSE;
break;
case ANY_VALUE:
tmp_95 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_95) {
const BssgpCellId_template& tmp_96 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_97 = tmp_96.ra__id();
tmp_95 = tmp_97.is_bound();
if(tmp_95) {
switch (tmp_97.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_95 = FALSE;
break;
case ANY_VALUE:
tmp_95 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_95) {
const GSM__Types::RoutingAreaIdentification_template& tmp_98 = tmp_97;
const GSM__Types::LocationAreaIdentification_template& tmp_99 = tmp_98.lai();
tmp_95 = tmp_99.is_value();
}
break;}
default:
tmp_95 = FALSE;
break;
}
}
}
break;}
default:
tmp_95 = FALSE;
break;
}
}
tmp_90 = tmp_95;
}
if (tmp_90) {
current_location.update_lineno(1142);
/* Osmocom_Gb_Types.ttcn, line 1142 */
{
boolean tmp_107;
{
boolean tmp_100 = cid.is_bound();
if(tmp_100) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_100 = FALSE;
break;
case ANY_VALUE:
tmp_100 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_100) {
const BssgpCellId_template& tmp_101 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_102 = tmp_101.ra__id();
tmp_100 = tmp_102.is_bound();
if(tmp_100) {
switch (tmp_102.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_100 = FALSE;
break;
case ANY_VALUE:
tmp_100 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_100) {
const GSM__Types::RoutingAreaIdentification_template& tmp_103 = tmp_102;
const GSM__Types::LocationAreaIdentification_template& tmp_104 = tmp_103.lai();
tmp_100 = tmp_104.is_bound();
if(tmp_100) {
switch (tmp_104.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_100 = FALSE;
break;
case ANY_VALUE:
tmp_100 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_100) {
const GSM__Types::LocationAreaIdentification_template& tmp_105 = tmp_104;
const HEXSTRING_template& tmp_106 = tmp_105.mcc__mnc();
tmp_100 = tmp_106.is_value();
}
break;}
default:
tmp_100 = FALSE;
break;
}
}
}
break;}
default:
tmp_100 = FALSE;
break;
}
}
}
break;}
default:
tmp_100 = FALSE;
break;
}
}
tmp_107 = tmp_100;
}
if (tmp_107) {
current_location.update_lineno(1143);
/* Osmocom_Gb_Types.ttcn, line 1143 */
ret.mccDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[0];
current_location.update_lineno(1144);
/* Osmocom_Gb_Types.ttcn, line 1144 */
ret.mccDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[1];
current_location.update_lineno(1145);
/* Osmocom_Gb_Types.ttcn, line 1145 */
ret.mccDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[2];
current_location.update_lineno(1146);
/* Osmocom_Gb_Types.ttcn, line 1146 */
ret.mncDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[3];
current_location.update_lineno(1147);
/* Osmocom_Gb_Types.ttcn, line 1147 */
ret.mncDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[4];
current_location.update_lineno(1148);
/* Osmocom_Gb_Types.ttcn, line 1148 */
ret.mncDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[5];
}
}
current_location.update_lineno(1150);
/* Osmocom_Gb_Types.ttcn, line 1150 */
{
boolean tmp_121;
{
boolean tmp_114 = cid.is_bound();
if(tmp_114) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_114 = FALSE;
break;
case ANY_VALUE:
tmp_114 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_114) {
const BssgpCellId_template& tmp_115 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_116 = tmp_115.ra__id();
tmp_114 = tmp_116.is_bound();
if(tmp_114) {
switch (tmp_116.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_114 = FALSE;
break;
case ANY_VALUE:
tmp_114 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_114) {
const GSM__Types::RoutingAreaIdentification_template& tmp_117 = tmp_116;
const GSM__Types::LocationAreaIdentification_template& tmp_118 = tmp_117.lai();
tmp_114 = tmp_118.is_bound();
if(tmp_114) {
switch (tmp_118.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_114 = FALSE;
break;
case ANY_VALUE:
tmp_114 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_114) {
const GSM__Types::LocationAreaIdentification_template& tmp_119 = tmp_118;
const INTEGER_template& tmp_120 = tmp_119.lac();
tmp_114 = tmp_120.is_value();
}
break;}
default:
tmp_114 = FALSE;
break;
}
}
}
break;}
default:
tmp_114 = FALSE;
break;
}
}
}
break;}
default:
tmp_114 = FALSE;
break;
}
}
tmp_121 = tmp_114;
}
if (tmp_121) {
current_location.update_lineno(1151);
/* Osmocom_Gb_Types.ttcn, line 1151 */
ret.lac() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).ra__id().lai().lac(), 2);
}
}
}
}
current_location.update_lineno(1154);
/* Osmocom_Gb_Types.ttcn, line 1154 */
{
boolean tmp_123;
tmp_123 = cid.is_value();
if (tmp_123) {
boolean tmp_124 = cid.is_bound();
if(tmp_124) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_124 = FALSE;
break;
case ANY_VALUE:
tmp_124 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_124) {
const BssgpCellId_template& tmp_125 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_126 = tmp_125.ra__id();
tmp_124 = tmp_126.is_value();
}
break;}
default:
tmp_124 = FALSE;
break;
}
}
tmp_123 = tmp_124;
}
if (tmp_123) {
current_location.update_lineno(1155);
/* Osmocom_Gb_Types.ttcn, line 1155 */
ret.rac() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).ra__id().rac(), 1);
}
}
current_location.update_lineno(1157);
/* Osmocom_Gb_Types.ttcn, line 1157 */
if (cid.is_value()) {
current_location.update_lineno(1158);
/* Osmocom_Gb_Types.ttcn, line 1158 */
ret.cI__value() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).cell__id(), 2);
}
current_location.update_lineno(1160);
/* Osmocom_Gb_Types.ttcn, line 1160 */
return ret;
}

BSSGP__Types::Cell__Identifier_template ts__BSSGP__IE__CellId(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1162, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_IE_CellId");
BSSGP__Types::Cell__Identifier_template ret_val;
ret_val.iEI() = os_10;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 8;
ret_val.mccDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[0];
ret_val.mccDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[1];
ret_val.mccDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[2];
ret_val.mncDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[3];
ret_val.mncDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[4];
ret_val.mncDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[5];
ret_val.lac() = int2oct(const_cast< const BssgpCellId_template&>(cid).ra__id().lai().lac().valueof(), 2);
ret_val.rac() = int2oct(const_cast< const BssgpCellId_template&>(cid).ra__id().rac().valueof(), 1);
ret_val.cI__value() = int2oct(const_cast< const BssgpCellId_template&>(cid).cell__id().valueof(), 2);
return ret_val;
}

BSSGP__Types::Cell__Identifier_template f__ts__BSSGP__IE__CellId(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1176, TTCN_Location::LOCATION_FUNCTION, "f_ts_BSSGP_IE_CellId");
current_location.update_lineno(1177);
/* Osmocom_Gb_Types.ttcn, line 1177 */
if (cid.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1178);
/* Osmocom_Gb_Types.ttcn, line 1178 */
return BSSGP__Types::Cell__Identifier_template(OMIT_VALUE);
}
else {
current_location.update_lineno(1180);
/* Osmocom_Gb_Types.ttcn, line 1180 */
return ts__BSSGP__IE__CellId(BssgpCellId_template(cid.valueof()));
}
}

BSSGP__Types::Tag_template ts__BSSGP__IE__Tag(const OCTETSTRING& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1184, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_IE_Tag");
BSSGP__Types::Tag_template ret_val;
ret_val.iEI() = os_26;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.unstructured__Value() = tag;
return ret_val;
}

BSSGP__Types::Tag_template tr__BSSGP__IE__Tag(const OCTETSTRING_template& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1193, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_IE_Tag");
BSSGP__Types::Tag_template ret_val;
ret_val.iEI() = os_26;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.unstructured__Value() = tag;
return ret_val;
}

BSSGP__Types::RA__Cap__UPD__CAUSE_template ts__BSSGP__IE__RACU__Cause(const OCTETSTRING_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1202, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_IE_RACU_Cause");
BSSGP__Types::RA__Cap__UPD__CAUSE_template ret_val;
ret_val.iEI() = os_27;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.rA__CAP__UPD__Cause__value() = cause;
return ret_val;
}

BSSGP__Types::RA__Cap__UPD__CAUSE_template tr__BSSGP__IE__RACU__Cause(const OCTETSTRING_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1211, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_IE_RACU_Cause");
BSSGP__Types::RA__Cap__UPD__CAUSE_template ret_val;
ret_val.iEI() = os_27;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.rA__CAP__UPD__Cause__value() = cause;
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__RESET(const BssgpCause& cause, const INTEGER& bvci, const BssgpCellId_template& cell__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1221, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_RESET");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__RESET_template& tmp_129 = ret_val.pDU__BSSGP__BVC__RESET();
tmp_129.bssgpPduType() = os_28;
tmp_129.bVCI() = ts__BSSGP__BVCI(INTEGER_template(bvci));
tmp_129.cause() = ts__BSSGP__CAUSE(BssgpCause_template(cause));
tmp_129.cell__Identifier() = f__ts__BSSGP__IE__CellId(cell__id);
tmp_129.feature__bitmap() = OMIT_VALUE;
tmp_129.extended__Feature__Bitmap() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__RESET(const BssgpCause_template& cause, const INTEGER_template& bvci, const BssgpCellId_template& cell__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1232, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_RESET");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__RESET_template& tmp_130 = ret_val.pDU__BSSGP__BVC__RESET();
tmp_130.bssgpPduType() = os_28;
tmp_130.bVCI() = tr__BSSGP__BVCI(bvci);
tmp_130.cause() = tr__BSSGP__CAUSE(cause);
tmp_130.cell__Identifier() = tr__BSSGP__IE__CellId(cell__id);
tmp_130.feature__bitmap() = ANY_OR_OMIT;
tmp_130.extended__Feature__Bitmap() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__RESET__ACK(const INTEGER& bvci, const BssgpCellId_template& cell__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1245, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_RESET_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__RESET__ACK_template& tmp_131 = ret_val.pDU__BSSGP__BVC__RESET__ACK();
tmp_131.bssgpPduType() = os_29;
tmp_131.bVCI() = ts__BSSGP__BVCI(INTEGER_template(bvci));
tmp_131.cell__Identifier() = f__ts__BSSGP__IE__CellId(cell__id);
tmp_131.feature__bitmap() = OMIT_VALUE;
tmp_131.extended__Feature__Bitmap() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__RESET__ACK(const INTEGER_template& bvci, const BssgpCellId_template& cell__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1254, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_RESET_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__RESET__ACK_template& tmp_132 = ret_val.pDU__BSSGP__BVC__RESET__ACK();
tmp_132.bssgpPduType() = os_29;
tmp_132.bVCI() = tr__BSSGP__BVCI(bvci);
tmp_132.cell__Identifier() = tr__BSSGP__IE__CellId(cell__id);
tmp_132.feature__bitmap() = ANY_OR_OMIT;
tmp_132.extended__Feature__Bitmap() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__UNBLOCK(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1266, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_UNBLOCK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__UNBLOCK_template& tmp_133 = ret_val.pDU__BSSGP__BVC__UNBLOCK();
tmp_133.bssgpPduType() = os_30;
tmp_133.bVCI() = tr__BSSGP__BVCI(bvci);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__UNBLOCK(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1272, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_UNBLOCK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__UNBLOCK_template& tmp_134 = ret_val.pDU__BSSGP__BVC__UNBLOCK();
tmp_134.bssgpPduType() = os_30;
tmp_134.bVCI() = ts__BSSGP__BVCI(bvci);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__UNBLOCK__ACK(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1280, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_UNBLOCK_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__UNBLOCK__ACK_template& tmp_135 = ret_val.pDU__BSSGP__BVC__UNBLOCK__ACK();
tmp_135.bssgpPduType() = os_21;
tmp_135.bVCI() = tr__BSSGP__BVCI(bvci);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__UNBLOCK__ACK(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1286, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_UNBLOCK_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__UNBLOCK__ACK_template& tmp_136 = ret_val.pDU__BSSGP__BVC__UNBLOCK__ACK();
tmp_136.bssgpPduType() = os_21;
tmp_136.bVCI() = ts__BSSGP__BVCI(bvci);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__BLOCK(const INTEGER_template& bvci, const BssgpCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1294, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_BLOCK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__BLOCK_template& tmp_137 = ret_val.pDU__BSSGP__BVC__BLOCK();
tmp_137.bssgpPduType() = os_25;
tmp_137.bVCI() = tr__BSSGP__BVCI(bvci);
tmp_137.cause() = tr__BSSGP__CAUSE(cause);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__BLOCK(const INTEGER_template& bvci, const BssgpCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1302, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_BLOCK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__BLOCK_template& tmp_138 = ret_val.pDU__BSSGP__BVC__BLOCK();
tmp_138.bssgpPduType() = os_25;
tmp_138.bVCI() = ts__BSSGP__BVCI(bvci);
tmp_138.cause() = ts__BSSGP__CAUSE(cause);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__BLOCK__ACK(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1312, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_BLOCK_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__BLOCK__ACK_template& tmp_139 = ret_val.pDU__BSSGP__BVC__BLOCK__ACK();
tmp_139.bssgpPduType() = os_31;
tmp_139.bVCI() = tr__BSSGP__BVCI(bvci);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__BLOCK__ACK(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1318, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_BLOCK_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__BVC__BLOCK__ACK_template& tmp_140 = ret_val.pDU__BSSGP__BVC__BLOCK__ACK();
tmp_140.bssgpPduType() = os_31;
tmp_140.bVCI() = ts__BSSGP__BVCI(bvci);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__FC__BVC(const INTEGER& bmax, const INTEGER& bucket__leak__rate, const INTEGER& bmax__default__ms, const INTEGER& r__default__ms, const OCTETSTRING& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1326, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_FC_BVC");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLOW__CONTROL__BVC_template& tmp_141 = ret_val.pDU__BSSGP__FLOW__CONTROL__BVC();
tmp_141.bssgpPduType() = os_32;
{
BSSGP__Types::Tag_template& tmp_142 = tmp_141.tag();
tmp_142.iEI() = os_26;
tmp_142.ext() = bs_2;
tmp_142.lengthIndicator().length1() = 1;
tmp_142.unstructured__Value() = tag;
}
{
BSSGP__Types::BVC__Bucket__Size_template& tmp_143 = tmp_141.bVC__Bucket__Size();
tmp_143.iEI() = os_6;
tmp_143.ext() = bs_2;
tmp_143.lengthIndicator().length1() = 2;
tmp_143.bmax() = int2oct(bmax, 2);
}
{
BSSGP__Types::Bucket__Leak__Rate_template& tmp_144 = tmp_141.bucket__Leak__Rate();
tmp_144.iEI() = os_5;
tmp_144.ext() = bs_2;
tmp_144.lengthIndicator().length1() = 2;
tmp_144.r__Value() = int2oct(bucket__leak__rate, 2);
}
{
BSSGP__Types::Bmax__default__MS_template& tmp_145 = tmp_141.bmax__default__MS();
tmp_145.iEI() = os_2;
tmp_145.ext() = bs_2;
tmp_145.lengthIndicator().length1() = 2;
tmp_145.bmax() = int2oct(bmax__default__ms, 2);
}
{
BSSGP__Types::R__default__MS_template& tmp_146 = tmp_141.r__default__MS();
tmp_146.iEI() = os_33;
tmp_146.ext() = bs_2;
tmp_146.lengthIndicator().length1() = 2;
tmp_146.r__default__MS__value() = int2oct(r__default__ms, 2);
}
tmp_141.bucket__Full__Ratio() = OMIT_VALUE;
tmp_141.bVC__Measurement() = OMIT_VALUE;
tmp_141.flow__Control__Granularity() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__FC__BVC(const INTEGER_template& bmax, const INTEGER_template& bucket__leak__rate, const INTEGER_template& bmax__default__ms, const INTEGER_template& r__default__ms, const OCTETSTRING_template& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1375, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_FC_BVC");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLOW__CONTROL__BVC_template& tmp_147 = ret_val.pDU__BSSGP__FLOW__CONTROL__BVC();
tmp_147.bssgpPduType() = os_32;
{
BSSGP__Types::Tag_template& tmp_148 = tmp_147.tag();
tmp_148.iEI() = os_26;
tmp_148.ext() = bs_2;
tmp_148.lengthIndicator().length1() = 1;
tmp_148.unstructured__Value() = tag;
}
{
BSSGP__Types::BVC__Bucket__Size_template& tmp_149 = tmp_147.bVC__Bucket__Size();
tmp_149.iEI() = os_6;
tmp_149.ext() = bs_2;
tmp_149.lengthIndicator().length1() = 2;
tmp_149.bmax() = Osmocom__Types::int2oct__tmpl(bmax, 2);
}
{
BSSGP__Types::Bucket__Leak__Rate_template& tmp_150 = tmp_147.bucket__Leak__Rate();
tmp_150.iEI() = os_5;
tmp_150.ext() = bs_2;
tmp_150.lengthIndicator().length1() = 2;
tmp_150.r__Value() = Osmocom__Types::int2oct__tmpl(bucket__leak__rate, 2);
}
{
BSSGP__Types::Bmax__default__MS_template& tmp_151 = tmp_147.bmax__default__MS();
tmp_151.iEI() = os_2;
tmp_151.ext() = bs_2;
tmp_151.lengthIndicator().length1() = 2;
tmp_151.bmax() = Osmocom__Types::int2oct__tmpl(bmax__default__ms, 2);
}
{
BSSGP__Types::R__default__MS_template& tmp_152 = tmp_147.r__default__MS();
tmp_152.iEI() = os_33;
tmp_152.ext() = bs_2;
tmp_152.lengthIndicator().length1() = 2;
tmp_152.r__default__MS__value() = Osmocom__Types::int2oct__tmpl(r__default__ms, 2);
}
tmp_147.bucket__Full__Ratio() = ANY_OR_OMIT;
tmp_147.bVC__Measurement() = ANY_OR_OMIT;
tmp_147.flow__Control__Granularity() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__FC__BVC__ACK(const OCTETSTRING_template& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1429, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_FC_BVC_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template& tmp_153 = ret_val.pDU__BSSGP__FLOW__CONTROL__BVC__ACK();
tmp_153.bssgpPduType() = os_34;
{
BSSGP__Types::Tag_template& tmp_154 = tmp_153.tag();
tmp_154.iEI() = os_26;
tmp_154.ext() = bs_2;
tmp_154.lengthIndicator().length1() = 1;
tmp_154.unstructured__Value() = tag;
}
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__FC__BVC__ACK(const OCTETSTRING_template& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1442, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_FC_BVC_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLOW__CONTROL__BVC__ACK_template& tmp_155 = ret_val.pDU__BSSGP__FLOW__CONTROL__BVC__ACK();
tmp_155.bssgpPduType() = os_34;
{
BSSGP__Types::Tag_template& tmp_156 = tmp_155.tag();
tmp_156.iEI() = os_26;
tmp_156.ext() = bs_2;
tmp_156.lengthIndicator().length1() = 1;
tmp_156.unstructured__Value() = tag;
}
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__FC__MS(const OCTETSTRING& tlli, const INTEGER& bmax, const INTEGER& bucket__leak__rate, const OCTETSTRING& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1457, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_FC_MS");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLOW__CONTROL__MS_template& tmp_157 = ret_val.pDU__BSSGP__FLOW__CONTROL__MS();
tmp_157.bssgpPduType() = os_35;
tmp_157.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
{
BSSGP__Types::Tag_template& tmp_158 = tmp_157.tag();
tmp_158.iEI() = os_26;
tmp_158.ext() = bs_2;
tmp_158.lengthIndicator().length1() = 1;
tmp_158.unstructured__Value() = tag;
}
{
BSSGP__Types::MS__Bucket__Size_template& tmp_159 = tmp_157.mS__Bucket__Size();
tmp_159.iEI() = os_12;
tmp_159.ext() = bs_2;
tmp_159.lengthIndicator().length1() = 2;
tmp_159.bmax() = int2oct(bmax, 2);
}
{
BSSGP__Types::Bucket__Leak__Rate_template& tmp_160 = tmp_157.bucket__Leak__Rate();
tmp_160.iEI() = os_5;
tmp_160.ext() = bs_2;
tmp_160.lengthIndicator().length1() = 2;
tmp_160.r__Value() = int2oct(bucket__leak__rate, 2);
}
tmp_157.bucket__Full__Ratio() = OMIT_VALUE;
tmp_157.flow__Control__Granularity() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__FC__MS(const OCTETSTRING_template& tlli, const INTEGER_template& bmax, const INTEGER_template& bucket__leak__rate, const OCTETSTRING_template& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1490, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_FC_MS");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLOW__CONTROL__MS_template& tmp_161 = ret_val.pDU__BSSGP__FLOW__CONTROL__MS();
tmp_161.bssgpPduType() = os_35;
tmp_161.tLLI() = tr__BSSGP__TLLI(tlli);
{
BSSGP__Types::Tag_template& tmp_162 = tmp_161.tag();
tmp_162.iEI() = os_26;
tmp_162.ext() = bs_2;
tmp_162.lengthIndicator().length1() = 1;
tmp_162.unstructured__Value() = tag;
}
{
BSSGP__Types::MS__Bucket__Size_template& tmp_163 = tmp_161.mS__Bucket__Size();
tmp_163.iEI() = os_12;
tmp_163.ext() = bs_2;
tmp_163.lengthIndicator().length1() = 2;
tmp_163.bmax() = Osmocom__Types::int2oct__tmpl(bmax, 2);
}
{
BSSGP__Types::Bucket__Leak__Rate_template& tmp_164 = tmp_161.bucket__Leak__Rate();
tmp_164.iEI() = os_5;
tmp_164.ext() = bs_2;
tmp_164.lengthIndicator().length1() = 2;
tmp_164.r__Value() = Osmocom__Types::int2oct__tmpl(bucket__leak__rate, 2);
}
tmp_161.bucket__Full__Ratio() = ANY_OR_OMIT;
tmp_161.flow__Control__Granularity() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BVC__FC__MS__ACK(const OCTETSTRING_template& tlli, const OCTETSTRING_template& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1527, TTCN_Location::LOCATION_TEMPLATE, "ts_BVC_FC_MS_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLOW__CONTROL__MS__ACK_template& tmp_165 = ret_val.pDU__BSSGP__FLOW__CONTROL__MS__ACK();
tmp_165.bssgpPduType() = os_36;
tmp_165.tLLI() = ts__BSSGP__TLLI(tlli);
{
BSSGP__Types::Tag_template& tmp_166 = tmp_165.tag();
tmp_166.iEI() = os_26;
tmp_166.ext() = bs_2;
tmp_166.lengthIndicator().length1() = 1;
tmp_166.unstructured__Value() = tag;
}
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BVC__FC__MS__ACK(const OCTETSTRING_template& tlli, const OCTETSTRING_template& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1543, TTCN_Location::LOCATION_TEMPLATE, "tr_BVC_FC_MS_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLOW__CONTROL__MS__ACK_template& tmp_167 = ret_val.pDU__BSSGP__FLOW__CONTROL__MS__ACK();
tmp_167.bssgpPduType() = os_36;
tmp_167.tLLI() = tr__BSSGP__TLLI(tlli);
{
BSSGP__Types::Tag_template& tmp_168 = tmp_167.tag();
tmp_168.iEI() = os_26;
tmp_168.ext() = bs_2;
tmp_168.lengthIndicator().length1() = 1;
tmp_168.unstructured__Value() = tag;
}
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__STATUS(const INTEGER_template& bvci, const BssgpCause_template& cause, const BSSGP__Types::PDU__BSSGP& pdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1561, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_STATUS");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__STATUS_template& tmp_169 = ret_val.pDU__BSSGP__STATUS();
tmp_169.bssgpPduType() = os_37;
tmp_169.cause() = ts__BSSGP__CAUSE(cause);
tmp_169.bVCI() = f__ts__BSSGP__BVCI(bvci);
{
BSSGP__Types::PDU__in__Error_template& tmp_170 = tmp_169.pDU__in__Error();
tmp_170.iEI() = os_38;
tmp_170.ext() = bs_2;
tmp_170.lengthIndicator().length1() = 0;
tmp_170.erroneous__BSSGP__PDU() = BSSGP__Types::enc__PDU__BSSGP(pdu);
}
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__STATUS(const INTEGER_template& bvci, const BssgpCause_template& cause, const OCTETSTRING_template& pdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1578, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_STATUS");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__STATUS_template& tmp_171 = ret_val.pDU__BSSGP__STATUS();
tmp_171.bssgpPduType() = os_37;
tmp_171.cause() = tr__BSSGP__CAUSE(cause);
tmp_171.bVCI() = tr__BSSGP__BVCI(bvci);
{
BSSGP__Types::PDU__in__Error_template& tmp_172 = tmp_171.pDU__in__Error();
tmp_172.iEI() = os_38;
tmp_172.ext() = bs_2;
tmp_172.lengthIndicator().length1() = ANY_VALUE;
tmp_172.erroneous__BSSGP__PDU() = pdu;
}
}
return ret_val;
}

BITSTRING f__presence__bit__MultislotCap__GPRS__BSSGP(const BSSGP__Types::MultislotCap__GPRS__BSSGP_template& mscap__gprs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1595, TTCN_Location::LOCATION_FUNCTION, "f_presence_bit_MultislotCap_GPRS_BSSGP");
current_location.update_lineno(1596);
/* Osmocom_Gb_Types.ttcn, line 1596 */
if (mscap__gprs.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1597);
/* Osmocom_Gb_Types.ttcn, line 1597 */
return bs_0;
}
current_location.update_lineno(1599);
/* Osmocom_Gb_Types.ttcn, line 1599 */
return bs_2;
}

BITSTRING f__presence__bit__MultislotCap__EGPRS__BSSGP(const BSSGP__Types::MultislotCap__EGPRS__BSSGP_template& mscap__egprs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1601, TTCN_Location::LOCATION_FUNCTION, "f_presence_bit_MultislotCap_EGPRS_BSSGP");
current_location.update_lineno(1602);
/* Osmocom_Gb_Types.ttcn, line 1602 */
if (mscap__egprs.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1603);
/* Osmocom_Gb_Types.ttcn, line 1603 */
return bs_0;
}
current_location.update_lineno(1605);
/* Osmocom_Gb_Types.ttcn, line 1605 */
return bs_2;
}

BSSGP__Types::MSRACapabilityValuesRecord__BSSGP_template ts__RaCapRec__BSSGP(const BITSTRING& att, const BSSGP__Types::MultislotCap__GPRS__BSSGP_template& mscap__gprs, const BSSGP__Types::MultislotCap__EGPRS__BSSGP_template& mscap__egprs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1607, TTCN_Location::LOCATION_TEMPLATE, "ts_RaCapRec_BSSGP");
BSSGP__Types::MSRACapabilityValuesRecord__BSSGP_template ret_val;
{
BSSGP__Types::MSRACapabilityValuesExclude1111__BSSGP_template& tmp_173 = ret_val.mSRACapabilityValues().mSRACapabilityValuesExclude1111();
tmp_173.accessTechnType() = att;
{
BSSGP__Types::AccessCapabilitiesStruct__BSSGP_template& tmp_174 = tmp_173.accessCapabilities();
tmp_174.lengthIndicator() = 0;
{
BSSGP__Types::AccessCapabilities__BSSGP_template& tmp_175 = tmp_174.accessCapabilities();
tmp_175.rfPowerCapability() = bs_4;
tmp_175.presenceBitA5() = bs_0;
tmp_175.a5bits() = OMIT_VALUE;
tmp_175.esind() = bs_2;
tmp_175.psbit() = bs_0;
tmp_175.vgcs() = bs_0;
tmp_175.vbs() = bs_0;
tmp_175.presenceBitMultislot() = bs_2;
{
BSSGP__Types::MultislotCap__BSSGP_template& tmp_176 = tmp_175.multislotcap();
tmp_176.presenceBitHscsd() = bs_0;
tmp_176.hscsdmultislotclass() = OMIT_VALUE;
tmp_176.presenceBitGprs() = f__presence__bit__MultislotCap__GPRS__BSSGP(mscap__gprs);
tmp_176.gprsmultislot() = mscap__gprs;
tmp_176.presenceBitSms() = bs_0;
tmp_176.multislotCap__SMS() = OMIT_VALUE;
{
BSSGP__Types::MultislotCapAdditionsAfterRel97__BSSGP_template& tmp_177 = tmp_176.multislotCapAdditionsAfterRel97();
tmp_177.presenceBitEcsdmulti() = bs_0;
tmp_177.ecsdmultislotclass() = OMIT_VALUE;
tmp_177.presenceBitEgprsmulti() = f__presence__bit__MultislotCap__EGPRS__BSSGP(mscap__egprs);
tmp_177.multislotCap__EGPRS() = mscap__egprs;
tmp_177.presenceBitDtmGprsmulti() = bs_0;
tmp_177.multislotCapdtmgprsmultislotsubclass() = OMIT_VALUE;
}
}
tmp_175.accessCapAdditionsAfterRel97() = OMIT_VALUE;
}
tmp_174.spare__bits() = OMIT_VALUE;
}
}
ret_val.presenceBitMSRACap() = bs_0;
return ret_val;
}

BSSGP__Types::MSRACapabilityValuesRecord__BSSGP_template tr__RaCapRec__BSSGP(const BITSTRING_template& att, const BSSGP__Types::MultislotCap__GPRS__BSSGP_template& mscap__gprs, const BSSGP__Types::MultislotCap__EGPRS__BSSGP_template& mscap__egprs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1646, TTCN_Location::LOCATION_TEMPLATE, "tr_RaCapRec_BSSGP");
BSSGP__Types::MSRACapabilityValuesRecord__BSSGP_template ret_val;
{
BSSGP__Types::MSRACapabilityValuesExclude1111__BSSGP_template& tmp_178 = ret_val.mSRACapabilityValues().mSRACapabilityValuesExclude1111();
tmp_178.accessTechnType() = att;
{
BSSGP__Types::AccessCapabilitiesStruct__BSSGP_template& tmp_179 = tmp_178.accessCapabilities();
tmp_179.lengthIndicator() = ANY_VALUE;
{
BSSGP__Types::AccessCapabilities__BSSGP_template& tmp_180 = tmp_179.accessCapabilities();
tmp_180.rfPowerCapability() = bs_4;
tmp_180.presenceBitA5() = ANY_VALUE;
tmp_180.a5bits() = ANY_OR_OMIT;
tmp_180.esind() = bs_2;
tmp_180.psbit() = bs_0;
tmp_180.vgcs() = bs_0;
tmp_180.vbs() = bs_0;
tmp_180.presenceBitMultislot() = bs_2;
{
BSSGP__Types::MultislotCap__BSSGP_template& tmp_181 = tmp_180.multislotcap();
tmp_181.presenceBitHscsd() = bs_0;
tmp_181.hscsdmultislotclass() = OMIT_VALUE;
tmp_181.presenceBitGprs() = ANY_VALUE;
tmp_181.gprsmultislot() = mscap__gprs;
tmp_181.presenceBitSms() = bs_0;
tmp_181.multislotCap__SMS() = OMIT_VALUE;
{
BSSGP__Types::MultislotCapAdditionsAfterRel97__BSSGP_template& tmp_182 = tmp_181.multislotCapAdditionsAfterRel97();
tmp_182.presenceBitEcsdmulti() = bs_0;
tmp_182.ecsdmultislotclass() = ANY_OR_OMIT;
tmp_182.presenceBitEgprsmulti() = ANY_VALUE;
tmp_182.multislotCap__EGPRS() = mscap__egprs;
tmp_182.presenceBitDtmGprsmulti() = ANY_VALUE;
tmp_182.multislotCapdtmgprsmultislotsubclass() = ANY_OR_OMIT;
}
}
tmp_180.accessCapAdditionsAfterRel97() = ANY_OR_OMIT;
}
tmp_179.spare__bits() = ANY_OR_OMIT;
}
}
ret_val.presenceBitMSRACap() = bs_0;
return ret_val;
}

BSSGP__Types::QoS__Profile_template ts__QoS__TLV(const BSSGP__Types::QoS__Profile__V_template& qos)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1698, TTCN_Location::LOCATION_TEMPLATE, "ts_QoS_TLV");
BSSGP__Types::QoS__Profile_template ret_val;
ret_val.iEI() = os_40;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 3;
ret_val.peak__Bit__Rate() = const_cast< const BSSGP__Types::QoS__Profile__V_template&>(qos).peak__Bit__Rate();
ret_val.precedence() = const_cast< const BSSGP__Types::QoS__Profile__V_template&>(qos).precedence();
ret_val.a__bit() = const_cast< const BSSGP__Types::QoS__Profile__V_template&>(qos).a__bit();
ret_val.t__bit() = const_cast< const BSSGP__Types::QoS__Profile__V_template&>(qos).t__bit();
ret_val.c__r__bit() = const_cast< const BSSGP__Types::QoS__Profile__V_template&>(qos).c__r__bit();
ret_val.peakBitRateGranularity() = const_cast< const BSSGP__Types::QoS__Profile__V_template&>(qos).peakBitRateGranularity();
return ret_val;
}

BSSGP__Types::PDU__Lifetime_template t__DefaultLifetime(const INTEGER& delay)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1710, TTCN_Location::LOCATION_TEMPLATE, "t_DefaultLifetime");
BSSGP__Types::PDU__Lifetime_template ret_val;
ret_val.iEI() = os_41;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.delay__Value() = int2oct(delay, 2);
return ret_val;
}

BSSGP__Types::MS__Radio__Access__Capability_template ts__BSSGP__IE__MSRAcap__omit(const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& racap)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1731, TTCN_Location::LOCATION_FUNCTION, "ts_BSSGP_IE_MSRAcap_omit");
current_location.update_lineno(1732);
/* Osmocom_Gb_Types.ttcn, line 1732 */
BSSGP__Types::MS__Radio__Access__Capability_template ret;
current_location.update_lineno(1733);
/* Osmocom_Gb_Types.ttcn, line 1733 */
if (racap.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1734);
/* Osmocom_Gb_Types.ttcn, line 1734 */
return BSSGP__Types::MS__Radio__Access__Capability_template(OMIT_VALUE);
}
else {
current_location.update_lineno(1736);
/* Osmocom_Gb_Types.ttcn, line 1736 */
ret.iEI() = os_14;
ret.ext() = bs_2;
ret.lengthIndicator().length1() = 1;
ret.mSRadioAccessCapabilityV__BSSGP() = racap;
current_location.update_lineno(1744);
/* Osmocom_Gb_Types.ttcn, line 1744 */
return ret;
}
}

BSSGP__Types::MS__Radio__Access__Capability_template tr__BSSGP__IE__MSRAcap(const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& racap)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1748, TTCN_Location::LOCATION_FUNCTION, "tr_BSSGP_IE_MSRAcap");
current_location.update_lineno(1749);
/* Osmocom_Gb_Types.ttcn, line 1749 */
BSSGP__Types::MS__Radio__Access__Capability_template ret;
current_location.update_lineno(1750);
/* Osmocom_Gb_Types.ttcn, line 1750 */
if (racap.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(1751);
/* Osmocom_Gb_Types.ttcn, line 1751 */
return BSSGP__Types::MS__Radio__Access__Capability_template(OMIT_VALUE);
}
else {
current_location.update_lineno(1753);
/* Osmocom_Gb_Types.ttcn, line 1753 */
ret.iEI() = os_14;
ret.ext() = ANY_VALUE;
ret.lengthIndicator() = ANY_VALUE;
ret.mSRadioAccessCapabilityV__BSSGP() = racap;
current_location.update_lineno(1759);
/* Osmocom_Gb_Types.ttcn, line 1759 */
return ret;
}
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__DL__UD(const OCTETSTRING& tlli, const OCTETSTRING& pdu, const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& racap, const BSSGP__Types::IMSI__BSSGP_template& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1764, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_DL_UD");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__DL__UNITDATA_template& tmp_185 = ret_val.pDU__BSSGP__DL__UNITDATA();
tmp_185.bssgpPduType() = os_0;
tmp_185.tLLI__current() = tlli;
tmp_185.qoS__Profile() = t__defaultQos;
tmp_185.pDU__Lifetime() = t__DefaultLifetime(65535);
tmp_185.mS__Radio__Access__Capability() = ts__BSSGP__IE__MSRAcap__omit(racap);
tmp_185.priority() = OMIT_VALUE;
tmp_185.dRX__Parameters() = OMIT_VALUE;
tmp_185.iMSI() = imsi;
tmp_185.tLLI__old() = OMIT_VALUE;
tmp_185.pFI() = OMIT_VALUE;
tmp_185.lSA__Information() = OMIT_VALUE;
tmp_185.service__UTRAN__CCO() = OMIT_VALUE;
tmp_185.service__Class__Indicator() = OMIT_VALUE;
tmp_185.subscriber__Profile__ID__For__RAT__Priority() = OMIT_VALUE;
tmp_185.redirection__Indication() = OMIT_VALUE;
tmp_185.redirection__Completed() = OMIT_VALUE;
tmp_185.unconfirmed__Send__State__Variable() = OMIT_VALUE;
tmp_185.sCI() = OMIT_VALUE;
tmp_185.gGSN__PGW__Location() = OMIT_VALUE;
tmp_185.eDRX__Paremeters() = OMIT_VALUE;
tmp_185.old__Routing__Area__Identification() = OMIT_VALUE;
tmp_185.attach__Indicator() = OMIT_VALUE;
tmp_185.alignment__octets() = OMIT_VALUE;
tmp_185.lLC__PDU() = ts__BSSGP__LLC__PDU(pdu);
tmp_185.initialLLC__PDU() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__DL__UD(const OCTETSTRING_template& tlli, const OCTETSTRING_template& pdu, const BSSGP__Types::IMSI__BSSGP_template& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1795, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_DL_UD");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__DL__UNITDATA_template& tmp_186 = ret_val.pDU__BSSGP__DL__UNITDATA();
tmp_186.bssgpPduType() = os_0;
tmp_186.tLLI__current() = tlli;
tmp_186.qoS__Profile() = ANY_VALUE;
tmp_186.pDU__Lifetime() = ANY_VALUE;
tmp_186.mS__Radio__Access__Capability() = ANY_OR_OMIT;
tmp_186.priority() = ANY_OR_OMIT;
tmp_186.dRX__Parameters() = ANY_OR_OMIT;
tmp_186.iMSI() = imsi;
tmp_186.tLLI__old() = ANY_OR_OMIT;
tmp_186.pFI() = ANY_OR_OMIT;
tmp_186.lSA__Information() = ANY_OR_OMIT;
tmp_186.service__UTRAN__CCO() = ANY_OR_OMIT;
tmp_186.service__Class__Indicator() = ANY_OR_OMIT;
tmp_186.subscriber__Profile__ID__For__RAT__Priority() = ANY_OR_OMIT;
tmp_186.redirection__Indication() = ANY_OR_OMIT;
tmp_186.redirection__Completed() = ANY_OR_OMIT;
tmp_186.unconfirmed__Send__State__Variable() = ANY_OR_OMIT;
tmp_186.sCI() = ANY_OR_OMIT;
tmp_186.gGSN__PGW__Location() = ANY_OR_OMIT;
tmp_186.eDRX__Paremeters() = ANY_OR_OMIT;
tmp_186.old__Routing__Area__Identification() = ANY_OR_OMIT;
tmp_186.attach__Indicator() = ANY_OR_OMIT;
tmp_186.alignment__octets() = ANY_OR_OMIT;
tmp_186.lLC__PDU() = tr__BSSGP__LLC__PDU(pdu);
tmp_186.initialLLC__PDU() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__UL__UD(const OCTETSTRING& tlli, const BssgpCellId& cell__id, const OCTETSTRING& payload)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1827, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_UL_UD");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__UL__UNITDATA_template& tmp_187 = ret_val.pDU__BSSGP__UL__UNITDATA();
tmp_187.bssgpPduType() = os_2;
tmp_187.tLLI() = tlli;
tmp_187.qoS__Profile() = t__defaultQos;
tmp_187.cell__Identifier() = ts__BSSGP__IE__CellId(BssgpCellId_template(cell__id));
tmp_187.pFI() = OMIT_VALUE;
tmp_187.lSA__Identifier__List() = OMIT_VALUE;
tmp_187.redirect__Attempt__Flag() = OMIT_VALUE;
tmp_187.iMSI__BSSGP() = OMIT_VALUE;
tmp_187.unconfirmed__Send__State__Variable() = OMIT_VALUE;
tmp_187.selected__PLMN__ID() = OMIT_VALUE;
tmp_187.selected__Operator() = OMIT_VALUE;
tmp_187.cS__Registered__Operator() = OMIT_VALUE;
tmp_187.alignment__octets() = OMIT_VALUE;
tmp_187.lLC__PDU() = ts__BSSGP__LLC__PDU(payload);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__UL__UD(const OCTETSTRING_template& tlli, const BssgpCellId_template& cell__id, const OCTETSTRING_template& payload)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1845, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_UL_UD");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__UL__UNITDATA_template& tmp_188 = ret_val.pDU__BSSGP__UL__UNITDATA();
tmp_188.bssgpPduType() = os_2;
tmp_188.tLLI() = tlli;
tmp_188.qoS__Profile() = ANY_VALUE;
tmp_188.cell__Identifier() = tr__BSSGP__IE__CellId(cell__id);
tmp_188.pFI() = ANY_OR_OMIT;
tmp_188.lSA__Identifier__List() = ANY_OR_OMIT;
tmp_188.redirect__Attempt__Flag() = ANY_OR_OMIT;
tmp_188.iMSI__BSSGP() = ANY_OR_OMIT;
tmp_188.unconfirmed__Send__State__Variable() = ANY_OR_OMIT;
tmp_188.selected__PLMN__ID() = ANY_OR_OMIT;
tmp_188.selected__Operator() = ANY_OR_OMIT;
tmp_188.cS__Registered__Operator() = ANY_OR_OMIT;
tmp_188.alignment__octets() = ANY_OR_OMIT;
tmp_188.lLC__PDU() = tr__BSSGP__LLC__PDU(payload);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__CS__PAGING(const INTEGER& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1866, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_CS_PAGING");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__PAGING__CS_template& tmp_189 = ret_val.pDU__BSSGP__PAGING__CS();
tmp_189.bssgpPduType() = os_8;
tmp_189.iMSI() = ANY_VALUE;
tmp_189.dRX__Parameters() = ANY_VALUE;
tmp_189.paging__Field4().bVCI() = ts__BSSGP__BVCI(INTEGER_template(bvci));
tmp_189.tLLI() = ANY_OR_OMIT;
tmp_189.channel__needed() = ANY_OR_OMIT;
tmp_189.eMLPP__Priority() = ANY_OR_OMIT;
tmp_189.tMSI() = ANY_OR_OMIT;
tmp_189.global__CN__Id() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__CS__PAGING__IMSI(const INTEGER& bvci, const HEXSTRING& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1881, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_CS_PAGING_IMSI");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__PAGING__CS_template& tmp_190 = ret_val.pDU__BSSGP__PAGING__CS();
tmp_190.bssgpPduType() = os_8;
tmp_190.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_190.dRX__Parameters() = t__defaultDRXparam;
tmp_190.paging__Field4().bVCI() = ts__BSSGP__BVCI(INTEGER_template(bvci));
tmp_190.tLLI() = OMIT_VALUE;
tmp_190.channel__needed() = OMIT_VALUE;
tmp_190.eMLPP__Priority() = OMIT_VALUE;
tmp_190.tMSI() = OMIT_VALUE;
tmp_190.global__CN__Id() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__CS__PAGING__PTMSI(const INTEGER& bvci, const HEXSTRING& imsi, const INTEGER& tmsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1896, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_CS_PAGING_PTMSI");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__PAGING__CS_template& tmp_191 = ret_val.pDU__BSSGP__PAGING__CS();
tmp_191.bssgpPduType() = os_8;
tmp_191.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_191.dRX__Parameters() = t__defaultDRXparam;
tmp_191.paging__Field4().bVCI() = ts__BSSGP__BVCI(INTEGER_template(bvci));
tmp_191.tLLI() = OMIT_VALUE;
tmp_191.channel__needed() = OMIT_VALUE;
tmp_191.eMLPP__Priority() = OMIT_VALUE;
tmp_191.tMSI() = ts__BSSGP__TMSI(tmsi);
tmp_191.global__CN__Id() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__PS__PAGING(const INTEGER_template& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1913, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_PS_PAGING");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__PAGING__PS_template& tmp_192 = ret_val.pDU__BSSGP__PAGING__PS();
tmp_192.bssgpPduType() = os_7;
tmp_192.iMSI() = ANY_VALUE;
tmp_192.dRX__Parameters() = ANY_OR_OMIT;
tmp_192.paging__Field4().bVCI() = tr__BSSGP__BVCI(bvci);
tmp_192.pFI() = ANY_OR_OMIT;
tmp_192.aBQP() = ANY_OR_OMIT;
tmp_192.qoS__Profile() = ANY_VALUE;
tmp_192.pTMSI() = ANY_OR_OMIT;
tmp_192.eDRX__Paremeters() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__PS__PAGING__IMSI(const INTEGER& bvci, const HEXSTRING& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1928, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_PS_PAGING_IMSI");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__PAGING__PS_template& tmp_193 = ret_val.pDU__BSSGP__PAGING__PS();
tmp_193.bssgpPduType() = os_7;
tmp_193.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_193.dRX__Parameters() = OMIT_VALUE;
tmp_193.paging__Field4().bVCI() = ts__BSSGP__BVCI(INTEGER_template(bvci));
tmp_193.pFI() = OMIT_VALUE;
tmp_193.aBQP() = OMIT_VALUE;
tmp_193.qoS__Profile() = ts__QoS__TLV(t__defaultQos);
tmp_193.pTMSI() = OMIT_VALUE;
tmp_193.eDRX__Paremeters() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__PS__PAGING__PTMSI(const INTEGER& bvci, const HEXSTRING& imsi, const INTEGER& tmsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1943, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_PS_PAGING_PTMSI");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__PAGING__PS_template& tmp_194 = ret_val.pDU__BSSGP__PAGING__PS();
tmp_194.bssgpPduType() = os_7;
tmp_194.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_194.dRX__Parameters() = OMIT_VALUE;
tmp_194.paging__Field4().bVCI() = ts__BSSGP__BVCI(INTEGER_template(bvci));
tmp_194.pFI() = OMIT_VALUE;
tmp_194.aBQP() = OMIT_VALUE;
tmp_194.qoS__Profile() = ts__QoS__TLV(t__defaultQos);
tmp_194.pTMSI() = ts__BSSGP__TMSI(tmsi);
tmp_194.eDRX__Paremeters() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::Paging__Field4_template ts__BssgpP4LAC(const GSM__Types::LocationAreaIdentification& lai)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1970, TTCN_Location::LOCATION_TEMPLATE, "ts_BssgpP4LAC");
BSSGP__Types::Paging__Field4_template ret_val;
ret_val.location__Area() = ts__BSSGP__LA__ID(lai);
return ret_val;
}

BSSGP__Types::Paging__Field4_template ts__BssgpP4RAC(const GSM__Types::RoutingAreaIdentification& rai)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1974, TTCN_Location::LOCATION_TEMPLATE, "ts_BssgpP4RAC");
BSSGP__Types::Paging__Field4_template ret_val;
ret_val.routeing__Area() = ts__BSSGP__RA__ID(rai);
return ret_val;
}

BSSGP__Types::Paging__Field4_template ts__BssgpP4Bvci(const INTEGER& bvci)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1978, TTCN_Location::LOCATION_TEMPLATE, "ts_BssgpP4Bvci");
BSSGP__Types::Paging__Field4_template ret_val;
ret_val.bVCI() = ts__BSSGP__BVCI(INTEGER_template(bvci));
return ret_val;
}

BSSGP__Types::Location__Area_template ts__BSSGP__LA__ID(const GSM__Types::LocationAreaIdentification& input)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1982, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_LA_ID");
BSSGP__Types::Location__Area_template ret_val;
ret_val.iEI() = os_16;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 5;
ret_val.mccDigit1() = const_cast< const GSM__Types::LocationAreaIdentification&>(input).mcc__mnc()[0];
ret_val.mccDigit2() = const_cast< const GSM__Types::LocationAreaIdentification&>(input).mcc__mnc()[1];
ret_val.mccDigit3() = const_cast< const GSM__Types::LocationAreaIdentification&>(input).mcc__mnc()[2];
ret_val.mncDigit3() = const_cast< const GSM__Types::LocationAreaIdentification&>(input).mcc__mnc()[3];
ret_val.mncDigit1() = const_cast< const GSM__Types::LocationAreaIdentification&>(input).mcc__mnc()[4];
ret_val.mncDigit2() = const_cast< const GSM__Types::LocationAreaIdentification&>(input).mcc__mnc()[5];
ret_val.lac() = int2oct(const_cast< const GSM__Types::LocationAreaIdentification&>(input).lac(), 2);
return ret_val;
}

BSSGP__Types::Routeing__Area_template ts__BSSGP__RA__ID(const GSM__Types::RoutingAreaIdentification& input)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 1997, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_RA_ID");
BSSGP__Types::Routeing__Area_template ret_val;
ret_val.iEI() = os_42;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 6;
ret_val.mccDigit1() = const_cast< const GSM__Types::RoutingAreaIdentification&>(input).lai().mcc__mnc()[0];
ret_val.mccDigit2() = const_cast< const GSM__Types::RoutingAreaIdentification&>(input).lai().mcc__mnc()[1];
ret_val.mccDigit3() = const_cast< const GSM__Types::RoutingAreaIdentification&>(input).lai().mcc__mnc()[2];
ret_val.mncDigit3() = const_cast< const GSM__Types::RoutingAreaIdentification&>(input).lai().mcc__mnc()[3];
ret_val.mncDigit1() = const_cast< const GSM__Types::RoutingAreaIdentification&>(input).lai().mcc__mnc()[4];
ret_val.mncDigit2() = const_cast< const GSM__Types::RoutingAreaIdentification&>(input).lai().mcc__mnc()[5];
ret_val.lac() = int2oct(const_cast< const GSM__Types::RoutingAreaIdentification&>(input).lai().lac(), 2);
ret_val.rac() = int2oct(const_cast< const GSM__Types::RoutingAreaIdentification&>(input).rac(), 1);
return ret_val;
}

BSSGP__Types::Routeing__Area_template f__ts__BSSGP__RA__ID(const GSM__Types::RoutingAreaIdentification_template& input)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2013, TTCN_Location::LOCATION_FUNCTION, "f_ts_BSSGP_RA_ID");
current_location.update_lineno(2015);
/* Osmocom_Gb_Types.ttcn, line 2015 */
if (input.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(2016);
/* Osmocom_Gb_Types.ttcn, line 2016 */
return BSSGP__Types::Routeing__Area_template(OMIT_VALUE);
}
else {
current_location.update_lineno(2018);
/* Osmocom_Gb_Types.ttcn, line 2018 */
return ts__BSSGP__RA__ID(input.valueof());
}
}

BSSGP__Types::Routeing__Area_template f__tr__BSSGP__RA__ID(const GSM__Types::RoutingAreaIdentification_template& input)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2022, TTCN_Location::LOCATION_FUNCTION, "f_tr_BSSGP_RA_ID");
current_location.update_lineno(2024);
/* Osmocom_Gb_Types.ttcn, line 2024 */
if (input.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(2025);
/* Osmocom_Gb_Types.ttcn, line 2025 */
return BSSGP__Types::Routeing__Area_template(OMIT_VALUE);
}
else {
current_location.update_lineno(2026);
/* Osmocom_Gb_Types.ttcn, line 2026 */
if (input.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(2027);
/* Osmocom_Gb_Types.ttcn, line 2027 */
return BSSGP__Types::Routeing__Area_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(2028);
/* Osmocom_Gb_Types.ttcn, line 2028 */
if (input.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(2029);
/* Osmocom_Gb_Types.ttcn, line 2029 */
return BSSGP__Types::Routeing__Area_template(ANY_VALUE);
}
else {
current_location.update_lineno(2031);
/* Osmocom_Gb_Types.ttcn, line 2031 */
return ts__BSSGP__RA__ID(input.valueof());
}
}
}
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__SUSPEND(const OCTETSTRING& tlli, const GSM__Types::RoutingAreaIdentification& ra__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2036, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_SUSPEND");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__SUSPEND_template& tmp_196 = ret_val.pDU__BSSGP__SUSPEND();
tmp_196.bssgpPduType() = os_1;
tmp_196.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_196.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__SUSPEND(const OCTETSTRING_template& tlli, const GSM__Types::RoutingAreaIdentification& ra__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2043, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_SUSPEND");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__SUSPEND_template& tmp_197 = ret_val.pDU__BSSGP__SUSPEND();
tmp_197.bssgpPduType() = os_1;
tmp_197.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_197.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__SUSPEND__ACK(const OCTETSTRING& tlli, const GSM__Types::RoutingAreaIdentification& ra__id, const OCTETSTRING_template& susp__ref)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2052, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_SUSPEND_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__SUSPEND__ACK_template& tmp_198 = ret_val.pDU__BSSGP__SUSPEND__ACK();
tmp_198.bssgpPduType() = os_20;
tmp_198.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_198.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
tmp_198.suspend__Reference__Number() = ts__BSSGP__SUSP__REF(susp__ref);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__SUSPEND__ACK(const OCTETSTRING& tlli, const GSM__Types::RoutingAreaIdentification& ra__id, const OCTETSTRING_template& susp__ref)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2061, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_SUSPEND_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__SUSPEND__ACK_template& tmp_199 = ret_val.pDU__BSSGP__SUSPEND__ACK();
tmp_199.bssgpPduType() = os_20;
tmp_199.tLLI() = tr__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_199.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
tmp_199.suspend__Reference__Number() = tr__BSSGP__SUSP__REF(susp__ref);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__SUSPEND__NACK(const OCTETSTRING& tlli, const GSM__Types::RoutingAreaIdentification& ra__id, const BssgpCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2072, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_SUSPEND_NACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__SUSPEND__NACK_template& tmp_200 = ret_val.pDU__BSSGP__SUSPEND__NACK();
tmp_200.bssgpPduType() = os_17;
tmp_200.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_200.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
tmp_200.cause() = ts__BSSGP__CAUSE(cause);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__SUSPEND__NACK(const OCTETSTRING& tlli, const GSM__Types::RoutingAreaIdentification& ra__id, const BssgpCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2081, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_SUSPEND_NACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__SUSPEND__NACK_template& tmp_201 = ret_val.pDU__BSSGP__SUSPEND__NACK();
tmp_201.bssgpPduType() = os_17;
tmp_201.tLLI() = tr__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_201.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
tmp_201.cause() = tr__BSSGP__CAUSE(cause);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__RESUME(const OCTETSTRING& tlli, const GSM__Types::RoutingAreaIdentification& ra__id, const OCTETSTRING& susp__ref)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2093, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_RESUME");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RESUME_template& tmp_202 = ret_val.pDU__BSSGP__RESUME();
tmp_202.bssgpPduType() = os_19;
tmp_202.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_202.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
tmp_202.suspend__Reference__Number() = ts__BSSGP__SUSP__REF(OCTETSTRING_template(susp__ref));
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__RESUME(const OCTETSTRING_template& tlli, const GSM__Types::RoutingAreaIdentification& ra__id, const OCTETSTRING_template& susp__ref)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2102, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_RESUME");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RESUME_template& tmp_203 = ret_val.pDU__BSSGP__RESUME();
tmp_203.bssgpPduType() = os_19;
tmp_203.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_203.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
tmp_203.suspend__Reference__Number() = tr__BSSGP__SUSP__REF(susp__ref);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__RESUME__ACK(const OCTETSTRING& tlli, const GSM__Types::RoutingAreaIdentification& ra__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2113, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_RESUME_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RESUME__ACK_template& tmp_204 = ret_val.pDU__BSSGP__RESUME__ACK();
tmp_204.bssgpPduType() = os_15;
tmp_204.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_204.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__RESUME__ACK(const OCTETSTRING_template& tlli, const GSM__Types::RoutingAreaIdentification& ra__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2121, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_RESUME_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RESUME__ACK_template& tmp_205 = ret_val.pDU__BSSGP__RESUME__ACK();
tmp_205.bssgpPduType() = os_15;
tmp_205.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_205.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__RESUME__NACK(const OCTETSTRING& tlli, const GSM__Types::RoutingAreaIdentification& ra__id, const BssgpCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2131, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_RESUME_NACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RESUME__NACK_template& tmp_206 = ret_val.pDU__BSSGP__RESUME__NACK();
tmp_206.bssgpPduType() = os_16;
tmp_206.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_206.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
tmp_206.cause() = ts__BSSGP__CAUSE(cause);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__RESUME__NACK(const OCTETSTRING_template& tlli, const GSM__Types::RoutingAreaIdentification& ra__id, const BssgpCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2140, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_RESUME_NACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RESUME__NACK_template& tmp_207 = ret_val.pDU__BSSGP__RESUME__NACK();
tmp_207.bssgpPduType() = os_16;
tmp_207.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_207.routeing__Area() = ts__BSSGP__RA__ID(ra__id);
tmp_207.cause() = tr__BSSGP__CAUSE(cause);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__DUMMY__PAGING__PS(const HEXSTRING& imsi, const GSM__Types::RoutingAreaIdentification_template& ra)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2152, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_DUMMY_PAGING_PS");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__DUMMY__PAGING__PS_template& tmp_208 = ret_val.pDU__BSSGP__DUMMY__PAGING__PS();
tmp_208.bssgpPduType() = os_12;
tmp_208.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_208.routeing__Area() = f__ts__BSSGP__RA__ID(ra);
tmp_208.eDRX__Paremeters() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__DUMMY__PAGING__PS(const HEXSTRING& imsi, const GSM__Types::RoutingAreaIdentification_template& ra)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2161, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_DUMMY_PAGING_PS");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__DUMMY__PAGING__PS_template& tmp_209 = ret_val.pDU__BSSGP__DUMMY__PAGING__PS();
tmp_209.bssgpPduType() = os_12;
tmp_209.iMSI() = tr__BSSGP__IMSI(HEXSTRING_template(imsi));
tmp_209.routeing__Area() = f__tr__BSSGP__RA__ID(ra);
tmp_209.eDRX__Paremeters() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::Time__Until__Next__Paging__Occasion_template ts__TimeNextPag(const INTEGER& mins, const INTEGER& secs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2171, TTCN_Location::LOCATION_TEMPLATE, "ts_TimeNextPag");
BSSGP__Types::Time__Until__Next__Paging__Occasion_template ret_val;
ret_val.iEI() = os_43;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.minutes() = mins;
ret_val.spare() = bs_7;
ret_val.seconds() = secs;
ret_val.spare2() = bs_7;
return ret_val;
}

BSSGP__Types::Time__Until__Next__Paging__Occasion_template tr__TimeNextPag(const INTEGER_template& mins, const INTEGER_template& secs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2182, TTCN_Location::LOCATION_TEMPLATE, "tr_TimeNextPag");
BSSGP__Types::Time__Until__Next__Paging__Occasion_template ret_val;
ret_val.iEI() = os_43;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 2;
ret_val.minutes() = mins;
ret_val.spare() = ANY_VALUE;
ret_val.seconds() = secs;
ret_val.spare2() = ANY_VALUE;
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__DUMMY__PAGING__PS__RESP(const HEXSTRING& imsi, const INTEGER& mins, const INTEGER& secs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2196, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_DUMMY_PAGING_PS_RESP");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template& tmp_210 = ret_val.pDU__BSSGP__DUMMY__PAGING__PS__RESPONSE();
tmp_210.bssgpPduType() = os_14;
tmp_210.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_210.time__Until__Next__Paging__Occasion() = ts__TimeNextPag(mins, secs);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__DUMMY__PAGING__PS__RESP(const HEXSTRING& imsi, const INTEGER_template& mins, const INTEGER_template& secs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2203, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_DUMMY_PAGING_PS_RESP");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__DUMMY__PAGING__PS__RESPONSE_template& tmp_211 = ret_val.pDU__BSSGP__DUMMY__PAGING__PS__RESPONSE();
tmp_211.bssgpPduType() = os_14;
tmp_211.iMSI() = tr__BSSGP__IMSI(HEXSTRING_template(imsi));
tmp_211.time__Until__Next__Paging__Occasion() = tr__TimeNextPag(mins, secs);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__PAGING__PS__REJ(const HEXSTRING& imsi, const INTEGER& mins, const INTEGER& secs, const INTEGER_template& tmsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2214, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_PAGING_PS_REJ");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__PAGING__PS__REJECT_template& tmp_212 = ret_val.pDU__BSSGP__PAGING__PS__REJECT();
tmp_212.bssgpPduType() = os_18;
tmp_212.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_212.pTMSI() = f__ts__BSSGP__TMSI(tmsi);
tmp_212.time__Until__Next__Paging__Occasion() = ts__TimeNextPag(mins, secs);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__PAGING__PS__REJ(const HEXSTRING& imsi, const INTEGER_template& mins, const INTEGER_template& secs, const INTEGER_template& tmsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2223, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_PAGING_PS_REJ");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__PAGING__PS__REJECT_template& tmp_213 = ret_val.pDU__BSSGP__PAGING__PS__REJECT();
tmp_213.bssgpPduType() = os_18;
tmp_213.iMSI() = tr__BSSGP__IMSI(HEXSTRING_template(imsi));
tmp_213.pTMSI() = f__tr__BSSGP__TMSI(tmsi);
tmp_213.time__Until__Next__Paging__Occasion() = tr__TimeNextPag(mins, secs);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__MS__REG__ENQ(const HEXSTRING& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2236, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_MS_REG_ENQ");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template& tmp_214 = ret_val.pDU__BSSGP__MS__REGISTRATION__ENQUIRY();
tmp_214.bssgpPduType() = os_44;
tmp_214.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_214.mME__Query() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__MS__REG__ENQ(const HEXSTRING& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2243, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_MS_REG_ENQ");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__MS__REGISTRATION__ENQUIRY_template& tmp_215 = ret_val.pDU__BSSGP__MS__REGISTRATION__ENQUIRY();
tmp_215.bssgpPduType() = os_44;
tmp_215.iMSI() = tr__BSSGP__IMSI(HEXSTRING_template(imsi));
tmp_215.mME__Query() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PLMN__Identity_template ts__BSSGP__PlmnId(const HEXSTRING_template& mccmnc)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2252, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_PlmnId");
BSSGP__Types::PLMN__Identity_template ret_val;
ret_val.iEI() = os_45;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 3;
ret_val.mccDigit1() = const_cast< const HEXSTRING_template&>(mccmnc)[0];
ret_val.mccDigit2() = const_cast< const HEXSTRING_template&>(mccmnc)[1];
ret_val.mccDigit3() = const_cast< const HEXSTRING_template&>(mccmnc)[2];
ret_val.mncDigit3() = const_cast< const HEXSTRING_template&>(mccmnc)[5];
ret_val.mncDigit1() = const_cast< const HEXSTRING_template&>(mccmnc)[3];
ret_val.mncDigit2() = const_cast< const HEXSTRING_template&>(mccmnc)[4];
return ret_val;
}

BSSGP__Types::PLMN__Identity_template tr__BSSGP__PlmnId(const HEXSTRING_template& mccmnc)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2265, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_PlmnId");
BSSGP__Types::PLMN__Identity_template ret_val;
ret_val.iEI() = os_45;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 3;
ret_val.mccDigit1() = const_cast< const HEXSTRING_template&>(mccmnc)[0];
ret_val.mccDigit2() = const_cast< const HEXSTRING_template&>(mccmnc)[1];
ret_val.mccDigit3() = const_cast< const HEXSTRING_template&>(mccmnc)[2];
ret_val.mncDigit3() = const_cast< const HEXSTRING_template&>(mccmnc)[5];
ret_val.mncDigit1() = const_cast< const HEXSTRING_template&>(mccmnc)[3];
ret_val.mncDigit2() = const_cast< const HEXSTRING_template&>(mccmnc)[4];
return ret_val;
}

BSSGP__Types::PLMN__Identity_template f__ts__BSSGP__PlmnId(const HEXSTRING_template& mccmnc)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2278, TTCN_Location::LOCATION_FUNCTION, "f_ts_BSSGP_PlmnId");
current_location.update_lineno(2280);
/* Osmocom_Gb_Types.ttcn, line 2280 */
if (mccmnc.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(2281);
/* Osmocom_Gb_Types.ttcn, line 2281 */
return BSSGP__Types::PLMN__Identity_template(OMIT_VALUE);
}
else {
current_location.update_lineno(2283);
/* Osmocom_Gb_Types.ttcn, line 2283 */
return ts__BSSGP__PlmnId(HEXSTRING_template(mccmnc.valueof()));
}
}

BSSGP__Types::PLMN__Identity_template f__tr__BSSGP__PlmnId(const HEXSTRING_template& mccmnc)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2286, TTCN_Location::LOCATION_FUNCTION, "f_tr_BSSGP_PlmnId");
current_location.update_lineno(2288);
/* Osmocom_Gb_Types.ttcn, line 2288 */
if (mccmnc.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(2289);
/* Osmocom_Gb_Types.ttcn, line 2289 */
return BSSGP__Types::PLMN__Identity_template(OMIT_VALUE);
}
else {
current_location.update_lineno(2290);
/* Osmocom_Gb_Types.ttcn, line 2290 */
if (mccmnc.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(2291);
/* Osmocom_Gb_Types.ttcn, line 2291 */
return BSSGP__Types::PLMN__Identity_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(2292);
/* Osmocom_Gb_Types.ttcn, line 2292 */
if (mccmnc.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(2293);
/* Osmocom_Gb_Types.ttcn, line 2293 */
return BSSGP__Types::PLMN__Identity_template(ANY_VALUE);
}
else {
current_location.update_lineno(2295);
/* Osmocom_Gb_Types.ttcn, line 2295 */
return ts__BSSGP__PlmnId(HEXSTRING_template(mccmnc.valueof()));
}
}
}
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__MS__REW__ENQ__RESP(const HEXSTRING& imsi, const HEXSTRING_template& mccmnc)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2300, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_MS_REW_ENQ_RESP");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template& tmp_216 = ret_val.pDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE();
tmp_216.bssgpPduType() = os_38;
tmp_216.iMSI() = ts__BSSGP__IMSI(imsi);
tmp_216.pS__Registered__Operator() = f__ts__BSSGP__PlmnId(mccmnc);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__MS__REW__ENQ__RESP(const HEXSTRING& imsi, const HEXSTRING_template& mccmnc)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2307, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_MS_REW_ENQ_RESP");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE_template& tmp_217 = ret_val.pDU__BSSGP__MS__REGISTRATION__ENQUIRY__RESPONSE();
tmp_217.bssgpPduType() = os_38;
tmp_217.iMSI() = tr__BSSGP__IMSI(HEXSTRING_template(imsi));
tmp_217.pS__Registered__Operator() = f__tr__BSSGP__PlmnId(mccmnc);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__FLUSH__LL(const OCTETSTRING& tlli, const INTEGER_template& bvci__old, const INTEGER_template& bvci__new, const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2316, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_FLUSH_LL");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLUSH__LL_template& tmp_218 = ret_val.pDU__BSSGP__FLUSH__LL();
tmp_218.bssgpPduType() = os_46;
tmp_218.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_218.bVCI__old() = ts__BSSGP__BVCI(bvci__old);
tmp_218.bVCI__new() = f__ts__BSSGP__BVCI(bvci__new);
tmp_218.nSEI() = f__ts__BSSGP__NSEI(nsei);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__FLUSH__LL(const OCTETSTRING_template& tlli, const INTEGER_template& bvci__old, const INTEGER_template& bvci__new, const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2327, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_FLUSH_LL");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLUSH__LL_template& tmp_219 = ret_val.pDU__BSSGP__FLUSH__LL();
tmp_219.bssgpPduType() = os_46;
tmp_219.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_219.bVCI__old() = tr__BSSGP__BVCI(bvci__old);
tmp_219.bVCI__new() = f__ts__BSSGP__BVCI(bvci__new);
tmp_219.nSEI() = f__ts__BSSGP__NSEI(nsei);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__FLUSH__LL__ACK(const OCTETSTRING& tlli, const OCTETSTRING_template& act, const INTEGER_template& oct__affected, const INTEGER_template& bvci__new, const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2340, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_FLUSH_LL_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLUSH__LL__ACK_template& tmp_220 = ret_val.pDU__BSSGP__FLUSH__LL__ACK();
tmp_220.bssgpPduType() = os_47;
tmp_220.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_220.flush__Action() = ts__FLUSH__ACTION(act);
tmp_220.bVCI__new() = f__ts__BSSGP__BVCI(bvci__new);
tmp_220.number__of__octets__affected() = ts__NO__OCT__AFF(oct__affected);
tmp_220.nSEI() = f__ts__BSSGP__NSEI(nsei);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__FLUSH__LL__ACK(const OCTETSTRING_template& tlli, const OCTETSTRING_template& act, const INTEGER_template& oct__affected, const INTEGER_template& bvci__new, const INTEGER_template& nsei)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2353, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_FLUSH_LL_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__FLUSH__LL__ACK_template& tmp_221 = ret_val.pDU__BSSGP__FLUSH__LL__ACK();
tmp_221.bssgpPduType() = os_47;
tmp_221.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_221.flush__Action() = tr__FLUSH__ACTION(act);
tmp_221.bVCI__new() = f__ts__BSSGP__BVCI(bvci__new);
tmp_221.number__of__octets__affected() = tr__NO__OCT__AFF(oct__affected);
tmp_221.nSEI() = f__ts__BSSGP__NSEI(nsei);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__LLC__DISCARDED(const OCTETSTRING& tlli, const INTEGER_template& frames__discarded, const INTEGER_template& bvci, const INTEGER_template& oct__deleted)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2368, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_LLC_DISCARDED");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__LLC__DISCARDED_template& tmp_222 = ret_val.pDU__BSSGP__LLC__DISCARDED();
tmp_222.bssgpPduType() = os_48;
tmp_222.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_222.lLC__Frames__Discarded() = ts__LLC__FRAMES__DISCARDED(frames__discarded);
tmp_222.bVCI() = ts__BSSGP__BVCI(bvci);
tmp_222.number__of__octets__deleted() = ts__NO__OCT__AFF(oct__deleted);
tmp_222.pFI() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__LLC__DISCARDED(const OCTETSTRING_template& tlli, const INTEGER_template& frames__discarded, const INTEGER_template& bvci, const INTEGER_template& oct__deleted)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2380, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_LLC_DISCARDED");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__LLC__DISCARDED_template& tmp_223 = ret_val.pDU__BSSGP__LLC__DISCARDED();
tmp_223.bssgpPduType() = os_48;
tmp_223.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_223.lLC__Frames__Discarded() = tr__LLC__FRAMES__DISCARDED(frames__discarded);
tmp_223.bVCI() = tr__BSSGP__BVCI(bvci);
tmp_223.number__of__octets__deleted() = tr__NO__OCT__AFF(oct__deleted);
tmp_223.pFI() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__RA__CAP(const OCTETSTRING& tlli, const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& racap)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2394, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_RA_CAP");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RA__CAPABILITY_template& tmp_224 = ret_val.pDU__BSSGP__RA__CAPABILITY();
tmp_224.bssgpPduType() = os_3;
tmp_224.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_224.mS__Radio__Access__Capability() = ts__BSSGP__IE__MSRAcap__omit(racap);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__RA__CAP(const OCTETSTRING_template& tlli, const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& racap)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2402, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_RA_CAP");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RA__CAPABILITY_template& tmp_225 = ret_val.pDU__BSSGP__RA__CAPABILITY();
tmp_225.bssgpPduType() = os_3;
tmp_225.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_225.mS__Radio__Access__Capability() = tr__BSSGP__IE__MSRAcap(racap);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__RA__CAP__UPD(const OCTETSTRING& tlli, const OCTETSTRING& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2413, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_RA_CAP_UPD");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RA__CAPABILITY__UPDATE_template& tmp_226 = ret_val.pDU__BSSGP__RA__CAPABILITY__UPDATE();
tmp_226.bssgpPduType() = os_10;
tmp_226.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_226.tag() = ts__BSSGP__IE__Tag(tag);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__RA__CAP__UPD(const OCTETSTRING_template& tlli, const OCTETSTRING_template& tag)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2420, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_RA_CAP_UPD");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RA__CAPABILITY__UPDATE_template& tmp_227 = ret_val.pDU__BSSGP__RA__CAPABILITY__UPDATE();
tmp_227.bssgpPduType() = os_10;
tmp_227.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_227.tag() = tr__BSSGP__IE__Tag(tag);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__RA__CAP__UPD__ACK(const OCTETSTRING& tlli, const OCTETSTRING& tag, const OCTETSTRING_template& cause, const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& racap)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2431, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_RA_CAP_UPD_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template& tmp_228 = ret_val.pDU__BSSGP__RA__CAPABILITY__UPDATE__ACK();
tmp_228.bssgpPduType() = os_13;
tmp_228.tLLI() = ts__BSSGP__TLLI(OCTETSTRING_template(tlli));
tmp_228.tag() = ts__BSSGP__IE__Tag(tag);
tmp_228.iMSI() = OMIT_VALUE;
tmp_228.rA__Cap__UPDATE__CAUSE() = ts__BSSGP__IE__RACU__Cause(cause);
tmp_228.mS__Radio__Access__Capability() = ts__BSSGP__IE__MSRAcap__omit(racap);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__RA__CAP__UPD__ACK(const OCTETSTRING_template& tlli, const OCTETSTRING_template& tag, const OCTETSTRING_template& cause, const BSSGP__Types::MSRadioAccessCapabilityV__BSSGP_template& racap)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2443, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_RA_CAP_UPD_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RA__CAPABILITY__UPDATE__ACK_template& tmp_229 = ret_val.pDU__BSSGP__RA__CAPABILITY__UPDATE__ACK();
tmp_229.bssgpPduType() = os_13;
tmp_229.tLLI() = tr__BSSGP__TLLI(tlli);
tmp_229.tag() = tr__BSSGP__IE__Tag(tag);
tmp_229.iMSI() = OMIT_VALUE;
tmp_229.rA__Cap__UPDATE__CAUSE() = tr__BSSGP__IE__RACU__Cause(cause);
tmp_229.mS__Radio__Access__Capability() = tr__BSSGP__IE__MSRAcap(racap);
}
return ret_val;
}

void BssgpRadioCause_encoder(const BssgpRadioCause& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.BssgpRadioCause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(BssgpRadioCause_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER BssgpRadioCause_decoder(OCTETSTRING& input_stream, BssgpRadioCause& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.BssgpRadioCause' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(BssgpRadioCause_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

BSSGP__Types::Radio__Cause_template ts__BSSGP__RADIO__CAUSE(const BssgpRadioCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2464, TTCN_Location::LOCATION_FUNCTION, "ts_BSSGP_RADIO_CAUSE");
current_location.update_lineno(2465);
/* Osmocom_Gb_Types.ttcn, line 2465 */
BSSGP__Types::Radio__Cause_template ret;
current_location.update_lineno(2466);
/* Osmocom_Gb_Types.ttcn, line 2466 */
if (cause.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(2467);
/* Osmocom_Gb_Types.ttcn, line 2467 */
ret = OMIT_VALUE;
}
else {
current_location.update_lineno(2469);
/* Osmocom_Gb_Types.ttcn, line 2469 */
ret.iEI() = os_49;
current_location.update_lineno(2470);
/* Osmocom_Gb_Types.ttcn, line 2470 */
ret.ext() = bs_2;
current_location.update_lineno(2471);
/* Osmocom_Gb_Types.ttcn, line 2471 */
{
BSSGP__Types::LIN2__2a_template& tmp_234 = ret.lengthIndicator();
tmp_234.length1() = 1;
}
current_location.update_lineno(2472);
/* Osmocom_Gb_Types.ttcn, line 2472 */
ret.radio__Cause__Value() = int2oct(BssgpRadioCause::enum2int(cause.valueof()), 1);
}
current_location.update_lineno(2474);
/* Osmocom_Gb_Types.ttcn, line 2474 */
return ret;
}

BSSGP__Types::Radio__Cause_template tr__BSSGP__RADIO__CAUSE(const BssgpRadioCause_template& cause)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2476, TTCN_Location::LOCATION_FUNCTION, "tr_BSSGP_RADIO_CAUSE");
current_location.update_lineno(2477);
/* Osmocom_Gb_Types.ttcn, line 2477 */
BSSGP__Types::Radio__Cause_template ret;
current_location.update_lineno(2478);
/* Osmocom_Gb_Types.ttcn, line 2478 */
ret.iEI() = os_49;
current_location.update_lineno(2479);
/* Osmocom_Gb_Types.ttcn, line 2479 */
ret.ext() = bs_2;
current_location.update_lineno(2480);
/* Osmocom_Gb_Types.ttcn, line 2480 */
{
BSSGP__Types::LIN2__2a_template& tmp_239 = ret.lengthIndicator();
tmp_239.length1() = 1;
}
current_location.update_lineno(2481);
/* Osmocom_Gb_Types.ttcn, line 2481 */
if (cause.is_value()) {
current_location.update_lineno(2482);
/* Osmocom_Gb_Types.ttcn, line 2482 */
ret.radio__Cause__Value() = int2oct(BssgpRadioCause::enum2int(cause.valueof()), 1);
}
else {
current_location.update_lineno(2484);
/* Osmocom_Gb_Types.ttcn, line 2484 */
ret.radio__Cause__Value() = ANY_VALUE;
}
current_location.update_lineno(2486);
/* Osmocom_Gb_Types.ttcn, line 2486 */
return ret;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__RADIO__STATUS(const OCTETSTRING_template& tlli, const BssgpRadioCause_template& cause, const INTEGER_template& tmsi, const HEXSTRING_template& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2490, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_RADIO_STATUS");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RADIO__STATUS_template& tmp_242 = ret_val.pDU__BSSGP__RADIO__STATUS();
tmp_242.bssgpPduType() = os_9;
tmp_242.tLLI() = f__ts__BSSGP__TLLI(tlli);
tmp_242.tMSI() = f__ts__BSSGP__TMSI(tmsi);
tmp_242.iMSI() = f__ts__BSSGP__IMSI(imsi);
tmp_242.radio__Cause() = ts__BSSGP__RADIO__CAUSE(cause);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__RADIO__STATUS(const OCTETSTRING_template& tlli, const BssgpRadioCause_template& cause, const INTEGER_template& tmsi, const HEXSTRING_template& imsi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2502, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_RADIO_STATUS");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RADIO__STATUS_template& tmp_243 = ret_val.pDU__BSSGP__RADIO__STATUS();
tmp_243.bssgpPduType() = os_9;
tmp_243.tLLI() = f__tr__BSSGP__TLLI(tlli);
tmp_243.tMSI() = f__tr__BSSGP__TMSI(tmsi);
tmp_243.iMSI() = f__tr__BSSGP__IMSI(imsi);
tmp_243.radio__Cause() = tr__BSSGP__RADIO__CAUSE(cause);
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__BSSGP__INVOKE__TRACE(const OCTETSTRING& eq__trace, const OCTETSTRING& ref)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2515, TTCN_Location::LOCATION_TEMPLATE, "ts_BSSGP_INVOKE_TRACE");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__SGSN__INVOKE__TRACE_template& tmp_244 = ret_val.pDU__BSSGP__SGSN__INVOKE__TRACE();
tmp_244.bssgpPduType() = os_50;
{
BSSGP__Types::Trace__Type__BSSGP_template& tmp_245 = tmp_244.traceType();
tmp_245.iEI() = os_28;
tmp_245.ext() = bs_2;
tmp_245.lengthIndicator().length1() = 1;
tmp_245.equipment__Trace() = eq__trace;
}
{
BSSGP__Types::Trace__Reference__BSSGP_template& tmp_246 = tmp_244.traceReference();
tmp_246.iEI() = os_31;
tmp_246.ext() = bs_2;
tmp_246.lengthIndicator().length1() = 2;
tmp_246.trace__Reference() = ref;
}
tmp_244.triggerId() = OMIT_VALUE;
tmp_244.mobileId() = OMIT_VALUE;
tmp_244.omcId() = OMIT_VALUE;
tmp_244.transactionId() = OMIT_VALUE;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__BSSGP__INVOKE__TRACE(const OCTETSTRING_template& eq__trace, const OCTETSTRING_template& ref)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2541, TTCN_Location::LOCATION_TEMPLATE, "tr_BSSGP_INVOKE_TRACE");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__SGSN__INVOKE__TRACE_template& tmp_247 = ret_val.pDU__BSSGP__SGSN__INVOKE__TRACE();
tmp_247.bssgpPduType() = os_50;
{
BSSGP__Types::Trace__Type__BSSGP_template& tmp_248 = tmp_247.traceType();
tmp_248.iEI() = os_28;
tmp_248.ext() = bs_2;
tmp_248.lengthIndicator().length1() = 1;
tmp_248.equipment__Trace() = eq__trace;
}
{
BSSGP__Types::Trace__Reference__BSSGP_template& tmp_249 = tmp_247.traceReference();
tmp_249.iEI() = os_31;
tmp_249.ext() = bs_2;
tmp_249.lengthIndicator().length1() = 2;
tmp_249.trace__Reference() = ref;
}
tmp_247.triggerId() = ANY_OR_OMIT;
tmp_247.mobileId() = ANY_OR_OMIT;
tmp_247.omcId() = ANY_OR_OMIT;
tmp_247.transactionId() = ANY_OR_OMIT;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__OVERLOAD(const BITSTRING_template& priority__class)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2569, TTCN_Location::LOCATION_TEMPLATE, "ts_OVERLOAD");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__OVERLOAD_template& tmp_250 = ret_val.pDU__BSSGP__OVERLOAD();
tmp_250.bssgpPduType() = os_51;
{
BSSGP__Types::Priority__Class__Indicator_template& tmp_251 = tmp_250.priority__Class__Indicator();
tmp_251.iEI() = os_52;
tmp_251.ext() = bs_2;
tmp_251.lengthIndicator().length1() = 1;
tmp_251.priority__Class__Indicator__Value() = priority__class;
tmp_251.spare() = bs_3;
}
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__OVERLOAD(const BITSTRING_template& priority__class)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2584, TTCN_Location::LOCATION_TEMPLATE, "tr_OVERLOAD");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__OVERLOAD_template& tmp_252 = ret_val.pDU__BSSGP__OVERLOAD();
tmp_252.bssgpPduType() = os_51;
{
BSSGP__Types::Priority__Class__Indicator_template& tmp_253 = tmp_252.priority__Class__Indicator();
tmp_253.iEI() = os_52;
tmp_253.ext() = bs_2;
tmp_253.lengthIndicator().length1() = 1;
tmp_253.priority__Class__Indicator__Value() = priority__class;
tmp_253.spare() = bs_3;
}
}
return ret_val;
}

BSSGP__Types::RIM__Application__Identity_template ts__RIM__Application__Identity(const OCTETSTRING& app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2606, TTCN_Location::LOCATION_TEMPLATE, "ts_RIM_Application_Identity");
BSSGP__Types::RIM__Application__Identity_template ret_val;
ret_val.iEI() = os_53;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.rIMApplicationIdentity() = app__id;
return ret_val;
}

BSSGP__Types::RIM__Application__Identity_template tr__RIM__Application__Identity(const OCTETSTRING_template& app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2614, TTCN_Location::LOCATION_TEMPLATE, "tr_RIM_Application_Identity");
BSSGP__Types::RIM__Application__Identity_template ret_val;
ret_val.iEI() = os_53;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.rIMApplicationIdentity() = app__id;
return ret_val;
}

BSSGP__Types::RIM__Sequence__Number_template ts__RIM__Sequence__Number(const INTEGER& seq)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2624, TTCN_Location::LOCATION_TEMPLATE, "ts_RIM_Sequence_Number");
BSSGP__Types::RIM__Sequence__Number_template ret_val;
ret_val.iEI() = os_54;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 4;
ret_val.rIMSequenceNumber() = int2oct(seq, 4);
return ret_val;
}

BSSGP__Types::RIM__Sequence__Number_template tr__RIM__Sequence__Number(const INTEGER_template& seq)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2632, TTCN_Location::LOCATION_FUNCTION, "tr_RIM_Sequence_Number");
current_location.update_lineno(2633);
/* Osmocom_Gb_Types.ttcn, line 2633 */
BSSGP__Types::RIM__Sequence__Number_template ret;
current_location.update_lineno(2634);
/* Osmocom_Gb_Types.ttcn, line 2634 */
ret.iEI() = os_54;
current_location.update_lineno(2635);
/* Osmocom_Gb_Types.ttcn, line 2635 */
ret.ext() = bs_2;
current_location.update_lineno(2636);
/* Osmocom_Gb_Types.ttcn, line 2636 */
{
BSSGP__Types::LIN2__2a_template& tmp_257 = ret.lengthIndicator();
tmp_257.length1() = 4;
}
current_location.update_lineno(2637);
/* Osmocom_Gb_Types.ttcn, line 2637 */
if (seq.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(2638);
/* Osmocom_Gb_Types.ttcn, line 2638 */
ret.rIMSequenceNumber() = ANY_OR_OMIT;
}
else {
current_location.update_lineno(2639);
/* Osmocom_Gb_Types.ttcn, line 2639 */
if (seq.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(2640);
/* Osmocom_Gb_Types.ttcn, line 2640 */
ret.rIMSequenceNumber() = ANY_VALUE;
}
else {
current_location.update_lineno(2642);
/* Osmocom_Gb_Types.ttcn, line 2642 */
ret.rIMSequenceNumber() = int2oct(seq.valueof(), 4);
}
}
current_location.update_lineno(2644);
/* Osmocom_Gb_Types.ttcn, line 2644 */
return ret;
}

BSSGP__Types::RAN__Information__Request__RIM__Container_template ts__RAN__Information__Request__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::RIM__Sequence__Number_template& seq, const BSSGP__Types::RIM__PDU__Indications_template& ind, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::RAN__Information__Request__Application__Container_template& app__cont, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2648, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Request_RIM_Container");
BSSGP__Types::RAN__Information__Request__RIM__Container_template ret_val;
ret_val.iEI() = os_55;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__Sequence__Number() = seq;
ret_val.rIM__PDU__Indications() = ind;
ret_val.rIM__Protocol__Version__Number() = ver;
ret_val.application__Container() = app__cont;
ret_val.sON__Transfer__Application__Identity__TLV() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__Request__RIM__Container_template tr__RAN__Information__Request__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::RIM__Sequence__Number_template& seq, const BSSGP__Types::RIM__PDU__Indications_template& ind, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::RAN__Information__Request__Application__Container_template& app__cont, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2667, TTCN_Location::LOCATION_TEMPLATE, "tr_RAN_Information_Request_RIM_Container");
BSSGP__Types::RAN__Information__Request__RIM__Container_template ret_val;
ret_val.iEI() = os_55;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = ANY_VALUE;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__Sequence__Number() = seq;
ret_val.rIM__PDU__Indications() = ind;
ret_val.rIM__Protocol__Version__Number() = ver;
ret_val.application__Container() = app__cont;
ret_val.sON__Transfer__Application__Identity__TLV() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__RIM__Container_template ts__RAN__Information__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::RIM__Sequence__Number_template& seq, const BSSGP__Types::RIM__PDU__Indications_template& ind, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::ApplContainer__or__ApplErrContainer_template& app__cont__or__app__err, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2689, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_RIM_Container");
BSSGP__Types::RAN__Information__RIM__Container_template ret_val;
ret_val.iEI() = os_56;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__Sequence__Number() = seq;
ret_val.rIM__PDU__Indications() = ind;
ret_val.rIM__Protocol__Version__Number() = ver;
ret_val.applContainer__or__ApplErrContainer() = app__cont__or__app__err;
ret_val.sON__Transfer__Application__Identity() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__RIM__Container_template tr__RAN__Information__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::RIM__Sequence__Number_template& seq, const BSSGP__Types::RIM__PDU__Indications_template& ind, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::ApplContainer__or__ApplErrContainer_template& app__cont__or__app__err, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2709, TTCN_Location::LOCATION_TEMPLATE, "tr_RAN_Information_RIM_Container");
BSSGP__Types::RAN__Information__RIM__Container_template ret_val;
ret_val.iEI() = os_56;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = ANY_VALUE;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__Sequence__Number() = seq;
ret_val.rIM__PDU__Indications() = ind;
ret_val.rIM__Protocol__Version__Number() = ver;
ret_val.applContainer__or__ApplErrContainer() = app__cont__or__app__err;
ret_val.sON__Transfer__Application__Identity() = son__app__id;
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer_template tsu__ApplContainer__or__ApplErrContainer__NACC(const BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2729, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplContainer_or_ApplErrContainer_NACC");
BSSGP__Types::ApplContainer__or__ApplErrContainer_template ret_val;
ret_val.nacc() = cont;
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer_template tru__ApplContainer__or__ApplErrContainer__NACC(const BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2733, TTCN_Location::LOCATION_TEMPLATE, "tru_ApplContainer_or_ApplErrContainer_NACC");
BSSGP__Types::ApplContainer__or__ApplErrContainer_template ret_val;
ret_val.nacc() = cont;
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer_template tsu__ApplContainer__or__ApplErrContainer__SI3(const BSSGP__Types::ApplContainer__or__ApplErrContainer__SI3_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2737, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplContainer_or_ApplErrContainer_SI3");
BSSGP__Types::ApplContainer__or__ApplErrContainer_template ret_val;
ret_val.si3() = cont;
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer_template tsu__ApplContainer__or__ApplErrContainer__MBMS__data__channel(const BSSGP__Types::ApplContainer__or__ApplErrContainer__MBMS__data__channel_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2741, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplContainer_or_ApplErrContainer_MBMS_data_channel");
BSSGP__Types::ApplContainer__or__ApplErrContainer_template ret_val;
ret_val.mBMS__data__channel() = cont;
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template tsu__ApplContainer__NACC(const BssgpCellId_template& cid, const BOOLEAN& psi__type, const INTEGER& si__psi__num, const OCTETSTRING& si__psi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2745, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplContainer_NACC");
BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template ret_val;
ret_val.application__Container() = ts__RAN__Information__Application__Container__NACC(cid, psi__type, si__psi__num, si__psi);
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template tru__ApplContainer__NACC(const BssgpCellId_template& cid, const BOOLEAN_template& psi__type, const INTEGER_template& si__psi__num, const OCTETSTRING_template& si__psi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2749, TTCN_Location::LOCATION_TEMPLATE, "tru_ApplContainer_NACC");
BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template ret_val;
ret_val.application__Container() = tr__RAN__Information__Application__Container__NACC(cid, psi__type, si__psi__num, si__psi);
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template tsu__ApplErrContainer__NACC(const BssgpCellId_template& cid, const INTEGER& cause, const BSSGP__Types::Application__Container__IE__NACC_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2753, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplErrContainer_NACC");
BSSGP__Types::ApplContainer__or__ApplErrContainer__NACC_template ret_val;
ret_val.application__Error__Container() = ts__Application__Error__Container__NACC(cid, cause, app__cont);
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer__SI3_template tsu__ApplContainer__SI3(const BssgpCellId_template& cid, const BSSGP__Types::SI3_template& si3)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2759, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplContainer_SI3");
BSSGP__Types::ApplContainer__or__ApplErrContainer__SI3_template ret_val;
ret_val.application__Container() = ts__RAN__Information__Application__Container__SI3(cid, si3);
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer__SI3_template tsu__ApplErrContainer__SI3(const BssgpCellId_template& cid, const INTEGER& cause, const BSSGP__Types::Application__Container__IE__SI3_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2763, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplErrContainer_SI3");
BSSGP__Types::ApplContainer__or__ApplErrContainer__SI3_template ret_val;
ret_val.application__Error__Container() = ts__Application__Error__Container__SI3(cid, cause, app__cont);
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer__MBMS__data__channel_template tsu__ApplContainer__MBMS__data__channel(const BssgpCellId_template& cid, const OCTETSTRING& data__ch__report)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2769, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplContainer_MBMS_data_channel");
BSSGP__Types::ApplContainer__or__ApplErrContainer__MBMS__data__channel_template ret_val;
ret_val.application__Container() = ts__RAN__Information__Application__Container__MBMS__data__channel(cid, data__ch__report);
return ret_val;
}

BSSGP__Types::ApplContainer__or__ApplErrContainer__MBMS__data__channel_template tsu__ApplErrContainer__MBMS__data__channel(const BssgpCellId_template& cid, const INTEGER& cause, const BSSGP__Types::Application__Container__IE__MBMS__data__channel_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2773, TTCN_Location::LOCATION_TEMPLATE, "tsu_ApplErrContainer_MBMS_data_channel");
BSSGP__Types::ApplContainer__or__ApplErrContainer__MBMS__data__channel_template ret_val;
ret_val.application__Error__Container() = ts__Application__Error__Container__MBMS__data__channel(cid, cause, app__cont);
return ret_val;
}

BSSGP__Types::RAN__Information__Ack__RIM__Container_template ts__RAN__Information__Ack__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::RIM__Sequence__Number_template& seq, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2781, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Ack_RIM_Container");
BSSGP__Types::RAN__Information__Ack__RIM__Container_template ret_val;
ret_val.iEI() = os_57;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__Sequence__Number() = seq;
ret_val.rIM__Protocol__Version__Number() = ver;
ret_val.sON__Transfer__Application__Identity() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__Ack__RIM__Container_template tr__RAN__Information__Ack__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::RIM__Sequence__Number_template& seq, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2796, TTCN_Location::LOCATION_TEMPLATE, "tr_RAN_Information_Ack_RIM_Container");
BSSGP__Types::RAN__Information__Ack__RIM__Container_template ret_val;
ret_val.iEI() = os_57;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = ANY_VALUE;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__Sequence__Number() = seq;
ret_val.rIM__Protocol__Version__Number() = ver;
ret_val.sON__Transfer__Application__Identity() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__Error__RIM__Container_template ts__RAN__Information__Error__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::Cause__BSSGP_template& cause, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::PDU__BSSGP& pdu, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2813, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Error_RIM_Container");
BSSGP__Types::RAN__Information__Error__RIM__Container_template ret_val;
ret_val.iEI() = os_58;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__cause() = cause;
ret_val.rIM__Protocol__Version__Number() = ver;
{
BSSGP__Types::PDU__in__Error_template& tmp_261 = ret_val.pDU__in__Error();
tmp_261.iEI() = os_38;
tmp_261.ext() = bs_2;
tmp_261.lengthIndicator().length1() = 0;
tmp_261.erroneous__BSSGP__PDU() = BSSGP__Types::enc__PDU__BSSGP(pdu);
}
ret_val.sON__Transfer__Application__Identity() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__Error__RIM__Container_template tr__RAN__Information__Error__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::Cause__BSSGP_template& cause, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const OCTETSTRING_template& pdu, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2837, TTCN_Location::LOCATION_TEMPLATE, "tr_RAN_Information_Error_RIM_Container");
BSSGP__Types::RAN__Information__Error__RIM__Container_template ret_val;
ret_val.iEI() = os_58;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = ANY_VALUE;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__cause() = cause;
ret_val.rIM__Protocol__Version__Number() = ver;
{
BSSGP__Types::PDU__in__Error_template& tmp_262 = ret_val.pDU__in__Error();
tmp_262.iEI() = os_38;
tmp_262.ext() = bs_2;
tmp_262.lengthIndicator().length1() = ANY_VALUE;
tmp_262.erroneous__BSSGP__PDU() = pdu;
}
ret_val.sON__Transfer__Application__Identity() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__Application__Error__RIM__Container_template ts__RAN__Information__Application__Error__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::RIM__Sequence__Number_template& seq, const BSSGP__Types::RIM__PDU__Indications_template& ind, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::Application__Error__Container_template& cont, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2863, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Application_Error_RIM_Container");
BSSGP__Types::RAN__Information__Application__Error__RIM__Container_template ret_val;
ret_val.iEI() = os_59;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__Sequence__Number() = seq;
ret_val.rIM__PDU__Indications() = ind;
ret_val.rIM__Protocol__Version__Number() = ver;
ret_val.application__Error__Container() = cont;
ret_val.sON__Transfer__Application__Identity() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__Application__Error__RIM__Container_template tr__RAN__Information__Application__Error__RIM__Container(const BSSGP__Types::RIM__Application__Identity_template& app__id, const BSSGP__Types::RIM__Sequence__Number_template& seq, const BSSGP__Types::RIM__PDU__Indications_template& ind, const BSSGP__Types::RIM__Protocol__Version__Number_template& ver, const BSSGP__Types::Application__Error__Container_template& cont, const BSSGP__Types::SON__Transfer__Application__Identity__TLV_template& son__app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2882, TTCN_Location::LOCATION_TEMPLATE, "tr_RAN_Information_Application_Error_RIM_Container");
BSSGP__Types::RAN__Information__Application__Error__RIM__Container_template ret_val;
ret_val.iEI() = os_59;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = ANY_VALUE;
ret_val.rIM__Application__Identity() = app__id;
ret_val.rIM__Sequence__Number() = seq;
ret_val.rIM__PDU__Indications() = ind;
ret_val.rIM__Protocol__Version__Number() = ver;
ret_val.application__Error__Container() = cont;
ret_val.sON__Transfer__Application__Identity() = son__app__id;
return ret_val;
}

BSSGP__Types::RAN__Information__Request__Application__Container_template tsu__RAN__Information__Request__Application__Container__NACC(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2904, TTCN_Location::LOCATION_TEMPLATE, "tsu_RAN_Information_Request_Application_Container_NACC");
BSSGP__Types::RAN__Information__Request__Application__Container_template ret_val;
ret_val.nacc() = ts__RAN__Information__Request__Application__Container__NACC(cid);
return ret_val;
}

BSSGP__Types::RAN__Information__Request__Application__Container_template tsu__RAN__Information__Request__Application__Container__SI3(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2908, TTCN_Location::LOCATION_TEMPLATE, "tsu_RAN_Information_Request_Application_Container_SI3");
BSSGP__Types::RAN__Information__Request__Application__Container_template ret_val;
ret_val.si3() = ts__RAN__Information__Request__Application__Container__SI3(cid);
return ret_val;
}

BSSGP__Types::RAN__Information__Request__Application__Container_template tsu__RAN__Information__Request__Application__Container__MBMS__data__channel(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2912, TTCN_Location::LOCATION_TEMPLATE, "tsu_RAN_Information_Request_Application_Container_MBMS_data_channel");
BSSGP__Types::RAN__Information__Request__Application__Container_template ret_val;
ret_val.mBMS__data__channel() = ts__RAN__Information__Request__Application__Container__MBMS__data__channel(cid);
return ret_val;
}

BSSGP__Types::RAN__Information__Request__Application__Container__NACC_template ts__RAN__Information__Request__Application__Container__NACC(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2927, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Request_Application_Container_NACC");
BSSGP__Types::RAN__Information__Request__Application__Container__NACC_template ret_val;
ret_val.iEI() = os_60;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.reporting__Cell__Identifier() = ts__Cell__Identifier__V(cid);
return ret_val;
}

BSSGP__Types::RAN__Information__Request__Application__Container__NACC_template tr__RAN__Information__Request__Application__Container__NACC(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2936, TTCN_Location::LOCATION_TEMPLATE, "tr_RAN_Information_Request_Application_Container_NACC");
BSSGP__Types::RAN__Information__Request__Application__Container__NACC_template ret_val;
ret_val.iEI() = os_60;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = ANY_VALUE;
ret_val.reporting__Cell__Identifier() = tr__Cell__Identifier__V(cid);
return ret_val;
}

BSSGP__Types::RAN__Information__Request__Application__Container__SI3_template ts__RAN__Information__Request__Application__Container__SI3(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2947, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Request_Application_Container_SI3");
BSSGP__Types::RAN__Information__Request__Application__Container__SI3_template ret_val;
ret_val.iEI() = os_60;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.reporting__Cell__Identifier() = ts__Cell__Identifier__V(cid);
return ret_val;
}

BSSGP__Types::RAN__Information__Request__Application__Container__MBMS__data__channel_template ts__RAN__Information__Request__Application__Container__MBMS__data__channel(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2958, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Request_Application_Container_MBMS_data_channel");
BSSGP__Types::RAN__Information__Request__Application__Container__MBMS__data__channel_template ret_val;
ret_val.iEI() = os_60;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.reporting__Cell__Identifier() = ts__Cell__Identifier__V(cid);
return ret_val;
}

BSSGP__Types::RAN__Information__Application__Container__NACC_template ts__RAN__Information__Application__Container__NACC(const BssgpCellId_template& cid, const BOOLEAN& psi__type, const INTEGER& si__psi__num, const OCTETSTRING& si__psi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2969, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Application_Container_NACC");
BSSGP__Types::RAN__Information__Application__Container__NACC_template ret_val;
ret_val.iEI() = os_61;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.reporting__Cell__Identifier() = ts__Cell__Identifier__V(cid);
ret_val.typeBit() = Osmocom__Types::bool2bit(psi__type);
ret_val.number__of__SI__PSI() = int2bit(si__psi__num, 7);
ret_val.sI__PSI() = si__psi;
return ret_val;
}

BSSGP__Types::RAN__Information__Application__Container__NACC_template tr__RAN__Information__Application__Container__NACC(const BssgpCellId_template& cid, const BOOLEAN_template& psi__type, const INTEGER_template& si__psi__num, const OCTETSTRING_template& si__psi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 2981, TTCN_Location::LOCATION_FUNCTION, "tr_RAN_Information_Application_Container_NACC");
current_location.update_lineno(2984);
/* Osmocom_Gb_Types.ttcn, line 2984 */
BSSGP__Types::RAN__Information__Application__Container__NACC_template ret;
current_location.update_lineno(2985);
/* Osmocom_Gb_Types.ttcn, line 2985 */
ret.iEI() = os_61;
current_location.update_lineno(2986);
/* Osmocom_Gb_Types.ttcn, line 2986 */
ret.ext() = bs_2;
current_location.update_lineno(2987);
/* Osmocom_Gb_Types.ttcn, line 2987 */
{
BSSGP__Types::LIN2__2a_template& tmp_266 = ret.lengthIndicator();
tmp_266.length1() = ANY_VALUE;
}
current_location.update_lineno(2988);
/* Osmocom_Gb_Types.ttcn, line 2988 */
ret.reporting__Cell__Identifier() = tr__Cell__Identifier__V(cid);
current_location.update_lineno(2989);
/* Osmocom_Gb_Types.ttcn, line 2989 */
if (psi__type.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(2990);
/* Osmocom_Gb_Types.ttcn, line 2990 */
ret.typeBit() = ANY_OR_OMIT;
}
else {
current_location.update_lineno(2991);
/* Osmocom_Gb_Types.ttcn, line 2991 */
if (psi__type.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(2992);
/* Osmocom_Gb_Types.ttcn, line 2992 */
ret.typeBit() = ANY_VALUE;
}
else {
current_location.update_lineno(2994);
/* Osmocom_Gb_Types.ttcn, line 2994 */
ret.typeBit() = Osmocom__Types::bool2bit(psi__type.valueof());
}
}
current_location.update_lineno(2996);
/* Osmocom_Gb_Types.ttcn, line 2996 */
if (si__psi__num.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(2997);
/* Osmocom_Gb_Types.ttcn, line 2997 */
ret.number__of__SI__PSI() = ANY_OR_OMIT;
}
else {
current_location.update_lineno(2998);
/* Osmocom_Gb_Types.ttcn, line 2998 */
if (si__psi__num.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(2999);
/* Osmocom_Gb_Types.ttcn, line 2999 */
ret.number__of__SI__PSI() = ANY_VALUE;
}
else {
current_location.update_lineno(3001);
/* Osmocom_Gb_Types.ttcn, line 3001 */
ret.number__of__SI__PSI() = int2bit(si__psi__num.valueof(), 7);
}
}
current_location.update_lineno(3003);
/* Osmocom_Gb_Types.ttcn, line 3003 */
ret.sI__PSI() = si__psi;
current_location.update_lineno(3004);
/* Osmocom_Gb_Types.ttcn, line 3004 */
return ret;
}

BSSGP__Types::RAN__Information__Application__Container__SI3_template ts__RAN__Information__Application__Container__SI3(const BssgpCellId_template& cid, const BSSGP__Types::SI3_template& si3)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3008, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Application_Container_SI3");
BSSGP__Types::RAN__Information__Application__Container__SI3_template ret_val;
ret_val.iEI() = os_61;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.reporting__Cell__Identifier() = ts__Cell__Identifier__V(cid);
ret_val.sI3() = si3;
return ret_val;
}

BSSGP__Types::RAN__Information__Application__Container__MBMS__data__channel_template ts__RAN__Information__Application__Container__MBMS__data__channel(const BssgpCellId_template& cid, const OCTETSTRING& data__ch__report)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3020, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_Information_Application_Container_MBMS_data_channel");
BSSGP__Types::RAN__Information__Application__Container__MBMS__data__channel_template ret_val;
ret_val.iEI() = os_61;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.reporting__Cell__Identifier() = ts__Cell__Identifier__V(cid);
ret_val.mBMS__data__channel__report() = data__ch__report;
return ret_val;
}

BSSGP__Types::Application__Error__Container_template tsu__Application__Error__Container__NACC(const BssgpCellId_template& cid, const INTEGER& cause, const BSSGP__Types::Application__Container__IE__NACC_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3033, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Error_Container_NACC");
BSSGP__Types::Application__Error__Container_template ret_val;
ret_val.nacc() = ts__Application__Error__Container__NACC(cid, cause, app__cont);
return ret_val;
}

BSSGP__Types::Application__Error__Container_template rsu__Application__Error__Container__NACC(const BssgpCellId_template& cid, const INTEGER_template& cause, const BSSGP__Types::Application__Container__IE__NACC_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3039, TTCN_Location::LOCATION_TEMPLATE, "rsu_Application_Error_Container_NACC");
BSSGP__Types::Application__Error__Container_template ret_val;
ret_val.nacc() = tr__Application__Error__Container__NACC(cid, cause, app__cont);
return ret_val;
}

BSSGP__Types::Application__Error__Container_template tsu__Application__Error__Container__SI3(const BssgpCellId_template& cid, const INTEGER& cause, const BSSGP__Types::Application__Container__IE__SI3_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3045, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Error_Container_SI3");
BSSGP__Types::Application__Error__Container_template ret_val;
ret_val.si3() = ts__Application__Error__Container__SI3(cid, cause, app__cont);
return ret_val;
}

BSSGP__Types::Application__Error__Container_template tsu__Application__Error__Container__MBMS__data__channel(const BssgpCellId_template& cid, const INTEGER& cause, const BSSGP__Types::Application__Container__IE__MBMS__data__channel_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3051, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Error_Container_MBMS_data_channel");
BSSGP__Types::Application__Error__Container_template ret_val;
ret_val.mBMS__data__channel() = ts__Application__Error__Container__MBMS__data__channel(cid, cause, app__cont);
return ret_val;
}

BSSGP__Types::Application__Error__Container__NACC_template ts__Application__Error__Container__NACC(const BssgpCellId_template& , const INTEGER& cause, const BSSGP__Types::Application__Container__IE__NACC_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3059, TTCN_Location::LOCATION_TEMPLATE, "ts_Application_Error_Container_NACC");
BSSGP__Types::Application__Error__Container__NACC_template ret_val;
ret_val.iEI() = os_62;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.nACC__cause() = int2oct(cause, 1);
ret_val.erroneousApplicationContainer() = app__cont;
return ret_val;
}

BSSGP__Types::Application__Error__Container__NACC_template tr__Application__Error__Container__NACC(const BssgpCellId_template& , const INTEGER_template& cause, const BSSGP__Types::Application__Container__IE__NACC_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3071, TTCN_Location::LOCATION_FUNCTION, "tr_Application_Error_Container_NACC");
current_location.update_lineno(3075);
/* Osmocom_Gb_Types.ttcn, line 3075 */
BSSGP__Types::Application__Error__Container__NACC_template ret;
current_location.update_lineno(3076);
/* Osmocom_Gb_Types.ttcn, line 3076 */
ret.iEI() = os_62;
current_location.update_lineno(3077);
/* Osmocom_Gb_Types.ttcn, line 3077 */
ret.ext() = bs_2;
current_location.update_lineno(3078);
/* Osmocom_Gb_Types.ttcn, line 3078 */
{
BSSGP__Types::LIN2__2a_template& tmp_278 = ret.lengthIndicator();
tmp_278.length1() = ANY_VALUE;
}
current_location.update_lineno(3079);
/* Osmocom_Gb_Types.ttcn, line 3079 */
ret.erroneousApplicationContainer() = app__cont;
current_location.update_lineno(3080);
/* Osmocom_Gb_Types.ttcn, line 3080 */
if (cause.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(3081);
/* Osmocom_Gb_Types.ttcn, line 3081 */
ret.nACC__cause() = ANY_OR_OMIT;
}
else {
current_location.update_lineno(3082);
/* Osmocom_Gb_Types.ttcn, line 3082 */
if (cause.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(3083);
/* Osmocom_Gb_Types.ttcn, line 3083 */
ret.nACC__cause() = ANY_VALUE;
}
else {
current_location.update_lineno(3085);
/* Osmocom_Gb_Types.ttcn, line 3085 */
ret.nACC__cause() = int2oct(cause.valueof(), 1);
}
}
current_location.update_lineno(3087);
/* Osmocom_Gb_Types.ttcn, line 3087 */
return ret;
}

BSSGP__Types::Application__Container__IE__NACC_template tsu__Application__Container__IE__NACC__req(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3090, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Container_IE_NACC_req");
BSSGP__Types::Application__Container__IE__NACC_template ret_val;
ret_val.rAN__Information__Request__Application__Container() = ts__RAN__Information__Request__Application__Container__NACC(cid);
return ret_val;
}

BSSGP__Types::Application__Container__IE__NACC_template rsu__Application__Container__IE__NACC__req(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3094, TTCN_Location::LOCATION_TEMPLATE, "rsu_Application_Container_IE_NACC_req");
BSSGP__Types::Application__Container__IE__NACC_template ret_val;
ret_val.rAN__Information__Request__Application__Container() = tr__RAN__Information__Request__Application__Container__NACC(cid);
return ret_val;
}

BSSGP__Types::Application__Container__IE__NACC_template tsu__Application__Container__IE__NACC(const BssgpCellId_template& cid, const BOOLEAN& psi__type, const INTEGER& si__psi__num, const OCTETSTRING& si__psi)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3098, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Container_IE_NACC");
BSSGP__Types::Application__Container__IE__NACC_template ret_val;
ret_val.rAN__Information__Application__Container() = ts__RAN__Information__Application__Container__NACC(cid, psi__type, si__psi__num, si__psi);
return ret_val;
}

BSSGP__Types::Application__Error__Container__SI3_template ts__Application__Error__Container__SI3(const BssgpCellId_template& , const INTEGER& cause, const BSSGP__Types::Application__Container__IE__SI3_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3104, TTCN_Location::LOCATION_TEMPLATE, "ts_Application_Error_Container_SI3");
BSSGP__Types::Application__Error__Container__SI3_template ret_val;
ret_val.iEI() = os_62;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.sI3__cause() = int2oct(cause, 1);
ret_val.erroneousApplicationContainer() = app__cont;
return ret_val;
}

BSSGP__Types::Application__Container__IE__SI3_template tsu__Application__Container__IE__SI3__req(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3116, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Container_IE_SI3_req");
BSSGP__Types::Application__Container__IE__SI3_template ret_val;
ret_val.rAN__Information__Request__Application__Container() = ts__RAN__Information__Request__Application__Container__SI3(cid);
return ret_val;
}

BSSGP__Types::Application__Container__IE__SI3_template tsu__Application__Container__IE__SI3(const BssgpCellId_template& cid, const BSSGP__Types::SI3_template& si3)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3120, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Container_IE_SI3");
BSSGP__Types::Application__Container__IE__SI3_template ret_val;
ret_val.rAN__Information__Application__Container() = ts__RAN__Information__Application__Container__SI3(cid, si3);
return ret_val;
}

BSSGP__Types::Application__Error__Container__MBMS__data__channel_template ts__Application__Error__Container__MBMS__data__channel(const BssgpCellId_template& , const INTEGER& cause, const BSSGP__Types::Application__Container__IE__MBMS__data__channel_template& app__cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3126, TTCN_Location::LOCATION_TEMPLATE, "ts_Application_Error_Container_MBMS_data_channel");
BSSGP__Types::Application__Error__Container__MBMS__data__channel_template ret_val;
ret_val.iEI() = os_62;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.mBMS__data__channel__cause() = int2oct(cause, 1);
ret_val.erroneousApplicationContainer() = app__cont;
return ret_val;
}

BSSGP__Types::Application__Container__IE__MBMS__data__channel_template tsu__Application__Container__IE__MBMS__data__channel__req(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3138, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Container_IE_MBMS_data_channel_req");
BSSGP__Types::Application__Container__IE__MBMS__data__channel_template ret_val;
ret_val.rAN__Information__Request__Application__Container() = ts__RAN__Information__Request__Application__Container__MBMS__data__channel(cid);
return ret_val;
}

BSSGP__Types::Application__Container__IE__MBMS__data__channel_template tsu__Application__Container__IE__MBMS__data__channel(const BssgpCellId_template& cid, const OCTETSTRING& data__ch__report)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3142, TTCN_Location::LOCATION_TEMPLATE, "tsu_Application_Container_IE_MBMS_data_channel");
BSSGP__Types::Application__Container__IE__MBMS__data__channel_template ret_val;
ret_val.rAN__Information__Application__Container() = ts__RAN__Information__Application__Container__MBMS__data__channel(cid, data__ch__report);
return ret_val;
}

BSSGP__Types::LocationAreaIdentification_template t__LocationAreaIdentification(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3149, TTCN_Location::LOCATION_FUNCTION, "t_LocationAreaIdentification");
current_location.update_lineno(3150);
/* Osmocom_Gb_Types.ttcn, line 3150 */
BSSGP__Types::LocationAreaIdentification_template ret;
ret.mccDigit1() = ANY_VALUE;
ret.mccDigit2() = ANY_VALUE;
ret.mccDigit3() = ANY_VALUE;
ret.mncDigit3() = ANY_VALUE;
ret.mncDigit1() = ANY_VALUE;
ret.mncDigit2() = ANY_VALUE;
ret.lac() = ANY_VALUE;
current_location.update_lineno(3159);
/* Osmocom_Gb_Types.ttcn, line 3159 */
if (cid.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(3160);
/* Osmocom_Gb_Types.ttcn, line 3160 */
return BSSGP__Types::LocationAreaIdentification_template(OMIT_VALUE);
}
else {
current_location.update_lineno(3161);
/* Osmocom_Gb_Types.ttcn, line 3161 */
if (cid.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(3162);
/* Osmocom_Gb_Types.ttcn, line 3162 */
return BSSGP__Types::LocationAreaIdentification_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(3163);
/* Osmocom_Gb_Types.ttcn, line 3163 */
if (cid.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(3164);
/* Osmocom_Gb_Types.ttcn, line 3164 */
return BSSGP__Types::LocationAreaIdentification_template(ANY_VALUE);
}
}
}
current_location.update_lineno(3166);
/* Osmocom_Gb_Types.ttcn, line 3166 */
{
boolean tmp_283;
{
boolean tmp_284;
tmp_284 = cid.is_value();
if (tmp_284) {
boolean tmp_285 = cid.is_bound();
if(tmp_285) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_285 = FALSE;
break;
case ANY_VALUE:
tmp_285 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_285) {
const BssgpCellId_template& tmp_286 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_287 = tmp_286.ra__id();
tmp_285 = tmp_287.is_value();
}
break;}
default:
tmp_285 = FALSE;
break;
}
}
tmp_284 = tmp_285;
}
tmp_283 = tmp_284;
}
if (tmp_283) {
boolean tmp_288 = cid.is_bound();
if(tmp_288) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_288 = FALSE;
break;
case ANY_VALUE:
tmp_288 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_288) {
const BssgpCellId_template& tmp_289 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_290 = tmp_289.ra__id();
tmp_288 = tmp_290.is_bound();
if(tmp_288) {
switch (tmp_290.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_288 = FALSE;
break;
case ANY_VALUE:
tmp_288 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_288) {
const GSM__Types::RoutingAreaIdentification_template& tmp_291 = tmp_290;
const GSM__Types::LocationAreaIdentification_template& tmp_292 = tmp_291.lai();
tmp_288 = tmp_292.is_value();
}
break;}
default:
tmp_288 = FALSE;
break;
}
}
}
break;}
default:
tmp_288 = FALSE;
break;
}
}
tmp_283 = tmp_288;
}
if (tmp_283) {
current_location.update_lineno(3167);
/* Osmocom_Gb_Types.ttcn, line 3167 */
{
boolean tmp_300;
{
boolean tmp_293 = cid.is_bound();
if(tmp_293) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_293 = FALSE;
break;
case ANY_VALUE:
tmp_293 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_293) {
const BssgpCellId_template& tmp_294 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_295 = tmp_294.ra__id();
tmp_293 = tmp_295.is_bound();
if(tmp_293) {
switch (tmp_295.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_293 = FALSE;
break;
case ANY_VALUE:
tmp_293 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_293) {
const GSM__Types::RoutingAreaIdentification_template& tmp_296 = tmp_295;
const GSM__Types::LocationAreaIdentification_template& tmp_297 = tmp_296.lai();
tmp_293 = tmp_297.is_bound();
if(tmp_293) {
switch (tmp_297.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_293 = FALSE;
break;
case ANY_VALUE:
tmp_293 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_293) {
const GSM__Types::LocationAreaIdentification_template& tmp_298 = tmp_297;
const HEXSTRING_template& tmp_299 = tmp_298.mcc__mnc();
tmp_293 = tmp_299.is_value();
}
break;}
default:
tmp_293 = FALSE;
break;
}
}
}
break;}
default:
tmp_293 = FALSE;
break;
}
}
}
break;}
default:
tmp_293 = FALSE;
break;
}
}
tmp_300 = tmp_293;
}
if (tmp_300) {
current_location.update_lineno(3168);
/* Osmocom_Gb_Types.ttcn, line 3168 */
ret.mccDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[0];
current_location.update_lineno(3169);
/* Osmocom_Gb_Types.ttcn, line 3169 */
ret.mccDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[1];
current_location.update_lineno(3170);
/* Osmocom_Gb_Types.ttcn, line 3170 */
ret.mccDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[2];
current_location.update_lineno(3171);
/* Osmocom_Gb_Types.ttcn, line 3171 */
ret.mncDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[3];
current_location.update_lineno(3172);
/* Osmocom_Gb_Types.ttcn, line 3172 */
ret.mncDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[4];
current_location.update_lineno(3173);
/* Osmocom_Gb_Types.ttcn, line 3173 */
ret.mncDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[5];
}
}
current_location.update_lineno(3175);
/* Osmocom_Gb_Types.ttcn, line 3175 */
{
boolean tmp_314;
{
boolean tmp_307 = cid.is_bound();
if(tmp_307) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_307 = FALSE;
break;
case ANY_VALUE:
tmp_307 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_307) {
const BssgpCellId_template& tmp_308 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_309 = tmp_308.ra__id();
tmp_307 = tmp_309.is_bound();
if(tmp_307) {
switch (tmp_309.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_307 = FALSE;
break;
case ANY_VALUE:
tmp_307 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_307) {
const GSM__Types::RoutingAreaIdentification_template& tmp_310 = tmp_309;
const GSM__Types::LocationAreaIdentification_template& tmp_311 = tmp_310.lai();
tmp_307 = tmp_311.is_bound();
if(tmp_307) {
switch (tmp_311.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_307 = FALSE;
break;
case ANY_VALUE:
tmp_307 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_307) {
const GSM__Types::LocationAreaIdentification_template& tmp_312 = tmp_311;
const INTEGER_template& tmp_313 = tmp_312.lac();
tmp_307 = tmp_313.is_value();
}
break;}
default:
tmp_307 = FALSE;
break;
}
}
}
break;}
default:
tmp_307 = FALSE;
break;
}
}
}
break;}
default:
tmp_307 = FALSE;
break;
}
}
tmp_314 = tmp_307;
}
if (tmp_314) {
current_location.update_lineno(3176);
/* Osmocom_Gb_Types.ttcn, line 3176 */
ret.lac() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).ra__id().lai().lac(), 2);
}
}
}
}
current_location.update_lineno(3179);
/* Osmocom_Gb_Types.ttcn, line 3179 */
return ret;
}

BSSGP__Types::ControlChannelDescription_template ts__ControlChannelDescription(const INTEGER& ccch__conf, const INTEGER& bs__ag__blks__res, const BOOLEAN& att, const BOOLEAN& mscr, const INTEGER& bs__pa__mfrms, const BITSTRING& cbq3, const INTEGER& t3212)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3183, TTCN_Location::LOCATION_TEMPLATE, "ts_ControlChannelDescription");
BSSGP__Types::ControlChannelDescription_template ret_val;
ret_val.cCCH__Conf() = int2bit(ccch__conf, 3);
ret_val.bS__AG__BLKS__RES() = int2bit(bs__ag__blks__res, 3);
ret_val.aTT() = Osmocom__Types::bool2bit(att);
ret_val.mSCR() = Osmocom__Types::bool2bit(mscr);
ret_val.bS__PA__MFRMS() = int2bit(bs__pa__mfrms, 3);
ret_val.spare1() = bs_7;
ret_val.cBQ3() = cbq3;
ret_val.spare2() = bs_0;
ret_val.t3212() = int2oct(t3212, 1);
return ret_val;
}

BSSGP__Types::CellOptions_template ts__CellOptions(const INTEGER& radio__link__timeout, const BITSTRING& dtx, const BOOLEAN& pwrc)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3202, TTCN_Location::LOCATION_TEMPLATE, "ts_CellOptions");
BSSGP__Types::CellOptions_template ret_val;
ret_val.radioLinkTimeout() = int2bit(radio__link__timeout, 4);
ret_val.dTX1() = (const_cast< const BITSTRING&>(dtx)[0] + const_cast< const BITSTRING&>(dtx)[1]);
ret_val.pWRC() = Osmocom__Types::bool2bit(pwrc);
ret_val.dtx2() = const_cast< const BITSTRING&>(dtx)[2];
return ret_val;
}

BSSGP__Types::CellSelectionParameters_template ts__CellSelectionParameters(const INTEGER& ms__txpwr__max__cch, const INTEGER& cell__reselection__hysteresis, const INTEGER& rxlev__access__min, const BOOLEAN& neci, const BOOLEAN& acs)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3212, TTCN_Location::LOCATION_TEMPLATE, "ts_CellSelectionParameters");
BSSGP__Types::CellSelectionParameters_template ret_val;
ret_val.mS__TXPWR__MAX__CCH() = int2bit(ms__txpwr__max__cch, 5);
ret_val.cellReselectHysterisis() = int2bit(cell__reselection__hysteresis, 3);
ret_val.rXLEV__Access__Min() = int2bit(rxlev__access__min, 6);
ret_val.nECI() = Osmocom__Types::bool2bit(neci);
ret_val.aCS() = Osmocom__Types::bool2bit(acs);
return ret_val;
}

BSSGP__Types::RACHControlParameters_template ts__RACHControlParameters(const BOOLEAN& re, const BOOLEAN& cell__barr__access, const INTEGER& tx__integer, const INTEGER& max__retrans, const INTEGER& ac__15__to__8, const INTEGER& ac__7__to__0)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3225, TTCN_Location::LOCATION_TEMPLATE, "ts_RACHControlParameters");
BSSGP__Types::RACHControlParameters_template ret_val;
ret_val.rE() = Osmocom__Types::bool2bit(re);
ret_val.cellBarrAccess() = Osmocom__Types::bool2bit(cell__barr__access);
ret_val.tX__Integer() = int2bit(tx__integer, 4);
ret_val.maxRetrans() = int2bit(max__retrans, 2);
ret_val.aC__15__to__8() = int2oct(ac__15__to__8, 1);
ret_val.aC__7__to__0() = int2oct(ac__7__to__0, 1);
return ret_val;
}

BSSGP__Types::SI3_template ts__SI3(const INTEGER& cell__id, const BSSGP__Types::LocationAreaIdentification_template& lai, const BSSGP__Types::ControlChannelDescription_template& cch__descr, const BSSGP__Types::CellOptions_template& cell__opt, const BSSGP__Types::CellSelectionParameters_template& cell__sel__par, const BSSGP__Types::RACHControlParameters_template& rach__ctrl__par, const OCTETSTRING& rest__octets)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3240, TTCN_Location::LOCATION_TEMPLATE, "ts_SI3");
BSSGP__Types::SI3_template ret_val;
ret_val.sI3MessageType() = os_42;
ret_val.cellIdentity() = int2oct(cell__id, 2);
ret_val.locationAreaIdentification() = lai;
ret_val.controlChannelDescription() = cch__descr;
ret_val.cellOptions() = cell__opt;
ret_val.cellSelectionParameters() = cell__sel__par;
ret_val.rACHControlParameters() = rach__ctrl__par;
ret_val.sI3RestOctets() = rest__octets;
return ret_val;
}

BSSGP__Types::RIM__PDU__Indications_template ts__RIM__PDU__Indications(const BOOLEAN& ack, const BITSTRING& type__ext)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3262, TTCN_Location::LOCATION_TEMPLATE, "ts_RIM_PDU_Indications");
BSSGP__Types::RIM__PDU__Indications_template ret_val;
ret_val.iEI() = os_63;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.ack() = Osmocom__Types::bool2bit(ack);
ret_val.pDU__Type__Extension() = type__ext;
ret_val.reserved() = bs_8;
return ret_val;
}

BSSGP__Types::RIM__PDU__Indications_template tr__RIM__PDU__Indications(const BOOLEAN_template& ack, const BITSTRING_template& type__ext)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3272, TTCN_Location::LOCATION_FUNCTION, "tr_RIM_PDU_Indications");
current_location.update_lineno(3273);
/* Osmocom_Gb_Types.ttcn, line 3273 */
BSSGP__Types::RIM__PDU__Indications_template ret;
current_location.update_lineno(3274);
/* Osmocom_Gb_Types.ttcn, line 3274 */
ret.iEI() = os_63;
current_location.update_lineno(3275);
/* Osmocom_Gb_Types.ttcn, line 3275 */
ret.ext() = bs_2;
current_location.update_lineno(3276);
/* Osmocom_Gb_Types.ttcn, line 3276 */
{
BSSGP__Types::LIN2__2a_template& tmp_319 = ret.lengthIndicator();
tmp_319.length1() = 1;
}
current_location.update_lineno(3277);
/* Osmocom_Gb_Types.ttcn, line 3277 */
if (ack.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(3278);
/* Osmocom_Gb_Types.ttcn, line 3278 */
ret.ack() = ANY_OR_OMIT;
}
else {
current_location.update_lineno(3279);
/* Osmocom_Gb_Types.ttcn, line 3279 */
if (ack.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(3280);
/* Osmocom_Gb_Types.ttcn, line 3280 */
ret.ack() = ANY_VALUE;
}
else {
current_location.update_lineno(3282);
/* Osmocom_Gb_Types.ttcn, line 3282 */
ret.ack() = Osmocom__Types::bool2bit(ack.valueof());
}
}
current_location.update_lineno(3284);
/* Osmocom_Gb_Types.ttcn, line 3284 */
if (type__ext.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(3285);
/* Osmocom_Gb_Types.ttcn, line 3285 */
ret.pDU__Type__Extension() = ANY_OR_OMIT;
}
else {
current_location.update_lineno(3286);
/* Osmocom_Gb_Types.ttcn, line 3286 */
if (type__ext.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(3287);
/* Osmocom_Gb_Types.ttcn, line 3287 */
ret.pDU__Type__Extension() = ANY_VALUE;
}
else {
current_location.update_lineno(3289);
/* Osmocom_Gb_Types.ttcn, line 3289 */
ret.pDU__Type__Extension() = type__ext.valueof();
}
}
current_location.update_lineno(3291);
/* Osmocom_Gb_Types.ttcn, line 3291 */
ret.reserved() = bs_8;
current_location.update_lineno(3292);
/* Osmocom_Gb_Types.ttcn, line 3292 */
return ret;
}

BSSGP__Types::RIM__Protocol__Version__Number_template ts__RIM__Protocol__Version__Number(const INTEGER& ver)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3296, TTCN_Location::LOCATION_TEMPLATE, "ts_RIM_Protocol_Version_Number");
BSSGP__Types::RIM__Protocol__Version__Number_template ret_val;
ret_val.iEI() = os_64;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 1;
ret_val.rIMProtocolVersionNumber() = int2oct(ver, 1);
return ret_val;
}

BSSGP__Types::RIM__Protocol__Version__Number_template tr__RIM__Protocol__Version__Number(const INTEGER_template& ver)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3304, TTCN_Location::LOCATION_FUNCTION, "tr_RIM_Protocol_Version_Number");
current_location.update_lineno(3305);
/* Osmocom_Gb_Types.ttcn, line 3305 */
BSSGP__Types::RIM__Protocol__Version__Number_template ret;
current_location.update_lineno(3306);
/* Osmocom_Gb_Types.ttcn, line 3306 */
ret.iEI() = os_64;
current_location.update_lineno(3307);
/* Osmocom_Gb_Types.ttcn, line 3307 */
ret.ext() = bs_2;
current_location.update_lineno(3308);
/* Osmocom_Gb_Types.ttcn, line 3308 */
{
BSSGP__Types::LIN2__2a_template& tmp_330 = ret.lengthIndicator();
tmp_330.length1() = 1;
}
current_location.update_lineno(3309);
/* Osmocom_Gb_Types.ttcn, line 3309 */
if (ver.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(3310);
/* Osmocom_Gb_Types.ttcn, line 3310 */
ret.rIMProtocolVersionNumber() = ANY_OR_OMIT;
}
else {
current_location.update_lineno(3311);
/* Osmocom_Gb_Types.ttcn, line 3311 */
if (ver.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(3312);
/* Osmocom_Gb_Types.ttcn, line 3312 */
ret.rIMProtocolVersionNumber() = ANY_VALUE;
}
else {
current_location.update_lineno(3314);
/* Osmocom_Gb_Types.ttcn, line 3314 */
ret.rIMProtocolVersionNumber() = int2oct(ver.valueof(), 1);
}
}
current_location.update_lineno(3316);
/* Osmocom_Gb_Types.ttcn, line 3316 */
return ret;
}

BSSGP__Types::RIM__Routing__Information_template ts__RIM__Routing__Information(const HEXSTRING& addr__discr, const BSSGP__Types::RIM__Routing__Address_template& addr)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3324, TTCN_Location::LOCATION_TEMPLATE, "ts_RIM_Routing_Information");
BSSGP__Types::RIM__Routing__Information_template ret_val;
ret_val.iEI() = os_65;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.rIMRoutingAddressDiscriminator() = addr__discr;
ret_val.spare() = hs_0;
ret_val.rIM__Routing__Address() = addr;
return ret_val;
}

BSSGP__Types::RIM__Routing__Information_template tr__RIM__Routing__Information(const HEXSTRING_template& addr__discr, const BSSGP__Types::RIM__Routing__Address_template& addr)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3334, TTCN_Location::LOCATION_TEMPLATE, "tr_RIM_Routing_Information");
BSSGP__Types::RIM__Routing__Information_template ret_val;
ret_val.iEI() = os_65;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = ANY_VALUE;
ret_val.rIMRoutingAddressDiscriminator() = addr__discr;
ret_val.spare() = hs_0;
ret_val.rIM__Routing__Address() = addr;
return ret_val;
}

BSSGP__Types::RIM__Routing__Address_template t__RIM__Routing__Address__cid(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3345, TTCN_Location::LOCATION_TEMPLATE, "t_RIM_Routing_Address_cid");
BSSGP__Types::RIM__Routing__Address_template ret_val;
ret_val.cell__Identifier() = tr__Cell__Identifier__V(cid);
return ret_val;
}

BSSGP__Types::RIM__Routing__Address_template t__RIM__Routing__Address__rncid(const BssgpCellId_template& cid, const INTEGER_template& rnc__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3348, TTCN_Location::LOCATION_TEMPLATE, "t_RIM_Routing_Address_rncid");
BSSGP__Types::RIM__Routing__Address_template ret_val;
ret_val.globalRNCID() = t__GlobalRNC__ID__BSSGP(cid, rnc__id);
return ret_val;
}

BSSGP__Types::RIM__Routing__Address_template t__RIM__Routing__Address__enbid(const BssgpCellId_template& cid, const INTEGER_template& tac, const OCTETSTRING_template& gnbid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3351, TTCN_Location::LOCATION_TEMPLATE, "t_RIM_Routing_Address_enbid");
BSSGP__Types::RIM__Routing__Address_template ret_val;
ret_val.eNB__Identifier() = t__ENB__Identifier__V(cid, tac, gnbid);
return ret_val;
}

BSSGP__Types::RIM__Routing__Address_template t__RIM__Routing__Address__sector(const OCTETSTRING_template& sector)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3354, TTCN_Location::LOCATION_TEMPLATE, "t_RIM_Routing_Address_sector");
BSSGP__Types::RIM__Routing__Address_template ret_val;
ret_val.eHRPD__SectorID() = sector;
return ret_val;
}

BSSGP__Types::Cell__Identifier__V_template tr__Cell__Identifier__V(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3358, TTCN_Location::LOCATION_FUNCTION, "tr_Cell_Identifier_V");
current_location.update_lineno(3359);
/* Osmocom_Gb_Types.ttcn, line 3359 */
BSSGP__Types::Cell__Identifier__V_template ret;
ret.mccDigit1() = ANY_VALUE;
ret.mccDigit2() = ANY_VALUE;
ret.mccDigit3() = ANY_VALUE;
ret.mncDigit3() = ANY_VALUE;
ret.mncDigit1() = ANY_VALUE;
ret.mncDigit2() = ANY_VALUE;
ret.lac() = ANY_VALUE;
ret.rac() = ANY_VALUE;
ret.cI__value() = ANY_VALUE;
current_location.update_lineno(3370);
/* Osmocom_Gb_Types.ttcn, line 3370 */
if (cid.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(3371);
/* Osmocom_Gb_Types.ttcn, line 3371 */
return BSSGP__Types::Cell__Identifier__V_template(OMIT_VALUE);
}
else {
current_location.update_lineno(3372);
/* Osmocom_Gb_Types.ttcn, line 3372 */
if (cid.get_istemplate_kind((const char*)cs_1)) {
current_location.update_lineno(3373);
/* Osmocom_Gb_Types.ttcn, line 3373 */
return BSSGP__Types::Cell__Identifier__V_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(3374);
/* Osmocom_Gb_Types.ttcn, line 3374 */
if (cid.get_istemplate_kind((const char*)cs_2)) {
current_location.update_lineno(3375);
/* Osmocom_Gb_Types.ttcn, line 3375 */
return BSSGP__Types::Cell__Identifier__V_template(ANY_VALUE);
}
}
}
current_location.update_lineno(3377);
/* Osmocom_Gb_Types.ttcn, line 3377 */
{
boolean tmp_334;
{
boolean tmp_335;
tmp_335 = cid.is_value();
if (tmp_335) {
boolean tmp_336 = cid.is_bound();
if(tmp_336) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_336 = FALSE;
break;
case ANY_VALUE:
tmp_336 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_336) {
const BssgpCellId_template& tmp_337 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_338 = tmp_337.ra__id();
tmp_336 = tmp_338.is_value();
}
break;}
default:
tmp_336 = FALSE;
break;
}
}
tmp_335 = tmp_336;
}
tmp_334 = tmp_335;
}
if (tmp_334) {
boolean tmp_339 = cid.is_bound();
if(tmp_339) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_339 = FALSE;
break;
case ANY_VALUE:
tmp_339 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_339) {
const BssgpCellId_template& tmp_340 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_341 = tmp_340.ra__id();
tmp_339 = tmp_341.is_bound();
if(tmp_339) {
switch (tmp_341.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_339 = FALSE;
break;
case ANY_VALUE:
tmp_339 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_339) {
const GSM__Types::RoutingAreaIdentification_template& tmp_342 = tmp_341;
const GSM__Types::LocationAreaIdentification_template& tmp_343 = tmp_342.lai();
tmp_339 = tmp_343.is_value();
}
break;}
default:
tmp_339 = FALSE;
break;
}
}
}
break;}
default:
tmp_339 = FALSE;
break;
}
}
tmp_334 = tmp_339;
}
if (tmp_334) {
current_location.update_lineno(3378);
/* Osmocom_Gb_Types.ttcn, line 3378 */
{
boolean tmp_351;
{
boolean tmp_344 = cid.is_bound();
if(tmp_344) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_344 = FALSE;
break;
case ANY_VALUE:
tmp_344 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_344) {
const BssgpCellId_template& tmp_345 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_346 = tmp_345.ra__id();
tmp_344 = tmp_346.is_bound();
if(tmp_344) {
switch (tmp_346.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_344 = FALSE;
break;
case ANY_VALUE:
tmp_344 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_344) {
const GSM__Types::RoutingAreaIdentification_template& tmp_347 = tmp_346;
const GSM__Types::LocationAreaIdentification_template& tmp_348 = tmp_347.lai();
tmp_344 = tmp_348.is_bound();
if(tmp_344) {
switch (tmp_348.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_344 = FALSE;
break;
case ANY_VALUE:
tmp_344 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_344) {
const GSM__Types::LocationAreaIdentification_template& tmp_349 = tmp_348;
const HEXSTRING_template& tmp_350 = tmp_349.mcc__mnc();
tmp_344 = tmp_350.is_value();
}
break;}
default:
tmp_344 = FALSE;
break;
}
}
}
break;}
default:
tmp_344 = FALSE;
break;
}
}
}
break;}
default:
tmp_344 = FALSE;
break;
}
}
tmp_351 = tmp_344;
}
if (tmp_351) {
current_location.update_lineno(3379);
/* Osmocom_Gb_Types.ttcn, line 3379 */
ret.mccDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[0];
current_location.update_lineno(3380);
/* Osmocom_Gb_Types.ttcn, line 3380 */
ret.mccDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[1];
current_location.update_lineno(3381);
/* Osmocom_Gb_Types.ttcn, line 3381 */
ret.mccDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[2];
current_location.update_lineno(3382);
/* Osmocom_Gb_Types.ttcn, line 3382 */
ret.mncDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[3];
current_location.update_lineno(3383);
/* Osmocom_Gb_Types.ttcn, line 3383 */
ret.mncDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[4];
current_location.update_lineno(3384);
/* Osmocom_Gb_Types.ttcn, line 3384 */
ret.mncDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[5];
}
}
current_location.update_lineno(3386);
/* Osmocom_Gb_Types.ttcn, line 3386 */
{
boolean tmp_365;
{
boolean tmp_358 = cid.is_bound();
if(tmp_358) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_358 = FALSE;
break;
case ANY_VALUE:
tmp_358 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_358) {
const BssgpCellId_template& tmp_359 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_360 = tmp_359.ra__id();
tmp_358 = tmp_360.is_bound();
if(tmp_358) {
switch (tmp_360.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_358 = FALSE;
break;
case ANY_VALUE:
tmp_358 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_358) {
const GSM__Types::RoutingAreaIdentification_template& tmp_361 = tmp_360;
const GSM__Types::LocationAreaIdentification_template& tmp_362 = tmp_361.lai();
tmp_358 = tmp_362.is_bound();
if(tmp_358) {
switch (tmp_362.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_358 = FALSE;
break;
case ANY_VALUE:
tmp_358 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_358) {
const GSM__Types::LocationAreaIdentification_template& tmp_363 = tmp_362;
const INTEGER_template& tmp_364 = tmp_363.lac();
tmp_358 = tmp_364.is_value();
}
break;}
default:
tmp_358 = FALSE;
break;
}
}
}
break;}
default:
tmp_358 = FALSE;
break;
}
}
}
break;}
default:
tmp_358 = FALSE;
break;
}
}
tmp_365 = tmp_358;
}
if (tmp_365) {
current_location.update_lineno(3387);
/* Osmocom_Gb_Types.ttcn, line 3387 */
ret.lac() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).ra__id().lai().lac(), 2);
}
}
}
}
current_location.update_lineno(3390);
/* Osmocom_Gb_Types.ttcn, line 3390 */
{
boolean tmp_367;
tmp_367 = cid.is_value();
if (tmp_367) {
boolean tmp_368 = cid.is_bound();
if(tmp_368) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_368 = FALSE;
break;
case ANY_VALUE:
tmp_368 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_368) {
const BssgpCellId_template& tmp_369 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_370 = tmp_369.ra__id();
tmp_368 = tmp_370.is_value();
}
break;}
default:
tmp_368 = FALSE;
break;
}
}
tmp_367 = tmp_368;
}
if (tmp_367) {
current_location.update_lineno(3391);
/* Osmocom_Gb_Types.ttcn, line 3391 */
ret.rac() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).ra__id().rac(), 1);
}
}
current_location.update_lineno(3393);
/* Osmocom_Gb_Types.ttcn, line 3393 */
if (cid.is_value()) {
current_location.update_lineno(3394);
/* Osmocom_Gb_Types.ttcn, line 3394 */
ret.cI__value() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).cell__id(), 2);
}
current_location.update_lineno(3396);
/* Osmocom_Gb_Types.ttcn, line 3396 */
return ret;
}

BSSGP__Types::Cell__Identifier__V_template ts__Cell__Identifier__V(const BssgpCellId_template& cid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3398, TTCN_Location::LOCATION_TEMPLATE, "ts_Cell_Identifier_V");
BSSGP__Types::Cell__Identifier__V_template ret_val;
ret_val.mccDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[0];
ret_val.mccDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[1];
ret_val.mccDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[2];
ret_val.mncDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[3];
ret_val.mncDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[4];
ret_val.mncDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[5];
ret_val.lac() = int2oct(const_cast< const BssgpCellId_template&>(cid).ra__id().lai().lac().valueof(), 2);
ret_val.rac() = int2oct(const_cast< const BssgpCellId_template&>(cid).ra__id().rac().valueof(), 1);
ret_val.cI__value() = int2oct(const_cast< const BssgpCellId_template&>(cid).cell__id().valueof(), 2);
return ret_val;
}

BSSGP__Types::GlobalRNC__ID__BSSGP_template t__GlobalRNC__ID__BSSGP(const BssgpCellId_template& cid, const INTEGER_template& rnc__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3410, TTCN_Location::LOCATION_FUNCTION, "t_GlobalRNC_ID_BSSGP");
current_location.update_lineno(3411);
/* Osmocom_Gb_Types.ttcn, line 3411 */
BSSGP__Types::GlobalRNC__ID__BSSGP_template ret;
ret.mccDigit1() = ANY_VALUE;
ret.mccDigit2() = ANY_VALUE;
ret.mccDigit3() = ANY_VALUE;
ret.mncDigit3() = ANY_VALUE;
ret.mncDigit1() = ANY_VALUE;
ret.mncDigit2() = ANY_VALUE;
ret.lac() = ANY_VALUE;
ret.rac() = ANY_VALUE;
ret.spare() = ANY_VALUE;
ret.rNC__ID() = ANY_VALUE;
current_location.update_lineno(3423);
/* Osmocom_Gb_Types.ttcn, line 3423 */
{
boolean tmp_373;
tmp_373 = cid.get_istemplate_kind((const char*)cs_0);
if (tmp_373) tmp_373 = rnc__id.get_istemplate_kind((const char*)cs_0);
if (tmp_373) {
current_location.update_lineno(3424);
/* Osmocom_Gb_Types.ttcn, line 3424 */
return BSSGP__Types::GlobalRNC__ID__BSSGP_template(OMIT_VALUE);
}
else {
current_location.update_lineno(3425);
/* Osmocom_Gb_Types.ttcn, line 3425 */
boolean tmp_374;
tmp_374 = cid.get_istemplate_kind((const char*)cs_1);
if (tmp_374) tmp_374 = rnc__id.get_istemplate_kind((const char*)cs_1);
if (tmp_374) {
current_location.update_lineno(3426);
/* Osmocom_Gb_Types.ttcn, line 3426 */
return BSSGP__Types::GlobalRNC__ID__BSSGP_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(3427);
/* Osmocom_Gb_Types.ttcn, line 3427 */
boolean tmp_375;
tmp_375 = cid.get_istemplate_kind((const char*)cs_2);
if (tmp_375) tmp_375 = rnc__id.get_istemplate_kind((const char*)cs_2);
if (tmp_375) {
current_location.update_lineno(3428);
/* Osmocom_Gb_Types.ttcn, line 3428 */
return BSSGP__Types::GlobalRNC__ID__BSSGP_template(ANY_VALUE);
}
}
}
}
current_location.update_lineno(3430);
/* Osmocom_Gb_Types.ttcn, line 3430 */
{
boolean tmp_376;
{
boolean tmp_377;
tmp_377 = cid.is_value();
if (tmp_377) {
boolean tmp_378 = cid.is_bound();
if(tmp_378) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_378 = FALSE;
break;
case ANY_VALUE:
tmp_378 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_378) {
const BssgpCellId_template& tmp_379 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_380 = tmp_379.ra__id();
tmp_378 = tmp_380.is_value();
}
break;}
default:
tmp_378 = FALSE;
break;
}
}
tmp_377 = tmp_378;
}
tmp_376 = tmp_377;
}
if (tmp_376) {
boolean tmp_381 = cid.is_bound();
if(tmp_381) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_381 = FALSE;
break;
case ANY_VALUE:
tmp_381 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_381) {
const BssgpCellId_template& tmp_382 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_383 = tmp_382.ra__id();
tmp_381 = tmp_383.is_bound();
if(tmp_381) {
switch (tmp_383.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_381 = FALSE;
break;
case ANY_VALUE:
tmp_381 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_381) {
const GSM__Types::RoutingAreaIdentification_template& tmp_384 = tmp_383;
const GSM__Types::LocationAreaIdentification_template& tmp_385 = tmp_384.lai();
tmp_381 = tmp_385.is_value();
}
break;}
default:
tmp_381 = FALSE;
break;
}
}
}
break;}
default:
tmp_381 = FALSE;
break;
}
}
tmp_376 = tmp_381;
}
if (tmp_376) {
current_location.update_lineno(3431);
/* Osmocom_Gb_Types.ttcn, line 3431 */
{
boolean tmp_393;
{
boolean tmp_386 = cid.is_bound();
if(tmp_386) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_386 = FALSE;
break;
case ANY_VALUE:
tmp_386 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_386) {
const BssgpCellId_template& tmp_387 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_388 = tmp_387.ra__id();
tmp_386 = tmp_388.is_bound();
if(tmp_386) {
switch (tmp_388.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_386 = FALSE;
break;
case ANY_VALUE:
tmp_386 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_386) {
const GSM__Types::RoutingAreaIdentification_template& tmp_389 = tmp_388;
const GSM__Types::LocationAreaIdentification_template& tmp_390 = tmp_389.lai();
tmp_386 = tmp_390.is_bound();
if(tmp_386) {
switch (tmp_390.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_386 = FALSE;
break;
case ANY_VALUE:
tmp_386 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_386) {
const GSM__Types::LocationAreaIdentification_template& tmp_391 = tmp_390;
const HEXSTRING_template& tmp_392 = tmp_391.mcc__mnc();
tmp_386 = tmp_392.is_value();
}
break;}
default:
tmp_386 = FALSE;
break;
}
}
}
break;}
default:
tmp_386 = FALSE;
break;
}
}
}
break;}
default:
tmp_386 = FALSE;
break;
}
}
tmp_393 = tmp_386;
}
if (tmp_393) {
current_location.update_lineno(3432);
/* Osmocom_Gb_Types.ttcn, line 3432 */
ret.mccDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[0];
current_location.update_lineno(3433);
/* Osmocom_Gb_Types.ttcn, line 3433 */
ret.mccDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[1];
current_location.update_lineno(3434);
/* Osmocom_Gb_Types.ttcn, line 3434 */
ret.mccDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[2];
current_location.update_lineno(3435);
/* Osmocom_Gb_Types.ttcn, line 3435 */
ret.mncDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[3];
current_location.update_lineno(3436);
/* Osmocom_Gb_Types.ttcn, line 3436 */
ret.mncDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[4];
current_location.update_lineno(3437);
/* Osmocom_Gb_Types.ttcn, line 3437 */
ret.mncDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[5];
}
}
current_location.update_lineno(3439);
/* Osmocom_Gb_Types.ttcn, line 3439 */
{
boolean tmp_407;
{
boolean tmp_400 = cid.is_bound();
if(tmp_400) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_400 = FALSE;
break;
case ANY_VALUE:
tmp_400 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_400) {
const BssgpCellId_template& tmp_401 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_402 = tmp_401.ra__id();
tmp_400 = tmp_402.is_bound();
if(tmp_400) {
switch (tmp_402.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_400 = FALSE;
break;
case ANY_VALUE:
tmp_400 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_400) {
const GSM__Types::RoutingAreaIdentification_template& tmp_403 = tmp_402;
const GSM__Types::LocationAreaIdentification_template& tmp_404 = tmp_403.lai();
tmp_400 = tmp_404.is_bound();
if(tmp_400) {
switch (tmp_404.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_400 = FALSE;
break;
case ANY_VALUE:
tmp_400 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_400) {
const GSM__Types::LocationAreaIdentification_template& tmp_405 = tmp_404;
const INTEGER_template& tmp_406 = tmp_405.lac();
tmp_400 = tmp_406.is_value();
}
break;}
default:
tmp_400 = FALSE;
break;
}
}
}
break;}
default:
tmp_400 = FALSE;
break;
}
}
}
break;}
default:
tmp_400 = FALSE;
break;
}
}
tmp_407 = tmp_400;
}
if (tmp_407) {
current_location.update_lineno(3440);
/* Osmocom_Gb_Types.ttcn, line 3440 */
ret.lac() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).ra__id().lai().lac(), 2);
}
}
}
}
current_location.update_lineno(3443);
/* Osmocom_Gb_Types.ttcn, line 3443 */
{
boolean tmp_409;
tmp_409 = cid.is_value();
if (tmp_409) {
boolean tmp_410 = cid.is_bound();
if(tmp_410) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_410 = FALSE;
break;
case ANY_VALUE:
tmp_410 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_410) {
const BssgpCellId_template& tmp_411 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_412 = tmp_411.ra__id();
tmp_410 = tmp_412.is_value();
}
break;}
default:
tmp_410 = FALSE;
break;
}
}
tmp_409 = tmp_410;
}
if (tmp_409) {
current_location.update_lineno(3444);
/* Osmocom_Gb_Types.ttcn, line 3444 */
ret.rac() = Osmocom__Types::int2oct__tmpl(const_cast< const BssgpCellId_template&>(cid).ra__id().rac(), 1);
}
}
current_location.update_lineno(3446);
/* Osmocom_Gb_Types.ttcn, line 3446 */
if (rnc__id.is_value()) {
current_location.update_lineno(3447);
/* Osmocom_Gb_Types.ttcn, line 3447 */
ret.spare() = hs_0;
current_location.update_lineno(3448);
/* Osmocom_Gb_Types.ttcn, line 3448 */
ret.rNC__ID() = rnc__id;
}
current_location.update_lineno(3451);
/* Osmocom_Gb_Types.ttcn, line 3451 */
return ret;
}

BSSGP__Types::ENB__Identifier__V_template t__ENB__Identifier__V(const BssgpCellId_template& cid, const INTEGER_template& tac, const OCTETSTRING_template& gnbid)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3454, TTCN_Location::LOCATION_FUNCTION, "t_ENB_Identifier_V");
current_location.update_lineno(3455);
/* Osmocom_Gb_Types.ttcn, line 3455 */
BSSGP__Types::ENB__Identifier__V_template ret;
ret.mccDigit1() = ANY_VALUE;
ret.mccDigit2() = ANY_VALUE;
ret.mccDigit3() = ANY_VALUE;
ret.mncDigit3() = ANY_VALUE;
ret.mncDigit1() = ANY_VALUE;
ret.mncDigit2() = ANY_VALUE;
ret.tac() = ANY_VALUE;
ret.globaleNBID() = ANY_VALUE;
current_location.update_lineno(3465);
/* Osmocom_Gb_Types.ttcn, line 3465 */
{
boolean tmp_416;
{
boolean tmp_417;
tmp_417 = cid.get_istemplate_kind((const char*)cs_0);
if (tmp_417) tmp_417 = tac.get_istemplate_kind((const char*)cs_0);
tmp_416 = tmp_417;
}
if (tmp_416) tmp_416 = gnbid.get_istemplate_kind((const char*)cs_0);
if (tmp_416) {
current_location.update_lineno(3466);
/* Osmocom_Gb_Types.ttcn, line 3466 */
return BSSGP__Types::ENB__Identifier__V_template(OMIT_VALUE);
}
else {
current_location.update_lineno(3467);
/* Osmocom_Gb_Types.ttcn, line 3467 */
boolean tmp_418;
{
boolean tmp_419;
tmp_419 = cid.get_istemplate_kind((const char*)cs_1);
if (tmp_419) tmp_419 = tac.get_istemplate_kind((const char*)cs_1);
tmp_418 = tmp_419;
}
if (tmp_418) tmp_418 = gnbid.get_istemplate_kind((const char*)cs_1);
if (tmp_418) {
current_location.update_lineno(3468);
/* Osmocom_Gb_Types.ttcn, line 3468 */
return BSSGP__Types::ENB__Identifier__V_template(ANY_OR_OMIT);
}
else {
current_location.update_lineno(3469);
/* Osmocom_Gb_Types.ttcn, line 3469 */
boolean tmp_420;
{
boolean tmp_421;
tmp_421 = cid.get_istemplate_kind((const char*)cs_2);
if (tmp_421) tmp_421 = tac.get_istemplate_kind((const char*)cs_2);
tmp_420 = tmp_421;
}
if (tmp_420) tmp_420 = gnbid.get_istemplate_kind((const char*)cs_2);
if (tmp_420) {
current_location.update_lineno(3470);
/* Osmocom_Gb_Types.ttcn, line 3470 */
return BSSGP__Types::ENB__Identifier__V_template(ANY_VALUE);
}
}
}
}
current_location.update_lineno(3472);
/* Osmocom_Gb_Types.ttcn, line 3472 */
{
boolean tmp_422;
{
boolean tmp_423;
tmp_423 = cid.is_value();
if (tmp_423) {
boolean tmp_424 = cid.is_bound();
if(tmp_424) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_424 = FALSE;
break;
case ANY_VALUE:
tmp_424 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_424) {
const BssgpCellId_template& tmp_425 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_426 = tmp_425.ra__id();
tmp_424 = tmp_426.is_value();
}
break;}
default:
tmp_424 = FALSE;
break;
}
}
tmp_423 = tmp_424;
}
tmp_422 = tmp_423;
}
if (tmp_422) {
boolean tmp_427 = cid.is_bound();
if(tmp_427) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_427 = FALSE;
break;
case ANY_VALUE:
tmp_427 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_427) {
const BssgpCellId_template& tmp_428 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_429 = tmp_428.ra__id();
tmp_427 = tmp_429.is_bound();
if(tmp_427) {
switch (tmp_429.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_427 = FALSE;
break;
case ANY_VALUE:
tmp_427 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_427) {
const GSM__Types::RoutingAreaIdentification_template& tmp_430 = tmp_429;
const GSM__Types::LocationAreaIdentification_template& tmp_431 = tmp_430.lai();
tmp_427 = tmp_431.is_value();
}
break;}
default:
tmp_427 = FALSE;
break;
}
}
}
break;}
default:
tmp_427 = FALSE;
break;
}
}
tmp_422 = tmp_427;
}
if (tmp_422) {
current_location.update_lineno(3473);
/* Osmocom_Gb_Types.ttcn, line 3473 */
{
boolean tmp_439;
{
boolean tmp_432 = cid.is_bound();
if(tmp_432) {
switch (cid.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_432 = FALSE;
break;
case ANY_VALUE:
tmp_432 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_432) {
const BssgpCellId_template& tmp_433 = cid;
const GSM__Types::RoutingAreaIdentification_template& tmp_434 = tmp_433.ra__id();
tmp_432 = tmp_434.is_bound();
if(tmp_432) {
switch (tmp_434.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_432 = FALSE;
break;
case ANY_VALUE:
tmp_432 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_432) {
const GSM__Types::RoutingAreaIdentification_template& tmp_435 = tmp_434;
const GSM__Types::LocationAreaIdentification_template& tmp_436 = tmp_435.lai();
tmp_432 = tmp_436.is_bound();
if(tmp_432) {
switch (tmp_436.get_selection()) {
case UNINITIALIZED_TEMPLATE:
tmp_432 = FALSE;
break;
case ANY_VALUE:
tmp_432 = FALSE;
break;
case SPECIFIC_VALUE: {
if(tmp_432) {
const GSM__Types::LocationAreaIdentification_template& tmp_437 = tmp_436;
const HEXSTRING_template& tmp_438 = tmp_437.mcc__mnc();
tmp_432 = tmp_438.is_value();
}
break;}
default:
tmp_432 = FALSE;
break;
}
}
}
break;}
default:
tmp_432 = FALSE;
break;
}
}
}
break;}
default:
tmp_432 = FALSE;
break;
}
}
tmp_439 = tmp_432;
}
if (tmp_439) {
current_location.update_lineno(3474);
/* Osmocom_Gb_Types.ttcn, line 3474 */
ret.mccDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[0];
current_location.update_lineno(3475);
/* Osmocom_Gb_Types.ttcn, line 3475 */
ret.mccDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[1];
current_location.update_lineno(3476);
/* Osmocom_Gb_Types.ttcn, line 3476 */
ret.mccDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[2];
current_location.update_lineno(3477);
/* Osmocom_Gb_Types.ttcn, line 3477 */
ret.mncDigit3() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[3];
current_location.update_lineno(3478);
/* Osmocom_Gb_Types.ttcn, line 3478 */
ret.mncDigit1() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[4];
current_location.update_lineno(3479);
/* Osmocom_Gb_Types.ttcn, line 3479 */
ret.mncDigit2() = const_cast< const BssgpCellId_template&>(cid).ra__id().lai().mcc__mnc()[5];
}
}
}
}
current_location.update_lineno(3482);
/* Osmocom_Gb_Types.ttcn, line 3482 */
if (tac.is_value()) {
current_location.update_lineno(3483);
/* Osmocom_Gb_Types.ttcn, line 3483 */
ret.tac() = int2oct(tac.valueof(), 2);
}
current_location.update_lineno(3485);
/* Osmocom_Gb_Types.ttcn, line 3485 */
if (gnbid.is_value()) {
current_location.update_lineno(3486);
/* Osmocom_Gb_Types.ttcn, line 3486 */
ret.globaleNBID() = gnbid;
}
current_location.update_lineno(3489);
/* Osmocom_Gb_Types.ttcn, line 3489 */
return ret;
}

BSSGP__Types::SON__Transfer__Application__Identity__TLV_template ts__SON__Transfer__Application__Identity__TLV(const OCTETSTRING_template& app__id)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3493, TTCN_Location::LOCATION_TEMPLATE, "ts_SON_Transfer_Application_Identity_TLV");
BSSGP__Types::SON__Transfer__Application__Identity__TLV_template ret_val;
ret_val.iEI() = os_66;
ret_val.ext() = bs_2;
ret_val.lengthIndicator().length1() = 0;
ret_val.sON__Transfer__Application__Identity() = app__id;
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__RAN__INFORMATION__REQUEST(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__Request__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3504, TTCN_Location::LOCATION_TEMPLATE, "ts_RAN_INFORMATION_REQUEST");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION__REQUEST_template& tmp_448 = ret_val.pDU__BSSGP__RAN__INFORMATION__REQUEST();
tmp_448.bssgpPduType() = os_67;
tmp_448.destination__Cell__Identifier() = dst;
tmp_448.source__Cell__Identifier() = src;
tmp_448.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__RAN__INFORMATION__REQUEST(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__Request__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3515, TTCN_Location::LOCATION_TEMPLATE, "tr_RAN_INFORMATION_REQUEST");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION__REQUEST_template& tmp_449 = ret_val.pDU__BSSGP__RAN__INFORMATION__REQUEST();
tmp_449.bssgpPduType() = os_67;
tmp_449.destination__Cell__Identifier() = dst;
tmp_449.source__Cell__Identifier() = src;
tmp_449.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__PDU__BSSGP__RAN__INFORMATION(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3528, TTCN_Location::LOCATION_TEMPLATE, "ts_PDU_BSSGP_RAN_INFORMATION");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION_template& tmp_450 = ret_val.pDU__BSSGP__RAN__INFORMATION();
tmp_450.bssgpPduType() = os_68;
tmp_450.destination__Cell__Identifier() = dst;
tmp_450.source__Cell__Identifier() = src;
tmp_450.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__PDU__BSSGP__RAN__INFORMATION(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3539, TTCN_Location::LOCATION_TEMPLATE, "tr_PDU_BSSGP_RAN_INFORMATION");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION_template& tmp_451 = ret_val.pDU__BSSGP__RAN__INFORMATION();
tmp_451.bssgpPduType() = os_68;
tmp_451.destination__Cell__Identifier() = dst;
tmp_451.source__Cell__Identifier() = src;
tmp_451.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__PDU__BSSGP__RAN__INFORMATION__ACK(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__Ack__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3552, TTCN_Location::LOCATION_TEMPLATE, "ts_PDU_BSSGP_RAN_INFORMATION_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION__ACK_template& tmp_452 = ret_val.pDU__BSSGP__RAN__INFORMATION__ACK();
tmp_452.bssgpPduType() = os_69;
tmp_452.destination__Cell__Identifier() = dst;
tmp_452.source__Cell__Identifier() = src;
tmp_452.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__PDU__BSSGP__RAN__INFORMATION__ACK(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__Ack__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3563, TTCN_Location::LOCATION_TEMPLATE, "tr_PDU_BSSGP_RAN_INFORMATION_ACK");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION__ACK_template& tmp_453 = ret_val.pDU__BSSGP__RAN__INFORMATION__ACK();
tmp_453.bssgpPduType() = os_69;
tmp_453.destination__Cell__Identifier() = dst;
tmp_453.source__Cell__Identifier() = src;
tmp_453.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__PDU__BSSGP__RAN__INFORMATION__ERROR(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__Error__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3576, TTCN_Location::LOCATION_TEMPLATE, "ts_PDU_BSSGP_RAN_INFORMATION_ERROR");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION__ERROR_template& tmp_454 = ret_val.pDU__BSSGP__RAN__INFORMATION__ERROR();
tmp_454.bssgpPduType() = os_70;
tmp_454.destination__Cell__Identifier() = dst;
tmp_454.source__Cell__Identifier() = src;
tmp_454.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__PDU__BSSGP__RAN__INFORMATION__ERROR(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__Error__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3587, TTCN_Location::LOCATION_TEMPLATE, "tr_PDU_BSSGP_RAN_INFORMATION_ERROR");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION__ERROR_template& tmp_455 = ret_val.pDU__BSSGP__RAN__INFORMATION__ERROR();
tmp_455.bssgpPduType() = os_70;
tmp_455.destination__Cell__Identifier() = dst;
tmp_455.source__Cell__Identifier() = src;
tmp_455.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template ts__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__Application__Error__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3600, TTCN_Location::LOCATION_TEMPLATE, "ts_PDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_template& tmp_456 = ret_val.pDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR();
tmp_456.bssgpPduType() = os_71;
tmp_456.destination__Cell__Identifier() = dst;
tmp_456.source__Cell__Identifier() = src;
tmp_456.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::PDU__BSSGP_template tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR(const BSSGP__Types::RIM__Routing__Information_template& dst, const BSSGP__Types::RIM__Routing__Information_template& src, const BSSGP__Types::RAN__Information__Application__Error__RIM__Container_template& cont)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3611, TTCN_Location::LOCATION_TEMPLATE, "tr_PDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR");
BSSGP__Types::PDU__BSSGP_template ret_val;
{
BSSGP__Types::PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_template& tmp_457 = ret_val.pDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR();
tmp_457.bssgpPduType() = os_71;
tmp_457.destination__Cell__Identifier() = dst;
tmp_457.source__Cell__Identifier() = src;
tmp_457.rIM__Container() = cont;
}
return ret_val;
}

BSSGP__Types::BVCI_template f__BSSGP__BVCI__IE__get(const BSSGP__Types::PDU__BSSGP& pdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3751, TTCN_Location::LOCATION_FUNCTION, "f_BSSGP_BVCI_IE_get");
{
const BSSGP__Types::PDU__BSSGP &tmp_460 = pdu;
current_location.update_lineno(3753);
/* Osmocom_Gb_Types.ttcn, line 3753 */
{
boolean tmp_459_0b;
{
BSSGP__Types::PDU__BSSGP_template tmp_461;
tmp_461.pDU__BSSGP__FLUSH__LL() = ANY_VALUE;
tmp_459_0b = tmp_461.match(tmp_460);
}
if(tmp_459_0b) goto tmp_459_0;
}
current_location.update_lineno(3756);
/* Osmocom_Gb_Types.ttcn, line 3756 */
{
boolean tmp_459_1b;
{
BSSGP__Types::PDU__BSSGP_template tmp_462;
tmp_462.pDU__BSSGP__FLUSH__LL__ACK() = ANY_VALUE;
tmp_459_1b = tmp_462.match(tmp_460);
}
if(tmp_459_1b) goto tmp_459_1;
}
current_location.update_lineno(3759);
/* Osmocom_Gb_Types.ttcn, line 3759 */
{
boolean tmp_459_2b;
{
BSSGP__Types::PDU__BSSGP_template tmp_463;
tmp_463.pDU__BSSGP__LLC__DISCARDED() = ANY_VALUE;
tmp_459_2b = tmp_463.match(tmp_460);
}
if(tmp_459_2b) goto tmp_459_2;
}
current_location.update_lineno(3762);
/* Osmocom_Gb_Types.ttcn, line 3762 */
{
boolean tmp_459_3b;
{
BSSGP__Types::PDU__BSSGP_template tmp_464;
tmp_464.pDU__BSSGP__BVC__BLOCK() = ANY_VALUE;
tmp_459_3b = tmp_464.match(tmp_460);
}
if(tmp_459_3b) goto tmp_459_3;
}
current_location.update_lineno(3765);
/* Osmocom_Gb_Types.ttcn, line 3765 */
{
boolean tmp_459_4b;
{
BSSGP__Types::PDU__BSSGP_template tmp_465;
tmp_465.pDU__BSSGP__BVC__BLOCK__ACK() = ANY_VALUE;
tmp_459_4b = tmp_465.match(tmp_460);
}
if(tmp_459_4b) goto tmp_459_4;
}
current_location.update_lineno(3768);
/* Osmocom_Gb_Types.ttcn, line 3768 */
{
boolean tmp_459_5b;
{
BSSGP__Types::PDU__BSSGP_template tmp_466;
tmp_466.pDU__BSSGP__BVC__UNBLOCK() = ANY_VALUE;
tmp_459_5b = tmp_466.match(tmp_460);
}
if(tmp_459_5b) goto tmp_459_5;
}
current_location.update_lineno(3771);
/* Osmocom_Gb_Types.ttcn, line 3771 */
{
boolean tmp_459_6b;
{
BSSGP__Types::PDU__BSSGP_template tmp_467;
tmp_467.pDU__BSSGP__BVC__UNBLOCK__ACK() = ANY_VALUE;
tmp_459_6b = tmp_467.match(tmp_460);
}
if(tmp_459_6b) goto tmp_459_6;
}
current_location.update_lineno(3774);
/* Osmocom_Gb_Types.ttcn, line 3774 */
{
boolean tmp_459_7b;
{
BSSGP__Types::PDU__BSSGP_template tmp_468;
tmp_468.pDU__BSSGP__BVC__RESET() = ANY_VALUE;
tmp_459_7b = tmp_468.match(tmp_460);
}
if(tmp_459_7b) goto tmp_459_7;
}
current_location.update_lineno(3777);
/* Osmocom_Gb_Types.ttcn, line 3777 */
{
boolean tmp_459_8b;
{
BSSGP__Types::PDU__BSSGP_template tmp_469;
tmp_469.pDU__BSSGP__BVC__RESET__ACK() = ANY_VALUE;
tmp_459_8b = tmp_469.match(tmp_460);
}
if(tmp_459_8b) goto tmp_459_8;
}
current_location.update_lineno(3780);
/* Osmocom_Gb_Types.ttcn, line 3780 */
{
boolean tmp_459_9b;
{
BSSGP__Types::PDU__BSSGP_template tmp_470;
tmp_470.pDU__BSSGP__STATUS() = ANY_VALUE;
tmp_459_9b = tmp_470.match(tmp_460);
}
if(tmp_459_9b) goto tmp_459_9;
}
current_location.update_lineno(3783);
/* Osmocom_Gb_Types.ttcn, line 3783 */
{
boolean tmp_459_10b;
{
BSSGP__Types::PDU__BSSGP_template tmp_471;
tmp_471.pDU__BSSGP__PERFORM__LOCATION__REQUEST() = ANY_VALUE;
tmp_459_10b = tmp_471.match(tmp_460);
}
if(tmp_459_10b) goto tmp_459_10;
}
current_location.update_lineno(3786);
/* Osmocom_Gb_Types.ttcn, line 3786 */
{
boolean tmp_459_11b;
{
BSSGP__Types::PDU__BSSGP_template tmp_472;
tmp_472.pDU__BSSGP__PERFORM__LOCATION__RESPONSE() = ANY_VALUE;
tmp_459_11b = tmp_472.match(tmp_460);
}
if(tmp_459_11b) goto tmp_459_11;
}
current_location.update_lineno(3789);
/* Osmocom_Gb_Types.ttcn, line 3789 */
{
boolean tmp_459_12b;
{
BSSGP__Types::PDU__BSSGP_template tmp_473;
tmp_473.pDU__BSSGP__PERFORM__LOCATION__ABORT() = ANY_VALUE;
tmp_459_12b = tmp_473.match(tmp_460);
}
if(tmp_459_12b) goto tmp_459_12;
}
current_location.update_lineno(3792);
/* Osmocom_Gb_Types.ttcn, line 3792 */
{
boolean tmp_459_13b;
{
BSSGP__Types::PDU__BSSGP_template tmp_474;
tmp_474.pDU__BSSGP__POSITION__COMMAND() = ANY_VALUE;
tmp_459_13b = tmp_474.match(tmp_460);
}
if(tmp_459_13b) goto tmp_459_13;
}
current_location.update_lineno(3795);
/* Osmocom_Gb_Types.ttcn, line 3795 */
{
boolean tmp_459_14b;
{
BSSGP__Types::PDU__BSSGP_template tmp_475;
tmp_475.pDU__BSSGP__POSITION__RESPONSE() = ANY_VALUE;
tmp_459_14b = tmp_475.match(tmp_460);
}
if(tmp_459_14b) goto tmp_459_14;
}
current_location.update_lineno(3798);
/* Osmocom_Gb_Types.ttcn, line 3798 */
{
boolean tmp_459_15b;
{
BSSGP__Types::PDU__BSSGP_template tmp_476;
{
BSSGP__Types::PDU__BSSGP__PAGING__PS_template& tmp_477 = tmp_476.pDU__BSSGP__PAGING__PS();
tmp_477.bssgpPduType() = ANY_VALUE;
tmp_477.iMSI() = ANY_VALUE;
tmp_477.dRX__Parameters() = ANY_OR_OMIT;
tmp_477.paging__Field4().bVCI() = ANY_VALUE;
tmp_477.pFI() = ANY_OR_OMIT;
tmp_477.aBQP() = ANY_OR_OMIT;
tmp_477.qoS__Profile() = ANY_VALUE;
tmp_477.pTMSI() = ANY_OR_OMIT;
tmp_477.eDRX__Paremeters() = ANY_OR_OMIT;
}
tmp_459_15b = tmp_476.match(tmp_460);
}
if(tmp_459_15b) goto tmp_459_15;
}
current_location.update_lineno(3801);
/* Osmocom_Gb_Types.ttcn, line 3801 */
{
boolean tmp_459_16b;
{
BSSGP__Types::PDU__BSSGP_template tmp_478;
{
BSSGP__Types::PDU__BSSGP__PAGING__CS_template& tmp_479 = tmp_478.pDU__BSSGP__PAGING__CS();
tmp_479.bssgpPduType() = ANY_VALUE;
tmp_479.iMSI() = ANY_VALUE;
tmp_479.dRX__Parameters() = ANY_VALUE;
tmp_479.paging__Field4().bVCI() = ANY_VALUE;
tmp_479.tLLI() = ANY_OR_OMIT;
tmp_479.channel__needed() = ANY_OR_OMIT;
tmp_479.eMLPP__Priority() = ANY_OR_OMIT;
tmp_479.tMSI() = ANY_OR_OMIT;
tmp_479.global__CN__Id() = ANY_OR_OMIT;
}
tmp_459_16b = tmp_478.match(tmp_460);
}
if(tmp_459_16b) goto tmp_459_16;
}
goto tmp_459_end;
tmp_459_0:
{
current_location.update_lineno(3754);
/* Osmocom_Gb_Types.ttcn, line 3754 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__FLUSH__LL().bVCI__old());
}
tmp_459_1:
{
current_location.update_lineno(3757);
/* Osmocom_Gb_Types.ttcn, line 3757 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__FLUSH__LL__ACK().bVCI__new());
}
tmp_459_2:
{
current_location.update_lineno(3760);
/* Osmocom_Gb_Types.ttcn, line 3760 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__LLC__DISCARDED().bVCI());
}
tmp_459_3:
{
current_location.update_lineno(3763);
/* Osmocom_Gb_Types.ttcn, line 3763 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__BVC__BLOCK().bVCI());
}
tmp_459_4:
{
current_location.update_lineno(3766);
/* Osmocom_Gb_Types.ttcn, line 3766 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__BVC__BLOCK__ACK().bVCI());
}
tmp_459_5:
{
current_location.update_lineno(3769);
/* Osmocom_Gb_Types.ttcn, line 3769 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__BVC__UNBLOCK().bVCI());
}
tmp_459_6:
{
current_location.update_lineno(3772);
/* Osmocom_Gb_Types.ttcn, line 3772 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__BVC__UNBLOCK__ACK().bVCI());
}
tmp_459_7:
{
current_location.update_lineno(3775);
/* Osmocom_Gb_Types.ttcn, line 3775 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__BVC__RESET().bVCI());
}
tmp_459_8:
{
current_location.update_lineno(3778);
/* Osmocom_Gb_Types.ttcn, line 3778 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__BVC__RESET__ACK().bVCI());
}
tmp_459_9:
{
current_location.update_lineno(3781);
/* Osmocom_Gb_Types.ttcn, line 3781 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__STATUS().bVCI());
}
tmp_459_10:
{
current_location.update_lineno(3784);
/* Osmocom_Gb_Types.ttcn, line 3784 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__PERFORM__LOCATION__REQUEST().bVCI());
}
tmp_459_11:
{
current_location.update_lineno(3787);
/* Osmocom_Gb_Types.ttcn, line 3787 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__PERFORM__LOCATION__RESPONSE().bVCI());
}
tmp_459_12:
{
current_location.update_lineno(3790);
/* Osmocom_Gb_Types.ttcn, line 3790 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__PERFORM__LOCATION__ABORT().bVCI());
}
tmp_459_13:
{
current_location.update_lineno(3793);
/* Osmocom_Gb_Types.ttcn, line 3793 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__POSITION__COMMAND().bVCI());
}
tmp_459_14:
{
current_location.update_lineno(3796);
/* Osmocom_Gb_Types.ttcn, line 3796 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__POSITION__RESPONSE().bVCI());
}
tmp_459_15:
{
current_location.update_lineno(3799);
/* Osmocom_Gb_Types.ttcn, line 3799 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__PAGING__PS().paging__Field4().bVCI());
}
tmp_459_16:
{
current_location.update_lineno(3802);
/* Osmocom_Gb_Types.ttcn, line 3802 */
return BSSGP__Types::BVCI_template(const_cast< const BSSGP__Types::PDU__BSSGP&>(pdu).pDU__BSSGP__PAGING__CS().paging__Field4().bVCI());
}
tmp_459_end: /* empty */;
}
current_location.update_lineno(3805);
/* Osmocom_Gb_Types.ttcn, line 3805 */
return BSSGP__Types::BVCI_template(OMIT_VALUE);
}

INTEGER_template f__BSSGP__BVCI__get(const BSSGP__Types::PDU__BSSGP& pdu)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3809, TTCN_Location::LOCATION_FUNCTION, "f_BSSGP_BVCI_get");
current_location.update_lineno(3810);
/* Osmocom_Gb_Types.ttcn, line 3810 */
BSSGP__Types::BVCI_template bvci__raw(f__BSSGP__BVCI__IE__get(pdu));
current_location.update_lineno(3811);
/* Osmocom_Gb_Types.ttcn, line 3811 */
if (bvci__raw.get_istemplate_kind((const char*)cs_0)) {
current_location.update_lineno(3812);
/* Osmocom_Gb_Types.ttcn, line 3812 */
return INTEGER_template(OMIT_VALUE);
}
current_location.update_lineno(3814);
/* Osmocom_Gb_Types.ttcn, line 3814 */
return INTEGER_template(oct2int(const_cast< const BSSGP__Types::BVCI_template&>(bvci__raw).unstructured__value().valueof()));
}

void TlliType_encoder(const TlliType& input_value, OCTETSTRING& output_stream, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, TRUE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.TlliType' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf;
input_value.encode(TlliType_descr_, ttcn_buf, coding_type, extra_options);
ttcn_buf.get_string(output_stream);
}

INTEGER TlliType_decoder(OCTETSTRING& input_stream, TlliType& output_value, const UNIVERSAL_CHARSTRING& coding_name)
{
TTCN_EncDec::coding_t coding_type;
unsigned int extra_options = 0;
TTCN_EncDec::get_coding_from_str(coding_name, &coding_type, &extra_options, FALSE);
if (coding_type != TTCN_EncDec::CT_RAW) {
TTCN_Logger::begin_event_log2str();
coding_name.log();
TTCN_error("Type `@Osmocom_Gb_Types.TlliType' does not support %s encoding", (const char*) TTCN_Logger::end_event_log2str());
}
TTCN_Buffer ttcn_buf(input_stream);
output_value.decode(TlliType_descr_, ttcn_buf, coding_type, extra_options);
switch (TTCN_EncDec::get_last_error_type()) {
case TTCN_EncDec::ET_NONE:
ttcn_buf.cut();
ttcn_buf.get_string(input_stream);
return 0;
case TTCN_EncDec::ET_INCOMPL_MSG:
case TTCN_EncDec::ET_LEN_ERR:
return 2;
default:
return 1;
}
}

TlliType f__gprs__tlli__type(const OCTETSTRING& tlli)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3829, TTCN_Location::LOCATION_FUNCTION, "f_gprs_tlli_type");
current_location.update_lineno(3830);
/* Osmocom_Gb_Types.ttcn, line 3830 */
BITSTRING tllib(oct2bit(tlli));
current_location.update_lineno(3831);
/* Osmocom_Gb_Types.ttcn, line 3831 */
if ((substr(tllib, 0, 2) == bs_10)) {
current_location.update_lineno(3832);
/* Osmocom_Gb_Types.ttcn, line 3832 */
return TlliType::TLLI__LOCAL;
}
else {
current_location.update_lineno(3833);
/* Osmocom_Gb_Types.ttcn, line 3833 */
if ((substr(tllib, 0, 2) == bs_11)) {
current_location.update_lineno(3834);
/* Osmocom_Gb_Types.ttcn, line 3834 */
return TlliType::TLLI__FOREIGN;
}
else {
current_location.update_lineno(3835);
/* Osmocom_Gb_Types.ttcn, line 3835 */
if ((substr(tllib, 0, 5) == bs_12)) {
current_location.update_lineno(3836);
/* Osmocom_Gb_Types.ttcn, line 3836 */
return TlliType::TLLI__RANDOM;
}
else {
current_location.update_lineno(3837);
/* Osmocom_Gb_Types.ttcn, line 3837 */
if ((substr(tllib, 0, 4) == bs_13)) {
current_location.update_lineno(3838);
/* Osmocom_Gb_Types.ttcn, line 3838 */
return TlliType::TLLI__RESERVED;
}
else {
current_location.update_lineno(3839);
/* Osmocom_Gb_Types.ttcn, line 3839 */
if ((substr(tllib, 0, 3) == bs_9)) {
current_location.update_lineno(3840);
/* Osmocom_Gb_Types.ttcn, line 3840 */
return TlliType::TLLI__RESERVED;
}
else {
current_location.update_lineno(3841);
/* Osmocom_Gb_Types.ttcn, line 3841 */
if ((substr(tllib, 0, 4) == bs_8)) {
current_location.update_lineno(3842);
/* Osmocom_Gb_Types.ttcn, line 3842 */
return TlliType::TLLI__G__RNTI;
}
else {
current_location.update_lineno(3843);
/* Osmocom_Gb_Types.ttcn, line 3843 */
if ((substr(tllib, 0, 4) == bs_5)) {
current_location.update_lineno(3844);
/* Osmocom_Gb_Types.ttcn, line 3844 */
return TlliType::TLLI__RAND__G__RNTI;
}
else {
current_location.update_lineno(3846);
/* Osmocom_Gb_Types.ttcn, line 3846 */
Misc__Helpers::f__shutdown(cs_3, 3846, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unknonw TLLI Type "),tllib.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(3848);
/* Osmocom_Gb_Types.ttcn, line 3848 */
return TlliType::TLLI__LOCAL;
}
}
}
}
}
}
}
}

OCTETSTRING f__gprs__tlli__from__tmsi(const OCTETSTRING& tmsi, const TlliType& tlli__type)
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3853, TTCN_Location::LOCATION_FUNCTION, "f_gprs_tlli_from_tmsi");
current_location.update_lineno(3854);
/* Osmocom_Gb_Types.ttcn, line 3854 */
BITSTRING tmsi__bits(oct2bit(tmsi));
current_location.update_lineno(3855);
/* Osmocom_Gb_Types.ttcn, line 3855 */
BITSTRING prefix;
{
const TlliType &tmp_481 = tlli__type;
current_location.update_lineno(3857);
/* Osmocom_Gb_Types.ttcn, line 3857 */
if(tmp_481 == TlliType::TLLI__LOCAL) goto tmp_480_0;
current_location.update_lineno(3858);
/* Osmocom_Gb_Types.ttcn, line 3858 */
if(tmp_481 == TlliType::TLLI__FOREIGN) goto tmp_480_1;
current_location.update_lineno(3859);
/* Osmocom_Gb_Types.ttcn, line 3859 */
if(tmp_481 == TlliType::TLLI__RANDOM) goto tmp_480_2;
current_location.update_lineno(3860);
/* Osmocom_Gb_Types.ttcn, line 3860 */
if(tmp_481 == TlliType::TLLI__RESERVED) goto tmp_480_3;
current_location.update_lineno(3861);
/* Osmocom_Gb_Types.ttcn, line 3861 */
if(tmp_481 == TlliType::TLLI__G__RNTI) goto tmp_480_4;
current_location.update_lineno(3862);
/* Osmocom_Gb_Types.ttcn, line 3862 */
if(tmp_481 == TlliType::TLLI__RAND__G__RNTI) goto tmp_480_5;
goto tmp_480_6;
tmp_480_0:
{
current_location.update_lineno(3857);
/* Osmocom_Gb_Types.ttcn, line 3857 */
prefix = bs_10;
goto tmp_480_end;
}
tmp_480_1:
{
current_location.update_lineno(3858);
/* Osmocom_Gb_Types.ttcn, line 3858 */
prefix = bs_12;
goto tmp_480_end;
}
tmp_480_2:
{
current_location.update_lineno(3859);
/* Osmocom_Gb_Types.ttcn, line 3859 */
prefix = bs_13;
goto tmp_480_end;
}
tmp_480_3:
{
current_location.update_lineno(3860);
/* Osmocom_Gb_Types.ttcn, line 3860 */
prefix = bs_9;
goto tmp_480_end;
}
tmp_480_4:
{
current_location.update_lineno(3861);
/* Osmocom_Gb_Types.ttcn, line 3861 */
prefix = bs_8;
goto tmp_480_end;
}
tmp_480_5:
{
current_location.update_lineno(3862);
/* Osmocom_Gb_Types.ttcn, line 3862 */
prefix = bs_5;
goto tmp_480_end;
}
tmp_480_6:
{
current_location.update_lineno(3864);
/* Osmocom_Gb_Types.ttcn, line 3864 */
Misc__Helpers::f__shutdown(cs_3, 3864, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unknonw TLLI Type "),tlli__type.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(3866);
/* Osmocom_Gb_Types.ttcn, line 3866 */
return os_73;
}
tmp_480_end: /* empty */;
}
current_location.update_lineno(3869);
/* Osmocom_Gb_Types.ttcn, line 3869 */
return bit2oct((prefix + substr(tmsi__bits, prefix.lengthof(), (32 - prefix.lengthof()))));
}

OCTETSTRING f__gprs__tlli__random()
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 3872, TTCN_Location::LOCATION_FUNCTION, "f_gprs_tlli_random");
current_location.update_lineno(3873);
/* Osmocom_Gb_Types.ttcn, line 3873 */
OCTETSTRING tlli(Osmocom__Types::f__rnd__octstring(4));
current_location.update_lineno(3874);
/* Osmocom_Gb_Types.ttcn, line 3874 */
return (tlli | os_74);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "Osmocom_Gb_Types");
GSM__Types::module_object.pre_init_module();
BSSGP__Types::module_object.pre_init_module();
NS__Types::module_object.pre_init_module();
module_object.add_function("ts_NS_IE_CAUSE_omit", (genericfunc_t)&ts__NS__IE__CAUSE__omit, NULL);
module_object.add_function("tr_NS_IE_CAUSE", (genericfunc_t)&tr__NS__IE__CAUSE, NULL);
module_object.add_function("ts_SNS_IP_ADDR", (genericfunc_t)&ts__SNS__IP__ADDR, NULL);
module_object.add_function("tr_SNS_IP_ADDR", (genericfunc_t)&tr__SNS__IP__ADDR, NULL);
module_object.add_function("tr_SNS_IPv4", (genericfunc_t)&tr__SNS__IPv4, NULL);
module_object.add_function("tr_SNS_IPv6", (genericfunc_t)&tr__SNS__IPv6, NULL);
module_object.add_function("ts_num_of_ep", (genericfunc_t)&ts__num__of__ep, NULL);
module_object.add_function("tr_num_of_ep", (genericfunc_t)&tr__num__of__ep, NULL);
module_object.add_function("ts_SNS_IE_ListIP4", (genericfunc_t)&ts__SNS__IE__ListIP4, NULL);
module_object.add_function("tr_SNS_IE_ListIP4", (genericfunc_t)&tr__SNS__IE__ListIP4, NULL);
module_object.add_function("ts_SNS_IE_ListIP6", (genericfunc_t)&ts__SNS__IE__ListIP6, NULL);
module_object.add_function("tr_SNS_IE_ListIP6", (genericfunc_t)&tr__SNS__IE__ListIP6, NULL);
module_object.add_function("tr_FLUSH_ACTION", (genericfunc_t)&tr__FLUSH__ACTION, NULL);
module_object.add_function("tr_NO_OCT_AFF", (genericfunc_t)&tr__NO__OCT__AFF, NULL);
module_object.add_function("tr_LLC_FRAMES_DISCARDED", (genericfunc_t)&tr__LLC__FRAMES__DISCARDED, NULL);
module_object.add_function("tr_BSSGP_BVCI", (genericfunc_t)&tr__BSSGP__BVCI, NULL);
module_object.add_function("f_ts_BSSGP_BVCI", (genericfunc_t)&f__ts__BSSGP__BVCI, NULL);
module_object.add_function("t_BSSGP_NSEI", (genericfunc_t)&t__BSSGP__NSEI, NULL);
module_object.add_function("f_ts_BSSGP_NSEI", (genericfunc_t)&f__ts__BSSGP__NSEI, NULL);
module_object.add_function("f_ts_BSSGP_TLLI", (genericfunc_t)&f__ts__BSSGP__TLLI, NULL);
module_object.add_function("f_tr_BSSGP_TLLI", (genericfunc_t)&f__tr__BSSGP__TLLI, NULL);
module_object.add_function("f_ts_BSSGP_IMSI", (genericfunc_t)&f__ts__BSSGP__IMSI, NULL);
module_object.add_function("f_tr_BSSGP_IMSI", (genericfunc_t)&f__tr__BSSGP__IMSI, NULL);
module_object.add_function("f_ts_BSSGP_TMSI", (genericfunc_t)&f__ts__BSSGP__TMSI, NULL);
module_object.add_function("f_tr_BSSGP_TMSI", (genericfunc_t)&f__tr__BSSGP__TMSI, NULL);
module_object.add_function("f_bssgp_length_ind", (genericfunc_t)&f__bssgp__length__ind, NULL);
module_object.add_function("ts_BSSGP_CAUSE", (genericfunc_t)&ts__BSSGP__CAUSE, NULL);
module_object.add_function("tr_BSSGP_CAUSE", (genericfunc_t)&tr__BSSGP__CAUSE, NULL);
module_object.add_function("tr_BSSGP_IE_CellId", (genericfunc_t)&tr__BSSGP__IE__CellId, NULL);
module_object.add_function("f_ts_BSSGP_IE_CellId", (genericfunc_t)&f__ts__BSSGP__IE__CellId, NULL);
module_object.add_function("f_presence_bit_MultislotCap_GPRS_BSSGP", (genericfunc_t)&f__presence__bit__MultislotCap__GPRS__BSSGP, NULL);
module_object.add_function("f_presence_bit_MultislotCap_EGPRS_BSSGP", (genericfunc_t)&f__presence__bit__MultislotCap__EGPRS__BSSGP, NULL);
module_object.add_function("ts_BSSGP_IE_MSRAcap_omit", (genericfunc_t)&ts__BSSGP__IE__MSRAcap__omit, NULL);
module_object.add_function("tr_BSSGP_IE_MSRAcap", (genericfunc_t)&tr__BSSGP__IE__MSRAcap, NULL);
module_object.add_function("f_ts_BSSGP_RA_ID", (genericfunc_t)&f__ts__BSSGP__RA__ID, NULL);
module_object.add_function("f_tr_BSSGP_RA_ID", (genericfunc_t)&f__tr__BSSGP__RA__ID, NULL);
module_object.add_function("f_ts_BSSGP_PlmnId", (genericfunc_t)&f__ts__BSSGP__PlmnId, NULL);
module_object.add_function("f_tr_BSSGP_PlmnId", (genericfunc_t)&f__tr__BSSGP__PlmnId, NULL);
module_object.add_function("ts_BSSGP_RADIO_CAUSE", (genericfunc_t)&ts__BSSGP__RADIO__CAUSE, NULL);
module_object.add_function("tr_BSSGP_RADIO_CAUSE", (genericfunc_t)&tr__BSSGP__RADIO__CAUSE, NULL);
current_location.update_lineno(2601);
/* Osmocom_Gb_Types.ttcn, line 2601 */
const_RIM__APP__ID__NACC = os_2;
current_location.update_lineno(2602);
/* Osmocom_Gb_Types.ttcn, line 2602 */
const_RIM__APP__ID__SI3 = os_3;
current_location.update_lineno(2603);
/* Osmocom_Gb_Types.ttcn, line 2603 */
const_RIM__APP__ID__MBMS__DATA__CH = os_5;
current_location.update_lineno(2604);
/* Osmocom_Gb_Types.ttcn, line 2604 */
const_RIM__APP__ID__SON__TRANSF = os_4;
current_location.update_lineno(2605);
/* Osmocom_Gb_Types.ttcn, line 2605 */
const_RIM__APP__ID__UTRA__SI = os_6;
module_object.add_function("tr_RIM_Sequence_Number", (genericfunc_t)&tr__RIM__Sequence__Number, NULL);
module_object.add_function("tr_RAN_Information_Application_Container_NACC", (genericfunc_t)&tr__RAN__Information__Application__Container__NACC, NULL);
module_object.add_function("tr_Application_Error_Container_NACC", (genericfunc_t)&tr__Application__Error__Container__NACC, NULL);
module_object.add_function("t_LocationAreaIdentification", (genericfunc_t)&t__LocationAreaIdentification, NULL);
current_location.update_lineno(3259);
/* Osmocom_Gb_Types.ttcn, line 3259 */
const_RIM__PDU__TYPE__STOP = bs_6;
current_location.update_lineno(3260);
/* Osmocom_Gb_Types.ttcn, line 3260 */
const_RIM__PDU__TYPE__SING__REP = bs_4;
current_location.update_lineno(3261);
/* Osmocom_Gb_Types.ttcn, line 3261 */
const_RIM__PDU__TYPE__MULT__REP = bs_9;
module_object.add_function("tr_RIM_PDU_Indications", (genericfunc_t)&tr__RIM__PDU__Indications, NULL);
module_object.add_function("tr_RIM_Protocol_Version_Number", (genericfunc_t)&tr__RIM__Protocol__Version__Number, NULL);
current_location.update_lineno(3320);
/* Osmocom_Gb_Types.ttcn, line 3320 */
const_RIM__ADDR__GERAN__CELL__ID = hs_0;
current_location.update_lineno(3321);
/* Osmocom_Gb_Types.ttcn, line 3321 */
const_RIM__ADDR__UTRAN__RNC__ID = hs_1;
current_location.update_lineno(3322);
/* Osmocom_Gb_Types.ttcn, line 3322 */
const_RIM__ADDR__EUTRAN__NODEB__ID = hs_2;
current_location.update_lineno(3323);
/* Osmocom_Gb_Types.ttcn, line 3323 */
const_RIM__ADDR__EHRPD__SECTOR__ID = hs_3;
module_object.add_function("tr_Cell_Identifier_V", (genericfunc_t)&tr__Cell__Identifier__V, NULL);
module_object.add_function("t_GlobalRNC_ID_BSSGP", (genericfunc_t)&t__GlobalRNC__ID__BSSGP, NULL);
module_object.add_function("t_ENB_Identifier_V", (genericfunc_t)&t__ENB__Identifier__V, NULL);
module_object.add_function("f_BSSGP_BVCI_IE_get", (genericfunc_t)&f__BSSGP__BVCI__IE__get, NULL);
module_object.add_function("f_BSSGP_BVCI_get", (genericfunc_t)&f__BSSGP__BVCI__get, NULL);
module_object.add_function("f_gprs_tlli_type", (genericfunc_t)&f__gprs__tlli__type, NULL);
module_object.add_function("f_gprs_tlli_from_tmsi", (genericfunc_t)&f__gprs__tlli__from__tmsi, NULL);
module_object.add_function("f_gprs_tlli_random", (genericfunc_t)&f__gprs__tlli__random, NULL);
}

void post_init_module()
{
TTCN_Location current_location("Osmocom_Gb_Types.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "Osmocom_Gb_Types");
GSM__Types::module_object.post_init_module();
BSSGP__Types::module_object.post_init_module();
NS__Types::module_object.post_init_module();
current_location.update_lineno(18);
/* Osmocom_Gb_Types.ttcn, line 18 */
template_t__BssgpBvciUser.set_type(COMPLEMENTED_LIST, 1);
template_t__BssgpBvciUser.list_item(0) = 0;
template_t__BssgpBvciUser.check_restriction(TR_PRESENT);
current_location.update_lineno(81);
/* Osmocom_Gb_Types.ttcn, line 81 */
template_t__SduCtrlB.rBit() = bs_0;
template_t__SduCtrlB.cBit() = bs_0;
template_t__SduCtrlB.spare() = bs_1;
current_location.update_lineno(199);
/* Osmocom_Gb_Types.ttcn, line 199 */
const_ts__SNS__IPv4_sig__weight_defval = 1;
current_location.update_lineno(199);
/* Osmocom_Gb_Types.ttcn, line 199 */
const_ts__SNS__IPv4_data__weight_defval = 1;
current_location.update_lineno(206);
/* Osmocom_Gb_Types.ttcn, line 206 */
template_tr__SNS__IPv4_sig__weight_defval = ANY_VALUE;
current_location.update_lineno(206);
/* Osmocom_Gb_Types.ttcn, line 206 */
template_tr__SNS__IPv4_data__weight_defval = ANY_VALUE;
current_location.update_lineno(233);
/* Osmocom_Gb_Types.ttcn, line 233 */
const_ts__SNS__IPv6_sig__weight_defval = 1;
current_location.update_lineno(233);
/* Osmocom_Gb_Types.ttcn, line 233 */
const_ts__SNS__IPv6_data__weight_defval = 1;
current_location.update_lineno(240);
/* Osmocom_Gb_Types.ttcn, line 240 */
template_tr__SNS__IPv6_sig__weight_defval = ANY_VALUE;
current_location.update_lineno(240);
/* Osmocom_Gb_Types.ttcn, line 240 */
template_tr__SNS__IPv6_data__weight_defval = ANY_VALUE;
current_location.update_lineno(327);
/* Osmocom_Gb_Types.ttcn, line 327 */
template_t__NS__UNBLOCK.pDU__NS__Unblock().nsPduType() = os_7;
current_location.update_lineno(333);
/* Osmocom_Gb_Types.ttcn, line 333 */
template_t__NS__UNBLOCK__ACK.pDU__NS__Unblock__Ack().nsPduType() = os_8;
current_location.update_lineno(339);
/* Osmocom_Gb_Types.ttcn, line 339 */
template_t__NS__ALIVE.pDU__NS__Alive().nsPduType() = os_9;
current_location.update_lineno(345);
/* Osmocom_Gb_Types.ttcn, line 345 */
template_t__NS__ALIVE__ACK.pDU__NS__Alive__Ack().nsPduType() = os_1;
current_location.update_lineno(467);
/* Osmocom_Gb_Types.ttcn, line 467 */
const_ts__SNS__SIZE_rst__flag_defval = TRUE;
current_location.update_lineno(468);
/* Osmocom_Gb_Types.ttcn, line 468 */
const_ts__SNS__SIZE_max__nsvcs_defval = 2;
current_location.update_lineno(469);
/* Osmocom_Gb_Types.ttcn, line 469 */
template_ts__SNS__SIZE_num__v4_defval = 1;
current_location.update_lineno(470);
/* Osmocom_Gb_Types.ttcn, line 470 */
template_ts__SNS__SIZE_num__v6_defval = OMIT_VALUE;
current_location.update_lineno(480);
/* Osmocom_Gb_Types.ttcn, line 480 */
template_tr__SNS__SIZE_rst__flag_defval = ANY_VALUE;
current_location.update_lineno(481);
/* Osmocom_Gb_Types.ttcn, line 481 */
template_tr__SNS__SIZE_max__nsvcs_defval = ANY_VALUE;
current_location.update_lineno(482);
/* Osmocom_Gb_Types.ttcn, line 482 */
template_tr__SNS__SIZE_num__v4_defval = ANY_VALUE;
current_location.update_lineno(483);
/* Osmocom_Gb_Types.ttcn, line 483 */
template_tr__SNS__SIZE_num__v6_defval = ANY_OR_OMIT;
current_location.update_lineno(588);
/* Osmocom_Gb_Types.ttcn, line 588 */
template_ts__SNS__CONFIG_v4_defval = OMIT_VALUE;
current_location.update_lineno(589);
/* Osmocom_Gb_Types.ttcn, line 589 */
template_ts__SNS__CONFIG_v6_defval = OMIT_VALUE;
current_location.update_lineno(599);
/* Osmocom_Gb_Types.ttcn, line 599 */
template_tr__SNS__CONFIG_v4_defval = OMIT_VALUE;
current_location.update_lineno(600);
/* Osmocom_Gb_Types.ttcn, line 600 */
template_tr__SNS__CONFIG_v6_defval = OMIT_VALUE;
current_location.update_lineno(627);
/* Osmocom_Gb_Types.ttcn, line 627 */
template_ts__SNS__ADD_v6_defval = OMIT_VALUE;
current_location.update_lineno(638);
/* Osmocom_Gb_Types.ttcn, line 638 */
template_tr__SNS__ADD_v6_defval = OMIT_VALUE;
current_location.update_lineno(651);
/* Osmocom_Gb_Types.ttcn, line 651 */
template_ts__SNS__DEL_v6_defval = OMIT_VALUE;
current_location.update_lineno(664);
/* Osmocom_Gb_Types.ttcn, line 664 */
template_tr__SNS__DEL_v6_defval = OMIT_VALUE;
current_location.update_lineno(677);
/* Osmocom_Gb_Types.ttcn, line 677 */
template_ts__SNS__CHG__WEIGHT_v6_defval = OMIT_VALUE;
current_location.update_lineno(688);
/* Osmocom_Gb_Types.ttcn, line 688 */
template_tr__SNS__CHG__WEIGHT_v6_defval = OMIT_VALUE;
current_location.update_lineno(700);
/* Osmocom_Gb_Types.ttcn, line 700 */
template_ts__SNS__ACK_cause_defval = OMIT_VALUE;
current_location.update_lineno(701);
/* Osmocom_Gb_Types.ttcn, line 701 */
template_ts__SNS__ACK_v4_defval = OMIT_VALUE;
current_location.update_lineno(702);
/* Osmocom_Gb_Types.ttcn, line 702 */
template_ts__SNS__ACK_v6_defval = OMIT_VALUE;
current_location.update_lineno(713);
/* Osmocom_Gb_Types.ttcn, line 713 */
template_tr__SNS__ACK_trans__id_defval = ANY_VALUE;
current_location.update_lineno(714);
/* Osmocom_Gb_Types.ttcn, line 714 */
template_tr__SNS__ACK_cause_defval = OMIT_VALUE;
current_location.update_lineno(715);
/* Osmocom_Gb_Types.ttcn, line 715 */
template_tr__SNS__ACK_v4_defval = ANY_OR_OMIT;
current_location.update_lineno(716);
/* Osmocom_Gb_Types.ttcn, line 716 */
template_tr__SNS__ACK_v6_defval = ANY_OR_OMIT;
current_location.update_lineno(1087);
/* Osmocom_Gb_Types.ttcn, line 1087 */
template_tr__BSSGP__LLC__PDU_pdu_defval = ANY_VALUE;
current_location.update_lineno(1375);
/* Osmocom_Gb_Types.ttcn, line 1375 */
template_tr__BVC__FC__BVC_bmax_defval = ANY_VALUE;
current_location.update_lineno(1376);
/* Osmocom_Gb_Types.ttcn, line 1376 */
template_tr__BVC__FC__BVC_bucket__leak__rate_defval = ANY_VALUE;
current_location.update_lineno(1377);
/* Osmocom_Gb_Types.ttcn, line 1377 */
template_tr__BVC__FC__BVC_bmax__default__ms_defval = ANY_VALUE;
current_location.update_lineno(1378);
/* Osmocom_Gb_Types.ttcn, line 1378 */
template_tr__BVC__FC__BVC_r__default__ms_defval = ANY_VALUE;
current_location.update_lineno(1379);
/* Osmocom_Gb_Types.ttcn, line 1379 */
template_tr__BVC__FC__BVC_tag_defval = ANY_VALUE;
current_location.update_lineno(1490);
/* Osmocom_Gb_Types.ttcn, line 1490 */
template_tr__BVC__FC__MS_tlli_defval = ANY_VALUE;
current_location.update_lineno(1491);
/* Osmocom_Gb_Types.ttcn, line 1491 */
template_tr__BVC__FC__MS_bmax_defval = ANY_VALUE;
current_location.update_lineno(1492);
/* Osmocom_Gb_Types.ttcn, line 1492 */
template_tr__BVC__FC__MS_bucket__leak__rate_defval = ANY_VALUE;
current_location.update_lineno(1493);
/* Osmocom_Gb_Types.ttcn, line 1493 */
template_tr__BVC__FC__MS_tag_defval = ANY_VALUE;
current_location.update_lineno(1544);
/* Osmocom_Gb_Types.ttcn, line 1544 */
template_tr__BVC__FC__MS__ACK_tag_defval = ANY_VALUE;
current_location.update_lineno(1578);
/* Osmocom_Gb_Types.ttcn, line 1578 */
template_tr__BSSGP__STATUS_bvci_defval = ANY_VALUE;
current_location.update_lineno(1578);
/* Osmocom_Gb_Types.ttcn, line 1578 */
template_tr__BSSGP__STATUS_cause_defval = ANY_VALUE;
current_location.update_lineno(1579);
/* Osmocom_Gb_Types.ttcn, line 1579 */
template_tr__BSSGP__STATUS_pdu_defval = ANY_VALUE;
current_location.update_lineno(1607);
/* Osmocom_Gb_Types.ttcn, line 1607 */
const_ts__RaCapRec__BSSGP_att_defval = bs_5;
current_location.update_lineno(1607);
/* Osmocom_Gb_Types.ttcn, line 1607 */
template_ts__RaCapRec__BSSGP_mscap__gprs_defval = OMIT_VALUE;
current_location.update_lineno(1607);
/* Osmocom_Gb_Types.ttcn, line 1607 */
template_ts__RaCapRec__BSSGP_mscap__egprs_defval = OMIT_VALUE;
current_location.update_lineno(1647);
/* Osmocom_Gb_Types.ttcn, line 1647 */
template_tr__RaCapRec__BSSGP_att_defval = bs_5;
current_location.update_lineno(1647);
/* Osmocom_Gb_Types.ttcn, line 1647 */
template_tr__RaCapRec__BSSGP_mscap__gprs_defval = ANY_OR_OMIT;
current_location.update_lineno(1648);
/* Osmocom_Gb_Types.ttcn, line 1648 */
template_tr__RaCapRec__BSSGP_mscap__egprs_defval = ANY_OR_OMIT;
current_location.update_lineno(1689);
/* Osmocom_Gb_Types.ttcn, line 1689 */
template_t__defaultQos.peak__Bit__Rate() = os_39;
template_t__defaultQos.precedence() = bs_6;
template_t__defaultQos.a__bit() = bs_0;
template_t__defaultQos.t__bit() = bs_0;
template_t__defaultQos.c__r__bit() = bs_0;
template_t__defaultQos.peakBitRateGranularity() = bs_7;
current_location.update_lineno(1710);
/* Osmocom_Gb_Types.ttcn, line 1710 */
const_t__DefaultLifetime_delay_defval = 65535;
current_location.update_lineno(1719);
/* Osmocom_Gb_Types.ttcn, line 1719 */
template_t__defaultDRXparam.iEI() = os_9;
template_t__defaultDRXparam.ext() = bs_2;
template_t__defaultDRXparam.lengthIndicator().length1() = 2;
template_t__defaultDRXparam.splitPG__CycleCode() = os_0;
template_t__defaultDRXparam.nonDRXTimer() = bs_6;
template_t__defaultDRXparam.splitOnCCCH() = bs_0;
template_t__defaultDRXparam.cnSpecificDRXCycleLength() = bs_8;
current_location.update_lineno(1765);
/* Osmocom_Gb_Types.ttcn, line 1765 */
template_ts__BSSGP__DL__UD_racap_defval = OMIT_VALUE;
current_location.update_lineno(1766);
/* Osmocom_Gb_Types.ttcn, line 1766 */
template_ts__BSSGP__DL__UD_imsi_defval = OMIT_VALUE;
current_location.update_lineno(1796);
/* Osmocom_Gb_Types.ttcn, line 1796 */
template_tr__BSSGP__DL__UD_imsi_defval = OMIT_VALUE;
current_location.update_lineno(1845);
/* Osmocom_Gb_Types.ttcn, line 1845 */
template_tr__BSSGP__UL__UD_tlli_defval = ANY_VALUE;
current_location.update_lineno(1845);
/* Osmocom_Gb_Types.ttcn, line 1845 */
template_tr__BSSGP__UL__UD_cell__id_defval = ANY_VALUE;
current_location.update_lineno(1846);
/* Osmocom_Gb_Types.ttcn, line 1846 */
template_tr__BSSGP__UL__UD_payload_defval = ANY_VALUE;
current_location.update_lineno(1959);
/* Osmocom_Gb_Types.ttcn, line 1959 */
{
BSSGP__Types::BSS__Area__Indication_template& tmp_195 = template_ts__BssgpP4BssArea.bSS__Area__Indication();
tmp_195.iEI() = os_3;
tmp_195.ext() = bs_2;
tmp_195.lengthIndicator().length1() = 1;
tmp_195.bSS__indicator() = os_0;
}
current_location.update_lineno(2317);
/* Osmocom_Gb_Types.ttcn, line 2317 */
template_ts__BSSGP__FLUSH__LL_bvci__new_defval = OMIT_VALUE;
current_location.update_lineno(2318);
/* Osmocom_Gb_Types.ttcn, line 2318 */
template_ts__BSSGP__FLUSH__LL_nsei_defval = OMIT_VALUE;
current_location.update_lineno(2328);
/* Osmocom_Gb_Types.ttcn, line 2328 */
template_tr__BSSGP__FLUSH__LL_bvci__new_defval = OMIT_VALUE;
current_location.update_lineno(2329);
/* Osmocom_Gb_Types.ttcn, line 2329 */
template_tr__BSSGP__FLUSH__LL_nsei_defval = OMIT_VALUE;
current_location.update_lineno(2342);
/* Osmocom_Gb_Types.ttcn, line 2342 */
template_ts__BSSGP__FLUSH__LL__ACK_bvci__new_defval = OMIT_VALUE;
current_location.update_lineno(2343);
/* Osmocom_Gb_Types.ttcn, line 2343 */
template_ts__BSSGP__FLUSH__LL__ACK_nsei_defval = OMIT_VALUE;
current_location.update_lineno(2355);
/* Osmocom_Gb_Types.ttcn, line 2355 */
template_tr__BSSGP__FLUSH__LL__ACK_bvci__new_defval = OMIT_VALUE;
current_location.update_lineno(2356);
/* Osmocom_Gb_Types.ttcn, line 2356 */
template_tr__BSSGP__FLUSH__LL__ACK_nsei_defval = OMIT_VALUE;
current_location.update_lineno(2395);
/* Osmocom_Gb_Types.ttcn, line 2395 */
template_ts__BSSGP__RA__CAP_racap_defval = OMIT_VALUE;
current_location.update_lineno(2433);
/* Osmocom_Gb_Types.ttcn, line 2433 */
template_ts__BSSGP__RA__CAP__UPD__ACK_racap_defval = OMIT_VALUE;
current_location.update_lineno(2445);
/* Osmocom_Gb_Types.ttcn, line 2445 */
template_tr__BSSGP__RA__CAP__UPD__ACK_racap_defval = OMIT_VALUE;
current_location.update_lineno(2492);
/* Osmocom_Gb_Types.ttcn, line 2492 */
template_ts__BSSGP__RADIO__STATUS_tmsi_defval = OMIT_VALUE;
current_location.update_lineno(2493);
/* Osmocom_Gb_Types.ttcn, line 2493 */
template_ts__BSSGP__RADIO__STATUS_imsi_defval = OMIT_VALUE;
current_location.update_lineno(2504);
/* Osmocom_Gb_Types.ttcn, line 2504 */
template_tr__BSSGP__RADIO__STATUS_tmsi_defval = ANY_OR_OMIT;
current_location.update_lineno(2504);
/* Osmocom_Gb_Types.ttcn, line 2504 */
template_tr__BSSGP__RADIO__STATUS_imsi_defval = ANY_OR_OMIT;
current_location.update_lineno(2614);
/* Osmocom_Gb_Types.ttcn, line 2614 */
template_tr__RIM__Application__Identity_app__id_defval = ANY_VALUE;
current_location.update_lineno(2632);
/* Osmocom_Gb_Types.ttcn, line 2632 */
template_tr__RIM__Sequence__Number_seq_defval = ANY_VALUE;
current_location.update_lineno(2652);
/* Osmocom_Gb_Types.ttcn, line 2652 */
template_ts__RAN__Information__Request__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2653);
/* Osmocom_Gb_Types.ttcn, line 2653 */
template_ts__RAN__Information__Request__RIM__Container_app__cont_defval = OMIT_VALUE;
current_location.update_lineno(2654);
/* Osmocom_Gb_Types.ttcn, line 2654 */
template_ts__RAN__Information__Request__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2668);
/* Osmocom_Gb_Types.ttcn, line 2668 */
template_tr__RAN__Information__Request__RIM__Container_app__id_defval = ANY_VALUE;
current_location.update_lineno(2669);
/* Osmocom_Gb_Types.ttcn, line 2669 */
template_tr__RAN__Information__Request__RIM__Container_seq_defval = ANY_VALUE;
current_location.update_lineno(2670);
/* Osmocom_Gb_Types.ttcn, line 2670 */
template_tr__RAN__Information__Request__RIM__Container_ind_defval = ANY_VALUE;
current_location.update_lineno(2671);
/* Osmocom_Gb_Types.ttcn, line 2671 */
template_tr__RAN__Information__Request__RIM__Container_ver_defval = ANY_OR_OMIT;
current_location.update_lineno(2672);
/* Osmocom_Gb_Types.ttcn, line 2672 */
template_tr__RAN__Information__Request__RIM__Container_app__cont_defval = ANY_OR_OMIT;
current_location.update_lineno(2673);
/* Osmocom_Gb_Types.ttcn, line 2673 */
template_tr__RAN__Information__Request__RIM__Container_son__app__id_defval = ANY_OR_OMIT;
current_location.update_lineno(2693);
/* Osmocom_Gb_Types.ttcn, line 2693 */
template_ts__RAN__Information__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2694);
/* Osmocom_Gb_Types.ttcn, line 2694 */
template_ts__RAN__Information__RIM__Container_app__cont__or__app__err_defval = OMIT_VALUE;
current_location.update_lineno(2695);
/* Osmocom_Gb_Types.ttcn, line 2695 */
template_ts__RAN__Information__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2710);
/* Osmocom_Gb_Types.ttcn, line 2710 */
template_tr__RAN__Information__RIM__Container_app__id_defval = ANY_VALUE;
current_location.update_lineno(2711);
/* Osmocom_Gb_Types.ttcn, line 2711 */
template_tr__RAN__Information__RIM__Container_seq_defval = ANY_VALUE;
current_location.update_lineno(2712);
/* Osmocom_Gb_Types.ttcn, line 2712 */
template_tr__RAN__Information__RIM__Container_ind_defval = ANY_VALUE;
current_location.update_lineno(2713);
/* Osmocom_Gb_Types.ttcn, line 2713 */
template_tr__RAN__Information__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2714);
/* Osmocom_Gb_Types.ttcn, line 2714 */
template_tr__RAN__Information__RIM__Container_app__cont__or__app__err_defval = OMIT_VALUE;
current_location.update_lineno(2715);
/* Osmocom_Gb_Types.ttcn, line 2715 */
template_tr__RAN__Information__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2734);
/* Osmocom_Gb_Types.ttcn, line 2734 */
template_tru__ApplContainer__or__ApplErrContainer__NACC_cont_defval = ANY_VALUE;
current_location.update_lineno(2750);
/* Osmocom_Gb_Types.ttcn, line 2750 */
template_tru__ApplContainer__NACC_cid_defval = ANY_VALUE;
current_location.update_lineno(2750);
/* Osmocom_Gb_Types.ttcn, line 2750 */
template_tru__ApplContainer__NACC_psi__type_defval = ANY_VALUE;
current_location.update_lineno(2750);
/* Osmocom_Gb_Types.ttcn, line 2750 */
template_tru__ApplContainer__NACC_si__psi__num_defval = ANY_VALUE;
current_location.update_lineno(2750);
/* Osmocom_Gb_Types.ttcn, line 2750 */
template_tru__ApplContainer__NACC_si__psi_defval = ANY_VALUE;
current_location.update_lineno(2784);
/* Osmocom_Gb_Types.ttcn, line 2784 */
template_ts__RAN__Information__Ack__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2785);
/* Osmocom_Gb_Types.ttcn, line 2785 */
template_ts__RAN__Information__Ack__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2797);
/* Osmocom_Gb_Types.ttcn, line 2797 */
template_tr__RAN__Information__Ack__RIM__Container_app__id_defval = ANY_VALUE;
current_location.update_lineno(2798);
/* Osmocom_Gb_Types.ttcn, line 2798 */
template_tr__RAN__Information__Ack__RIM__Container_seq_defval = ANY_VALUE;
current_location.update_lineno(2799);
/* Osmocom_Gb_Types.ttcn, line 2799 */
template_tr__RAN__Information__Ack__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2800);
/* Osmocom_Gb_Types.ttcn, line 2800 */
template_tr__RAN__Information__Ack__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2816);
/* Osmocom_Gb_Types.ttcn, line 2816 */
template_ts__RAN__Information__Error__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2818);
/* Osmocom_Gb_Types.ttcn, line 2818 */
template_ts__RAN__Information__Error__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2838);
/* Osmocom_Gb_Types.ttcn, line 2838 */
template_tr__RAN__Information__Error__RIM__Container_app__id_defval = ANY_VALUE;
current_location.update_lineno(2839);
/* Osmocom_Gb_Types.ttcn, line 2839 */
template_tr__RAN__Information__Error__RIM__Container_cause_defval = ANY_VALUE;
current_location.update_lineno(2840);
/* Osmocom_Gb_Types.ttcn, line 2840 */
template_tr__RAN__Information__Error__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2841);
/* Osmocom_Gb_Types.ttcn, line 2841 */
template_tr__RAN__Information__Error__RIM__Container_pdu_defval = ANY_VALUE;
current_location.update_lineno(2842);
/* Osmocom_Gb_Types.ttcn, line 2842 */
template_tr__RAN__Information__Error__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2867);
/* Osmocom_Gb_Types.ttcn, line 2867 */
template_ts__RAN__Information__Application__Error__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2869);
/* Osmocom_Gb_Types.ttcn, line 2869 */
template_ts__RAN__Information__Application__Error__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2883);
/* Osmocom_Gb_Types.ttcn, line 2883 */
template_tr__RAN__Information__Application__Error__RIM__Container_app__id_defval = ANY_VALUE;
current_location.update_lineno(2884);
/* Osmocom_Gb_Types.ttcn, line 2884 */
template_tr__RAN__Information__Application__Error__RIM__Container_seq_defval = ANY_VALUE;
current_location.update_lineno(2885);
/* Osmocom_Gb_Types.ttcn, line 2885 */
template_tr__RAN__Information__Application__Error__RIM__Container_ind_defval = ANY_VALUE;
current_location.update_lineno(2886);
/* Osmocom_Gb_Types.ttcn, line 2886 */
template_tr__RAN__Information__Application__Error__RIM__Container_ver_defval = OMIT_VALUE;
current_location.update_lineno(2887);
/* Osmocom_Gb_Types.ttcn, line 2887 */
template_tr__RAN__Information__Application__Error__RIM__Container_cont_defval = ANY_VALUE;
current_location.update_lineno(2888);
/* Osmocom_Gb_Types.ttcn, line 2888 */
template_tr__RAN__Information__Application__Error__RIM__Container_son__app__id_defval = OMIT_VALUE;
current_location.update_lineno(2937);
/* Osmocom_Gb_Types.ttcn, line 2937 */
template_tr__RAN__Information__Request__Application__Container__NACC_cid_defval = ANY_VALUE;
current_location.update_lineno(2981);
/* Osmocom_Gb_Types.ttcn, line 2981 */
template_tr__RAN__Information__Application__Container__NACC_cid_defval = ANY_VALUE;
current_location.update_lineno(2981);
/* Osmocom_Gb_Types.ttcn, line 2981 */
template_tr__RAN__Information__Application__Container__NACC_psi__type_defval = ANY_VALUE;
current_location.update_lineno(2982);
/* Osmocom_Gb_Types.ttcn, line 2982 */
template_tr__RAN__Information__Application__Container__NACC_si__psi__num_defval = ANY_VALUE;
current_location.update_lineno(2982);
/* Osmocom_Gb_Types.ttcn, line 2982 */
template_tr__RAN__Information__Application__Container__NACC_si__psi_defval = ANY_VALUE;
current_location.update_lineno(3040);
/* Osmocom_Gb_Types.ttcn, line 3040 */
template_rsu__Application__Error__Container__NACC_cid_defval = ANY_VALUE;
current_location.update_lineno(3041);
/* Osmocom_Gb_Types.ttcn, line 3041 */
template_rsu__Application__Error__Container__NACC_cause_defval = ANY_VALUE;
current_location.update_lineno(3042);
/* Osmocom_Gb_Types.ttcn, line 3042 */
template_rsu__Application__Error__Container__NACC_app__cont_defval = ANY_VALUE;
current_location.update_lineno(3071);
/* Osmocom_Gb_Types.ttcn, line 3071 */
template_tr__Application__Error__Container__NACC_cid_defval = ANY_VALUE;
current_location.update_lineno(3072);
/* Osmocom_Gb_Types.ttcn, line 3072 */
template_tr__Application__Error__Container__NACC_cause_defval = ANY_VALUE;
current_location.update_lineno(3073);
/* Osmocom_Gb_Types.ttcn, line 3073 */
template_tr__Application__Error__Container__NACC_app__cont_defval = ANY_VALUE;
current_location.update_lineno(3095);
/* Osmocom_Gb_Types.ttcn, line 3095 */
template_rsu__Application__Container__IE__NACC__req_cid_defval = ANY_VALUE;
current_location.update_lineno(3272);
/* Osmocom_Gb_Types.ttcn, line 3272 */
template_tr__RIM__PDU__Indications_ack_defval = ANY_VALUE;
current_location.update_lineno(3272);
/* Osmocom_Gb_Types.ttcn, line 3272 */
template_tr__RIM__PDU__Indications_type__ext_defval = ANY_VALUE;
current_location.update_lineno(3304);
/* Osmocom_Gb_Types.ttcn, line 3304 */
template_tr__RIM__Protocol__Version__Number_ver_defval = ANY_VALUE;
current_location.update_lineno(3334);
/* Osmocom_Gb_Types.ttcn, line 3334 */
template_tr__RIM__Routing__Information_addr__discr_defval = ANY_VALUE;
current_location.update_lineno(3334);
/* Osmocom_Gb_Types.ttcn, line 3334 */
template_tr__RIM__Routing__Information_addr_defval = ANY_VALUE;
current_location.update_lineno(3345);
/* Osmocom_Gb_Types.ttcn, line 3345 */
template_t__RIM__Routing__Address__cid_cid_defval = ANY_VALUE;
current_location.update_lineno(3348);
/* Osmocom_Gb_Types.ttcn, line 3348 */
template_t__RIM__Routing__Address__rncid_cid_defval = ANY_VALUE;
current_location.update_lineno(3348);
/* Osmocom_Gb_Types.ttcn, line 3348 */
template_t__RIM__Routing__Address__rncid_rnc__id_defval = ANY_VALUE;
current_location.update_lineno(3351);
/* Osmocom_Gb_Types.ttcn, line 3351 */
template_t__RIM__Routing__Address__enbid_cid_defval = ANY_VALUE;
current_location.update_lineno(3351);
/* Osmocom_Gb_Types.ttcn, line 3351 */
template_t__RIM__Routing__Address__enbid_tac_defval = ANY_VALUE;
current_location.update_lineno(3351);
/* Osmocom_Gb_Types.ttcn, line 3351 */
template_t__RIM__Routing__Address__enbid_gnbid_defval = ANY_VALUE;
current_location.update_lineno(3354);
/* Osmocom_Gb_Types.ttcn, line 3354 */
template_t__RIM__Routing__Address__sector_sector_defval = ANY_VALUE;
current_location.update_lineno(3516);
/* Osmocom_Gb_Types.ttcn, line 3516 */
template_tr__RAN__INFORMATION__REQUEST_dst_defval = ANY_VALUE;
current_location.update_lineno(3517);
/* Osmocom_Gb_Types.ttcn, line 3517 */
template_tr__RAN__INFORMATION__REQUEST_src_defval = ANY_VALUE;
current_location.update_lineno(3518);
/* Osmocom_Gb_Types.ttcn, line 3518 */
template_tr__RAN__INFORMATION__REQUEST_cont_defval = ANY_VALUE;
current_location.update_lineno(3540);
/* Osmocom_Gb_Types.ttcn, line 3540 */
template_tr__PDU__BSSGP__RAN__INFORMATION_dst_defval = ANY_VALUE;
current_location.update_lineno(3541);
/* Osmocom_Gb_Types.ttcn, line 3541 */
template_tr__PDU__BSSGP__RAN__INFORMATION_src_defval = ANY_VALUE;
current_location.update_lineno(3542);
/* Osmocom_Gb_Types.ttcn, line 3542 */
template_tr__PDU__BSSGP__RAN__INFORMATION_cont_defval = ANY_VALUE;
current_location.update_lineno(3564);
/* Osmocom_Gb_Types.ttcn, line 3564 */
template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_dst_defval = ANY_VALUE;
current_location.update_lineno(3565);
/* Osmocom_Gb_Types.ttcn, line 3565 */
template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_src_defval = ANY_VALUE;
current_location.update_lineno(3566);
/* Osmocom_Gb_Types.ttcn, line 3566 */
template_tr__PDU__BSSGP__RAN__INFORMATION__ACK_cont_defval = ANY_VALUE;
current_location.update_lineno(3588);
/* Osmocom_Gb_Types.ttcn, line 3588 */
template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_dst_defval = ANY_VALUE;
current_location.update_lineno(3589);
/* Osmocom_Gb_Types.ttcn, line 3589 */
template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_src_defval = ANY_VALUE;
current_location.update_lineno(3590);
/* Osmocom_Gb_Types.ttcn, line 3590 */
template_tr__PDU__BSSGP__RAN__INFORMATION__ERROR_cont_defval = ANY_VALUE;
current_location.update_lineno(3612);
/* Osmocom_Gb_Types.ttcn, line 3612 */
template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_dst_defval = ANY_VALUE;
current_location.update_lineno(3613);
/* Osmocom_Gb_Types.ttcn, line 3613 */
template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_src_defval = ANY_VALUE;
current_location.update_lineno(3614);
/* Osmocom_Gb_Types.ttcn, line 3614 */
template_tr__PDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR_cont_defval = ANY_VALUE;
current_location.update_lineno(3624);
/* Osmocom_Gb_Types.ttcn, line 3624 */
template_tr__BSSGP__PERMITTED__PTP__ONLY.set_type(VALUE_LIST, 30);
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(0).pDU__BSSGP__DL__UNITDATA() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(1).pDU__BSSGP__UL__UNITDATA() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(2).pDU__BSSGP__RA__CAPABILITY() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(3).pDU__BSSGP__RA__CAPABILITY__UPDATE() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(4).pDU__BSSGP__RA__CAPABILITY__UPDATE__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(5).pDU__BSSGP__RADIO__STATUS() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(6).pDU__BSSGP__FLOW__CONTROL__BVC() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(7).pDU__BSSGP__FLOW__CONTROL__BVC__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(8).pDU__BSSGP__FLOW__CONTROL__MS() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(9).pDU__BSSGP__FLOW__CONTROL__MS__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(10).pDU__BSSGP__FLOW__CONTROL__PFC() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(11).pDU__BSSGP__FLOW__CONTROL__PFC__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(12).pDU__BSSGP__DOWNLOAD__BSS__PFC() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(13).pDU__BSSGP__CREATE__BSS__PFC() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(14).pDU__BSSGP__CREATE__BSS__PFC__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(15).pDU__BSSGP__CREATE__BSS__PFC__NACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(16).pDU__BSSGP__MODIFY__BSS__PFC() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(17).pDU__BSSGP__MODIFY__BSS__PFC__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(18).pDU__BSSGP__DELETE__BSS__PFC() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(19).pDU__BSSGP__DELETE__BSS__PFC__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(20).pDU__BSSGP__DELETE__BSS__PFC__REQ() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(21).pDU__BSSGP__PS__HANDOVER__REQUIRED() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(22).pDU__BSSGP__PS__HANDOVER__REQUIRED__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(23).pDU__BSSGP__PS__HANDOVER__REQUIRED__NACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(24).pDU__BSSGP__PS__HANDOVER__REQUEST() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(25).pDU__BSSGP__PS__HANDOVER__REQUEST__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(26).pDU__BSSGP__PS__HANDOVER__REQUEST__NACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(27).pDU__BSSGP__PS__HANDOVER__COMPLETE() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(28).pDU__BSSGP__PS__HANDOVER__COMPLETE__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP__ONLY.list_item(29).pDU__BSSGP__PS__HANDOVER__CANCEL() = ANY_VALUE;
current_location.update_lineno(3657);
/* Osmocom_Gb_Types.ttcn, line 3657 */
template_tr__BSSGP__PERMITTED__PTP.set_type(VALUE_LIST, 4);
template_tr__BSSGP__PERMITTED__PTP.list_item(0) = tr__BSSGP__PERMITTED__PTP__ONLY;
template_tr__BSSGP__PERMITTED__PTP.list_item(1).pDU__BSSGP__PAGING__PS() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP.list_item(2).pDU__BSSGP__PAGING__CS() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTP.list_item(3).pDU__BSSGP__STATUS() = ANY_VALUE;
current_location.update_lineno(3665);
/* Osmocom_Gb_Types.ttcn, line 3665 */
template_tr__BSSGP__PERMITTED__SIGN__ONLY.set_type(VALUE_LIST, 32);
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(0).pDU__BSSGP__SUSPEND() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(1).pDU__BSSGP__SUSPEND__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(2).pDU__BSSGP__SUSPEND__NACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(3).pDU__BSSGP__RESUME() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(4).pDU__BSSGP__RESUME__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(5).pDU__BSSGP__RESUME__NACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(6).pDU__BSSGP__FLUSH__LL() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(7).pDU__BSSGP__FLUSH__LL__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(8).pDU__BSSGP__LLC__DISCARDED() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(9).pDU__BSSGP__BVC__BLOCK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(10).pDU__BSSGP__BVC__BLOCK__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(11).pDU__BSSGP__BVC__UNBLOCK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(12).pDU__BSSGP__BVC__UNBLOCK__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(13).pDU__BSSGP__BVC__RESET() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(14).pDU__BSSGP__BVC__RESET__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(15).pDU__BSSGP__SGSN__INVOKE__TRACE() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(16).pDU__BSSGP__PERFORM__LOCATION__REQUEST() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(17).pDU__BSSGP__PERFORM__LOCATION__RESPONSE() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(18).pDU__BSSGP__PERFORM__LOCATION__ABORT() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(19).pDU__BSSGP__POSITION__COMMAND() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(20).pDU__BSSGP__POSITION__RESPONSE() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(21).pDU__BSSGP__RAN__INFORMATION() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(22).pDU__BSSGP__RAN__INFORMATION__REQUEST() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(23).pDU__BSSGP__RAN__INFORMATION__ACK() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(24).pDU__BSSGP__RAN__INFORMATION__ERROR() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(25).pDU__BSSGP__RAN__INFORMATION__APPLICATION__ERROR() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(26).pDU__BSSGP__MBMS__SESSION__START__REQUEST() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(27).pDU__BSSGP__MBMS__SESSION__START__RESPONSE() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(28).pDU__BSSGP__MBMS__SESSION__STOP__REQUEST() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(29).pDU__BSSGP__MBMS__STOP__RESPONSE() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(30).pDU__BSSGP__SESSION__UPDATE__REQUEST() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN__ONLY.list_item(31).pDU__BSSGP__SESSION__UPDATE__RESPONSE() = ANY_VALUE;
current_location.update_lineno(3700);
/* Osmocom_Gb_Types.ttcn, line 3700 */
template_tr__BSSGP__PERMITTED__SIGN.set_type(VALUE_LIST, 5);
template_tr__BSSGP__PERMITTED__SIGN.list_item(0) = tr__BSSGP__PERMITTED__SIGN__ONLY;
template_tr__BSSGP__PERMITTED__SIGN.list_item(1).pDU__BSSGP__PAGING__PS() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN.list_item(2).pDU__BSSGP__PAGING__CS() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN.list_item(3).pDU__BSSGP__SUSPEND() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__SIGN.list_item(4).pDU__BSSGP__STATUS() = ANY_VALUE;
current_location.update_lineno(3709);
/* Osmocom_Gb_Types.ttcn, line 3709 */
template_tr__BSSGP__PERMITTED__PTM__ONLY.set_type(VALUE_LIST, 2);
template_tr__BSSGP__PERMITTED__PTM__ONLY.list_item(0).pDU__BSSGP__DL__MBMS__UNITDATA() = ANY_VALUE;
template_tr__BSSGP__PERMITTED__PTM__ONLY.list_item(1).pDU__BSSGP__UL__MBMS__UNITDATA() = ANY_VALUE;
current_location.update_lineno(3714);
/* Osmocom_Gb_Types.ttcn, line 3714 */
template_tr__BSSGP__PERMITTED__PTM.set_type(VALUE_LIST, 2);
template_tr__BSSGP__PERMITTED__PTM.list_item(0) = tr__BSSGP__PERMITTED__PTM__ONLY;
template_tr__BSSGP__PERMITTED__PTM.list_item(1).pDU__BSSGP__STATUS() = ANY_VALUE;
current_location.update_lineno(3721);
/* Osmocom_Gb_Types.ttcn, line 3721 */
template_tr__BSSGP__IE__PtpBvci.iEI() = os_4;
template_tr__BSSGP__IE__PtpBvci.ext() = bs_2;
template_tr__BSSGP__IE__PtpBvci.lengthIndicator().length1() = 2;
{
OCTETSTRING_template& tmp_458 = template_tr__BSSGP__IE__PtpBvci.unstructured__value();
tmp_458.set_type(COMPLEMENTED_LIST, 2);
tmp_458.list_item(0) = os_11;
tmp_458.list_item(1) = os_72;
}
}


} /* end of namespace */
