Change in osmo-ttcn3-hacks[master]: library/GSM_RestOctets: initial SI2quater Rest Octets definition

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Fri Jul 3 23:12:44 UTC 2020


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19082 )

Change subject: library/GSM_RestOctets: initial SI2quater Rest Octets definition
......................................................................

library/GSM_RestOctets: initial SI2quater Rest Octets definition

This is a very minimalistic (incomplete) implementation of SI2quater
Rest Octets as per 3GPP TS 44.018, table 10.5.2.33b.1.  Should be
enough to decode some of the E-UTRAN specific parameters though.

Some BITn fields might need to be replaced with more specific
enumerated or integer types.  Beware [1], the bit ordering rules
are different for integer and bitstring (sub-)types if a field
ends up on boundary of the two octets!

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488

Change-Id: I6a12c9ee12f8df8b4fc0976dd593152dc1195718
Related: SYS#4870
---
M library/GSM_RestOctets.ttcn
1 file changed, 505 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/GSM_RestOctets.ttcn b/library/GSM_RestOctets.ttcn
index 531528c..3bc9349 100644
--- a/library/GSM_RestOctets.ttcn
+++ b/library/GSM_RestOctets.ttcn
@@ -1,6 +1,7 @@
 /**
  * GSM Rest Octets definitions as per 3GPP TS 44.018.
  *
+ * (C) 2020 by sysmocom s.f.m.c. GmbH <info at sysmocom.de>
  * (C) 2020 Vadim Yanitskiy <axilirator at gmail.com>
  * All rights reserved.
  *
@@ -15,6 +16,504 @@
 import from General_Types all;
 import from Osmocom_Types all;
 
+/* 10.5.2.33b SI 2quater Rest Octets */
+type record SI2quaterRestOctets {
+	BIT1				ba_ind,
+	BIT1				ba_3g_ind,
+	BIT1				mp_change_mark,
+	uint4_t				si2quater_index,
+	uint4_t				si2quater_count,
+
+	/* Measurement Parameters Description */
+	MeasParamsDescOpt	meas_params_desc,
+	/* GPRS specific parameters */
+	record {
+		GPRS_RealTimeDiffDescOpt	rt_diff_desc,
+		GPRS_BSICDescOpt		bsic_desc,
+		GPRS_ReportPrioDescOpt		rep_prio_desc,
+		MeasParamsDescOpt		meas_params_desc
+	} gprs,
+	/* NC Measurement Parameters Description */
+	NCMeasParamsOpt			nc_meas_params,
+	/* SI2quater Extension Information */
+	SI2quaterExtInfoOpt		ext_info,
+
+	/* 3G Neighbour Cell Description */
+	UTRAN_NeighDescOpt		utran_neigh_desc,
+	/* 3G Measurement Parameters Description */
+	UTRAN_MeasParamsDescOpt		utran_meas_params_desc,
+	/* GPRS 3G Measurement Parameters Description */
+	UTRAN_GPRSMeasParamsDescOpt	utran_gprs_meas_params_desc,
+
+	/* SI2quater Rel-{5,6,7,8,9,10} Additions (Matrioshka!) */
+	SI2quaterAdditions		rel_additions
+} with {
+	/* The TITAN's RAW encoder generates an octet-aligned octetstring,
+	 * so we should make sure that unused bits contain proper padding. */
+	variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
+};
+
+/* Measurement Parameters Description */
+private type record MeasParamsDescOpt {
+	BIT1				presence, // 0/1
+	MeasParamsDesc			desc optional
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record MeasParamsDesc {
+	BIT1				report_type,
+	BIT2				serving_band_reporting
+} with { variant "" };
+
+/* GPRS Real Time Difference Description (not implemented) */
+private type record GPRS_RealTimeDiffDescOpt {
+	BIT1				presence ('0'B), // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* GPRS BSIC Description (not implemented) */
+private type record GPRS_BSICDescOpt {
+	BIT1				presence ('0'B), // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* GPRS Report Priority Description (not implemented) */
+private type record GPRS_ReportPrioDescOpt {
+	BIT1				presence ('0'B), // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* NC (Network Controlled?) Measurement Parameters */
+private type record NCMeasParams {
+	/* Network Control Order */
+	BIT2				nco,
+	BIT1				p_presence,
+	NCMeasPeriods			p optional
+} with {
+	variant (p) "PRESENCE(p_presence = '1'B)"
+};
+
+/* NC Measurement Periods */
+private type record NCMeasParamsOpt {
+	BIT1				presence, // 0/1
+	NCMeasParams			params optional
+} with {
+	variant (params) "PRESENCE(presence = '1'B)"
+};
+
+private type record NCMeasPeriods {
+	BIT3				non_drx_period,
+	BIT3				rep_period_i,
+	BIT3				rep_period_t
+} with { variant "" };
+
+/* SI2quater Extersion Information */
+private type record SI2quaterExtInfoOpt {
+	BIT1				presence, // 0/1
+	SI2quaterExtInfo		info optional
+} with {
+	variant (info) "PRESENCE(presence = '1'B)"
+};
+
+private type record SI2quaterExtInfo {
+	uint8_t				len,
+	CCNSupportDescOpt		ccn_supp_desc optional,
+	bitstring			padding /* Octet alignment? */
+} with {
+	variant (len) "LENGTHTO(ccn_supp_desc,padding) + 1"
+	variant (len) "UNIT(bits)"
+};
+
+/* CCN Support Description */
+private type record CCNSupportDescOpt {
+	BIT1				presence, // 0/1
+	CCNSupportDesc			desc optional
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record CCNSupportDesc {
+	uint7_t				nr_of_cells,
+	bitstring			ccn_supported
+} with {
+	variant (nr_of_cells) "LENGTHTO(ccn_supported)"
+	variant (nr_of_cells) "UNIT(bits)"
+};
+
+/* 3G Neighbour Cell Description */
+private type record UTRAN_NeighDescOpt {
+	BIT1				presence, // 0/1
+	UTRAN_NeighDesc			desc optional
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record UTRAN_NeighDesc {
+	BIT1				idx_start_3g_presence,
+	uint7_t				idx_start_3g optional,
+	BIT1				abs_idx_start_emr_presence,
+	uint7_t				abs_idx_start_emr optional,
+	UTRAN_FDDDescOpt		fdd_desc,
+	UTRAN_TDDDescOpt		tdd_desc
+} with {
+	variant (idx_start_3g) "PRESENCE(idx_start_3g_presence = '1'B)"
+	variant (abs_idx_start_emr) "PRESENCE(abs_idx_start_emr_presence = '1'B)"
+};
+
+/* UTRAN (3G) FDD/TDD Description (not implementaed).
+ *
+ * TODO: Repeated UTRAN FDD/TDD Neighbour Cells structure contains a variable length
+ * field, that needs to be computed using tables (see 9.1.54.1a and 9.1.54.1b) with
+ * magic numbers. This cannot be described uing TITAN's RAW codec attributes. */
+private type record UTRAN_FDDDescOpt {
+	BIT1				presence ('0'B), // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record UTRAN_TDDDescOpt {
+	BIT1				presence ('0'B), // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* 3G Measurement Parameters Description (not implemented) */
+private type record UTRAN_MeasParamsDescOpt {
+	BIT1				presence ('0'B), // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* GPRS 3G Measurement Parameters Description (not implemented) */
+private type record UTRAN_GPRSMeasParamsDescOpt {
+	BIT1				presence ('0'B), // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* SI2quater Rel-{5,6,7,8,9,10} Additions */
+private type record SI2quaterAdditions {
+	BIT1				rel5_presence, // L/H
+	SI2quaterR5Additions		rel5 optional
+} with {
+	variant (rel5_presence) "CSN.1 L/H"
+	variant (rel5) "PRESENCE(rel5_presence = '1'B)"
+};
+
+/* SI2quater Rel-5 and Rel-{6,7,8,9,10} Additions */
+private type record SI2quaterR5Additions {
+	UMTS_AddMeasParamsDescOpt	umts_add_meas_params_desc,
+	UMTS_AddMeasParamsDesc2Opt	umts_add_meas_params_desc2,
+	BIT1				rel6_presence, // L/H
+	SI2quaterR6Additions		rel6 optional
+} with {
+	variant (rel6_presence) "CSN.1 L/H"
+	variant (rel6) "PRESENCE(rel6_presence = '1'B)"
+};
+
+/* 3G Additional Measurement Parameters Description */
+private type record UMTS_AddMeasParamsDescOpt {
+	BIT1				presence, // 0/1
+	UMTS_AddMeasParamsDesc		desc optional
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record UMTS_AddMeasParamsDesc {
+	BIT3				fdd_qmin_offset,
+	BIT4				fdd_rscpmin
+} with { variant "" };
+
+/* 3G Additional Measurement Parameters Description 2 */
+private type record UMTS_AddMeasParamsDesc2Opt {
+	BIT1				presence, // 0/1
+	UMTS_AddMeasParamsDesc		desc optional
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record UMTS_AddMeasParamsDesc2 {
+	/* FDD Reporting Threshold 2 */
+	BIT1				presence, // 0/1
+	uint6_t				threshold optional
+} with {
+	variant (threshold) "PRESENCE(presence = '1'B)"
+};
+
+/* SI2quater Rel-6 and Rel-{7,8,9,10} Additions */
+private type record SI2quaterR6Additions {
+	BIT1				umts_ccn_active,
+	BIT1				rel7_presence, // L/H
+	SI2quaterR7Additions		rel7 optional
+} with {
+	variant (rel7_presence) "CSN.1 L/H"
+	variant (rel7) "PRESENCE(rel7_presence = '1'B)"
+};
+
+/* SI2quater Rel-7 and Rel-{8,9,10} Additions */
+private type record SI2quaterR7Additions {
+	Rel7RepOffseThresholdOpt	rep700,
+	Rel7RepOffseThresholdOpt	rep810,
+	BIT1				rel8_presence, // L/H
+	SI2quaterR8Additions		rel8 optional
+} with {
+	variant (rel8_presence) "CSN.1 L/H"
+	variant (rel8) "PRESENCE(rel8_presence = '1'B)"
+};
+
+/* Additions in Rel-7: Reporting Offset & Threshold */
+private type record Rel7RepOffseThresholdOpt {
+	BIT1				presence, // 0/1
+	Rel7RepOffseThreshold		val optional
+} with {
+	variant (val) "PRESENCE(presence = '1'B)"
+};
+
+private type record Rel7RepOffseThreshold {
+	BIT3				offset,
+	BIT3				threshold
+} with { variant "" };
+
+/* SI2quater Rel-8 and Rel-{9,10} Additions */
+private type record SI2quaterR8Additions {
+	Rel8PrioEUTRANParamsDescOpt	prio_eutran_params_desc,
+	Rel8UTRANCSGDescOpt		utran_csg_desc,
+	Rel8EUTRANCSGDescOpt		eutran_csg_desc
+	// TODO: Rel9 Additions (not implemented)
+} with { variant "" };
+
+/* Additions in Rel-8: Priority and E-UTRAN Parameters Description */
+private type record Rel8PrioEUTRANParamsDescOpt {
+	BIT1				presence, // 0/1
+	Rel8PrioEUTRANParamsDesc	desc optional
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record Rel8PrioEUTRANParamsDesc {
+	ServingCellPrioParamsDescOpt	sc_prio_params_desc,
+	UTRAN_PrioParamsDescOpt		utran_prio_params_desc,
+	EUTRAN_ParamsDescOpt		eutran_params_desc
+} with { variant "" };
+
+/* Serving Cell Priority Parameters Description */
+private type record ServingCellPrioParamsDescOpt {
+	BIT1				presence, // 0/1
+	ServingCellPrioParamsDesc	desc optional
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record ServingCellPrioParamsDesc {
+	uint3_t				geran_priority,
+	uint4_t				thresh_priority_search,
+	uint4_t				thresh_gsm_low,
+	uint2_t				h_prio,
+	uint2_t				t_reselection
+} with { variant "" };
+
+/* 3G Priority Parameters Description (not implemented) */
+private type record UTRAN_PrioParamsDescOpt {
+	BIT1				presence, // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* E-UTRAN Parameters Description */
+private type record EUTRAN_ParamsDescOpt {
+	BIT1				presence, // 0/1
+	EUTRAN_ParamsDesc		desc optional
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+private type record EUTRAN_ParamsDesc {
+	BIT1				ccn_active,
+	BIT1				e_start,
+	BIT1				e_stop,
+
+	/* E-UTRAN Measurement Parameters Description */
+	EUTRAN_MeasParamsDescOpt	meas_params_desc,
+	/* GPRS E-UTRAN Measurement Parameters Description */
+	EUTRAN_GPRSMeasParamsDescOpt	gprs_meas_params_desc,
+
+	/* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */
+	EUTRAN_NeighbourCells		neigh_cell_list optional,
+	BIT1				neigh_cell_list_term ('0'B),
+	/* { 1 < Repeated E-UTRAN Not Allowed Cells > } ** 0 */
+	EUTRAN_NotAllowedCells		not_allowed_cell_list optional,
+	BIT1				not_allowed_cell_list_term ('0'B),
+	/* { 1 < Repeated E-UTRAN PCID to TA mapping > } ** 0 */
+	EUTRAN_PCID2TAMaps		pcid2ta_map_list optional,
+	BIT1				pcid2ta_map_list_term ('0'B)
+} with { variant "" };
+
+/* E-UTRAN Measurement Parameters Description (not implemented) */
+private type record EUTRAN_MeasParamsDescOpt {
+	BIT1				presence, // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* GPRS E-UTRAN Measurement Parameters Description (not implemented) */
+private type record EUTRAN_GPRSMeasParamsDescOpt {
+	BIT1				presence, // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* Repeated E-UTRAN Neighbour Cell List */
+private type record of EUTRAN_NeighbourCell EUTRAN_NeighbourCells;
+private type record EUTRAN_NeighbourCell {
+	BIT1				item_ind ('1'B),
+	/* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */
+	EUTRAN_CellDescs		cell_desc_list optional,
+	BIT1				cell_desc_list_term ('0'B),
+	BIT1				prio_presence, // 0/1
+	uint3_t				prio optional,
+	uint5_t				thresh_high,
+	BIT1				thresh_low_presence, // 0/1
+	uint5_t				thresh_low optional,
+	BIT1				qrxlevmin_presence, // 0/1
+	uint5_t				qrxlevmin optional
+} with {
+	variant "PRESENCE(item_ind = '1'B)"
+	variant (prio) "PRESENCE(prio_presence = '1'B)"
+	variant (thresh_low) "PRESENCE(thresh_low_presence = '1'B)"
+	variant (qrxlevmin) "PRESENCE(qrxlevmin_presence = '1'B)"
+};
+
+/* Repeated E-UTRAN Cell Description (E-ARFCN & Measurement Bandwidth) List */
+private type record of EUTRAN_CellDesc EUTRAN_CellDescs;
+private type record EUTRAN_CellDesc {
+	BIT1				item_ind ('1'B),
+	uint16_t			e_arfcn,
+	BIT1				meas_bw_presence, // 0/1
+	uint3_t				meas_bw optional
+} with {
+	variant "PRESENCE(item_ind = '1'B)"
+	variant (meas_bw) "PRESENCE(meas_bw_presence = '1'B)"
+};
+
+/* Repeated E-UTRAN Not Allowed Cell List */
+private type record of EUTRAN_NotAllowedCell EUTRAN_NotAllowedCells;
+private type record EUTRAN_NotAllowedCell {
+	BIT1				item_ind ('1'B),
+	/* FIXME: Not Allowed Cells : < PCID Group IE > (not implemented) */
+	BIT1				pcid_group_presence ('0'B),
+	/* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */
+	EUTRAN_FreqIndexes		freq_idx_list optional,
+	BIT1				freq_idx_list_term ('0'B)
+} with {
+	variant "PRESENCE(item_ind = '1'B)"
+};
+
+/* Repeated E-UTRAN PCID to TA mapping List */
+private type record of EUTRAN_PCID2TAMap EUTRAN_PCID2TAMaps;
+private type record EUTRAN_PCID2TAMap {
+	BIT1				item_ind ('1'B),
+	/* FIXME: PCID to TA mapping : < PCID Group IE > (not implemented) */
+	BIT1				pcid_group_presence ('0'B),
+	/* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */
+	EUTRAN_FreqIndexes		freq_idx_list optional,
+	BIT1				freq_idx_list_term ('0'B)
+} with {
+	variant "PRESENCE(item_ind = '1'B)"
+};
+
+/* Repeated E-UTRAN Frequency Index List */
+private type record of EUTRAN_FreqIndex EUTRAN_FreqIndexes;
+private type record EUTRAN_FreqIndex {
+	BIT1				item_ind ('1'B),
+	uint3_t				idx
+} with {
+	variant "PRESENCE(item_ind = '1'B)"
+};
+
+/* Additions in Rel-8: 3G CSG Description (not implemented) */
+private type record Rel8UTRANCSGDescOpt {
+	BIT1				presence, // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+/* Additions in Rel-8: E-UTRAN CSG Description (not implemented) */
+private type record Rel8EUTRANCSGDescOpt {
+	BIT1				presence, // 0/1
+	bitstring			desc optional // TODO
+} with {
+	variant (desc) "PRESENCE(presence = '1'B)"
+};
+
+
+/* Basic any-/omit-matching templates. To be inherited by other templates (see below).
+ * The point is that you cannot fit everything into 20 octets, so usually several kinds
+ * of SI2quater are being sub-multiplexed by the BTS.  This is achieved using both
+ * 'si2quater_index' and 'si2quater_count' fields. */
+template SI2quaterRestOctets tra_SI2quaterRestOctets_base := {
+	ba_ind := ?,
+	ba_3g_ind := ?,
+	mp_change_mark := ?,
+	si2quater_index := ?,
+	si2quater_count := ?,
+
+	meas_params_desc := { presence := ?, desc := * },
+	gprs := {
+		rt_diff_desc := { presence := ?, desc := * },
+		bsic_desc := { presence := ?, desc := * },
+		rep_prio_desc := { presence := ?, desc := * },
+		meas_params_desc := { presence := ?, desc := * }
+	},
+	nc_meas_params := { presence := ?, params := * },
+	ext_info := { presence := ?, info := * },
+
+	utran_neigh_desc := { presence := ?, desc := * },
+	utran_meas_params_desc := { presence := ?, desc := * },
+	utran_gprs_meas_params_desc := { presence := ?, desc := * },
+
+	rel_additions := ?
+};
+
+template SI2quaterRestOctets tro_SI2quaterRestOctets_base := {
+	ba_ind := ?,
+	ba_3g_ind := ?,
+	mp_change_mark := ?,
+	si2quater_index := ?,
+	si2quater_count := ?,
+
+	meas_params_desc := { presence := '0'B, desc := omit },
+	gprs := {
+		rt_diff_desc := { presence := '0'B, desc := omit },
+		bsic_desc := { presence := '0'B, desc := omit },
+		rep_prio_desc := { presence := '0'B, desc := omit },
+		meas_params_desc := { presence := '0'B, desc := omit }
+	},
+	nc_meas_params := { presence := '0'B, params := omit },
+	ext_info := { presence := '0'B, info := omit },
+
+	utran_neigh_desc := { presence := '0'B, desc := omit },
+	utran_meas_params_desc := { presence := '0'B, desc := omit },
+	utran_gprs_meas_params_desc := { presence := '0'B, desc := omit },
+
+	rel_additions := { rel5_presence := CSN1_L, rel5 := omit }
+};
+
+
 /* 10.5.2.34 SI 3 Rest Octets */
 type record SI3RestOctets {
 	SelectionParamsOpt	sel_params,
@@ -131,6 +630,12 @@
 	variant (pos) "PRESENCE(presence = '1'B)"
 };
 
+
+external function enc_SI2quaterRestOctets(in SI2quaterRestOctets ro) return octetstring
+	with { extension "prototype(convert) encode(RAW)" };
+external function dec_SI2quaterRestOctets(in octetstring stream) return SI2quaterRestOctets
+	with { extension "prototype(convert) decode(RAW)" };
+
 external function enc_SI3RestOctets(in SI3RestOctets ro) return octetstring
 	with { extension "prototype(convert) encode(RAW)" };
 external function dec_SI3RestOctets(in octetstring stream) return SI3RestOctets

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19082
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6a12c9ee12f8df8b4fc0976dd593152dc1195718
Gerrit-Change-Number: 19082
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200703/801c4707/attachment.htm>


More information about the gerrit-log mailing list