aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-10-23 11:36:50 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2017-10-26 16:08:00 +0200
commitdf78e48eb04c906fbee0a65d2f11d5f9069520c0 (patch)
treeff73b961a92aab4889e47676f5d4b7b62108a723
parent5de728564c78dcf4e7fde8baf520d8b4f056860b (diff)
log: log the sccp message type of messages sent
We already log the message type of sccp messages we receive, but for transmitting the log output is missing. Also log the message type for tramsitted sccp messages. Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7
-rw-r--r--src/osmo-bsc/osmo_bsc_sigtran.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 48796c1fa..31a8cea4d 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -331,6 +331,22 @@ int osmo_bsc_sigtran_send(const struct osmo_bsc_sccp_con *conn, struct msgb *msg
msc = conn->msc;
+ /* Log the type of the message we are sending. This is just
+ * informative, do not stop if detecting the type fails */
+ if (msg->len >= 3) {
+ switch (msg->data[0]) {
+ case BSSAP_MSG_BSS_MANAGEMENT:
+ LOGP(DMSC, LOGL_INFO, "Tx MSC %s\n", gsm0808_bssmap_name(msg->data[2]));
+ break;
+ case BSSAP_MSG_DTAP:
+ LOGP(DMSC, LOGL_INFO, "Tx MSC DTAP\n");
+ break;
+ default:
+ LOGP(DMSC, LOGL_ERROR, "Tx MSC (unknwon message type)\n");
+ }
+ } else
+ LOGP(DMSC, LOGL_ERROR, "Tx MSC (message too short)\n");
+
if (a_reset_conn_ready(msc->a.reset) == false) {
LOGP(DMSC, LOGL_ERROR, "MSC is not connected. Dropping.\n");
return -EINVAL;