blob: 45d67f6b123dfeace761af4cebb2fa06d11bfd1f [file] [log] [blame]
Harald Welte6be350c2011-05-25 13:10:08 +02001#ifndef _GSM_DATA_SHAREDH
2#define _GSM_DATA_SHAREDH
3
Holger Hans Peter Freyther06c9da62011-06-09 21:48:49 +02004#include <regex.h>
Harald Welte6be350c2011-05-25 13:10:08 +02005#include <stdbool.h>
6#include <stdint.h>
7
8#include <osmocom/core/timer.h>
9#include <osmocom/core/bitvec.h>
10#include <osmocom/core/statistics.h>
11#include <osmocom/core/utils.h>
12#include <osmocom/gsm/gsm_utils.h>
13#include <osmocom/gsm/tlv.h>
14#include <osmocom/gsm/rxlev_stat.h>
15#include <osmocom/gsm/sysinfo.h>
Harald Welte7ff4f0e2013-03-07 18:38:09 +000016#include <osmocom/gsm/meas_rep.h>
Maxc08ee712016-05-11 12:45:13 +020017#include <osmocom/gsm/protocol/gsm_04_08.h>
Harald Welte6be350c2011-05-25 13:10:08 +020018#include <osmocom/gsm/protocol/gsm_08_58.h>
Harald Welte3300c012011-06-05 13:31:33 +020019#include <osmocom/gsm/protocol/gsm_12_21.h>
Harald Welte6be350c2011-05-25 13:10:08 +020020
Harald Welte0eae6132011-08-24 13:52:07 +020021#include <osmocom/abis/e1_input.h>
Neels Hofmeyrc0164792017-09-04 15:15:32 +020022#include <osmocom/bsc/common_cs.h>
23#include <osmocom/bsc/meas_rep.h>
Neels Hofmeyrf0ea05e2017-11-27 22:30:47 +010024#include <osmocom/bsc/rest_octets.h>
Neels Hofmeyrac1f1432016-05-10 13:30:17 +020025
Max70fdd242017-06-15 15:10:53 +020026/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1:
27 4-bit index is used (2#1111 = 10#15) */
Max9b97b002017-06-02 10:58:26 +020028#define SI2Q_MAX_NUM 16
29/* length in bits (for single SI2quater message) */
30#define SI2Q_MAX_LEN 160
31#define SI2Q_MIN_LEN 18
32
Holger Hans Peter Freyther8ec49522011-08-15 15:53:00 +020033struct osmo_bsc_data;
34
Harald Welte6be350c2011-05-25 13:10:08 +020035struct osmo_bsc_sccp_con;
36struct gsm_sms_queue;
37
38/* RRLP mode of operation */
39enum rrlp_mode {
40 RRLP_MODE_NONE,
41 RRLP_MODE_MS_BASED,
42 RRLP_MODE_MS_PREF,
43 RRLP_MODE_ASS_PREF,
44};
45
46/* Channel Request reason */
47enum gsm_chreq_reason_t {
48 GSM_CHREQ_REASON_EMERG,
49 GSM_CHREQ_REASON_PAG,
50 GSM_CHREQ_REASON_CALL,
51 GSM_CHREQ_REASON_LOCATION_UPD,
52 GSM_CHREQ_REASON_OTHER,
Alexander Couzens11368112016-11-28 23:26:50 +010053 GSM_CHREQ_REASON_PDCH,
Harald Welte6be350c2011-05-25 13:10:08 +020054};
55
Max582e4f62016-10-18 16:19:33 +020056/* lchans 0..3 are SDCCH in combined channel configuration,
57 use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */
58#define CCCH_LCHAN 4
59
Harald Welte6be350c2011-05-25 13:10:08 +020060#define TRX_NR_TS 8
61#define TS_MAX_LCHAN 8
62
63#define HARDCODED_ARFCN 123
Harald Welte6be350c2011-05-25 13:10:08 +020064#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */
65
66/* for multi-drop config */
67#define HARDCODED_BTS0_TS 1
68#define HARDCODED_BTS1_TS 6
69#define HARDCODED_BTS2_TS 11
70
Maxf9685c12017-03-23 12:01:07 +010071#define MAX_VERSION_LENGTH 64
72
Max7b62d542017-05-09 15:19:15 +020073#define MAX_BTS_FEATURES 128
74
Harald Welte6be350c2011-05-25 13:10:08 +020075enum gsm_hooks {
76 GSM_HOOK_NM_SWLOAD,
77 GSM_HOOK_RR_PAGING,
78 GSM_HOOK_RR_SECURITY,
79};
80
81enum gsm_paging_event {
82 GSM_PAGING_SUCCEEDED,
83 GSM_PAGING_EXPIRED,
84 GSM_PAGING_OOM,
85 GSM_PAGING_BUSY,
86};
87
88enum bts_gprs_mode {
89 BTS_GPRS_NONE = 0,
90 BTS_GPRS_GPRS = 1,
91 BTS_GPRS_EGPRS = 2,
92};
93
94struct gsm_lchan;
Harald Welte6be350c2011-05-25 13:10:08 +020095struct gsm_mncc;
Harald Welte135a6bd2011-09-04 13:53:26 +020096struct osmo_rtp_socket;
Harald Welte6be350c2011-05-25 13:10:08 +020097struct rtp_socket;
98struct bsc_api;
99
100/* Network Management State */
101struct gsm_nm_state {
102 uint8_t operational;
103 uint8_t administrative;
104 uint8_t availability;
105};
106
Harald Welted64c0bc2011-05-30 12:07:53 +0200107struct gsm_abis_mo {
Harald Welte3300c012011-06-05 13:31:33 +0200108 uint8_t obj_class;
Holger Hans Peter Freyther49976f42013-11-05 16:06:17 +0100109 uint8_t procedure_pending;
Harald Welte3300c012011-06-05 13:31:33 +0200110 struct abis_om_obj_inst obj_inst;
Harald Welted64c0bc2011-05-30 12:07:53 +0200111 const char *name;
112 struct gsm_nm_state nm_state;
113 struct tlv_parsed *nm_attr;
Harald Welte32bc1162011-06-06 18:58:48 +0200114 struct gsm_bts *bts;
Harald Welted64c0bc2011-05-30 12:07:53 +0200115};
116
Harald Welte591e1d72016-07-09 22:20:57 +0200117/* Ericsson OM2000 Managed Object */
118struct abis_om2k_mo {
119 uint8_t class;
120 uint8_t bts;
121 uint8_t assoc_so;
122 uint8_t inst;
123} __attribute__ ((packed));
124
125struct om2k_mo {
126 struct abis_om2k_mo addr;
127 struct osmo_fsm_inst *fsm;
128};
129
Harald Welte6be350c2011-05-25 13:10:08 +0200130#define A38_XOR_MIN_KEY_LEN 12
131#define A38_XOR_MAX_KEY_LEN 16
132#define A38_COMP128_KEY_LEN 16
133#define RSL_ENC_ALG_A5(x) (x+1)
Max27c3e762016-04-20 15:57:12 +0200134#define MAX_EARFCN_LIST 32
Harald Welte6be350c2011-05-25 13:10:08 +0200135
136/* is the data link established? who established it? */
137#define LCHAN_SAPI_UNUSED 0
138#define LCHAN_SAPI_MS 1
139#define LCHAN_SAPI_NET 2
Andreas Eversberg7d8fa342013-12-05 13:25:06 +0100140#define LCHAN_SAPI_REL 3
Harald Welte6be350c2011-05-25 13:10:08 +0200141
142/* state of a logical channel */
143enum gsm_lchan_state {
144 LCHAN_S_NONE, /* channel is not active */
Holger Hans Peter Freytherded02682012-01-15 00:02:17 +0100145 LCHAN_S_ACT_REQ, /* channel activation requested */
Harald Welte6be350c2011-05-25 13:10:08 +0200146 LCHAN_S_ACTIVE, /* channel is active and operational */
147 LCHAN_S_REL_REQ, /* channel release has been requested */
148 LCHAN_S_REL_ERR, /* channel is in an error state */
Holger Hans Peter Freyther638da512012-12-06 19:25:06 +0100149 LCHAN_S_BROKEN, /* channel is somehow unusable */
Harald Welte6be350c2011-05-25 13:10:08 +0200150 LCHAN_S_INACTIVE, /* channel is set inactive */
151};
152
Harald Weltec7921c92011-06-29 10:38:34 +0200153/* BTS ONLY */
154#define MAX_NUM_UL_MEAS 104
155#define LC_UL_M_F_L1_VALID (1 << 0)
156#define LC_UL_M_F_RES_VALID (1 << 1)
157
158struct bts_ul_meas {
159 /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */
160 uint16_t ber10k;
161 /* timing advance offset (in quarter bits) */
162 int16_t ta_offs_qbits;
163 /* C/I ratio in dB */
164 float c_i;
165 /* flags */
166 uint8_t is_sub:1;
167 /* RSSI in dBm * -1 */
168 uint8_t inv_rssi;
169};
Harald Weltef3b59322011-09-06 22:14:43 +0200170
Andreas Eversberga83d5112013-12-07 18:32:28 +0100171struct bts_codec_conf {
172 uint8_t hr;
173 uint8_t efr;
174 uint8_t amr;
175};
176
Harald Weltef3b59322011-09-06 22:14:43 +0200177struct amr_mode {
178 uint8_t mode;
Holger Hans Peter Freyther615ed462015-09-24 11:30:58 +0200179 uint8_t threshold;
180 uint8_t hysteresis;
Harald Weltef3b59322011-09-06 22:14:43 +0200181};
Holger Hans Peter Freyther615ed462015-09-24 11:30:58 +0200182
Harald Weltef3b59322011-09-06 22:14:43 +0200183struct amr_multirate_conf {
184 uint8_t gsm48_ie[2];
Holger Hans Peter Freyther615ed462015-09-24 11:30:58 +0200185 struct amr_mode ms_mode[4];
186 struct amr_mode bts_mode[4];
Harald Weltef3b59322011-09-06 22:14:43 +0200187 uint8_t num_modes;
188};
Harald Weltec7921c92011-06-29 10:38:34 +0200189/* /BTS ONLY */
190
Harald Weltee4227982012-08-24 15:33:56 +0200191enum lchan_csd_mode {
192 LCHAN_CSD_M_NT,
193 LCHAN_CSD_M_T_1200_75,
194 LCHAN_CSD_M_T_600,
195 LCHAN_CSD_M_T_1200,
196 LCHAN_CSD_M_T_2400,
197 LCHAN_CSD_M_T_9600,
198 LCHAN_CSD_M_T_14400,
199 LCHAN_CSD_M_T_29000,
200 LCHAN_CSD_M_T_32000,
201};
202
Daniel Willmann324c8052012-12-29 12:32:30 +0100203/* State of the SAPIs in the lchan */
204enum lchan_sapi_state {
205 LCHAN_SAPI_S_NONE,
206 LCHAN_SAPI_S_REQ,
207 LCHAN_SAPI_S_ASSIGNED,
208 LCHAN_SAPI_S_REL,
209 LCHAN_SAPI_S_ERROR,
210};
211
Harald Welte6be350c2011-05-25 13:10:08 +0200212struct gsm_lchan {
213 /* The TS that we're part of */
214 struct gsm_bts_trx_ts *ts;
215 /* The logical subslot number in the TS */
216 uint8_t nr;
217 /* The logical channel type */
218 enum gsm_chan_t type;
219 /* RSL channel mode */
220 enum rsl_cmod_spd rsl_cmode;
221 /* If TCH, traffic channel mode */
222 enum gsm48_chan_mode tch_mode;
Harald Weltee4227982012-08-24 15:33:56 +0200223 enum lchan_csd_mode csd_mode;
Harald Welte6be350c2011-05-25 13:10:08 +0200224 /* State */
225 enum gsm_lchan_state state;
Holger Hans Peter Freyther454140e2014-12-28 12:08:28 +0100226 const char *broken_reason;
Harald Welte6be350c2011-05-25 13:10:08 +0200227 /* Power levels for MS and BTS */
228 uint8_t bs_power;
229 uint8_t ms_power;
230 /* Encryption information */
Neels Hofmeyrac1f1432016-05-10 13:30:17 +0200231 struct gsm_encr encr;
Harald Welte6be350c2011-05-25 13:10:08 +0200232
233 /* AMR bits */
Andreas Eversberg73266522014-01-19 11:47:44 +0100234 uint8_t mr_ms_lv[7];
235 uint8_t mr_bts_lv[7];
Harald Welte6be350c2011-05-25 13:10:08 +0200236
237 /* Established data link layer services */
238 uint8_t sapis[8];
Holger Hans Peter Freytherb9b828b2013-01-01 19:20:28 +0100239 int sacch_deact;
Holger Hans Peter Freytherdfcfe652011-12-27 20:49:53 +0100240
Harald Welte6be350c2011-05-25 13:10:08 +0200241 struct {
242 uint32_t bound_ip;
243 uint32_t connect_ip;
244 uint16_t bound_port;
245 uint16_t connect_port;
246 uint16_t conn_id;
247 uint8_t rtp_payload;
248 uint8_t rtp_payload2;
249 uint8_t speech_mode;
250 struct rtp_socket *rtp_socket;
Philipp Maier39f62bb2017-04-09 12:32:51 +0200251
252 /* info we need to postpone the AoIP
253 * assignment completed message */
254 struct {
255 uint8_t rr_cause;
256 uint8_t chosen_channel;
257 uint8_t encr_alg_id;
258 uint8_t speech_mode;
259 bool valid;
260 } ass_compl;
Harald Welte6be350c2011-05-25 13:10:08 +0200261 } abis_ip;
262
Harald Welte2c1ae472011-06-26 14:13:37 +0200263 uint8_t rqd_ta;
264
Harald Weltec696cc22015-12-05 16:19:21 +0100265 char *name;
266
Harald Welte6be350c2011-05-25 13:10:08 +0200267 struct osmo_timer_list T3101;
Holger Hans Peter Freytherb3489392011-12-28 16:21:05 +0100268 struct osmo_timer_list T3109;
Harald Welte6be350c2011-05-25 13:10:08 +0200269 struct osmo_timer_list T3111;
270 struct osmo_timer_list error_timer;
Harald Weltee8bd9e82011-08-10 23:26:33 +0200271 struct osmo_timer_list act_timer;
Andreas Eversberg7d8fa342013-12-05 13:25:06 +0100272 struct osmo_timer_list rel_work;
Holger Hans Peter Freyther638da512012-12-06 19:25:06 +0100273 uint8_t error_cause;
Harald Welte6be350c2011-05-25 13:10:08 +0200274
275 /* table of neighbor cell measurements */
276 struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
277
278 /* cache of last measurement reports on this lchan */
279 struct gsm_meas_rep meas_rep[6];
280 int meas_rep_idx;
281
282 /* GSM Random Access data */
283 struct gsm48_req_ref *rqd_ref;
Harald Welte6be350c2011-05-25 13:10:08 +0200284
285 struct gsm_subscriber_connection *conn;
Andreas Eversberg9df268e2013-10-11 13:32:30 +0200286
287 struct {
288 /* channel activation type and handover ref */
289 uint8_t act_type;
290 uint8_t ho_ref;
Neels Hofmeyrb91e6002016-07-23 19:45:15 +0200291 struct gsm48_req_ref *rqd_ref;
292 uint8_t rqd_ta;
Neels Hofmeyr6e999b72016-07-23 21:00:51 +0200293 } dyn;
Harald Welte6be350c2011-05-25 13:10:08 +0200294};
295
Neels Hofmeyr2ebacce2016-06-14 14:08:35 +0200296enum {
297 TS_F_PDCH_ACTIVE = 0x1000,
298 TS_F_PDCH_ACT_PENDING = 0x2000,
299 TS_F_PDCH_DEACT_PENDING = 0x4000,
300 TS_F_PDCH_PENDING_MASK = 0x6000 /*<
301 TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */
302} gsm_bts_trx_ts_flags;
303
Harald Welte6be350c2011-05-25 13:10:08 +0200304/* One Timeslot in a TRX */
305struct gsm_bts_trx_ts {
306 struct gsm_bts_trx *trx;
307 /* number of this timeslot at the TRX */
308 uint8_t nr;
309
310 enum gsm_phys_chan_config pchan;
311
Neels Hofmeyrc1658762016-07-23 16:14:06 +0200312 struct {
313 enum gsm_phys_chan_config pchan_is;
314 enum gsm_phys_chan_config pchan_want;
315 struct msgb *pending_chan_activ;
316 } dyn;
317
Harald Welte6be350c2011-05-25 13:10:08 +0200318 unsigned int flags;
Harald Welted64c0bc2011-05-30 12:07:53 +0200319 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200320 struct tlv_parsed nm_attr;
321 uint8_t nm_chan_comb;
Harald Welte135a6482011-05-30 12:09:13 +0200322 int tsc; /* -1 == use BTS TSC */
Harald Welte6be350c2011-05-25 13:10:08 +0200323
324 struct {
325 /* Parameters below are configured by VTY */
326 int enabled;
327 uint8_t maio;
328 uint8_t hsn;
329 struct bitvec arfcns;
330 uint8_t arfcns_data[1024/8];
331 /* This is the pre-computed MA for channel assignments */
332 struct bitvec ma;
333 uint8_t ma_len; /* part of ma_data that is used */
334 uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */
335 } hopping;
336
337 /* To which E1 subslot are we connected */
338 struct gsm_e1_subslot e1_link;
339
Harald Welte591e1d72016-07-09 22:20:57 +0200340 union {
341 struct {
342 struct om2k_mo om2k_mo;
343 } rbs2000;
344 };
345
Harald Welte6be350c2011-05-25 13:10:08 +0200346 struct gsm_lchan lchan[TS_MAX_LCHAN];
347};
348
349/* One TRX in a BTS */
350struct gsm_bts_trx {
351 /* list header in bts->trx_list */
352 struct llist_head list;
353
354 struct gsm_bts *bts;
355 /* number of this TRX in the BTS */
356 uint8_t nr;
357 /* human readable name / description */
358 char *description;
359 /* how do we talk RSL with this TRX? */
360 struct gsm_e1_subslot rsl_e1_link;
361 uint8_t rsl_tei;
362 struct e1inp_sign_link *rsl_link;
Holger Hans Peter Freythercaa98d52013-10-06 15:52:14 +0200363
Harald Welte6be350c2011-05-25 13:10:08 +0200364 /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
365 struct e1inp_sign_link *oml_link;
366
Harald Welted64c0bc2011-05-30 12:07:53 +0200367 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200368 struct tlv_parsed nm_attr;
369 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200370 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200371 } bb_transc;
372
373 uint16_t arfcn;
374 int nominal_power; /* in dBm */
375 unsigned int max_power_red; /* in actual dB */
Holger Hans Peter Freyther9b625802014-07-30 18:20:51 +0200376
Harald Welte6be350c2011-05-25 13:10:08 +0200377 union {
378 struct {
379 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200380 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200381 } bbsig;
382 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200383 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200384 } pa;
385 } bs11;
386 struct {
387 unsigned int test_state;
388 uint8_t test_nr;
389 struct rxlev_stats rxlev_stat;
390 } ipaccess;
Harald Welte591e1d72016-07-09 22:20:57 +0200391 struct {
392 struct {
393 struct om2k_mo om2k_mo;
394 } trxc;
395 struct {
396 struct om2k_mo om2k_mo;
397 } rx;
398 struct {
399 struct om2k_mo om2k_mo;
400 } tx;
401 } rbs2000;
Harald Welte6be350c2011-05-25 13:10:08 +0200402 };
403 struct gsm_bts_trx_ts ts[TRX_NR_TS];
404};
405
Max70fdd242017-06-15 15:10:53 +0200406#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i])
Max9b97b002017-06-02 10:58:26 +0200407#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i))
Max70fdd242017-06-15 15:10:53 +0200408#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0])
409#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0])
Harald Welte6be350c2011-05-25 13:10:08 +0200410
411enum gsm_bts_type {
412 GSM_BTS_TYPE_UNKNOWN,
413 GSM_BTS_TYPE_BS11,
414 GSM_BTS_TYPE_NANOBTS,
415 GSM_BTS_TYPE_RBS2000,
Dieter Spaar16646022011-07-28 00:01:50 +0200416 GSM_BTS_TYPE_NOKIA_SITE,
Maxf9685c12017-03-23 12:01:07 +0100417 GSM_BTS_TYPE_OSMOBTS,
Harald Weltee555c2b2012-08-17 13:02:12 +0200418 _NUM_GSM_BTS_TYPE
Harald Welte6be350c2011-05-25 13:10:08 +0200419};
420
Maxf9685c12017-03-23 12:01:07 +0100421enum gsm_bts_type_variant {
422 BTS_UNKNOWN,
423 BTS_OSMO_LITECELL15,
424 BTS_OSMO_OCTPHY,
425 BTS_OSMO_SYSMO,
426 BTS_OSMO_TRX,
427 _NUM_BTS_VARIANT
428};
429
Max7507aef2017-04-10 13:59:14 +0200430/* Used by OML layer for BTS Attribute reporting */
431enum bts_attribute {
432 BTS_TYPE_VARIANT,
433 BTS_SUB_MODEL,
Max33e13572017-05-29 11:48:29 +0200434 TRX_PHY_VERSION,
Max7507aef2017-04-10 13:59:14 +0200435};
436
Harald Welte6be350c2011-05-25 13:10:08 +0200437struct vty;
438
439struct gsm_bts_model {
440 struct llist_head list;
441
442 enum gsm_bts_type type;
Maxf9685c12017-03-23 12:01:07 +0100443 enum gsm_bts_type_variant variant;
Harald Welte6be350c2011-05-25 13:10:08 +0200444 const char *name;
445
446 bool started;
447 int (*start)(struct gsm_network *net);
448 int (*oml_rcvmsg)(struct msgb *msg);
Max3d049d22017-10-09 17:12:53 +0200449 char * (*oml_status)(const struct gsm_bts *bts);
Harald Welte6be350c2011-05-25 13:10:08 +0200450
Pablo Neira Ayusoed5cacb2011-08-17 22:44:07 +0200451 void (*e1line_bind_ops)(struct e1inp_line *line);
452
Harald Welte6be350c2011-05-25 13:10:08 +0200453 void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts);
454 void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx);
455 void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts);
456
457 struct tlv_definition nm_att_tlvdef;
458
Maxaef68382017-05-31 12:15:54 +0200459 /* features of a given BTS model set via gsm_bts_model_register() locally */
Harald Welte6be350c2011-05-25 13:10:08 +0200460 struct bitvec features;
Max7b62d542017-05-09 15:19:15 +0200461 uint8_t _features_data[MAX_BTS_FEATURES/8];
Harald Welte6be350c2011-05-25 13:10:08 +0200462};
463
Maxaef68382017-05-31 12:15:54 +0200464/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility
465 with BTS compiled against earlier version of this header */
Harald Welte6be350c2011-05-25 13:10:08 +0200466enum gsm_bts_features {
467 BTS_FEAT_HSCSD,
468 BTS_FEAT_GPRS,
469 BTS_FEAT_EGPRS,
470 BTS_FEAT_ECSD,
471 BTS_FEAT_HOPPING,
Harald Welte903aaea2014-01-19 17:10:50 +0100472 BTS_FEAT_MULTI_TSC,
Max1ebf23b2017-05-10 12:21:17 +0200473 BTS_FEAT_OML_ALERTS,
474 BTS_FEAT_AGCH_PCH_PROP,
475 BTS_FEAT_CBCH,
Maxaef68382017-05-31 12:15:54 +0200476 _NUM_BTS_FEAT
Harald Welte6be350c2011-05-25 13:10:08 +0200477};
478
Maxaef68382017-05-31 12:15:54 +0200479extern const struct value_string gsm_bts_features_descs[];
480
Harald Welte6be350c2011-05-25 13:10:08 +0200481/*
482 * This keeps track of the paging status of one BTS. It
483 * includes a number of pending requests, a back pointer
484 * to the gsm_bts, a timer and some more state.
485 */
486struct gsm_bts_paging_state {
487 /* pending requests */
488 struct llist_head pending_requests;
489 struct gsm_bts *bts;
490
491 struct osmo_timer_list work_timer;
492 struct osmo_timer_list credit_timer;
493
494 /* free chans needed */
495 int free_chans_need;
496
497 /* load */
498 uint16_t available_slots;
499};
500
501struct gsm_envabtse {
Harald Welted64c0bc2011-05-30 12:07:53 +0200502 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200503};
504
505struct gsm_bts_gprs_nsvc {
506 struct gsm_bts *bts;
507 /* data read via VTY config file, to configure the BTS
508 * via OML from BSC */
509 int id;
510 uint16_t nsvci;
511 uint16_t local_port; /* on the BTS */
512 uint16_t remote_port; /* on the SGSN */
513 uint32_t remote_ip; /* on the SGSN */
514
Harald Welted64c0bc2011-05-30 12:07:53 +0200515 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200516};
517
Harald Welte019f9132012-06-28 08:43:14 +0200518enum gprs_rlc_par {
519 RLC_T3142,
520 RLC_T3169,
521 RLC_T3191,
522 RLC_T3193,
523 RLC_T3195,
524 RLC_N3101,
525 RLC_N3103,
526 RLC_N3105,
527 CV_COUNTDOWN,
528 T_DL_TBF_EXT, /* ms */
529 T_UL_TBF_EXT, /* ms */
530 _NUM_RLC_PAR
531};
532
533enum gprs_cs {
534 GPRS_CS1,
535 GPRS_CS2,
536 GPRS_CS3,
537 GPRS_CS4,
538 GPRS_MCS1,
539 GPRS_MCS2,
540 GPRS_MCS3,
541 GPRS_MCS4,
542 GPRS_MCS5,
543 GPRS_MCS6,
544 GPRS_MCS7,
545 GPRS_MCS8,
546 GPRS_MCS9,
547 _NUM_GRPS_CS
548};
549
550struct gprs_rlc_cfg {
551 uint16_t parameter[_NUM_RLC_PAR];
552 struct {
553 uint16_t repeat_time; /* ms */
554 uint8_t repeat_count;
555 } paging;
556 uint32_t cs_mask; /* bitmask of gprs_cs */
557 uint8_t initial_cs;
558 uint8_t initial_mcs;
559};
560
561
Harald Welte6be350c2011-05-25 13:10:08 +0200562enum neigh_list_manual_mode {
563 NL_MODE_AUTOMATIC = 0,
564 NL_MODE_MANUAL = 1,
565 NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */
566};
567
Daniel Willmann47b5b3e2011-08-05 13:51:27 +0200568enum bts_loc_fix {
569 BTS_LOC_FIX_INVALID = 0,
570 BTS_LOC_FIX_2D = 1,
571 BTS_LOC_FIX_3D = 2,
572};
573
Daniel Willmann7d109832012-05-14 18:43:23 +0200574extern const struct value_string bts_loc_fix_names[];
575
Daniel Willmann47b5b3e2011-08-05 13:51:27 +0200576struct bts_location {
577 struct llist_head list;
578 time_t tstamp;
579 enum bts_loc_fix valid;
580 double lat;
581 double lon;
582 double height;
583};
584
Harald Welte6be350c2011-05-25 13:10:08 +0200585/* One BTS */
586struct gsm_bts {
587 /* list header in net->bts_list */
588 struct llist_head list;
589
Daniel Willmann47b5b3e2011-08-05 13:51:27 +0200590 /* Geographical location of the BTS */
591 struct llist_head loc_list;
592
Harald Welte6be350c2011-05-25 13:10:08 +0200593 /* number of ths BTS in network */
594 uint8_t nr;
595 /* human readable name / description */
596 char *description;
597 /* Cell Identity */
598 uint16_t cell_identity;
599 /* location area code of this BTS */
600 uint16_t location_area_code;
Harald Weltea2bbc5e2015-11-20 10:43:31 +0100601 /* Base Station Identification Code (BSIC), lower 3 bits is BCC,
602 * which is used as TSC for the CCCH */
Harald Welte6be350c2011-05-25 13:10:08 +0200603 uint8_t bsic;
604 /* type of BTS */
605 enum gsm_bts_type type;
Max6d8e5192017-04-11 18:23:47 +0200606 enum gsm_bts_type_variant variant;
Harald Welte6be350c2011-05-25 13:10:08 +0200607 struct gsm_bts_model *model;
608 enum gsm_band band;
Maxf9685c12017-03-23 12:01:07 +0100609 char version[MAX_VERSION_LENGTH];
Max1ebf23b2017-05-10 12:21:17 +0200610 char sub_model[MAX_VERSION_LENGTH];
Maxf9685c12017-03-23 12:01:07 +0100611
Maxaef68382017-05-31 12:15:54 +0200612 /* features of a given BTS set/reported via OML */
613 struct bitvec features;
614 uint8_t _features_data[MAX_BTS_FEATURES/8];
615
Maxf9685c12017-03-23 12:01:07 +0100616 /* Connected PCU version (if any) */
617 char pcu_version[MAX_VERSION_LENGTH];
618
Harald Welte6be350c2011-05-25 13:10:08 +0200619 /* maximum Tx power that the MS is permitted to use in this cell */
620 int ms_max_power;
621
622 /* how do we talk OML with this TRX? */
623 struct gsm_e1_subslot oml_e1_link;
624 uint8_t oml_tei;
625 struct e1inp_sign_link *oml_link;
Maxd1f70ed2017-09-21 16:15:32 +0200626 /* when OML link was established */
627 time_t uptime;
Harald Welte6be350c2011-05-25 13:10:08 +0200628
629 /* Abis network management O&M handle */
630 struct abis_nm_h *nmh;
Harald Welted64c0bc2011-05-30 12:07:53 +0200631
632 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200633
634 /* number of this BTS on given E1 link */
635 uint8_t bts_nr;
636
Maxc08ee712016-05-11 12:45:13 +0200637 /* DTX features of this BTS */
638 enum gsm48_dtx_mode dtxu;
639 bool dtxd;
640
Harald Welte6be350c2011-05-25 13:10:08 +0200641 /* paging state and control */
642 struct gsm_bts_paging_state paging;
643
644 /* CCCH is on C0 */
645 struct gsm_bts_trx *c0;
646
647 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200648 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200649 } site_mgr;
650
651 /* bitmask of all SI that are present/valid in si_buf */
652 uint32_t si_valid;
Max6f0e50c2017-04-12 15:30:54 +0200653 /* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */
Maxf39d03a2017-05-12 17:00:30 +0200654 uint8_t si2q_index; /* distinguish individual SI2quater messages */
655 uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */
Harald Welte6be350c2011-05-25 13:10:08 +0200656 /* buffers where we put the pre-computed SI */
Max70fdd242017-06-15 15:10:53 +0200657 sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM];
Maxf39d03a2017-05-12 17:00:30 +0200658 /* offsets used while generating SI2quater */
659 size_t e_offset;
660 size_t u_offset;
Harald Welte6be350c2011-05-25 13:10:08 +0200661
662 /* ip.accesss Unit ID's have Site/BTS/TRX layout */
663 union {
664 struct {
665 uint16_t site_id;
666 uint16_t bts_id;
667 uint32_t flags;
Harald Welte8b291802013-03-12 13:57:05 +0100668 uint32_t rsl_ip;
Harald Welte6be350c2011-05-25 13:10:08 +0200669 } ip_access;
670 struct {
671 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200672 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200673 } cclk;
674 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200675 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200676 } rack;
677 struct gsm_envabtse envabtse[4];
678 } bs11;
679 struct {
680 struct {
Harald Welte591e1d72016-07-09 22:20:57 +0200681 struct om2k_mo om2k_mo;
682 struct gsm_abis_mo mo;
683 struct llist_head conn_groups;
684 } cf;
685 struct {
686 struct om2k_mo om2k_mo;
Harald Welted64c0bc2011-05-30 12:07:53 +0200687 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200688 struct llist_head conn_groups;
689 } is;
690 struct {
Harald Welte591e1d72016-07-09 22:20:57 +0200691 struct om2k_mo om2k_mo;
Harald Welted64c0bc2011-05-30 12:07:53 +0200692 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200693 struct llist_head conn_groups;
694 } con;
695 struct {
Harald Welte591e1d72016-07-09 22:20:57 +0200696 struct om2k_mo om2k_mo;
Harald Welted64c0bc2011-05-30 12:07:53 +0200697 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200698 } dp;
699 struct {
Harald Welte591e1d72016-07-09 22:20:57 +0200700 struct om2k_mo om2k_mo;
Harald Welted64c0bc2011-05-30 12:07:53 +0200701 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200702 } tf;
Harald Weltece492582016-11-15 22:59:24 +0100703 uint32_t use_superchannel:1;
Harald Welte6be350c2011-05-25 13:10:08 +0200704 } rbs2000;
705 struct {
Harald Weltec8755af2011-07-28 00:22:17 +0200706 uint8_t bts_type;
Holger Hans Peter Freyther3e603482012-03-02 14:14:33 +0100707 unsigned int configured:1,
708 skip_reset:1,
Andreas Eversberg7d8fa342013-12-05 13:25:06 +0100709 no_loc_rel_cnf:1,
Sipos Csaba56e17662015-02-07 13:27:36 +0100710 bts_reset_timer_cnf,
Holger Hans Peter Freyther3e603482012-03-02 14:14:33 +0100711 did_reset:1,
712 wait_reset:1;
Harald Weltec8755af2011-07-28 00:22:17 +0200713 struct osmo_timer_list reset_timer;
714 } nokia;
Harald Welte6be350c2011-05-25 13:10:08 +0200715 };
716
717 /* Not entirely sure how ip.access specific this is */
718 struct {
bhargava350533c2016-07-21 11:14:34 +0530719 uint8_t supports_egprs_11bit_rach;
Harald Welte6be350c2011-05-25 13:10:08 +0200720 enum bts_gprs_mode mode;
721 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200722 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200723 uint16_t nsei;
724 uint8_t timer[7];
725 } nse;
726 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200727 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200728 uint16_t bvci;
729 uint8_t timer[11];
Harald Welte019f9132012-06-28 08:43:14 +0200730 struct gprs_rlc_cfg rlc_cfg;
Harald Welte6be350c2011-05-25 13:10:08 +0200731 } cell;
732 struct gsm_bts_gprs_nsvc nsvc[2];
733 uint8_t rac;
Andreas Eversberg0c8f9ca2013-03-16 16:31:26 +0100734 uint8_t net_ctrl_ord;
Max292ec582016-07-28 11:55:37 +0200735 bool ctrl_ack_type_use_block;
Harald Welte6be350c2011-05-25 13:10:08 +0200736 } gprs;
737
738 /* RACH NM values */
739 int rach_b_thresh;
740 int rach_ldavg_slots;
741
742 /* transceivers */
743 int num_trx;
744 struct llist_head trx_list;
745
Holger Hans Peter Freytherb92a5382014-11-21 10:00:39 +0100746 /* SI related items */
Jacob Erlbeck65d114f2014-01-16 11:02:14 +0100747 int force_combined_si;
Holger Hans Peter Freytherb92a5382014-11-21 10:00:39 +0100748 int bcch_change_mark;
Jacob Erlbeck65d114f2014-01-16 11:02:14 +0100749
Harald Welte6be350c2011-05-25 13:10:08 +0200750 /* Abis NM queue */
751 struct llist_head abis_queue;
752 int abis_nm_pend;
753
754 struct gsm_network *network;
755
756 /* should the channel allocator allocate channels from high TRX to TRX0,
757 * rather than starting from TRX0 and go upwards? */
758 int chan_alloc_reverse;
759
760 enum neigh_list_manual_mode neigh_list_manual_mode;
761 /* parameters from which we build SYSTEM INFORMATION */
762 struct {
763 struct gsm48_rach_control rach_control;
764 uint8_t ncc_permitted;
765 struct gsm48_cell_sel_par cell_sel_par;
766 struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */
767 struct gsm48_cell_options cell_options;
768 struct gsm48_control_channel_descr chan_desc;
769 struct bitvec neigh_list;
770 struct bitvec cell_alloc;
771 struct bitvec si5_neigh_list;
Max59a1bf32016-04-15 16:04:46 +0200772 struct osmo_earfcn_si2q si2quater_neigh_list;
Max26679e02016-04-20 15:57:13 +0200773 size_t uarfcn_length; /* index for uarfcn and scramble lists */
Harald Welte6be350c2011-05-25 13:10:08 +0200774 struct {
775 /* bitmask large enough for all possible ARFCN's */
776 uint8_t neigh_list[1024/8];
777 uint8_t cell_alloc[1024/8];
778 /* If the user wants a different neighbor list in SI5 than in SI2 */
779 uint8_t si5_neigh_list[1024/8];
Max59a1bf32016-04-15 16:04:46 +0200780 uint8_t meas_bw_list[MAX_EARFCN_LIST];
781 uint16_t earfcn_list[MAX_EARFCN_LIST];
Max26679e02016-04-20 15:57:13 +0200782 uint16_t uarfcn_list[MAX_EARFCN_LIST];
783 uint16_t scramble_list[MAX_EARFCN_LIST];
Harald Welte6be350c2011-05-25 13:10:08 +0200784 } data;
785 } si_common;
Harald Welte42def722017-01-13 00:10:32 +0100786 bool early_classmark_allowed;
Pau Espin Pedrole8dda5f2017-11-23 19:06:09 +0100787 bool early_classmark_allowed_3g;
Harald Welte2f8b9d22017-06-18 11:12:13 +0300788 /* for testing only: Have an infinitely long radio link timeout */
789 bool infinite_radio_link_timeout;
Harald Welte6be350c2011-05-25 13:10:08 +0200790
791 /* do we use static (user-defined) system information messages? (bitmask) */
792 uint32_t si_mode_static;
Holger Hans Peter Freythere30d40d2012-07-20 10:27:31 +0200793
794 /* exclude the BTS from the global RF Lock handling */
795 int excl_from_rf_lock;
Andreas Eversberga83d5112013-12-07 18:32:28 +0100796
797 /* supported codecs beside FR */
798 struct bts_codec_conf codec;
Holger Hans Peter Freytherc22930e2014-12-17 14:46:17 +0100799
800 /* BTS dependencies bit field */
801 uint32_t depends_on[256/(8*4)];
Andreas Eversberg73266522014-01-19 11:47:44 +0100802
803 /* full and half rate multirate config */
804 struct amr_multirate_conf mr_full;
805 struct amr_multirate_conf mr_half;
806
Philipp Maierb4999b62016-10-26 15:19:41 +0200807 /* PCU socket state */
Harald Welte8254cf72017-05-29 13:42:19 +0200808 char *pcu_sock_path;
Philipp Maierb4999b62016-10-26 15:19:41 +0200809 struct pcu_sock_state *pcu_state;
Harald Welte6be350c2011-05-25 13:10:08 +0200810};
811
812
Alexander Chemeris0796a6c2017-07-11 01:42:41 +0630813struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num);
Harald Welte1449c9f2014-08-24 09:50:10 +0200814struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
Harald Welte6be350c2011-05-25 13:10:08 +0200815
Harald Welte1449c9f2014-08-24 09:50:10 +0200816struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
Harald Welte4f8ad532011-09-19 14:21:51 +0200817struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num);
Harald Welte6be350c2011-05-25 13:10:08 +0200818
Max7507aef2017-04-10 13:59:14 +0200819enum gsm_bts_type str2btstype(const char *arg);
820const char *btstype2str(enum gsm_bts_type type);
821
822enum bts_attribute str2btsattr(const char *s);
823const char *btsatttr2str(enum bts_attribute v);
824
825enum gsm_bts_type_variant str2btsvariant(const char *arg);
826const char *btsvariant2str(enum gsm_bts_type_variant v);
Harald Welte4ab9d7c2012-08-17 12:42:06 +0200827
Philipp Maier6f483d32017-02-24 15:18:08 +0100828extern const struct value_string gsm_chreq_descs[];
Neels Hofmeyr17a6bab2016-07-23 16:14:06 +0200829const struct value_string gsm_pchant_names[13];
830const struct value_string gsm_pchant_descs[13];
Harald Welte6be350c2011-05-25 13:10:08 +0200831const char *gsm_pchan_name(enum gsm_phys_chan_config c);
832enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
833const char *gsm_lchant_name(enum gsm_chan_t c);
834const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
Harald Welte4f8ad532011-09-19 14:21:51 +0200835char *gsm_trx_name(const struct gsm_bts_trx *trx);
836char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
Neels Hofmeyr34b8b5b2016-07-16 23:59:32 +0200837char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts);
Harald Weltec696cc22015-12-05 16:19:21 +0100838char *gsm_lchan_name_compute(const struct gsm_lchan *lchan);
Harald Welte6be350c2011-05-25 13:10:08 +0200839const char *gsm_lchans_name(enum gsm_lchan_state s);
840
Harald Weltec696cc22015-12-05 16:19:21 +0100841static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
842{
843 return lchan->name;
844}
Harald Welte6be350c2011-05-25 13:10:08 +0200845
Maxaef68382017-05-31 12:15:54 +0200846static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat)
847{
848 OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
849 return bitvec_set_bit_pos(&bts->features, feat, 1);
850}
851
852static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat)
853{
854 OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
855 return bitvec_get_bit_pos(&bts->features, feat);
856}
857
Harald Welteb7849982011-06-29 16:49:03 +0200858void gsm_abis_mo_reset(struct gsm_abis_mo *mo);
859
Harald Welte978714d2011-06-06 18:31:20 +0200860struct gsm_nm_state *
861gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class,
Harald Welte4f8ad532011-09-19 14:21:51 +0200862 const struct abis_om_obj_inst *obj_inst);
Harald Welte978714d2011-06-06 18:31:20 +0200863void *
864gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
Harald Welte4f8ad532011-09-19 14:21:51 +0200865 const struct abis_om_obj_inst *obj_inst);
Harald Welte978714d2011-06-06 18:31:20 +0200866
Harald Welteb7849982011-06-29 16:49:03 +0200867/* reset the state of all MO in the BTS */
868void gsm_bts_mo_reset(struct gsm_bts *bts);
869
Neels Hofmeyrd3841102016-07-18 23:43:44 +0200870uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan,
871 uint8_t ts_nr, uint8_t lchan_nr);
Harald Weltef6093a42011-06-25 10:02:33 +0200872uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
Neels Hofmeyrd3841102016-07-18 23:43:44 +0200873uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan,
874 enum gsm_phys_chan_config as_pchan);
Harald Weltef6093a42011-06-25 10:02:33 +0200875
Harald Welte142d12d2014-12-29 17:47:08 +0100876/* return the gsm_lchan for the CBCH (if it exists at all) */
877struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts);
878
Holger Hans Peter Freyther06c9da62011-06-09 21:48:49 +0200879/*
880 * help with parsing regexps
881 */
882int gsm_parse_reg(void *ctx, regex_t *reg, char **str,
883 int argc, const char **argv) __attribute__ ((warn_unused_result));
884
Harald Welte1fe24122014-01-19 17:18:21 +0100885static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts)
886{
887 if (ts->tsc != -1)
888 return ts->tsc;
889 else
Harald Weltea2bbc5e2015-11-20 10:43:31 +0100890 return ts->trx->bts->bsic & 7;
Harald Welte1fe24122014-01-19 17:18:21 +0100891}
Holger Hans Peter Freyther06c9da62011-06-09 21:48:49 +0200892
Neels Hofmeyr74585722016-07-23 17:38:22 +0200893struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
894 int *rc);
Holger Hans Peter Freyther06c9da62011-06-09 21:48:49 +0200895
Neels Hofmeyrec16c162016-10-17 01:03:53 +0200896enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts);
Neels Hofmeyr76a0ad72016-07-29 18:12:06 +0200897uint8_t ts_subslots(struct gsm_bts_trx_ts *ts);
Neels Hofmeyr255dbfe2016-09-25 15:07:01 +0200898bool ts_is_tch(struct gsm_bts_trx_ts *ts);
Neels Hofmeyr76a0ad72016-07-29 18:12:06 +0200899
Harald Welte6be350c2011-05-25 13:10:08 +0200900#endif