Change in osmo-msc[master]: libmsc/transaction: introduce trans_find_by_sm_rp_mr()

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sun Nov 25 15:36:12 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/11917


Change subject: libmsc/transaction: introduce trans_find_by_sm_rp_mr()
......................................................................

libmsc/transaction: introduce trans_find_by_sm_rp_mr()

According to GSM TS 04.11, section 8.2.3, the RP Message Reference
is a mandatory field for all messages on the SM-RL (SM Relay Layer),
that is used to link an RP-ACK or RP-ERROR message to the associated
(preceding) RP-DATA or RP-SMMA message transfer attempt.

This change extends the transaction state structure with SM-RP-MR,
and introduces a new function for matching transactions within a
given connection by this reference.

Change-Id: Ice47c37ecef4416e65ecee8931d946c915316791
---
M include/osmocom/msc/transaction.h
M src/libmsc/transaction.c
2 files changed, 27 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/17/11917/1

diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h
index b7d7971..762eeea 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -76,6 +76,9 @@
 			struct gsm411_smc_inst smc_inst;
 			struct gsm411_smr_inst smr_inst;
 
+			/* SM-RP-MR, Message Reference (see GSM TS 04.11, section 8.2.3) */
+			uint8_t sm_rp_mr;
+
 			struct gsm_sms *sms;
 		} sms;
 		struct {
@@ -99,6 +102,8 @@
 				   uint8_t proto, uint8_t trans_id);
 struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
 					uint32_t callref);
+struct gsm_trans *trans_find_by_sm_rp_mr(struct gsm_subscriber_connection *conn,
+					 uint8_t sm_rp_mr);
 
 struct gsm_trans *trans_alloc(struct gsm_network *net,
 			      struct vlr_subscr *vsub,
diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index be14420..c5c8bd4 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -73,6 +73,28 @@
 	return NULL;
 }
 
+/*! Find a transaction by SM-RP-MR (RP Message Reference)
+ * \param[in] conn Connection in whihc we want to find transaction
+ * \param[in] sm_rp_mr RP Message Reference (see GSM TS 04.11, section 8.2.3)
+ * \returns Matching transaction, if any
+ */
+struct gsm_trans *trans_find_by_sm_rp_mr(struct gsm_subscriber_connection *conn,
+					 uint8_t sm_rp_mr)
+{
+	struct gsm_network *net = conn->network;
+	struct vlr_subscr *vsub = conn->vsub;
+	struct gsm_trans *trans;
+
+	llist_for_each_entry(trans, &net->trans_list, entry) {
+		if (trans->vsub == vsub &&
+		    trans->protocol == GSM48_PDISC_SMS &&
+		    trans->sms.sm_rp_mr == sm_rp_mr)
+			return trans;
+	}
+
+	return NULL;
+}
+
 /*! Allocate a new transaction and add it to network list
  *  \param[in] net Netwokr in which we allocate transaction
  *  \param[in] subscr Subscriber for which we allocate transaction

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice47c37ecef4416e65ecee8931d946c915316791
Gerrit-Change-Number: 11917
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Ivan Kluchnikov <kluchnikovi at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181125/02929608/attachment.htm>


More information about the gerrit-log mailing list