libosmogsm 1.13.1.1-afb4 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! */
11 enum osmo_bts_features {
12 BTS_FEAT_HSCSD,
13 BTS_FEAT_GPRS,
14 BTS_FEAT_EGPRS,
15 BTS_FEAT_ECSD,
16 BTS_FEAT_HOPPING,
17 BTS_FEAT_MULTI_TSC,
18 BTS_FEAT_OML_ALERTS,
19 BTS_FEAT_AGCH_PCH_PROP,
20 BTS_FEAT_CBCH,
21 BTS_FEAT_SPEECH_F_V1,
22 BTS_FEAT_SPEECH_H_V1,
23 BTS_FEAT_SPEECH_F_EFR,
24 BTS_FEAT_SPEECH_F_AMR,
25 BTS_FEAT_SPEECH_H_AMR,
26 BTS_FEAT_ETWS_PN,
27 BTS_FEAT_PAGING_COORDINATION, /* BTS hands CS paging to PCU/PACCH */
28 BTS_FEAT_IPV6_NSVC,
29 BTS_FEAT_ACCH_REP,
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 */
33 BTS_FEAT_BCCH_POWER_RED,
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 */
39 BTS_FEAT_TWTS001, /* TW-TS-001: enhanced RTP transport for FR & EFR */
40 BTS_FEAT_TWTS002, /* TW-TS-002: enhanced RTP transport for HRv1 */
41 _NUM_BTS_FEAT
42};
43
44 extern const struct value_string osmo_bts_features_descs[];
45
46 static inline const char *osmo_bts_features_desc(enum osmo_bts_features val)
47{ return get_value_string(osmo_bts_features_descs, val); }
48
49 const char *osmo_bts_feature_name(enum osmo_bts_features feature)
50 OSMO_DEPRECATED("Use osmo_bts_features_desc() instead");
51
52 extern const struct value_string osmo_bts_features_names[];
53
54 static inline const char *osmo_bts_features_name(enum osmo_bts_features val)
55{ return get_value_string(osmo_bts_features_names, val); }
56
57 static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
58{
59 OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
60 return bitvec_set_bit_pos(features, feature, 1);
61}
62
63 static inline int osmo_bts_unset_feature(struct bitvec *features, enum osmo_bts_features feature)
64{
65 OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
66 return bitvec_set_bit_pos(features, feature, 0);
67}
68
69 static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
70{
71 OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
72 return bitvec_get_bit_pos(features, feature) == ONE;
73}
bitvec.h
osmo_bts_features_desc
static const char * osmo_bts_features_desc(enum osmo_bts_features val)
Definition: bts_features.h:46
osmo_bts_features_name
static const char * osmo_bts_features_name(enum osmo_bts_features val)
Definition: bts_features.h:54
osmo_bts_set_feature
static int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:57
MAX_BTS_FEATURES
#define MAX_BTS_FEATURES
Definition: bts_features.h:6
osmo_bts_features_descs
const struct value_string osmo_bts_features_descs[]
Definition: bts_features.c:22
osmo_bts_has_feature
static bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:69
osmo_bts_feature_name
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:60
osmo_bts_unset_feature
static int osmo_bts_unset_feature(struct bitvec *features, enum osmo_bts_features feature)
Definition: bts_features.h:63
osmo_bts_features_names
const struct value_string osmo_bts_features_names[]
Definition: bts_features.c:65
osmo_bts_features
osmo_bts_features
Definition: bts_features.h:11
BTS_FEAT_ABIS_OSMO_PCU
@ BTS_FEAT_ABIS_OSMO_PCU
Definition: bts_features.h:32
BTS_FEAT_SPEECH_H_AMR
@ BTS_FEAT_SPEECH_H_AMR
Definition: bts_features.h:25
BTS_FEAT_PAGING_COORDINATION
@ BTS_FEAT_PAGING_COORDINATION
Definition: bts_features.h:27
_NUM_BTS_FEAT
@ _NUM_BTS_FEAT
Definition: bts_features.h:41
BTS_FEAT_SPEECH_F_V1
@ BTS_FEAT_SPEECH_F_V1
Definition: bts_features.h:21
BTS_FEAT_OML_ALERTS
@ BTS_FEAT_OML_ALERTS
Definition: bts_features.h:18
BTS_FEAT_AGCH_PCH_PROP
@ BTS_FEAT_AGCH_PCH_PROP
Definition: bts_features.h:19
BTS_FEAT_ECSD
@ BTS_FEAT_ECSD
Definition: bts_features.h:15
BTS_FEAT_DYN_TS_SDCCH8
@ BTS_FEAT_DYN_TS_SDCCH8
Definition: bts_features.h:34
BTS_FEAT_IPV6_NSVC
@ BTS_FEAT_IPV6_NSVC
Definition: bts_features.h:28
BTS_FEAT_MULTI_TSC
@ BTS_FEAT_MULTI_TSC
Definition: bts_features.h:17
BTS_FEAT_BCCH_POWER_RED
@ BTS_FEAT_BCCH_POWER_RED
Definition: bts_features.h:33
BTS_FEAT_VGCS
@ BTS_FEAT_VGCS
Definition: bts_features.h:38
BTS_FEAT_VAMOS
@ BTS_FEAT_VAMOS
Definition: bts_features.h:31
BTS_FEAT_SPEECH_F_AMR
@ BTS_FEAT_SPEECH_F_AMR
Definition: bts_features.h:24
BTS_FEAT_ACCH_REP
@ BTS_FEAT_ACCH_REP
Definition: bts_features.h:29
BTS_FEAT_TWTS002
@ BTS_FEAT_TWTS002
Definition: bts_features.h:40
BTS_FEAT_GPRS
@ BTS_FEAT_GPRS
Definition: bts_features.h:13
BTS_FEAT_ETWS_PN
@ BTS_FEAT_ETWS_PN
Definition: bts_features.h:26
BTS_FEAT_CCN
@ BTS_FEAT_CCN
Definition: bts_features.h:30
BTS_FEAT_HOPPING
@ BTS_FEAT_HOPPING
Definition: bts_features.h:16
BTS_FEAT_HSCSD
@ BTS_FEAT_HSCSD
Definition: bts_features.h:12
BTS_FEAT_VBS
@ BTS_FEAT_VBS
Definition: bts_features.h:37
BTS_FEAT_TWTS001
@ BTS_FEAT_TWTS001
Definition: bts_features.h:39
BTS_FEAT_SPEECH_H_V1
@ BTS_FEAT_SPEECH_H_V1
Definition: bts_features.h:22
BTS_FEAT_OSMUX
@ BTS_FEAT_OSMUX
Definition: bts_features.h:36
BTS_FEAT_CBCH
@ BTS_FEAT_CBCH
Definition: bts_features.h:20
BTS_FEAT_ACCH_TEMP_OVP
@ BTS_FEAT_ACCH_TEMP_OVP
Definition: bts_features.h:35
BTS_FEAT_EGPRS
@ BTS_FEAT_EGPRS
Definition: bts_features.h:14
BTS_FEAT_SPEECH_F_EFR
@ BTS_FEAT_SPEECH_F_EFR
Definition: bts_features.h:23
bitvec_set_bit_pos
int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnr, enum bit_value bit)
bitvec_get_bit_pos
enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr)
ONE
ONE
OSMO_ASSERT
#define OSMO_ASSERT(exp)
OSMO_DEPRECATED
#define OSMO_DEPRECATED(text)
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
bitvec
value_string
utils.h