aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-02-14 16:54:10 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-02-15 02:19:30 +0700
commitd8daaae91ec0f93238e1800bd6e1370147786488 (patch)
treef874249dda4c64e9efbec18258e80d3de3263316
parent30fb97aa431d8c8cfcf00e193c809ad1c5567d10 (diff)
transaction: clarify magic 0xff transaction ID
-rw-r--r--include/osmocom/msc/transaction.h3
-rw-r--r--src/libmsc/gsm_04_08_cc.c5
-rw-r--r--src/libmsc/gsm_09_11.c2
-rw-r--r--src/libmsc/transaction.c2
4 files changed, 8 insertions, 4 deletions
diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h
index c5c740c..5e8d637 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -9,6 +9,9 @@
#include <osmocom/gsm/gsm0411_smc.h>
#include <osmocom/gsm/gsm0411_smr.h>
+/* Used for late TID assignment */
+#define TRANS_ID_UNASSIGNED 0xff
+
enum bridge_state {
BRIDGE_STATE_NONE,
BRIDGE_STATE_LOOPBACK_PENDING,
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index b84fd03..98c2aa3 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -617,7 +617,7 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg)
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
/* transaction id must not be assigned */
- if (trans->transaction_id != 0xff) { /* unasssigned */
+ if (trans->transaction_id != TRANS_ID_UNASSIGNED) {
DEBUGP(DCC, "TX Setup with assigned transaction. "
"This is not allowed!\n");
/* Temporarily out of order */
@@ -1928,7 +1928,8 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
GSM48_CC_CAUSE_DEST_OOO);
}
/* Create transaction */
- trans = trans_alloc(net, vsub, GSM48_PDISC_CC, 0xff, data->callref);
+ trans = trans_alloc(net, vsub, GSM48_PDISC_CC,
+ TRANS_ID_UNASSIGNED, data->callref);
if (!trans) {
LOGP(DCC, LOGL_ERROR, "No memory for trans.\n");
vlr_subscr_put(vsub);
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 08721d4..d2ad0b7 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -296,7 +296,7 @@ static struct gsm_trans *establish_nc_ss_trans(struct gsm_network *net,
/* Allocate a new transaction */
trans = trans_alloc(net, vsub, GSM48_PDISC_NC_SS,
- 0xff, gsup_msg->session_id);
+ TRANS_ID_UNASSIGNED, gsup_msg->session_id);
if (!trans) {
LOGP(DMM, LOGL_ERROR, " -> No memory for trans\n");
return NULL;
diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index 237191d..23880aa 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -196,7 +196,7 @@ int trans_assign_trans_id(const struct gsm_network *net, const struct vlr_subscr
llist_for_each_entry(trans, &net->trans_list, entry) {
if (trans->vsub != vsub ||
trans->protocol != protocol ||
- trans->transaction_id == 0xff)
+ trans->transaction_id == TRANS_ID_UNASSIGNED)
continue;
used_tid_bitmask |= (1 << trans->transaction_id);
}