library: add System Information Type 10 Rest Octets codec

The CSN.1 definition can be found in 3GPP TS 44.018, section 10.5.2.44.

Change-Id: Iab04a588e645abf9b3c99bddef293526ae6752e1
Related: OS#5782
diff --git a/library/GSM_RestOctets.ttcn b/library/GSM_RestOctets.ttcn
index 6fa781c..eff9546 100644
--- a/library/GSM_RestOctets.ttcn
+++ b/library/GSM_RestOctets.ttcn
@@ -1241,6 +1241,125 @@
 };
 
 
+/* 10.5.2.44 SI10 rest octets (ASCI) */
+type record SI10RestOctets {
+	BIT1			ba_ind,
+	BIT1			neigh_info_presence, // L/H
+	SI10NeighInfo		neigh_info optional
+} with {
+	variant (neigh_info_presence) "CSN.1 L/H"
+	variant (neigh_info) "PRESENCE(neigh_info_presence = '1'B)"
+
+	/* 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)"
+};
+
+private type record SI10NeighInfo {
+	uint5_t			first_freq,
+	SI10CellInfo		cell_info,
+	SI10InfoFieldList	info_field optional,
+	BIT1			info_field_term ('0'B) // L/H
+} with {
+	variant (info_field_term) "CSN.1 L/H"
+};
+
+private type record SI10CellInfo {
+	uint6_t			bsic,
+	BIT1			cell_params_presence, // L/H
+	SI10CellParams		cell_params optional
+} with {
+	variant (cell_params_presence) "CSN.1 L/H"
+	variant (cell_params) "PRESENCE(cell_params_presence = '1'B)"
+};
+
+private type record SI10CellParams {
+	BIT1			cell_barred, // L/H
+	SI10FurtherCellInfo	further_cell_info optional
+} with {
+	variant (cell_barred) "CSN.1 L/H"
+	variant (further_cell_info) "PRESENCE(cell_barred = '0'B)"
+};
+
+private type record SI10FurtherCellInfo {
+	BIT1			la_different, // L/H
+	uint3_t			cell_resel_hyst optional,
+	uint5_t			ms_txpwr_max_cch,
+	uint6_t			rxlev_access_min,
+	uint6_t			cell_resel_offset,
+	uint3_t			temp_offset,
+	uint5_t			penalty_time
+} with {
+	variant (la_different) "CSN.1 L/H"
+	variant (cell_resel_hyst) "PRESENCE(la_different = '1'B)"
+};
+
+private type record of SI10InfoField SI10InfoFieldList;
+private type record SI10InfoField {
+	BIT1			item_ind ('1'B),
+	SI10NextFreqList	next_freq optional,
+	BIT1			next_freq_term ('0'B), // L/H
+	SI10DiffCellInfo	diff_cell_info
+} with {
+	variant (item_ind) "CSN.1 L/H"
+	variant "PRESENCE(item_ind = '1'B)"
+	variant (next_freq_term) "CSN.1 L/H"
+};
+
+private type record of SI10NextFreq SI10NextFreqList;
+private type BIT1 SI10NextFreq with { variant "CSN.1 L/H" };
+
+private type record SI10DiffCellInfo {
+	BIT1			bcc_or_bsic, // L/H
+	uint3_t			bcc optional,
+	uint6_t			bsic optional,
+	BIT1			diff_cell_params_presence, // L/H
+	SI10DiffCellParams	diff_cell_params optional
+} with {
+	variant (bcc_or_bsic) "CSN.1 L/H"
+	variant (bcc) "PRESENCE(bcc_or_bsic = '1'B)"
+	variant (bsic) "PRESENCE(bcc_or_bsic = '0'B)"
+	variant (diff_cell_params_presence) "CSN.1 L/H"
+	variant (diff_cell_params) "PRESENCE(diff_cell_params_presence = '1'B)"
+};
+
+private type record SI10DiffCellParams {
+	BIT1				cell_barred, // L/H
+	SI10FurtherDiffCellInfo		further_diff_cell_info optional
+} with {
+	variant (cell_barred) "CSN.1 L/H"
+	variant (further_diff_cell_info) "PRESENCE(cell_barred = '0'B)"
+};
+
+private type record SI10FurtherDiffCellInfo {
+	BIT1			la_different, // L/H
+	uint3_t			cell_resel_hyst optional,
+	BIT1			ms_txpwr_max_cch_presence, // L/H
+	uint5_t			ms_txpwr_max_cch optional,
+	BIT1			rxlev_access_min_presence, // L/H
+	uint6_t			rxlev_access_min optional,
+	BIT1			cell_resel_offset_presence, // L/H
+	uint6_t			cell_resel_offset optional,
+	BIT1			temp_offset_presence, // L/H
+	uint3_t			temp_offset optional,
+	BIT1			penalty_time_presence, // L/H
+	uint5_t			penalty_time optional
+} with {
+	variant (la_different) "CSN.1 L/H"
+	variant (cell_resel_hyst) "PRESENCE(la_different = '1'B)"
+	variant (ms_txpwr_max_cch_presence) "CSN.1 L/H"
+	variant (ms_txpwr_max_cch) "PRESENCE(ms_txpwr_max_cch_presence = '1'B)"
+	variant (rxlev_access_min_presence) "CSN.1 L/H"
+	variant (rxlev_access_min) "PRESENCE(rxlev_access_min_presence = '1'B)"
+	variant (cell_resel_offset_presence) "CSN.1 L/H"
+	variant (cell_resel_offset) "PRESENCE(cell_resel_offset_presence = '1'B)"
+	variant (temp_offset_presence) "CSN.1 L/H"
+	variant (temp_offset) "PRESENCE(temp_offset_presence = '1'B)"
+	variant (penalty_time_presence) "CSN.1 L/H"
+	variant (penalty_time) "PRESENCE(penalty_time_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
@@ -1266,6 +1385,11 @@
 external function dec_SI13RestOctets(in octetstring stream) return SI13RestOctets
 	with { extension "prototype(convert) decode(RAW)" };
 
+external function enc_SI10RestOctets(in SI10RestOctets ro) return octetstring
+	with { extension "prototype(convert) encode(RAW)" };
+external function dec_SI10RestOctets(in octetstring stream) return SI10RestOctets
+	with { extension "prototype(convert) decode(RAW)" };
+
 
 /* Basic templates to be extended in place */
 template (value) SI3RestOctets ts_SI3RestOctets := {