aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-11-08 16:45:25 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-11-09 15:50:44 +0000
commit9dfa53c6e4afc479af34671fbdf158e1ed7918d4 (patch)
tree0f54f713b59633a6d701da35102f0dd52e6d5f99
parent1cdf1d76ae63b1491c1d3277b707464a16eeac70 (diff)
abis_nm: Support parsing nanoBTS format for Get Attributes Info
Spec compliant format is defined in: * 3GPP TS 52.021 §8.11.3 "Get Attribute Response" * 3GPP TS 52.021 §9.4.64 "Get Attribute Response Info". On nanoBTS, however, reported attribute list is provided directly inside/after the foh header instead of being enveloped inside the Get Attributes Response Info. Furthermore, The Get Attributes Response Info can still appear and be at any position in the reported attribute list, and it only contains the unreported attribute ID list inside. Change-Id: I81a613d53bddf432a79fa5cb0bf9d847b4bdee37
-rw-r--r--src/osmo-bsc/abis_nm.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index 89a6d82d4..d147606ac 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -494,7 +494,8 @@ static inline const uint8_t *parse_attr_resp_info_unreported(uint8_t bts_nr, con
bts_nr, get_value_string(abis_nm_att_names, ari[i + 1]));
/* the data starts right after the list of unreported attributes + space for length of that list */
- *out_len = ari_len - (num_unreported + 2);
+ if (out_len)
+ *out_len = ari_len - (num_unreported + 2);
return ari + num_unreported + 1; /* we have to account for 1st byte with number of unreported attributes */
}
@@ -575,6 +576,13 @@ static int parse_attr_resp_info_attr(struct gsm_bts *bts, const struct gsm_bts_t
bts->nr, unit_id);
}
+ /* nanoBTS provides Get Attribute Response Info at random position and only the unreported part of it. */
+ if (TLVP_PRES_LEN(tp, NM_ATT_GET_ARI, 1)) {
+ data = TLVP_VAL(tp, NM_ATT_GET_ARI);
+ len = TLVP_LEN(tp, NM_ATT_GET_ARI);
+ parse_attr_resp_info_unreported(bts->nr, data, len, NULL);
+ }
+
return 0;
}