aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-01-11 11:51:28 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-23 12:16:05 +0000
commita5e369300f77269b2f6b596c2bf7f53795602a0c (patch)
treeb16ff3acbc8591842649d5d36411c4b0760c4645 /openbsc/src/libbsc
parent93bafb611a58293e0353320a14db298133c9d99a (diff)
Improve OML failure report
* clearly separate report parts * use textual representation for failure cause if possible Change-Id: I7a98a77011463021d0edd6ecfab1680e211f7e16 Related: OS#1615
Diffstat (limited to 'openbsc/src/libbsc')
-rw-r--r--openbsc/src/libbsc/abis_nm.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 26982251..8b0eec2e 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -37,6 +37,7 @@
#include <openbsc/gsm_data.h>
#include <openbsc/debug.h>
#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/abis_nm.h>
#include <osmocom/core/talloc.h>
@@ -281,25 +282,32 @@ static int rx_fail_evt_rep(struct msgb *mb)
const uint8_t *p_val;
char *p_text;
- LOGPC(DNM, LOGL_ERROR, "Failure Event Report ");
-
+ LOGPC(DNM, LOGL_ERROR, "Failure Event Report: ");
+
abis_nm_tlv_parse(&tp, sign_link->trx->bts, foh->data, oh->length-sizeof(*foh));
if (TLVP_PRESENT(&tp, NM_ATT_EVENT_TYPE))
- LOGPC(DNM, LOGL_ERROR, "Type=%s ",
+ LOGPC(DNM, LOGL_ERROR, "Type=%s, ",
abis_nm_event_type_name(*TLVP_VAL(&tp, NM_ATT_EVENT_TYPE)));
if (TLVP_PRESENT(&tp, NM_ATT_SEVERITY))
- LOGPC(DNM, LOGL_ERROR, "Severity=%s ",
+ LOGPC(DNM, LOGL_ERROR, "Severity=%s, ",
abis_nm_severity_name(*TLVP_VAL(&tp, NM_ATT_SEVERITY)));
if (TLVP_PRESENT(&tp, NM_ATT_PROB_CAUSE)) {
p_val = TLVP_VAL(&tp, NM_ATT_PROB_CAUSE);
- LOGPC(DNM, LOGL_ERROR, "Probable cause= %02X %02X %02X ", p_val[0], p_val[1], p_val[2]);
+ LOGPC(DNM, LOGL_ERROR, "Probable cause=%s: ",
+ get_value_string(abis_nm_pcause_type_names, p_val[0]));
+ if (p_val[0] == NM_PCAUSE_T_MANUF)
+ LOGPC(DNM, LOGL_ERROR, "%s, ",
+ get_value_string(abis_mm_event_cause_names,
+ osmo_load16be(p_val + 1)));
+ else
+ LOGPC(DNM, LOGL_ERROR, "%02X %02X ", p_val[1], p_val[2]);
}
if (TLVP_PRESENT(&tp, NM_ATT_ADD_TEXT)) {
p_val = TLVP_VAL(&tp, NM_ATT_ADD_TEXT);
p_text = talloc_strndup(tall_bsc_ctx, (const char *) p_val, TLVP_LEN(&tp, NM_ATT_ADD_TEXT));
if (p_text) {
- LOGPC(DNM, LOGL_ERROR, "Additional Text=%s ", p_text);
+ LOGPC(DNM, LOGL_ERROR, "Additional Text=%s. ", p_text);
talloc_free(p_text);
}
}