Change in osmo-ttcn3-hacks[master]: hlr/HLR_EUSE.ttcn: remove redundant code from f_main_mo()

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Mon Nov 5 05:10:07 UTC 2018


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/11578 )

Change subject: hlr/HLR_EUSE.ttcn: remove redundant code from f_main_mo()
......................................................................

hlr/HLR_EUSE.ttcn: remove redundant code from f_main_mo()

There is no need to pass session state from f_main_mo() to a
choosen EUSE handler (e.g. f_ss_echo), because a handler
itself is capable to extract the session state IE.

Change-Id: I1054baf3e7dafd05b797610b586e6202740f07b6
---
M hlr/HLR_EUSE.ttcn
1 file changed, 9 insertions(+), 13 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Neels Hofmeyr: Looks good to me, approved



diff --git a/hlr/HLR_EUSE.ttcn b/hlr/HLR_EUSE.ttcn
index 1e7574b..93eb8f4 100644
--- a/hlr/HLR_EUSE.ttcn
+++ b/hlr/HLR_EUSE.ttcn
@@ -50,14 +50,17 @@
 	}
 }
 
-type function f_euse_cb(GSUP_SessionState ss_state, GSUP_PDU rx_pdu) return GSUP_PDU;
+type function f_euse_cb(GSUP_PDU rx_pdu) return GSUP_PDU;
 
-function f_ss_echo_continue(GSUP_SessionState ss_state, GSUP_PDU rx_pdu) return GSUP_PDU {
+function f_ss_echo_continue(GSUP_PDU rx_pdu) return GSUP_PDU {
 	var GSUP_SessionState ss_next_state;
-	var GSUP_IeValue ss_ie;
+	var GSUP_IeValue ss_ie, state_ie;
 	var SS_FacilityInformation dec_fac, rsp_fac;
 	var octetstring ss_rsp;
 
+	f_gsup_find_ie(rx_pdu, OSMO_GSUP_SS_INFO_IE, state_ie);
+	var GSUP_SessionState ss_state := state_ie.session_state;
+
 	f_gsup_find_ie(rx_pdu, OSMO_GSUP_SS_INFO_IE, ss_ie);
 	dec_fac := dec_SS_FacilityInformation(ss_ie.ss_info);
 	log("dec_fac: ", dec_fac);
@@ -74,7 +77,7 @@
 					   ss_next_state, ss_rsp));
 }
 
-function f_ss_echo(GSUP_SessionState ss_state, GSUP_PDU rx_pdu) return GSUP_PDU {
+function f_ss_echo(GSUP_PDU rx_pdu) return GSUP_PDU {
 	var GSUP_IeValue ss_ie;
 	var SS_FacilityInformation dec_fac, rsp_fac;
 	var octetstring ss_rsp;
@@ -100,15 +103,8 @@
 
 	while (true) {
 		alt {
-		[] EUSE.receive(tr_GSUP_PROC_SS_REQ(?, ?, OSMO_GSUP_SESSION_STATE_BEGIN)) -> value rx_pdu {
-			EUSE.send(cb_fn.apply(OSMO_GSUP_SESSION_STATE_BEGIN, rx_pdu));
-			}
-		[] EUSE.receive(tr_GSUP_PROC_SS_REQ(?, ?, OSMO_GSUP_SESSION_STATE_CONTINUE)) -> value rx_pdu {
-			EUSE.send(cb_fn.apply(OSMO_GSUP_SESSION_STATE_CONTINUE, rx_pdu));
-			}
-
-		[] EUSE.receive(tr_GSUP_PROC_SS_REQ(?, ?, OSMO_GSUP_SESSION_STATE_END)) -> value rx_pdu {
-			EUSE.send(cb_fn.apply(OSMO_GSUP_SESSION_STATE_END, rx_pdu));
+		[] EUSE.receive(tr_GSUP_PROC_SS_REQ(?, ?, ?)) -> value rx_pdu {
+			EUSE.send(cb_fn.apply(rx_pdu));
 			}
 
 

-- 
To view, visit https://gerrit.osmocom.org/11578
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1054baf3e7dafd05b797610b586e6202740f07b6
Gerrit-Change-Number: 11578
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181105/660c1a28/attachment.html>


More information about the gerrit-log mailing list