blob: 63978e6b4710e58a9dc69558106402f8e3f7e26e [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>
16
17#include <osmocom/gsm/protocol/gsm_08_58.h>
Harald Welte3300c012011-06-05 13:31:33 +020018#include <osmocom/gsm/protocol/gsm_12_21.h>
Harald Welte6be350c2011-05-25 13:10:08 +020019
Harald Welte0eae6132011-08-24 13:52:07 +020020#include <osmocom/abis/e1_input.h>
21
Harald Welte6be350c2011-05-25 13:10:08 +020022struct osmo_msc_data;
23struct osmo_bsc_sccp_con;
24struct gsm_sms_queue;
25
26/* RRLP mode of operation */
27enum rrlp_mode {
28 RRLP_MODE_NONE,
29 RRLP_MODE_MS_BASED,
30 RRLP_MODE_MS_PREF,
31 RRLP_MODE_ASS_PREF,
32};
33
34/* Channel Request reason */
35enum gsm_chreq_reason_t {
36 GSM_CHREQ_REASON_EMERG,
37 GSM_CHREQ_REASON_PAG,
38 GSM_CHREQ_REASON_CALL,
39 GSM_CHREQ_REASON_LOCATION_UPD,
40 GSM_CHREQ_REASON_OTHER,
41};
42
43#define TRX_NR_TS 8
44#define TS_MAX_LCHAN 8
45
46#define HARDCODED_ARFCN 123
47#define HARDCODED_TSC 7
48#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */
49
50/* for multi-drop config */
51#define HARDCODED_BTS0_TS 1
52#define HARDCODED_BTS1_TS 6
53#define HARDCODED_BTS2_TS 11
54
55/* reserved according to GSM 03.03 ยง 2.4 */
56#define GSM_RESERVED_TMSI 0xFFFFFFFF
57
58enum gsm_hooks {
59 GSM_HOOK_NM_SWLOAD,
60 GSM_HOOK_RR_PAGING,
61 GSM_HOOK_RR_SECURITY,
62};
63
64enum gsm_paging_event {
65 GSM_PAGING_SUCCEEDED,
66 GSM_PAGING_EXPIRED,
67 GSM_PAGING_OOM,
68 GSM_PAGING_BUSY,
69};
70
71enum bts_gprs_mode {
72 BTS_GPRS_NONE = 0,
73 BTS_GPRS_GPRS = 1,
74 BTS_GPRS_EGPRS = 2,
75};
76
77struct gsm_lchan;
78struct gsm_subscriber;
79struct gsm_mncc;
Harald Welte135a6bd2011-09-04 13:53:26 +020080struct osmo_rtp_socket;
Harald Welte6be350c2011-05-25 13:10:08 +020081struct rtp_socket;
82struct bsc_api;
83
84/* Network Management State */
85struct gsm_nm_state {
86 uint8_t operational;
87 uint8_t administrative;
88 uint8_t availability;
89};
90
Harald Welted64c0bc2011-05-30 12:07:53 +020091struct gsm_abis_mo {
Harald Welte3300c012011-06-05 13:31:33 +020092 uint8_t obj_class;
93 struct abis_om_obj_inst obj_inst;
Harald Welted64c0bc2011-05-30 12:07:53 +020094 const char *name;
95 struct gsm_nm_state nm_state;
96 struct tlv_parsed *nm_attr;
Harald Welte32bc1162011-06-06 18:58:48 +020097 struct gsm_bts *bts;
Harald Welted64c0bc2011-05-30 12:07:53 +020098};
99
Harald Welte6be350c2011-05-25 13:10:08 +0200100#define MAX_A5_KEY_LEN (128/8)
101#define A38_XOR_MIN_KEY_LEN 12
102#define A38_XOR_MAX_KEY_LEN 16
103#define A38_COMP128_KEY_LEN 16
104#define RSL_ENC_ALG_A5(x) (x+1)
105
106/* is the data link established? who established it? */
107#define LCHAN_SAPI_UNUSED 0
108#define LCHAN_SAPI_MS 1
109#define LCHAN_SAPI_NET 2
110
111/* state of a logical channel */
112enum gsm_lchan_state {
113 LCHAN_S_NONE, /* channel is not active */
114 LCHAN_S_ACT_REQ, /* channel activatin requested */
115 LCHAN_S_ACTIVE, /* channel is active and operational */
116 LCHAN_S_REL_REQ, /* channel release has been requested */
117 LCHAN_S_REL_ERR, /* channel is in an error state */
118 LCHAN_S_INACTIVE, /* channel is set inactive */
119};
120
Harald Weltec7921c92011-06-29 10:38:34 +0200121/* BTS ONLY */
122#define MAX_NUM_UL_MEAS 104
123#define LC_UL_M_F_L1_VALID (1 << 0)
124#define LC_UL_M_F_RES_VALID (1 << 1)
125
126struct bts_ul_meas {
127 /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */
128 uint16_t ber10k;
129 /* timing advance offset (in quarter bits) */
130 int16_t ta_offs_qbits;
131 /* C/I ratio in dB */
132 float c_i;
133 /* flags */
134 uint8_t is_sub:1;
135 /* RSSI in dBm * -1 */
136 uint8_t inv_rssi;
137};
138/* /BTS ONLY */
139
Harald Welte6be350c2011-05-25 13:10:08 +0200140struct gsm_lchan {
141 /* The TS that we're part of */
142 struct gsm_bts_trx_ts *ts;
143 /* The logical subslot number in the TS */
144 uint8_t nr;
145 /* The logical channel type */
146 enum gsm_chan_t type;
147 /* RSL channel mode */
148 enum rsl_cmod_spd rsl_cmode;
149 /* If TCH, traffic channel mode */
150 enum gsm48_chan_mode tch_mode;
151 /* State */
152 enum gsm_lchan_state state;
153 /* Power levels for MS and BTS */
154 uint8_t bs_power;
155 uint8_t ms_power;
156 /* Encryption information */
157 struct {
158 uint8_t alg_id;
159 uint8_t key_len;
160 uint8_t key[MAX_A5_KEY_LEN];
161 } encr;
162
163 /* AMR bits */
164 struct gsm48_multi_rate_conf mr_conf;
165
166 /* Established data link layer services */
167 uint8_t sapis[8];
168 int sach_deact;
169 int release_reason;
170
171 struct {
172 uint32_t bound_ip;
173 uint32_t connect_ip;
174 uint16_t bound_port;
175 uint16_t connect_port;
176 uint16_t conn_id;
177 uint8_t rtp_payload;
178 uint8_t rtp_payload2;
179 uint8_t speech_mode;
Harald Welte135a6bd2011-09-04 13:53:26 +0200180#ifdef ROLE_BSC
Harald Welte6be350c2011-05-25 13:10:08 +0200181 struct rtp_socket *rtp_socket;
Harald Welte135a6bd2011-09-04 13:53:26 +0200182#else
183 struct osmo_rtp_socket *rtp_socket;
184#endif
Harald Welte6be350c2011-05-25 13:10:08 +0200185 } abis_ip;
186
Harald Welte2c1ae472011-06-26 14:13:37 +0200187 uint8_t rqd_ta;
188
Harald Welte6be350c2011-05-25 13:10:08 +0200189#ifdef ROLE_BSC
190 struct osmo_timer_list T3101;
191 struct osmo_timer_list T3111;
192 struct osmo_timer_list error_timer;
Harald Weltee8bd9e82011-08-10 23:26:33 +0200193 struct osmo_timer_list act_timer;
Harald Welte6be350c2011-05-25 13:10:08 +0200194
195 /* table of neighbor cell measurements */
196 struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS];
197
198 /* cache of last measurement reports on this lchan */
199 struct gsm_meas_rep meas_rep[6];
200 int meas_rep_idx;
201
202 /* GSM Random Access data */
203 struct gsm48_req_ref *rqd_ref;
Harald Welte6be350c2011-05-25 13:10:08 +0200204
205 struct gsm_subscriber_connection *conn;
Harald Weltef6093a42011-06-25 10:02:33 +0200206#else
207 struct lapdm_channel lapdm_ch;
Harald Welte135a6bd2011-09-04 13:53:26 +0200208 struct llist_head dl_tch_queue;
Harald Welte2c1ae472011-06-26 14:13:37 +0200209 struct {
210 /* bitmask of all SI that are present/valid in si_buf */
211 uint32_t valid;
212 uint32_t last;
213 /* buffers where we put the pre-computed SI */
214 sysinfo_buf_t buf[_MAX_SYSINFO_TYPE];
215 } si;
Harald Weltec7921c92011-06-29 10:38:34 +0200216 struct {
217 uint8_t flags;
218 /* RSL measurment result number, 0 at lchan_act */
219 uint8_t res_nr;
220 /* current Tx power level of the BTS */
221 uint8_t bts_tx_pwr;
222 /* number of measurements stored in array below */
223 uint8_t num_ul_meas;
224 struct bts_ul_meas uplink[MAX_NUM_UL_MEAS];
225 /* last L1 header from the MS */
226 uint8_t l1_info[2];
227 struct {
228 uint8_t rxlev_full;
229 uint8_t rxlev_sub;
230 uint8_t rxqual_full;
231 uint8_t rxqual_sub;
232 } res;
233 } meas;
Harald Welte6be350c2011-05-25 13:10:08 +0200234#endif
235};
236
Harald Welte6be350c2011-05-25 13:10:08 +0200237#define TS_F_PDCH_MODE 0x1000
238/* One Timeslot in a TRX */
239struct gsm_bts_trx_ts {
240 struct gsm_bts_trx *trx;
241 /* number of this timeslot at the TRX */
242 uint8_t nr;
243
244 enum gsm_phys_chan_config pchan;
245
246 unsigned int flags;
Harald Welted64c0bc2011-05-30 12:07:53 +0200247 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200248 struct tlv_parsed nm_attr;
249 uint8_t nm_chan_comb;
Harald Welte135a6482011-05-30 12:09:13 +0200250 int tsc; /* -1 == use BTS TSC */
Harald Welte6be350c2011-05-25 13:10:08 +0200251
252 struct {
253 /* Parameters below are configured by VTY */
254 int enabled;
255 uint8_t maio;
256 uint8_t hsn;
257 struct bitvec arfcns;
258 uint8_t arfcns_data[1024/8];
259 /* This is the pre-computed MA for channel assignments */
260 struct bitvec ma;
261 uint8_t ma_len; /* part of ma_data that is used */
262 uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */
263 } hopping;
264
265 /* To which E1 subslot are we connected */
266 struct gsm_e1_subslot e1_link;
267
268 struct gsm_lchan lchan[TS_MAX_LCHAN];
269};
270
271/* One TRX in a BTS */
272struct gsm_bts_trx {
273 /* list header in bts->trx_list */
274 struct llist_head list;
275
276 struct gsm_bts *bts;
277 /* number of this TRX in the BTS */
278 uint8_t nr;
279 /* human readable name / description */
280 char *description;
281 /* how do we talk RSL with this TRX? */
282 struct gsm_e1_subslot rsl_e1_link;
283 uint8_t rsl_tei;
284 struct e1inp_sign_link *rsl_link;
285 /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
286 struct e1inp_sign_link *oml_link;
287
Harald Welted64c0bc2011-05-30 12:07:53 +0200288 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200289 struct tlv_parsed nm_attr;
290 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200291 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200292 } bb_transc;
293
294 uint16_t arfcn;
295 int nominal_power; /* in dBm */
296 unsigned int max_power_red; /* in actual dB */
297
Harald Welted134cc72011-06-07 00:12:53 +0200298 struct {
299 void *l1h;
300 } role_bts;
301
Harald Welte6be350c2011-05-25 13:10:08 +0200302 union {
303 struct {
304 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200305 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200306 } bbsig;
307 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200308 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200309 } pa;
310 } bs11;
311 struct {
312 unsigned int test_state;
313 uint8_t test_nr;
314 struct rxlev_stats rxlev_stat;
315 } ipaccess;
316 };
317 struct gsm_bts_trx_ts ts[TRX_NR_TS];
318};
319
320#define GSM_BTS_SI(bts, i) (void *)(bts->si_buf[i])
321
322enum gsm_bts_type {
323 GSM_BTS_TYPE_UNKNOWN,
324 GSM_BTS_TYPE_BS11,
325 GSM_BTS_TYPE_NANOBTS,
326 GSM_BTS_TYPE_RBS2000,
327 GSM_BTS_TYPE_HSL_FEMTO,
Dieter Spaar16646022011-07-28 00:01:50 +0200328 GSM_BTS_TYPE_NOKIA_SITE,
Harald Welte6be350c2011-05-25 13:10:08 +0200329};
330
331struct vty;
332
333struct gsm_bts_model {
334 struct llist_head list;
335
336 enum gsm_bts_type type;
337 const char *name;
338
339 bool started;
340 int (*start)(struct gsm_network *net);
341 int (*oml_rcvmsg)(struct msgb *msg);
342
Pablo Neira Ayusoed5cacb2011-08-17 22:44:07 +0200343 void (*e1line_bind_ops)(struct e1inp_line *line);
344
Harald Welte6be350c2011-05-25 13:10:08 +0200345 void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts);
346 void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx);
347 void (*config_write_ts)(struct vty *vty, struct gsm_bts_trx_ts *ts);
348
349 struct tlv_definition nm_att_tlvdef;
350
351 struct bitvec features;
352 uint8_t _features_data[128/8];
353};
354
355enum gsm_bts_features {
356 BTS_FEAT_HSCSD,
357 BTS_FEAT_GPRS,
358 BTS_FEAT_EGPRS,
359 BTS_FEAT_ECSD,
360 BTS_FEAT_HOPPING,
361};
362
363/*
364 * This keeps track of the paging status of one BTS. It
365 * includes a number of pending requests, a back pointer
366 * to the gsm_bts, a timer and some more state.
367 */
368struct gsm_bts_paging_state {
369 /* pending requests */
370 struct llist_head pending_requests;
371 struct gsm_bts *bts;
372
373 struct osmo_timer_list work_timer;
374 struct osmo_timer_list credit_timer;
375
376 /* free chans needed */
377 int free_chans_need;
378
379 /* load */
380 uint16_t available_slots;
381};
382
383struct gsm_envabtse {
Harald Welted64c0bc2011-05-30 12:07:53 +0200384 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200385};
386
387struct gsm_bts_gprs_nsvc {
388 struct gsm_bts *bts;
389 /* data read via VTY config file, to configure the BTS
390 * via OML from BSC */
391 int id;
392 uint16_t nsvci;
393 uint16_t local_port; /* on the BTS */
394 uint16_t remote_port; /* on the SGSN */
395 uint32_t remote_ip; /* on the SGSN */
396
Harald Welted64c0bc2011-05-30 12:07:53 +0200397 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200398};
399
400enum neigh_list_manual_mode {
401 NL_MODE_AUTOMATIC = 0,
402 NL_MODE_MANUAL = 1,
403 NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */
404};
405
406/* One BTS */
407struct gsm_bts {
408 /* list header in net->bts_list */
409 struct llist_head list;
410
411 /* number of ths BTS in network */
412 uint8_t nr;
413 /* human readable name / description */
414 char *description;
415 /* Cell Identity */
416 uint16_t cell_identity;
417 /* location area code of this BTS */
418 uint16_t location_area_code;
419 /* Training Sequence Code */
420 uint8_t tsc;
421 /* Base Station Identification Code (BSIC) */
422 uint8_t bsic;
423 /* type of BTS */
424 enum gsm_bts_type type;
425 struct gsm_bts_model *model;
426 enum gsm_band band;
427 /* maximum Tx power that the MS is permitted to use in this cell */
428 int ms_max_power;
429
430 /* how do we talk OML with this TRX? */
431 struct gsm_e1_subslot oml_e1_link;
432 uint8_t oml_tei;
433 struct e1inp_sign_link *oml_link;
434
435 /* Abis network management O&M handle */
436 struct abis_nm_h *nmh;
Harald Welted64c0bc2011-05-30 12:07:53 +0200437
438 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200439
440 /* number of this BTS on given E1 link */
441 uint8_t bts_nr;
442
443 /* paging state and control */
444 struct gsm_bts_paging_state paging;
445
446 /* CCCH is on C0 */
447 struct gsm_bts_trx *c0;
448
449 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200450 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200451 } site_mgr;
452
453 /* bitmask of all SI that are present/valid in si_buf */
454 uint32_t si_valid;
455 /* buffers where we put the pre-computed SI */
456 sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE];
457
458 /* ip.accesss Unit ID's have Site/BTS/TRX layout */
459 union {
460 struct {
461 uint16_t site_id;
462 uint16_t bts_id;
463 uint32_t flags;
464 } ip_access;
465 struct {
466 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200467 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200468 } cclk;
469 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200470 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200471 } rack;
472 struct gsm_envabtse envabtse[4];
473 } bs11;
474 struct {
475 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200476 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200477 struct llist_head conn_groups;
478 } is;
479 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200480 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200481 struct llist_head conn_groups;
482 } con;
483 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200484 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200485 } dp;
486 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200487 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200488 } tf;
489 } rbs2000;
490 struct {
491 unsigned long serno;
492 } hsl;
Harald Weltec8755af2011-07-28 00:22:17 +0200493 struct {
494 uint8_t bts_type;
495 int configured:1,
496 do_reset:1,
497 wait_reset:1;
498 struct osmo_timer_list reset_timer;
499 } nokia;
Harald Welte6be350c2011-05-25 13:10:08 +0200500 };
501
502 /* Not entirely sure how ip.access specific this is */
503 struct {
504 enum bts_gprs_mode mode;
505 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200506 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200507 uint16_t nsei;
508 uint8_t timer[7];
509 } nse;
510 struct {
Harald Welted64c0bc2011-05-30 12:07:53 +0200511 struct gsm_abis_mo mo;
Harald Welte6be350c2011-05-25 13:10:08 +0200512 uint16_t bvci;
513 uint8_t timer[11];
514 } cell;
515 struct gsm_bts_gprs_nsvc nsvc[2];
516 uint8_t rac;
517 } gprs;
518
519 /* RACH NM values */
520 int rach_b_thresh;
521 int rach_ldavg_slots;
522
523 /* transceivers */
524 int num_trx;
525 struct llist_head trx_list;
526
527#ifdef ROLE_BSC
528 /* Abis NM queue */
529 struct llist_head abis_queue;
530 int abis_nm_pend;
531
532 struct gsm_network *network;
533
534 /* should the channel allocator allocate channels from high TRX to TRX0,
535 * rather than starting from TRX0 and go upwards? */
536 int chan_alloc_reverse;
537
538 enum neigh_list_manual_mode neigh_list_manual_mode;
539 /* parameters from which we build SYSTEM INFORMATION */
540 struct {
541 struct gsm48_rach_control rach_control;
542 uint8_t ncc_permitted;
543 struct gsm48_cell_sel_par cell_sel_par;
544 struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */
545 struct gsm48_cell_options cell_options;
546 struct gsm48_control_channel_descr chan_desc;
547 struct bitvec neigh_list;
548 struct bitvec cell_alloc;
549 struct bitvec si5_neigh_list;
550 struct {
551 /* bitmask large enough for all possible ARFCN's */
552 uint8_t neigh_list[1024/8];
553 uint8_t cell_alloc[1024/8];
554 /* If the user wants a different neighbor list in SI5 than in SI2 */
555 uint8_t si5_neigh_list[1024/8];
556 } data;
557 } si_common;
558
559 /* do we use static (user-defined) system information messages? (bitmask) */
560 uint32_t si_mode_static;
561#endif /* ROLE_BSC */
Harald Welte978714d2011-06-06 18:31:20 +0200562 void *role;
Harald Welte6be350c2011-05-25 13:10:08 +0200563};
564
565
Harald Welte3300c012011-06-05 13:31:33 +0200566struct gsm_bts *gsm_bts_alloc(void *talloc_ctx);
Harald Welte6be350c2011-05-25 13:10:08 +0200567struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
568
569struct gsm_bts_trx *gsm_bts_trx_num(struct gsm_bts *bts, int num);
Harald Welte6be350c2011-05-25 13:10:08 +0200570
571const char *gsm_pchan_name(enum gsm_phys_chan_config c);
572enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
573const char *gsm_lchant_name(enum gsm_chan_t c);
574const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
575char *gsm_trx_name(struct gsm_bts_trx *trx);
576char *gsm_ts_name(struct gsm_bts_trx_ts *ts);
577char *gsm_lchan_name(struct gsm_lchan *lchan);
578const char *gsm_lchans_name(enum gsm_lchan_state s);
579
Harald Welte6be350c2011-05-25 13:10:08 +0200580
Harald Welteb7849982011-06-29 16:49:03 +0200581void gsm_abis_mo_reset(struct gsm_abis_mo *mo);
582
Harald Welte978714d2011-06-06 18:31:20 +0200583struct gsm_abis_mo *
584gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class,
585 struct abis_om_obj_inst *obj_inst);
586
587struct gsm_nm_state *
588gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class,
589 struct abis_om_obj_inst *obj_inst);
590void *
591gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
592 struct abis_om_obj_inst *obj_inst);
593
Harald Welteb7849982011-06-29 16:49:03 +0200594/* reset the state of all MO in the BTS */
595void gsm_bts_mo_reset(struct gsm_bts *bts);
596
Harald Weltef6093a42011-06-25 10:02:33 +0200597uint8_t gsm_ts2chan_nr(const struct gsm_bts_trx_ts *ts, uint8_t lchan_nr);
598uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
599
Holger Hans Peter Freyther06c9da62011-06-09 21:48:49 +0200600/*
601 * help with parsing regexps
602 */
603int gsm_parse_reg(void *ctx, regex_t *reg, char **str,
604 int argc, const char **argv) __attribute__ ((warn_unused_result));
605
606
607
Harald Welte6be350c2011-05-25 13:10:08 +0200608#endif