abis_nm: move fail report parsing to extra func
Separate raw input parsing from handling the failure report. A follow-up
patch will use the new parsing function to print saved failure reports
to the VTY.
While at it, put struct tlv_parsed inside struct nm_fail_rep_signal_data
instead of a pointer, so we don't need an additional alloc. Also add
error handling to the abis_nm_tlv_parse() call.
Related: OS#1605
Change-Id: Ia51004faf620aa4d40435d58c70d758c9d0054d8
diff --git a/include/osmocom/bsc/abis_nm.h b/include/osmocom/bsc/abis_nm.h
index 45bbe2c..83bc2f8 100644
--- a/include/osmocom/bsc/abis_nm.h
+++ b/include/osmocom/bsc/abis_nm.h
@@ -27,6 +27,7 @@
#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmocom/bsc/gsm_data.h>
+#include <osmocom/bsc/signal.h>
/* max number of attributes represented as 3GPP TS 52.021 §9.4.62 SW Description array */
#define MAX_BTS_ATTR 5
@@ -170,6 +171,8 @@
int abis_nm_select_newest_sw(const struct abis_nm_sw_desc *sw, const size_t len);
+struct nm_fail_rep_signal_data *abis_nm_fail_evt_rep_parse(struct msgb *mb, struct gsm_bts *bts);
+
/* Helper functions for updating attributes */
int abis_nm_update_max_power_red(struct gsm_bts_trx *trx);
diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h
index 10200d7..952e03c 100644
--- a/include/osmocom/bsc/signal.h
+++ b/include/osmocom/bsc/signal.h
@@ -153,7 +153,7 @@
struct gsm_bts *bts;
/* raw data */
struct msgb *msg;
- struct tlv_parsed *tp;
+ struct tlv_parsed tp;
/* parsed data */
struct {
const char *event_type;