transaction: clarify magic 0xff transaction ID

Change-Id: I2d3a6334f49989bedbb1430d26ffad8b61dfd873
This commit is contained in:
Max 2019-02-14 16:54:10 +07:00 committed by Vadim Yanitskiy
parent 30fb97aa43
commit d8daaae91e
4 changed files with 8 additions and 4 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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);
}