diff --git a/bts/gen_links.sh b/bts/gen_links.sh index b6921fa1b..7aa8398e9 100755 --- a/bts/gen_links.sh +++ b/bts/gen_links.sh @@ -33,7 +33,7 @@ FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn" gen_links $DIR $FILES DIR=../library -FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_VTY_Functions.ttcn GSM_SystemInformation.ttcn Osmocom_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn " +FILES="Misc_Helpers.ttcn General_Types.ttcn GSM_Types.ttcn GSM_RR_Types.ttcn Osmocom_VTY_Functions.ttcn GSM_SystemInformation.ttcn GSM_RestOctets.ttcn Osmocom_Types.ttcn RLCMAC_Templates.ttcn RLCMAC_Types.ttcn RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn RLCMAC_EncDec.cc L1CTL_Types.ttcn L1CTL_PortType.ttcn L1CTL_PortType_CtrlFunct.ttcn L1CTL_PortType_CtrlFunctDef.cc LAPDm_RAW_PT.ttcn LAPDm_Types.ttcn " #FILES+="NS_Emulation.ttcn NS_CodecPort.ttcn NS_CodecPort_CtrlFunct.ttcn NS_CodecPort_CtrlFunctDef.cc " #FILES+="BSSGP_Emulation.ttcn Osmocom_Gb_Types.ttcn " FILES+="IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp IPA_CodecPort.ttcn RSL_Types.ttcn RSL_Emulation.ttcn AbisOML_Types.ttcn " diff --git a/library/GSM_RestOctets.ttcn b/library/GSM_RestOctets.ttcn new file mode 100644 index 000000000..8f0346d2a --- /dev/null +++ b/library/GSM_RestOctets.ttcn @@ -0,0 +1,119 @@ +/** + * GSM Rest Octets definitions as per 3GPP TS 44.018. + * + * (C) 2020 Vadim Yanitskiy + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +module GSM_RestOctets { + +import from General_Types all; +import from Osmocom_Types all; + +/* 10.5.2.34 SI 3 Rest Octets */ +type record SI3RestOctets { + SelectionParamsOpt sel_params, + PowerOffsetOpt pwr_offset, + BIT1 si_2ter_ind, + BIT1 early_cm_ind, + SchedIfAndWhere sched_where, + GPRSIndicatorOpt gprs_ind, + BIT1 umts_early_cm_ind, + SI2quaterIndicatorOpt si2_quater_ind, + BIT1 iu_mode_ind ('1'B) optional, + SI21IndicatorOpt si21_ind optional + /* ... spare padding ... */ +} with { + variant (si_2ter_ind) "CSN.1 L/H" + variant (early_cm_ind) "CSN.1 L/H" + variant (umts_early_cm_ind) "CSN.1 L/H" + + /* If Iu mode is not supported in the cell, the Iu Indicator is not sent + * within this cell. Iu Indicator is included if and only if GPRS is + * not supported, and Iu mode is supported in the cell. */ + variant (iu_mode_ind) "PRESENCE(gprs_ind.presence = '0'B)" + /* SI21 field is only present if 'WHERE' information is not present. */ + variant (si21_ind) "PRESENCE(sched_where.presence = '0'B)" +}; + +/* Selection Parameters */ +type record SelectionParams { + boolean cbq, + uint6_t cr_offset, + uint3_t temp_offset, + uint5_t penalty_time +} with { + variant (cbq) "FIELDLENGTH(1)" +}; + +/* Optional Selection Parameters: L | H < Selection Parameters > */ +type record SelectionParamsOpt { + BIT1 presence, // L/H + SelectionParams params optional +} with { + variant (presence) "CSN.1 L/H" + variant (params) "PRESENCE(presence = '1'B)" +}; + +/* Optional Power Offset: L | H < Power Offset bit(2) > */ +type record PowerOffsetOpt { + BIT1 presence, // L/H + uint2_t offset optional +} with { + variant (presence) "CSN.1 L/H" + variant (offset) "PRESENCE(presence = '1'B)" +}; + +/* Scheduling if and where: L | H < WHERE bit(3) > */ +type record SchedIfAndWhere { + BIT1 presence, // L/H + uint3_t where optional +} with { + variant (presence) "CSN.1 L/H" + variant (where) "PRESENCE(presence = '1'B)" +}; + +type record GPRSIndicator { + uint3_t ra_colour, + BIT1 si13_pos +} with { variant "" }; + +/* Optional GPRS Indicator: L | H < GPRS Indicator > */ +type record GPRSIndicatorOpt { + BIT1 presence, // L/H + GPRSIndicator ind optional +} with { + variant (presence) "CSN.1 L/H" + variant (ind) "PRESENCE(presence = '1'B)" +}; + +/* Optional SI2quater Indicator: L | H < SI2quater Indicator > */ +type record SI2quaterIndicatorOpt { + BIT1 presence, // L/H + BIT1 ind optional +} with { + variant (presence) "CSN.1 L/H" + variant (ind) "PRESENCE(presence = '1'B)" +}; + +/* Optional SI21 Indicator: L | H < SI21 Position > */ +type record SI21IndicatorOpt { + BIT1 presence, // L/H + BIT1 pos optional +} with { + variant (presence) "CSN.1 L/H" + variant (pos) "PRESENCE(presence = '1'B)" +}; + +external function enc_SI3RestOctets(in SI3RestOctets ro) return octetstring + with { extension "prototype(convert) encode(RAW)" }; +external function dec_SI3RestOctets(in octetstring stream) return SI3RestOctets + with { extension "prototype(convert) decode(RAW)" }; + + +} with { encode "RAW"; variant "FIELDORDER(msb)" }