libosmogsm  1.9.0.19-e4f34.202310262026
Osmocom GSM library
bts_features.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <osmocom/core/utils.h>
4 #include <osmocom/core/bitvec.h>
5 
6 #define MAX_BTS_FEATURES 128
7 
8 /* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility
9  with BTS compiled against earlier version of this header. Also make sure that the description strings
10  osmo_bts_features_{descs,names}[] in bts_features.c are also updated accordingly! */
27  BTS_FEAT_PAGING_COORDINATION, /* BTS hands CS paging to PCU/PACCH */
30  BTS_FEAT_CCN, /* Is CCN supported by the cell? TS 44.060 sec 8.8.2 */
31  BTS_FEAT_VAMOS, /* Is the BTS VAMOS capable? */
32  BTS_FEAT_ABIS_OSMO_PCU, /* BTS supports forwarding data to PCUIF over IPA OML multiplex */
34  BTS_FEAT_DYN_TS_SDCCH8, /* Osmo Dynamic TS supports configured as SDCCH8 */
35  BTS_FEAT_ACCH_TEMP_OVP, /* FACCH/SACCH Temporary overpower */
36  BTS_FEAT_OSMUX, /* Osmux (Osmocom RTP muxing) support */
37  BTS_FEAT_VBS, /* Voice Broadcast Service support, 3GPP TS 43.069 */
38  BTS_FEAT_VGCS, /* Voice Group Call Service support, 3GPP TS 44.068 */
40 };
41 
42 extern const struct value_string osmo_bts_features_descs[];
43 
44 static inline const char *osmo_bts_features_desc(enum osmo_bts_features val)
46 
47 const char *osmo_bts_feature_name(enum osmo_bts_features feature)
48  OSMO_DEPRECATED("Use osmo_bts_features_desc() instead");
49 
50 extern const struct value_string osmo_bts_features_names[];
51 
52 static inline const char *osmo_bts_features_name(enum osmo_bts_features val)
53 { return get_value_string(osmo_bts_features_names, val); }
54 
55 static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
56 {
58  return bitvec_set_bit_pos(features, feature, 1);
59 }
60 
61 static inline int osmo_bts_unset_feature(struct bitvec *features, enum osmo_bts_features feature)
62 {
64  return bitvec_set_bit_pos(features, feature, 0);
65 }
66 
67 static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
68 {
70  return bitvec_get_bit_pos(features, feature) == ONE;
71 }
Definition: bts_features.h:23
#define OSMO_DEPRECATED(text)
const char * get_value_string(const struct value_string *vs, uint32_t val)
osmo_bts_features
Definition: bts_features.h:11
Definition: bts_features.h:21
Definition: bts_features.h:12
Definition: bts_features.h:24
#define OSMO_ASSERT(exp)
Definition: bts_features.h:16
static const char * osmo_bts_features_name(enum osmo_bts_features val)
Definition: bts_features.h:52
Definition: bts_features.h:30
Definition: bts_features.h:25
Definition: bts_features.h:38
Definition: bts_features.h:35
int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnr, enum bit_value bit)
ONE
Definition: bts_features.h:13
const char * osmo_bts_feature_name(enum osmo_bts_features feature) OSMO_DEPRECATED("Use osmo_bts_features_desc() instead")
return description string of a BTS feature (osmo_bts_features_descs).
Definition: bts_features.c:58
const struct value_string osmo_bts_features_descs[]
Definition: bts_features.c:22
enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr)
Definition: bts_features.h:18
Definition: bts_features.h:15
Definition: bts_features.h:20
Definition: bts_features.h:22
Definition: bts_features.h:34
Definition: bts_features.h:17
static const char * osmo_bts_features_desc(enum osmo_bts_features val)
Definition: bts_features.h:44
Definition: bts_features.h:19
static int osmo_bts_unset_feature(struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:61
static bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:67
Definition: bts_features.h:27
Definition: bts_features.h:37
Definition: bts_features.h:28
Definition: bts_features.h:14
Definition: bts_features.h:29
Definition: bts_features.h:36
#define MAX_BTS_FEATURES
Definition: bts_features.h:6
Definition: bts_features.h:33
Definition: bts_features.h:26
Definition: bts_features.h:39
Definition: bts_features.h:32
static int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:55
Definition: bts_features.h:31