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
This commit is contained in:
Neels Hofmeyr 2017-12-14 03:52:18 +01:00
parent fb21d9dde6
commit f879fc92cf
1 changed files with 9 additions and 1 deletions

View File

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