Add remote BTS feature storage and helpers
In addition to compile-time defined BTS model features we also need
run-time BTS features reported by BTS via OML. This should be shared by
BSC and BTS. To accommodate for this, add following:
* features bitvec to gsm_bts struct
* features descriptions
* comments to avoid confusion between 2 feature sets
* helper functions to set/query particular feature
* upper boundary on number of supported features and assertion for it
Change-Id: I02bd317097ba66585c50ebd4e8fc348f6dc3dad9
Related: OS#1614
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index 2c7ea0a..8830ce1 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -225,11 +225,13 @@
int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat)
{
+ OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
return bitvec_set_bit_pos(&model->features, feat, 1);
}
bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat)
{
+ OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
return bitvec_get_bit_pos(&model->features, feat);
}