Change in osmo-ttcn3-hacks[master]: bsc: Verify ms power level value from RSL IE MS Power during CHAN ACT

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/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Oct 28 14:14:45 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15883 )


Change subject: bsc: Verify ms power level value from RSL IE MS Power during CHAN ACT
......................................................................

bsc: Verify ms power level value from RSL IE MS Power during CHAN ACT

Change-Id: I0a632156420251b14d1bbfd4ca19dc2bdf5a5f1e
---
M bsc/MSC_ConnectionHandler.ttcn
M library/RSL_Types.ttcn
2 files changed, 17 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/15883/1

diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 40701d6..461d61c 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -526,6 +526,7 @@
 	TestHdlrEncrParams encr optional,
 	TestHdlrParamsLcls lcls,
 	TestHdlrParamsHandover handover optional,
+	uint5_t 	exp_ms_power_level,
 	boolean		aoip,
 	boolean		use_osmux
 };
@@ -551,6 +552,7 @@
 		adjust_cx_exp := true
 	},
 	handover := omit,
+	exp_ms_power_level := 7, /* calculated from osmo-bsc.cfg "ms max power" */
 	aoip := true,
 	use_osmux := false
 }
@@ -739,6 +741,7 @@
 private function f_check_chan_act(AssignmentState st, RSL_Message chan_act) runs on MSC_ConnHdlr {
 	var RSL_IE_Body encr_info;
 	var RSL_IE_Body ms_power_param;
+	var RSL_IE_Body ms_power;
 
 	if (ispresent(g_pars.encr) and g_pars.encr.enc_alg != '01'O) {
 		if (not f_rsl_find_ie(chan_act, RSL_IE_ENCR_INFO, encr_info)) {
@@ -763,6 +766,14 @@
 		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "IE MS Power Parameters not found in CHAN ACT");
 	}
 
+	if (not f_rsl_find_ie(chan_act, RSL_IE_MS_POWER, ms_power)) {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "IE MS Powernot found in CHAN ACT");
+	} else {
+		if (not match(ms_power.ms_power, tr_RSL_IE_MS_Power(g_pars.exp_ms_power_level, false))) {
+			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Wrong Encryption IE in CHAN ACT");
+		}
+	}
+
 }
 
 altstep as_assignment(inout AssignmentState st) runs on MSC_ConnHdlr {
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index db0e231..d982e02 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -454,6 +454,12 @@
 		boolean		fpc_epc,
 		uint5_t		power_level
 	}
+	template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
+							    template boolean fpc_epc := false) := {
+		reserved := 0,
+		fpc_epc := fpc_epc,
+		power_level := power_level
+	}
 	template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
 							    boolean fpc_epc := false) := {
 		reserved := 0,

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15883
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: I0a632156420251b14d1bbfd4ca19dc2bdf5a5f1e
Gerrit-Change-Number: 15883
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191028/bb681541/attachment.htm>


More information about the gerrit-log mailing list