Change in osmo-ttcn3-hacks[master]: IPA_Types/Emulation: Add RSPRO support

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

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Oct 10 20:30:36 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/11304


Change subject: IPA_Types/Emulation: Add RSPRO support
......................................................................

IPA_Types/Emulation: Add RSPRO support

RSPRO is the protocol used by osmo-remsim.  It is embedded into an IPA
multiplex, and hence the TTCN-3 IPA code needs some extension to cover
support for it.

Change-Id: I536d6843b3e65b3ee35fbbcd6353e0fb0ce21c8e
---
M library/IPA_Emulation.ttcnpp
M library/IPA_Types.ttcn
2 files changed, 49 insertions(+), 2 deletions(-)



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

diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index 7a26a6b..413d290 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -8,7 +8,7 @@
  * GSUP.  IT hence transcodes messages so the user can work with abstract data types rather
  * than binary messages.  It handles multiple packets inside one TCP segment.
  *
- * (C) 2017 by Harald Welte <laforge at gnumonks.org>
+ * (C) 2017-2018 by Harald Welte <laforge at gnumonks.org>
  * All rights reserved.
  *
  * Released under the terms of GNU General Public License, Version 2 or
@@ -39,6 +39,12 @@
 import from GSUP_Types all;
 #endif
 
+#ifdef IPA_EMULATION_RSPRO
+import from RSPRO all;
+import from RSPRO_Types all;
+#endif
+
+
 import from Osmocom_CTRL_Types all;
 
 modulepar {
@@ -137,6 +143,14 @@
 } with { extension "internal" }
 #endif
 
+#ifdef IPA_EMULATION_RSPRO
+type port IPA_RSPRO_PT message {
+	inout RsproPDU, ASP_IPA_Event;
+} with { extension "internal" }
+#endif
+
+
+
 
 type component IPA_Emulation_CT {
 	/* down-facing port to IPA codec port */
@@ -159,6 +173,10 @@
 	/* up-facing port for GSUP */
 	port IPA_GSUP_PT IPA_GSUP_PORT;
 #endif
+#ifdef IPA_EMULATION_RSPRO
+	/* up-facing port for RSPRO */
+	port IPA_RSPRO_PT IPA_RSPRO_PORT;
+#endif
 
 	/* up-facing port for other streams */
 	port IPA_SP_PT IPA_SP_PORT;
@@ -266,6 +284,11 @@
 		IPA_GSUP_PORT.send(evt);
 	}
 #endif
+#ifdef IPA_EMULATION_RSPRO
+	if (IPA_RSPRO_PORT.checkstate("Connected")) {
+		IPA_RSPRO_PORT.send(evt);
+	}
+#endif
 	/* FIXME: to other ports */
 }
 
@@ -455,6 +478,13 @@
 }
 #endif
 
+#ifdef IPA_EMULATION_RSPRO
+private function f_rspro_to_user(octetstring msg) runs on IPA_Emulation_CT {
+	var RsproPDU rspro := dec_RsproPDU(msg);
+	IPA_RSPRO_PORT.send(rspro);
+}
+#endif
+
 #ifdef IPA_EMULATION_MGCP
 private function f_mgcp_to_user(octetstring msg) runs on IPA_Emulation_CT {
 	var charstring msg_ch := oct2char(msg);
@@ -497,6 +527,9 @@
 #ifdef IPA_EMULATION_RSL
 	var ASP_RSL_Unitdata rsl;
 #endif
+#ifdef IPA_EMULATION_RSPRO
+	var RsproPDU rspro;
+#endif
 
 	/* Set function for dissecting the binary */
 	var f_IPL4_getMsgLen vl_f := refers(f_IPL4_fixedMsgLen);
@@ -559,6 +592,11 @@
 						f_gsup_to_user(ipa_rx.msg);
 					}
 #endif
+#ifdef IPA_EMULATION_RSPRO
+					case (IPAC_PROTO_EXT_RSPRO) {
+						f_rspro_to_user(ipa_rx.msg);
+					}
+#endif
 					case else {
 						IPA_SP_PORT.send(f_to_asp(ipa_rx));
 					}
@@ -639,6 +677,14 @@
 		}
 #endif
 
+#ifdef IPA_EMULATION_RSPRO
+		[] IPA_RSPRO_PORT.receive(RsproPDU:?) -> value rspro {
+			payload := enc_RsproPDU(rspro);
+			ipa_ud := valueof(t_ASP_IPA_UD(IPAC_PROTO_OSMO, payload, IPAC_PROTO_EXT_RSPRO));
+			IPA_PORT.send(f_from_asp(g_ipa_conn_id, ipa_ud));
+		}
+#endif
+
 #ifdef IPA_EMULATION_RSL
 		/* Received RSL -> down into IPA */
 		[] IPA_RSL_PORT.receive(ASP_RSL_Unitdata:?) -> value rsl {
diff --git a/library/IPA_Types.ttcn b/library/IPA_Types.ttcn
index 3230329..1325b14 100644
--- a/library/IPA_Types.ttcn
+++ b/library/IPA_Types.ttcn
@@ -32,7 +32,8 @@
 	IPAC_PROTO_EXT_SMSC	('03'H),
 	IPAC_PROTO_EXT_ORC	('04'H),
 	IPAC_PROTO_EXT_GSUP	('05'H),
-	IPAC_PROTO_EXT_OAP	('06'H)
+	IPAC_PROTO_EXT_OAP	('06'H),
+	IPAC_PROTO_EXT_RSPRO	('07'H)
 } with { variant "FIELDLENGTH(8)" }
 
 external function enc_PDU_IPA(in PDU_IPA pdu) return octetstring

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I536d6843b3e65b3ee35fbbcd6353e0fb0ce21c8e
Gerrit-Change-Number: 11304
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181010/f81a5669/attachment.htm>


More information about the gerrit-log mailing list