smc: Introduce an id and prefix all log messages with SMC(ID)
When OpenBSC is handling more than one message at a time it is difficult
to see which log message belongs to which SMC. Introduce a uint64_t id
that can be set to the row_id/message_id and prefix all log messages
with SMC(ID).
This change is ABI and API incompatible with previous versions of
libosmogsm.
Example:
SMC(100) instance created
SMC(100) message MNSMS-EST-REQ received in state IDLE
diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h
index 2140db4..239ee13 100644
--- a/include/osmocom/gsm/gsm0411_smc.h
+++ b/include/osmocom/gsm/gsm0411_smc.h
@@ -24,6 +24,7 @@
#define GSM411_MNSMS_REL_REQ 0x107
struct gsm411_smc_inst {
+ uint64_t id; /* a unique id for the SMS */
int network; /* is this a MO (0) or MT (1) transfer */
int (*mn_recv) (struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg);
@@ -43,7 +44,7 @@
extern const struct value_string gsm411_cp_cause_strs[];
/* init a new instance */
-void gsm411_smc_init(struct gsm411_smc_inst *inst, int network,
+void gsm411_smc_init(struct gsm411_smc_inst *inst, uint64_t id, int network,
int (*mn_recv) (struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg),
int (*mm_send) (struct gsm411_smc_inst *inst, int msg_type,