Change in osmo-ttcn3-hacks[master]: library/IPA_Emulation: server mode: expose IPA IDENTITY RESPONSE

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

fixeria gerrit-no-reply at lists.osmocom.org
Mon May 25 15:15:16 UTC 2020


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


Change subject: library/IPA_Emulation: server mode: expose IPA IDENTITY RESPONSE
......................................................................

library/IPA_Emulation: server mode: expose IPA IDENTITY RESPONSE

Change-Id: I685c2697cdbe932572e1839420d0c74c8fa94ee2
Related: OS#4546
---
M library/IPA_Emulation.ttcnpp
1 file changed, 33 insertions(+), 6 deletions(-)



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

diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp
index 62a11b7..d2f2102 100644
--- a/library/IPA_Emulation.ttcnpp
+++ b/library/IPA_Emulation.ttcnpp
@@ -79,25 +79,33 @@
 type enumerated ASP_IPA_EventType {
 	ASP_IPA_EVENT_DOWN,
 	ASP_IPA_EVENT_UP,
+	ASP_IPA_EVENT_ID_RESP,
 	ASP_IPA_EVENT_ID_ACK
 }
 
 /* an event indicating us whether or not a connection is physically up or down,
- * and whether we have received an ID_ACK */
+ * and whether we have received an ID_RESP or ID_ACK */
 type record ASP_IPA_Event {
 	ASP_IPA_EventType	ev_type,
-	integer			conn_id
+	integer			conn_id,
+
+	/* Presence of these fields depends on event type */
+	IpaCcmIdResp		id_resp optional  // ASP_IPA_EVENT_ID_RESP
 }
 
-template (value) ASP_IPA_Event ts_ASP_IPA_EV(ASP_IPA_EventType ev_type, integer conn_id) := {
+template (value) ASP_IPA_Event ts_ASP_IPA_EV(ASP_IPA_EventType ev_type, integer conn_id,
+					     template (omit) IpaCcmIdResp id_resp := omit) := {
 	ev_type := ev_type,
-	conn_id := conn_id
+	conn_id := conn_id,
+	id_resp := id_resp
 }
 
 template ASP_IPA_Event tr_ASP_IPA_EV(template ASP_IPA_EventType ev_type,
-				     template integer conn_id := ?) := {
+				     template integer conn_id := ?,
+				     template IpaCcmIdResp id_resp := *) := {
 	ev_type := ev_type,
-	conn_id := conn_id
+	conn_id := conn_id,
+	id_resp := id_resp
 }
 
 template ASP_IPA_Unitdata t_ASP_IPA_UD(IpaStreamId sid, octetstring pl,
@@ -424,6 +432,16 @@
 	}
 }
 
+template PDU_IPA_CCM tr_IPA_ID_RESP := {
+	msg_type := IPAC_MSGT_ID_RESP,
+	u := {
+		resp := {
+			{ ?, IPAC_IDTAG_UNITNAME, ? },
+			{ ?, IPAC_IDTAG_UNITID, ? }
+		}
+	}
+}
+
 /* receive IPA CCM message */
 private function f_ccm_rx_client(PDU_IPA_CCM ccm) runs on IPA_Emulation_CT {
 	select (ccm.msg_type) {
@@ -458,6 +476,15 @@
 		}
 		case (IPAC_MSGT_ID_RESP) {
 			log("IPA ID RESP: ", ccm.u.resp);
+
+			/* make sure that the response contains all fields we requested */
+			if (not match(ccm, tr_IPA_ID_RESP)) {
+				log("IPA identity response ", ccm.u.resp, " mismatch");
+				return;
+			}
+
+			/* forward to the upper layers, so they can map conn_id with unit_id */
+			f_send_IPA_EVT(ts_ASP_IPA_EV(ASP_IPA_EVENT_ID_RESP, conn_id, ccm.u.resp));
 			/* acknowledge any identity that the client may have sent */
 			f_ccm_tx(valueof(ts_IPA_ACK), conn_id);
 		}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/18464
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: I685c2697cdbe932572e1839420d0c74c8fa94ee2
Gerrit-Change-Number: 18464
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200525/d3df4f89/attachment.htm>


More information about the gerrit-log mailing list