Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 1 | #ifndef _GSM_DATA_H |
| 2 | #define _GSM_DATA_H |
| 3 | |
| 4 | #include <sys/types.h> |
| 5 | |
Harald Welte | 255539c | 2008-12-28 02:26:27 +0000 | [diff] [blame] | 6 | #include <openbsc/timer.h> |
Holger Freyther | 1adb4ff | 2009-02-04 00:04:52 +0000 | [diff] [blame] | 7 | #include <openbsc/gsm_04_08.h> |
Harald Welte | 255539c | 2008-12-28 02:26:27 +0000 | [diff] [blame] | 8 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 9 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
| 10 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 11 | #define GSM_MAX_BTS 8 |
| 12 | #define BTS_MAX_TRX 8 |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 13 | #define TRX_NR_TS 8 |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 14 | #define TS_MAX_LCHAN 8 |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 15 | |
| 16 | #define HARDCODED_ARFCN 123 |
Harald Welte | 02b0e09 | 2009-02-28 13:11:07 +0000 | [diff] [blame] | 17 | #define HARDCODED_TSC 7 |
Harald Welte | 78f2f50 | 2009-05-23 16:56:52 +0000 | [diff] [blame^] | 18 | #define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 19 | |
Harald Welte | 8e1e3ee | 2009-02-01 13:32:45 +0000 | [diff] [blame] | 20 | enum gsm_hooks { |
| 21 | GSM_HOOK_NM_SWLOAD, |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 22 | GSM_HOOK_RR_PAGING, |
| 23 | }; |
| 24 | |
| 25 | enum gsm_paging_event { |
| 26 | GSM_PAGING_SUCCEEDED, |
| 27 | GSM_PAGING_EXPIRED, |
Harald Welte | 8e1e3ee | 2009-02-01 13:32:45 +0000 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | struct msgb; |
| 31 | typedef int gsm_cbfn(unsigned int hooknum, |
| 32 | unsigned int event, |
| 33 | struct msgb *msg, |
| 34 | void *data, void *param); |
| 35 | |
Holger Freyther | c6ea9db | 2008-12-30 19:18:21 +0000 | [diff] [blame] | 36 | /* |
| 37 | * Use the channel. As side effect the lchannel recycle timer |
| 38 | * will be started. |
| 39 | */ |
| 40 | #define LCHAN_RELEASE_TIMEOUT 4, 0 |
| 41 | #define use_lchan(lchan) \ |
| 42 | do { lchan->use_count++; \ |
Harald Welte | ff117a8 | 2009-05-23 05:22:08 +0000 | [diff] [blame] | 43 | bsc_schedule_timer(&lchan->release_timer, LCHAN_RELEASE_TIMEOUT); } while(0); |
Holger Freyther | c6ea9db | 2008-12-30 19:18:21 +0000 | [diff] [blame] | 44 | |
| 45 | #define put_lchan(lchan) \ |
| 46 | do { lchan->use_count--; } while(0); |
| 47 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 48 | /* communications link with a BTS */ |
| 49 | struct gsm_bts_link { |
| 50 | struct gsm_bts *bts; |
| 51 | }; |
| 52 | |
Harald Welte | a3d0438 | 2008-12-27 17:02:56 +0000 | [diff] [blame] | 53 | enum gsm_call_type { |
| 54 | GSM_CT_NONE, |
| 55 | GSM_CT_MO, |
| 56 | GSM_CT_MT, |
| 57 | }; |
| 58 | |
| 59 | enum gsm_call_state { |
| 60 | GSM_CSTATE_NULL, |
| 61 | GSM_CSTATE_INITIATED, |
| 62 | GSM_CSTATE_ACTIVE, |
| 63 | GSM_CSTATE_RELEASE_REQ, |
| 64 | }; |
| 65 | |
Harald Welte | 49f48b8 | 2009-02-17 15:29:33 +0000 | [diff] [blame] | 66 | struct gsm_lchan; |
| 67 | struct gsm_subscriber; |
| 68 | |
Harald Welte | a3d0438 | 2008-12-27 17:02:56 +0000 | [diff] [blame] | 69 | /* One end of a call */ |
| 70 | struct gsm_call { |
| 71 | enum gsm_call_type type; |
| 72 | enum gsm_call_state state; |
| 73 | u_int8_t transaction_id; /* 10.3.2 */ |
| 74 | |
Harald Welte | 49f48b8 | 2009-02-17 15:29:33 +0000 | [diff] [blame] | 75 | /* the 'local' channel */ |
| 76 | struct gsm_lchan *local_lchan; |
| 77 | /* the 'remote' channel */ |
| 78 | struct gsm_lchan *remote_lchan; |
| 79 | |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 80 | /* the 'remote' subscriber */ |
| 81 | struct gsm_subscriber *called_subscr; |
Harald Welte | a3d0438 | 2008-12-27 17:02:56 +0000 | [diff] [blame] | 82 | }; |
| 83 | |
| 84 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 85 | enum gsm_phys_chan_config { |
| 86 | GSM_PCHAN_NONE, |
| 87 | GSM_PCHAN_CCCH, |
| 88 | GSM_PCHAN_CCCH_SDCCH4, |
| 89 | GSM_PCHAN_TCH_F, |
| 90 | GSM_PCHAN_TCH_H, |
| 91 | GSM_PCHAN_SDCCH8_SACCH8C, |
| 92 | GSM_PCHAN_UNKNOWN, |
| 93 | }; |
| 94 | |
| 95 | enum gsm_chan_t { |
| 96 | GSM_LCHAN_NONE, |
| 97 | GSM_LCHAN_SDCCH, |
| 98 | GSM_LCHAN_TCH_F, |
| 99 | GSM_LCHAN_TCH_H, |
| 100 | GSM_LCHAN_UNKNOWN, |
| 101 | }; |
| 102 | |
Harald Welte | e14a57c | 2008-12-29 04:08:28 +0000 | [diff] [blame] | 103 | |
| 104 | /* Channel Request reason */ |
| 105 | enum gsm_chreq_reason_t { |
| 106 | GSM_CHREQ_REASON_EMERG, |
| 107 | GSM_CHREQ_REASON_PAG, |
| 108 | GSM_CHREQ_REASON_CALL, |
| 109 | GSM_CHREQ_REASON_LOCATION_UPD, |
| 110 | GSM_CHREQ_REASON_OTHER, |
| 111 | }; |
| 112 | |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 113 | /* Network Management State */ |
| 114 | struct gsm_nm_state { |
| 115 | u_int8_t operational; |
| 116 | u_int8_t administrative; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 117 | u_int8_t availability; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 118 | }; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 119 | struct gsm_attr { |
| 120 | u_int8_t len; |
| 121 | u_int8_t data[0]; |
| 122 | }; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 123 | |
Holger Freyther | 73487a2 | 2008-12-31 18:53:57 +0000 | [diff] [blame] | 124 | /* |
| 125 | * LOCATION UPDATING REQUEST state |
| 126 | * |
| 127 | * Our current operation is: |
| 128 | * - Get imei/tmsi |
| 129 | * - Accept/Reject according to global policy |
| 130 | */ |
| 131 | struct gsm_loc_updating_operation { |
| 132 | struct timer_list updating_timer; |
| 133 | int waiting_for_imsi : 1; |
| 134 | int waiting_for_imei : 1; |
| 135 | }; |
| 136 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 137 | struct gsm_lchan { |
| 138 | /* The TS that we're part of */ |
| 139 | struct gsm_bts_trx_ts *ts; |
| 140 | /* The logical subslot number in the TS */ |
| 141 | u_int8_t nr; |
Harald Welte | 45b407a | 2009-05-23 15:51:12 +0000 | [diff] [blame] | 142 | /* The logical channel type */ |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 143 | enum gsm_chan_t type; |
Harald Welte | 45b407a | 2009-05-23 15:51:12 +0000 | [diff] [blame] | 144 | /* If TCH, traffic channel mode */ |
| 145 | enum gsm_chan_t tch_mode; |
Harald Welte | d4c9bf3 | 2009-02-15 16:56:18 +0000 | [diff] [blame] | 146 | /* Power levels for MS and BTS */ |
| 147 | u_int8_t bs_power; |
| 148 | u_int8_t ms_power; |
| 149 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 150 | /* To whom we are allocated at the moment */ |
| 151 | struct gsm_subscriber *subscr; |
Holger Freyther | c6ea9db | 2008-12-30 19:18:21 +0000 | [diff] [blame] | 152 | |
| 153 | /* Timer started to release the channel */ |
| 154 | struct timer_list release_timer; |
Harald Welte | a3d0438 | 2008-12-27 17:02:56 +0000 | [diff] [blame] | 155 | |
| 156 | /* local end of a call, if any */ |
| 157 | struct gsm_call call; |
Holger Freyther | 3186bf2 | 2008-12-29 06:23:49 +0000 | [diff] [blame] | 158 | |
| 159 | /* temporary user data, to be removed... and merged into gsm_call */ |
| 160 | void *user_data; |
Holger Freyther | b7193e4 | 2008-12-29 17:44:08 +0000 | [diff] [blame] | 161 | |
Holger Freyther | 73487a2 | 2008-12-31 18:53:57 +0000 | [diff] [blame] | 162 | /* |
| 163 | * Operations that have a state and might be pending |
| 164 | */ |
| 165 | struct gsm_loc_updating_operation *loc_operation; |
| 166 | |
Holger Freyther | b7193e4 | 2008-12-29 17:44:08 +0000 | [diff] [blame] | 167 | /* use count. how many users use this channel */ |
| 168 | unsigned int use_count; |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 169 | }; |
| 170 | |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 171 | struct gsm_e1_subslot { |
| 172 | /* Number of E1 link */ |
| 173 | u_int8_t e1_nr; |
| 174 | /* Number of E1 TS inside E1 link */ |
| 175 | u_int8_t e1_ts; |
| 176 | /* Sub-slot within the E1 TS, 0xff if full TS */ |
| 177 | u_int8_t e1_ts_ss; |
| 178 | }; |
| 179 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 180 | #define BTS_TRX_F_ACTIVATED 0x0001 |
| 181 | /* One Timeslot in a TRX */ |
| 182 | struct gsm_bts_trx_ts { |
| 183 | struct gsm_bts_trx *trx; |
| 184 | /* number of this timeslot at the TRX */ |
| 185 | u_int8_t nr; |
| 186 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 187 | enum gsm_phys_chan_config pchan; |
| 188 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 189 | unsigned int flags; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 190 | struct gsm_nm_state nm_state; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 191 | struct gsm_attr *nm_attr; |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 192 | |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 193 | /* To which E1 subslot are we connected */ |
| 194 | struct gsm_e1_subslot e1_link; |
Harald Welte | 7509926 | 2009-02-16 21:12:08 +0000 | [diff] [blame] | 195 | struct { |
| 196 | u_int32_t bound_ip; |
| 197 | u_int16_t bound_port; |
| 198 | u_int8_t attr_fc; |
| 199 | u_int16_t attr_f8; |
| 200 | } abis_ip; |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 201 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 202 | struct gsm_lchan lchan[TS_MAX_LCHAN]; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 203 | }; |
| 204 | |
| 205 | /* One TRX in a BTS */ |
| 206 | struct gsm_bts_trx { |
| 207 | struct gsm_bts *bts; |
| 208 | /* number of this TRX in the BTS */ |
| 209 | u_int8_t nr; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 210 | /* how do we talk RSL with this TRX? */ |
| 211 | struct e1inp_sign_link *rsl_link; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 212 | struct gsm_nm_state nm_state; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 213 | struct gsm_attr *nm_attr; |
| 214 | struct { |
| 215 | struct gsm_nm_state nm_state; |
| 216 | } bb_transc; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 217 | |
| 218 | u_int16_t arfcn; |
Harald Welte | 85770c7 | 2009-01-18 17:47:32 +0000 | [diff] [blame] | 219 | struct gsm_bts_trx_ts ts[TRX_NR_TS]; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 220 | }; |
| 221 | |
Harald Welte | 978cb42 | 2009-01-18 17:57:27 +0000 | [diff] [blame] | 222 | enum gsm_bts_type { |
| 223 | GSM_BTS_TYPE_UNKNOWN, |
| 224 | GSM_BTS_TYPE_BS11, |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 225 | GSM_BTS_TYPE_NANOBTS_900, |
| 226 | GSM_BTS_TYPE_NANOBTS_1800, |
Harald Welte | 978cb42 | 2009-01-18 17:57:27 +0000 | [diff] [blame] | 227 | }; |
| 228 | |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 229 | /** |
| 230 | * A pending paging request |
| 231 | */ |
| 232 | struct gsm_paging_request { |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 233 | /* list_head for list of all paging requests */ |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 234 | struct llist_head entry; |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 235 | /* the subscriber which we're paging. Later gsm_paging_request |
| 236 | * should probably become a part of the gsm_subscriber struct? */ |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 237 | struct gsm_subscriber *subscr; |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 238 | /* back-pointer to the BTS on which we are paging */ |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 239 | struct gsm_bts *bts; |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 240 | /* what kind of channel type do we ask the MS to establish */ |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 241 | int chan_type; |
Harald Welte | cd06bfb | 2009-02-10 17:33:56 +0000 | [diff] [blame] | 242 | |
| 243 | /* Timer 3113: how long do we try to page? */ |
| 244 | struct timer_list T3113; |
Harald Welte | 0932d1e | 2009-02-16 22:53:52 +0000 | [diff] [blame] | 245 | |
| 246 | /* callback to be called in case paging completes */ |
| 247 | gsm_cbfn *cbfn; |
| 248 | void *cbfn_param; |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 249 | }; |
Harald Welte | cd06bfb | 2009-02-10 17:33:56 +0000 | [diff] [blame] | 250 | #define T3113_VALUE 60, 0 |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 251 | |
| 252 | /* |
| 253 | * This keeps track of the paging status of one BTS. It |
| 254 | * includes a number of pending requests, a back pointer |
| 255 | * to the gsm_bts, a timer and some more state. |
| 256 | */ |
| 257 | struct gsm_bts_paging_state { |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 258 | /* pending requests */ |
| 259 | struct llist_head pending_requests; |
| 260 | struct gsm_paging_request *last_request; |
| 261 | struct gsm_bts *bts; |
| 262 | |
Harald Welte | 75a1fa8 | 2009-02-17 01:39:41 +0000 | [diff] [blame] | 263 | struct timer_list work_timer; |
| 264 | |
Holger Freyther | 392209c | 2009-02-10 00:06:19 +0000 | [diff] [blame] | 265 | /* load */ |
| 266 | u_int16_t available_slots; |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 267 | }; |
| 268 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 269 | /* One BTS */ |
| 270 | struct gsm_bts { |
| 271 | struct gsm_network *network; |
| 272 | /* number of ths BTS in network */ |
| 273 | u_int8_t nr; |
| 274 | /* location area code of this BTS */ |
| 275 | u_int8_t location_area_code; |
Harald Welte | 02b0e09 | 2009-02-28 13:11:07 +0000 | [diff] [blame] | 276 | /* Training Sequence Code */ |
| 277 | u_int8_t tsc; |
Harald Welte | 78f2f50 | 2009-05-23 16:56:52 +0000 | [diff] [blame^] | 278 | /* Base Station Identification Code (BSIC) */ |
| 279 | u_int8_t bsic; |
Harald Welte | 978cb42 | 2009-01-18 17:57:27 +0000 | [diff] [blame] | 280 | /* type of BTS */ |
| 281 | enum gsm_bts_type type; |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 282 | /* how do we talk OML with this TRX? */ |
| 283 | struct e1inp_sign_link *oml_link; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 284 | |
| 285 | /* Abis network management O&M handle */ |
| 286 | struct abis_nm_h *nmh; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 287 | struct gsm_nm_state nm_state; |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 288 | struct gsm_attr *nm_attr; |
Harald Welte | 978cb42 | 2009-01-18 17:57:27 +0000 | [diff] [blame] | 289 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 290 | /* number of this BTS on given E1 link */ |
| 291 | u_int8_t bts_nr; |
| 292 | |
Holger Freyther | 1adb4ff | 2009-02-04 00:04:52 +0000 | [diff] [blame] | 293 | struct gsm48_control_channel_descr chan_desc; |
| 294 | |
Holger Freyther | ceb59b7 | 2009-02-06 18:54:00 +0000 | [diff] [blame] | 295 | /* paging state and control */ |
| 296 | struct gsm_bts_paging_state paging; |
| 297 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 298 | /* CCCH is on C0 */ |
| 299 | struct gsm_bts_trx *c0; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 300 | |
| 301 | struct { |
| 302 | struct gsm_nm_state nm_state; |
| 303 | } site_mgr; |
Harald Welte | edb3778 | 2009-05-01 14:59:07 +0000 | [diff] [blame] | 304 | |
| 305 | /* ip.accesss Unit ID's have Site/BTS/TRX layout */ |
| 306 | struct { |
| 307 | u_int16_t site_id; |
| 308 | u_int16_t bts_id; |
| 309 | } ip_access; |
Harald Welte | bbcc7a5 | 2009-02-14 19:45:44 +0000 | [diff] [blame] | 310 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 311 | /* transceivers */ |
| 312 | int num_trx; |
| 313 | struct gsm_bts_trx trx[BTS_MAX_TRX+1]; |
| 314 | }; |
| 315 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 316 | struct gsm_network { |
| 317 | /* global parameters */ |
Harald Welte | b84e2f4 | 2008-12-28 23:42:04 +0000 | [diff] [blame] | 318 | u_int16_t country_code; |
| 319 | u_int16_t network_code; |
Harald Welte | c6ba9c2 | 2008-12-30 18:01:02 +0000 | [diff] [blame] | 320 | char *name_long; |
| 321 | char *name_short; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 322 | |
| 323 | unsigned int num_bts; |
| 324 | /* private lists */ |
| 325 | struct gsm_bts bts[GSM_MAX_BTS+1]; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 326 | }; |
| 327 | |
Harald Welte | 7e310b1 | 2009-03-30 20:56:32 +0000 | [diff] [blame] | 328 | #define SMS_HDR_SIZE 128 |
| 329 | #define SMS_TEXT_SIZE 256 |
| 330 | struct gsm_sms { |
| 331 | u_int64_t id; |
| 332 | struct gsm_subscriber *sender; |
| 333 | struct gsm_subscriber *receiver; |
| 334 | |
| 335 | unsigned char header[SMS_HDR_SIZE]; |
| 336 | char text[SMS_TEXT_SIZE]; |
| 337 | }; |
| 338 | |
Harald Welte | 8c1d0e4 | 2009-02-15 03:38:12 +0000 | [diff] [blame] | 339 | struct gsm_network *gsm_network_init(unsigned int num_bts, enum gsm_bts_type bts_type, |
| 340 | u_int16_t country_code, u_int16_t network_code); |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 341 | |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 342 | const char *gsm_pchan_name(enum gsm_phys_chan_config c); |
| 343 | const char *gsm_lchan_name(enum gsm_chan_t c); |
| 344 | const char *gsm_chreq_name(enum gsm_chreq_reason_t c); |
Harald Welte | 23a6863 | 2009-02-19 17:06:42 +0000 | [diff] [blame] | 345 | char *gsm_ts_name(struct gsm_bts_trx_ts *ts); |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 346 | |
Harald Welte | ad38464 | 2008-12-26 10:20:07 +0000 | [diff] [blame] | 347 | enum gsm_e1_event { |
| 348 | EVT_E1_NONE, |
Harald Welte | 1fa60c8 | 2009-02-09 18:13:26 +0000 | [diff] [blame] | 349 | EVT_E1_TEI_UP, |
| 350 | EVT_E1_TEI_DN, |
Harald Welte | ad38464 | 2008-12-26 10:20:07 +0000 | [diff] [blame] | 351 | }; |
| 352 | |
Harald Welte | cd06bfb | 2009-02-10 17:33:56 +0000 | [diff] [blame] | 353 | void set_ts_e1link(struct gsm_bts_trx_ts *ts, u_int8_t e1_nr, |
| 354 | u_int8_t e1_ts, u_int8_t e1_ts_ss); |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 355 | enum gsm_bts_type parse_btstype(char *arg); |
| 356 | char *btstype2str(enum gsm_bts_type type); |
Harald Welte | be99149 | 2009-05-23 13:56:40 +0000 | [diff] [blame] | 357 | struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, |
| 358 | struct gsm_bts *start_bts); |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 359 | |
| 360 | static inline int is_ipaccess_bts(struct gsm_bts *bts) |
| 361 | { |
| 362 | switch (bts->type) { |
| 363 | case GSM_BTS_TYPE_NANOBTS_900: |
| 364 | case GSM_BTS_TYPE_NANOBTS_1800: |
| 365 | return 1; |
| 366 | default: |
| 367 | break; |
| 368 | } |
| 369 | return 0; |
| 370 | } |
| 371 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 372 | #endif |