diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2017-12-14 03:52:18 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-12-18 03:47:14 +0100 |
commit | f879fc92cf3b8f891c9009b775e9258e5d86f47e (patch) | |
tree | 761c0cfb6dd1ddaa6fc60fc703d4244b41c02bb5 /src | |
parent | fb21d9dde60d66ab4871ebb5b63daaecd555c47b (diff) |
debug log: a_iface_tx_cipher_mode(): log cipher and key
Introduce LOGPCONN() which would also be useful in numerous other places in
this file.
Change-Id: Ib406d6e6784342341e716206997e382c702ac9d2
Diffstat (limited to 'src')
-rw-r--r-- | src/libmsc/a_iface.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 83ec82f11..f863517c4 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -39,9 +39,15 @@ #include <osmocom/sccp/sccp_types.h> #include <osmocom/msc/a_reset.h> #include <osmocom/msc/osmo_msc.h> +#include <osmocom/msc/vlr.h> #include <errno.h> +#define LOGPCONN(conn, level, fmt, args...) \ + LOGP(DMSC, level, "(subscr %s, conn_id %d) " fmt, \ + vlr_subscr_name(conn ? conn->vsub : NULL), conn ? conn->a.conn_id : -1, \ + ## args) + /* A pointer to the GSM network we work with. By the current paradigm, * there can only be one gsm_network per MSC. The pointer is set once * when calling a_init() */ @@ -172,10 +178,12 @@ int a_iface_tx_cipher_mode(const struct gsm_subscriber_connection *conn, OSMO_ASSERT(conn); - LOGP(DMSC, LOGL_DEBUG, "Passing Cipher mode command message from MSC to BSC (conn_id=%i)\n", conn->a.conn_id); uint8_t crm = 0x01; uint8_t *crm_ptr = NULL; + LOGPCONN(conn, LOGL_DEBUG, "Cipher Mode Command to BSC, cipher=%d key=%s\n", + cipher, osmo_hexdump_nospc(key, len)); + /* Setup encryption information */ if (len > ENCRY_INFO_KEY_MAXLEN || !key) { LOGP(DMSC, LOGL_ERROR, |