Change in osmo-ttcn3-hacks[master]: Make f_gen_tr_ss_ies() work for both 'latest' and 'master'

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat May 11 09:13:53 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/13990 )

Change subject: Make f_gen_tr_ss_ies() work for both 'latest' and 'master'
......................................................................

Make f_gen_tr_ss_ies() work for both 'latest' and 'master'

This fixes the partial revert of c43c8cd275b4f71b0bc6a50fc81564c812d5b406
to work for both situtions:  Messages that have the OSMO_GSUP_MESSAGE_CLASS_USSD
and messages that don't.

The particular implementation is rather ugly, but we're waiting for
a response to https://www.eclipse.org/forums/index.php/t/1098847/
on how to solve this kind of problem in a more elegant way.  Meanwile,
we make it work first.

Change-Id: Ibf137de6a41aaa43894cc0b6da8341ceb88b0756
---
M library/GSUP_Types.ttcn
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn
index 7e26e19..44b9f26 100644
--- a/library/GSUP_Types.ttcn
+++ b/library/GSUP_Types.ttcn
@@ -1091,15 +1091,23 @@
 		tr_GSUP_IE_SessionId(sid),
 		tr_GSUP_IE_SessionState(state)
 	};
+	var integer last_idx := 3;
 
 	/* Optional SS payload */
 	if (istemplatekind(ss, "*")) {
 		ies[3] := *;
+		last_idx := last_idx + 1;
 	} else if (not istemplatekind(ss, "omit")) {
 		ies[3] := tr_GSUP_IE_SSInfo(ss);
+		last_idx := last_idx + 1;
 	}
 
-	return ies;
+	/* the GSUP Message Class IE is optional, as old implementations don't have it yet */
+	var template GSUP_IEs ies2 := ies;
+	ies2[last_idx] := tr_GSUP_IE_Message_Class(OSMO_GSUP_MESSAGE_CLASS_USSD);
+	last_idx := last_idx + 1;
+
+	return (ies, ies2);
 }
 
 template (value) GSUP_PDU ts_GSUP_PROC_SS_REQ(

-- 
To view, visit https://gerrit.osmocom.org/13990
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: Ibf137de6a41aaa43894cc0b6da8341ceb88b0756
Gerrit-Change-Number: 13990
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190511/f1c6dcb1/attachment.html>


More information about the gerrit-log mailing list