libosmogsm 1.13.1.1-afb4 Osmocom GSM library

sysinfo.h
Go to the documentation of this file.
1
3#pragma once
4
5#include <stdbool.h>
6
7#include <osmocom/core/defs.h>
8#include <osmocom/core/utils.h>
9#include <osmocom/gsm/protocol/gsm_04_08.h>
10
11#define OSMO_EARFCN_INVALID 666
12#define OSMO_EARFCN_MEAS_INVALID 0xff
13
14 enum osmo_sysinfo_type {
15 SYSINFO_TYPE_NONE,
16 SYSINFO_TYPE_1,
17 SYSINFO_TYPE_2,
18 SYSINFO_TYPE_3,
19 SYSINFO_TYPE_4,
20 SYSINFO_TYPE_5,
21 SYSINFO_TYPE_6,
22 SYSINFO_TYPE_7,
23 SYSINFO_TYPE_8,
24 SYSINFO_TYPE_9,
25 SYSINFO_TYPE_10,
26 SYSINFO_TYPE_13,
27 SYSINFO_TYPE_16,
28 SYSINFO_TYPE_17,
29 SYSINFO_TYPE_18,
30 SYSINFO_TYPE_19,
31 SYSINFO_TYPE_20,
32 SYSINFO_TYPE_2bis,
33 SYSINFO_TYPE_2ter,
34 SYSINFO_TYPE_2quater,
35 SYSINFO_TYPE_5bis,
36 SYSINFO_TYPE_5ter,
37 SYSINFO_TYPE_EMO,
38 SYSINFO_TYPE_MEAS_INFO,
39 SYSINFO_TYPE_13alt,
40 SYSINFO_TYPE_15,
41 SYSINFO_TYPE_2n,
42 SYSINFO_TYPE_21,
43 SYSINFO_TYPE_22,
44 SYSINFO_TYPE_23,
45 _MAX_SYSINFO_TYPE
46};
47
48 struct osmo_earfcn_si2q {
49 /* EARFCN (16 bits) array */
50 uint16_t *arfcn;
51 /* Measurement Bandwidth (3 bits), might be absent
52 (OSMO_EARFCN_MEAS_INVALID is stored in this case) */
53 uint8_t *meas_bw;
54 /* length of arfcn and meas_bw arrays (got to be the same) */
55 size_t length;
56 /* THRESH_E-UTRAN_high (5 bits) */
57 uint8_t thresh_hi;
58 /* THRESH_E-UTRAN_low (5 bits) */
59 uint8_t thresh_lo;
60 /* E-UTRAN_PRIORITY (3 bits) */
61 uint8_t prio;
62 /* E-UTRAN_QRXLEVMIN */
63 uint8_t qrxlm;
64 /* indicates whether thresh_lo value is valid
65 thresh_hi is mandatory and hence always considered valid */
66 bool thresh_lo_valid;
67 /* indicates whether prio value is valid */
68 bool prio_valid;
69 /* indicates whether qrxlm value is valid */
70 bool qrxlm_valid;
71};
72
73 typedef uint8_t sysinfo_buf_t[GSM_MACBLOCK_LEN];
74
75 extern const struct value_string osmo_sitype_strs[_MAX_SYSINFO_TYPE];
76 int osmo_earfcn_add(struct osmo_earfcn_si2q *e, uint16_t arfcn, uint8_t meas_bw);
77 int osmo_earfcn_del(struct osmo_earfcn_si2q *e, uint16_t arfcn);
78 size_t osmo_earfcn_bit_size(const struct osmo_earfcn_si2q *e) OSMO_DEPRECATED("Use osmo_earfcn_bit_size_ext()instead.");
79 size_t osmo_earfcn_bit_size_ext(const struct osmo_earfcn_si2q *e, size_t offset);
80 void osmo_earfcn_init(struct osmo_earfcn_si2q *e);
81uint8_t osmo_sitype2rsl(enum osmo_sysinfo_type si_type);
82 enum osmo_sysinfo_type osmo_rsl2sitype(uint8_t rsl_si);
defs.h
OSMO_DEPRECATED
#define OSMO_DEPRECATED(text)
gsm_04_08.h
GSM TS 04.08 definitions.
GSM_MACBLOCK_LEN
#define GSM_MACBLOCK_LEN
Definition: gsm_04_08.h:2277
osmo_earfcn_si2q
Definition: sysinfo.h:48
osmo_earfcn_si2q::length
size_t length
Definition: sysinfo.h:55
osmo_earfcn_si2q::qrxlm_valid
bool qrxlm_valid
Definition: sysinfo.h:70
osmo_earfcn_si2q::qrxlm
uint8_t qrxlm
Definition: sysinfo.h:63
osmo_earfcn_si2q::thresh_lo
uint8_t thresh_lo
Definition: sysinfo.h:59
osmo_earfcn_si2q::thresh_lo_valid
bool thresh_lo_valid
Definition: sysinfo.h:66
osmo_earfcn_si2q::prio_valid
bool prio_valid
Definition: sysinfo.h:68
osmo_earfcn_si2q::meas_bw
uint8_t * meas_bw
Definition: sysinfo.h:53
osmo_earfcn_si2q::thresh_hi
uint8_t thresh_hi
Definition: sysinfo.h:57
osmo_earfcn_si2q::arfcn
uint16_t * arfcn
Definition: sysinfo.h:50
osmo_earfcn_si2q::prio
uint8_t prio
Definition: sysinfo.h:61
value_string
osmo_sysinfo_type
osmo_sysinfo_type
Definition: sysinfo.h:14
SYSINFO_TYPE_4
@ SYSINFO_TYPE_4
Definition: sysinfo.h:19
SYSINFO_TYPE_NONE
@ SYSINFO_TYPE_NONE
Definition: sysinfo.h:15
SYSINFO_TYPE_10
@ SYSINFO_TYPE_10
Definition: sysinfo.h:25
SYSINFO_TYPE_15
@ SYSINFO_TYPE_15
Definition: sysinfo.h:40
SYSINFO_TYPE_23
@ SYSINFO_TYPE_23
Definition: sysinfo.h:44
SYSINFO_TYPE_18
@ SYSINFO_TYPE_18
Definition: sysinfo.h:29
_MAX_SYSINFO_TYPE
@ _MAX_SYSINFO_TYPE
Definition: sysinfo.h:45
SYSINFO_TYPE_1
@ SYSINFO_TYPE_1
Definition: sysinfo.h:16
SYSINFO_TYPE_5
@ SYSINFO_TYPE_5
Definition: sysinfo.h:20
SYSINFO_TYPE_8
@ SYSINFO_TYPE_8
Definition: sysinfo.h:23
SYSINFO_TYPE_MEAS_INFO
@ SYSINFO_TYPE_MEAS_INFO
Definition: sysinfo.h:38
SYSINFO_TYPE_5ter
@ SYSINFO_TYPE_5ter
Definition: sysinfo.h:36
SYSINFO_TYPE_16
@ SYSINFO_TYPE_16
Definition: sysinfo.h:27
SYSINFO_TYPE_3
@ SYSINFO_TYPE_3
Definition: sysinfo.h:18
SYSINFO_TYPE_2
@ SYSINFO_TYPE_2
Definition: sysinfo.h:17
SYSINFO_TYPE_9
@ SYSINFO_TYPE_9
Definition: sysinfo.h:24
SYSINFO_TYPE_17
@ SYSINFO_TYPE_17
Definition: sysinfo.h:28
SYSINFO_TYPE_22
@ SYSINFO_TYPE_22
Definition: sysinfo.h:43
SYSINFO_TYPE_5bis
@ SYSINFO_TYPE_5bis
Definition: sysinfo.h:35
SYSINFO_TYPE_13alt
@ SYSINFO_TYPE_13alt
Definition: sysinfo.h:39
SYSINFO_TYPE_EMO
@ SYSINFO_TYPE_EMO
Definition: sysinfo.h:37
SYSINFO_TYPE_7
@ SYSINFO_TYPE_7
Definition: sysinfo.h:22
SYSINFO_TYPE_2bis
@ SYSINFO_TYPE_2bis
Definition: sysinfo.h:32
SYSINFO_TYPE_6
@ SYSINFO_TYPE_6
Definition: sysinfo.h:21
SYSINFO_TYPE_13
@ SYSINFO_TYPE_13
Definition: sysinfo.h:26
SYSINFO_TYPE_19
@ SYSINFO_TYPE_19
Definition: sysinfo.h:30
SYSINFO_TYPE_21
@ SYSINFO_TYPE_21
Definition: sysinfo.h:42
SYSINFO_TYPE_20
@ SYSINFO_TYPE_20
Definition: sysinfo.h:31
SYSINFO_TYPE_2ter
@ SYSINFO_TYPE_2ter
Definition: sysinfo.h:33
SYSINFO_TYPE_2quater
@ SYSINFO_TYPE_2quater
Definition: sysinfo.h:34
SYSINFO_TYPE_2n
@ SYSINFO_TYPE_2n
Definition: sysinfo.h:41
osmo_earfcn_bit_size_ext
size_t osmo_earfcn_bit_size_ext(const struct osmo_earfcn_si2q *e, size_t offset)
Return number of bits necessary to represent earfcn struct as Repeated E-UTRAN Neighbour Cells IE fro...
Definition: sysinfo.c:166
osmo_earfcn_init
void osmo_earfcn_init(struct osmo_earfcn_si2q *e)
Initialize earfcn struct.
Definition: sysinfo.c:211
osmo_earfcn_bit_size
size_t osmo_earfcn_bit_size(const struct osmo_earfcn_si2q *e) OSMO_DEPRECATED("Use osmo_earfcn_bit_size_ext()instead.")
Return number of bits necessary to represent earfcn struct as Repeated E-UTRAN Neighbour Cells IE fro...
Definition: sysinfo.c:155
osmo_sitype2rsl
uint8_t osmo_sitype2rsl(enum osmo_sysinfo_type si_type)
Definition: sysinfo.c:220
sysinfo_buf_t
uint8_t sysinfo_buf_t[GSM_MACBLOCK_LEN]
Definition: sysinfo.h:73
osmo_rsl2sitype
enum osmo_sysinfo_type osmo_rsl2sitype(uint8_t rsl_si)
Definition: sysinfo.c:225
osmo_sitype_strs
const struct value_string osmo_sitype_strs[_MAX_SYSINFO_TYPE]
Definition: sysinfo.c:104
osmo_earfcn_del
int osmo_earfcn_del(struct osmo_earfcn_si2q *e, uint16_t arfcn)
Delete arfcn (and corresponding measurement bandwith) from earfcn struct.
Definition: sysinfo.c:195
osmo_earfcn_add
int osmo_earfcn_add(struct osmo_earfcn_si2q *e, uint16_t arfcn, uint8_t meas_bw)
Add pair of arfcn and measurement bandwith value to earfcn struct.
Definition: sysinfo.c:137
utils.h