oap_client: move logging to DLOAP logging category
Use libosmocore's DLOAP logging category for OAP.
oap_client_test.c: make sure DLOAP is in DEBUG level to not lose any logging
messages from experr.
Todo: we're using a "Library" logging category, which is not really what the
library category was intended for. Instead, the OAP client should probably be
given a logging category like DVLR or DGPRS in its initialization API.
Related: OS#1592
Change-Id: Ic765c19381b0d983da90a5d8aee9cd17e31cf34a
diff --git a/openbsc/src/libcommon/oap_client.c b/openbsc/src/libcommon/oap_client.c
index 92140c1..46dbcdd 100644
--- a/openbsc/src/libcommon/oap_client.c
+++ b/openbsc/src/libcommon/oap_client.c
@@ -38,12 +38,12 @@
goto disable;
if (config->secret_k_present == 0) {
- LOGP(DGPRS, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n");
+ LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n");
goto disable;
}
if (config->secret_opc_present == 0) {
- LOGP(DGPRS, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n");
+ LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n");
goto disable;
}
@@ -101,16 +101,16 @@
osmo_auth_gen_vec(&vec, &auth, rx_random);
if (vec.res_len != 8) {
- LOGP(DGPRS, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n",
+ LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n",
vec.res_len);
return -3;
}
if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) {
- LOGP(DGPRS, LOGL_ERROR, "OAP: AUTN mismatch!\n");
- LOGP(DGPRS, LOGL_INFO, "OAP: AUTN from server: %s\n",
+ LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n");
+ LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n",
osmo_hexdump_nospc(rx_autn, sizeof(vec.autn)));
- LOGP(DGPRS, LOGL_INFO, "OAP: AUTN expected: %s\n",
+ LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n",
osmo_hexdump_nospc(vec.autn, sizeof(vec.autn)));
return -2;
}
@@ -135,7 +135,7 @@
struct osmo_oap_message oap_msg = {0};
if (client_id < 1) {
- LOGP(DGPRS, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id);
+ LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id);
return NULL;
}
@@ -175,7 +175,7 @@
uint8_t xres[8];
if (!(oap_rx->rand_present && oap_rx->autn_present)) {
- LOGP(DGPRS, LOGL_ERROR,
+ LOGP(DLOAP, LOGL_ERROR,
"OAP challenge incomplete (rand_present: %d, autn_present: %d)\n",
oap_rx->rand_present, oap_rx->autn_present);
rc = -2;
@@ -218,7 +218,7 @@
rc = osmo_oap_decode(&oap_msg, data, data_len);
if (rc < 0) {
- LOGP(DGPRS, LOGL_ERROR,
+ LOGP(DLOAP, LOGL_ERROR,
"Decoding OAP message failed with error '%s' (%d)\n",
get_value_string(gsm48_gmm_cause_names, -rc), -rc);
return -10;
@@ -234,7 +234,7 @@
break;
case OAP_MSGT_REGISTER_ERROR:
- LOGP(DGPRS, LOGL_ERROR,
+ LOGP(DLOAP, LOGL_ERROR,
"OAP registration failed\n");
state->state = OAP_INITIALIZED;
if (state->registration_failures < 3) {
@@ -245,13 +245,13 @@
case OAP_MSGT_REGISTER_REQUEST:
case OAP_MSGT_CHALLENGE_RESULT:
- LOGP(DGPRS, LOGL_ERROR,
+ LOGP(DLOAP, LOGL_ERROR,
"Received invalid OAP message type for OAP client side: %d\n",
(int)oap_msg.message_type);
return -12;
default:
- LOGP(DGPRS, LOGL_ERROR,
+ LOGP(DLOAP, LOGL_ERROR,
"Unknown OAP message type: %d\n",
(int)oap_msg.message_type);
return -13;