Harald Welte | fbc5ca0 | 2010-03-04 10:39:50 +0100 | [diff] [blame] | 1 | /* (C) 2008-2010 by Harald Welte <laforge@gnumonks.org> |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 2 | * |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 3 | * All Rights Reserved |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 6 | * it under the terms of the GNU Affero General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 13 | * GNU Affero General Public License for more details. |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 14 | * |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 15 | * You should have received a copy of the GNU Affero General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 17 | * |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | #include <stdlib.h> |
Harald Welte | 51f3845 | 2009-02-24 22:36:40 +0000 | [diff] [blame] | 22 | #include <stdio.h> |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 23 | #include <string.h> |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 24 | #include <errno.h> |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 25 | #include <ctype.h> |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 26 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 27 | #include <netinet/in.h> |
| 28 | |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 29 | #include <osmocom/core/linuxlist.h> |
| 30 | #include <osmocom/core/talloc.h> |
| 31 | #include <osmocom/gsm/gsm_utils.h> |
| 32 | #include <osmocom/core/statistics.h> |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 33 | |
Holger Hans Peter Freyther | ed83286 | 2010-06-28 18:20:22 +0800 | [diff] [blame] | 34 | #include <openbsc/gsm_data.h> |
Holger Hans Peter Freyther | 3e8e046 | 2010-09-15 22:29:25 +0800 | [diff] [blame] | 35 | #include <openbsc/osmo_msc_data.h> |
Holger Hans Peter Freyther | ed83286 | 2010-06-28 18:20:22 +0800 | [diff] [blame] | 36 | #include <openbsc/abis_nm.h> |
| 37 | |
Andreas Eversberg | 8226fa7 | 2009-06-29 15:19:38 +0200 | [diff] [blame] | 38 | void *tall_bsc_ctx; |
| 39 | |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 40 | static LLIST_HEAD(bts_models); |
| 41 | |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 42 | void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, |
| 43 | uint8_t e1_ts, uint8_t e1_ts_ss) |
Harald Welte | cd06bfb | 2009-02-10 17:33:56 +0000 | [diff] [blame] | 44 | { |
| 45 | ts->e1_link.e1_nr = e1_nr; |
| 46 | ts->e1_link.e1_ts = e1_ts; |
| 47 | ts->e1_link.e1_ts_ss = e1_ts_ss; |
| 48 | } |
| 49 | |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 50 | static const struct value_string pchan_names[] = { |
| 51 | { GSM_PCHAN_NONE, "NONE" }, |
| 52 | { GSM_PCHAN_CCCH, "CCCH" }, |
| 53 | { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, |
| 54 | { GSM_PCHAN_TCH_F, "TCH/F" }, |
| 55 | { GSM_PCHAN_TCH_H, "TCH/H" }, |
| 56 | { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, |
| 57 | { GSM_PCHAN_PDCH, "PDCH" }, |
| 58 | { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, |
| 59 | { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, |
| 60 | { 0, NULL } |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | const char *gsm_pchan_name(enum gsm_phys_chan_config c) |
| 64 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 65 | return get_value_string(pchan_names, c); |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 66 | } |
| 67 | |
Harald Welte | a171a1b | 2009-08-07 00:24:39 +0200 | [diff] [blame] | 68 | enum gsm_phys_chan_config gsm_pchan_parse(const char *name) |
| 69 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 70 | return get_string_value(pchan_names, name); |
Harald Welte | a171a1b | 2009-08-07 00:24:39 +0200 | [diff] [blame] | 71 | } |
| 72 | |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 73 | static const struct value_string lchant_names[] = { |
| 74 | { GSM_LCHAN_NONE, "NONE" }, |
| 75 | { GSM_LCHAN_SDCCH, "SDCCH" }, |
| 76 | { GSM_LCHAN_TCH_F, "TCH/F" }, |
| 77 | { GSM_LCHAN_TCH_H, "TCH/H" }, |
| 78 | { GSM_LCHAN_UNKNOWN, "UNKNOWN" }, |
| 79 | { 0, NULL } |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 80 | }; |
| 81 | |
Harald Welte (local) | ccd8845 | 2009-12-27 18:05:25 +0100 | [diff] [blame] | 82 | const char *gsm_lchant_name(enum gsm_chan_t c) |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 83 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 84 | return get_value_string(lchant_names, c); |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 85 | } |
| 86 | |
Harald Welte | 1887f9d | 2009-12-29 10:52:38 +0100 | [diff] [blame] | 87 | static const struct value_string lchan_s_names[] = { |
| 88 | { LCHAN_S_NONE, "NONE" }, |
| 89 | { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, |
| 90 | { LCHAN_S_ACTIVE, "ACTIVE" }, |
| 91 | { LCHAN_S_INACTIVE, "INACTIVE" }, |
| 92 | { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, |
Holger Hans Peter Freyther | 4b4dd10 | 2010-05-31 21:38:24 +0800 | [diff] [blame] | 93 | { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 94 | { 0, NULL } |
Harald Welte | 1887f9d | 2009-12-29 10:52:38 +0100 | [diff] [blame] | 95 | }; |
| 96 | |
| 97 | const char *gsm_lchans_name(enum gsm_lchan_state s) |
| 98 | { |
| 99 | return get_value_string(lchan_s_names, s); |
| 100 | } |
| 101 | |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 102 | static const struct value_string chreq_names[] = { |
| 103 | { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, |
| 104 | { GSM_CHREQ_REASON_PAG, "PAGING" }, |
| 105 | { GSM_CHREQ_REASON_CALL, "CALL" }, |
| 106 | { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, |
| 107 | { GSM_CHREQ_REASON_OTHER, "OTHER" }, |
| 108 | { 0, NULL } |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 109 | }; |
| 110 | |
| 111 | const char *gsm_chreq_name(enum gsm_chreq_reason_t c) |
| 112 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 113 | return get_value_string(chreq_names, c); |
Harald Welte | a72c98e | 2009-01-04 16:10:38 +0000 | [diff] [blame] | 114 | } |
| 115 | |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 116 | static struct gsm_bts_model *bts_model_find(enum gsm_bts_type type) |
| 117 | { |
| 118 | struct gsm_bts_model *model; |
| 119 | |
| 120 | llist_for_each_entry(model, &bts_models, list) { |
| 121 | if (model->type == type) |
| 122 | return model; |
| 123 | } |
| 124 | |
| 125 | return NULL; |
| 126 | } |
| 127 | |
| 128 | int gsm_bts_model_register(struct gsm_bts_model *model) |
| 129 | { |
| 130 | if (bts_model_find(model->type)) |
| 131 | return -EEXIST; |
| 132 | |
| 133 | tlv_def_patch(&model->nm_att_tlvdef, &nm_att_tlvdef); |
| 134 | llist_add_tail(&model->list, &bts_models); |
| 135 | return 0; |
| 136 | } |
| 137 | |
| 138 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 139 | struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 140 | { |
Holger Hans Peter Freyther | 5ea7313 | 2009-10-29 02:29:45 +0100 | [diff] [blame] | 141 | struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 142 | int k; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 143 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 144 | if (!trx) |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 145 | return NULL; |
| 146 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 147 | trx->bts = bts; |
| 148 | trx->nr = bts->num_trx++; |
Holger Hans Peter Freyther | f31e474 | 2009-12-31 03:05:52 +0100 | [diff] [blame] | 149 | trx->nm_state.administrative = NM_STATE_UNLOCKED; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 150 | |
| 151 | for (k = 0; k < TRX_NR_TS; k++) { |
| 152 | struct gsm_bts_trx_ts *ts = &trx->ts[k]; |
| 153 | int l; |
| 154 | |
| 155 | ts->trx = trx; |
| 156 | ts->nr = k; |
| 157 | ts->pchan = GSM_PCHAN_NONE; |
| 158 | |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 159 | ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); |
| 160 | ts->hopping.arfcns.data = ts->hopping.arfcns_data; |
Harald Welte | fd37089 | 2010-06-15 08:52:12 +0200 | [diff] [blame] | 161 | ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); |
| 162 | ts->hopping.ma.data = ts->hopping.ma_data; |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 163 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 164 | for (l = 0; l < TS_MAX_LCHAN; l++) { |
| 165 | struct gsm_lchan *lchan; |
| 166 | lchan = &ts->lchan[l]; |
| 167 | |
| 168 | lchan->ts = ts; |
| 169 | lchan->nr = l; |
| 170 | lchan->type = GSM_LCHAN_NONE; |
| 171 | } |
| 172 | } |
| 173 | |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 174 | if (trx->nr != 0) |
| 175 | trx->nominal_power = bts->c0->nominal_power; |
| 176 | |
Harald Welte | 9fb3b8b | 2009-08-06 19:05:58 +0200 | [diff] [blame] | 177 | llist_add_tail(&trx->list, &bts->trx_list); |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 178 | |
| 179 | return trx; |
| 180 | } |
| 181 | |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 182 | static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; |
| 183 | static const uint8_t bts_cell_timer_default[] = |
| 184 | { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; |
| 185 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 186 | struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, enum gsm_bts_type type, |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 187 | uint8_t tsc, uint8_t bsic) |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 188 | { |
Holger Hans Peter Freyther | 5ea7313 | 2009-10-29 02:29:45 +0100 | [diff] [blame] | 189 | struct gsm_bts *bts = talloc_zero(net, struct gsm_bts); |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 190 | struct gsm_bts_model *model = bts_model_find(type); |
Harald Welte | 55dd443 | 2009-10-24 10:19:14 +0200 | [diff] [blame] | 191 | int i; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 192 | |
| 193 | if (!bts) |
| 194 | return NULL; |
| 195 | |
laforge | 6af56d1 | 2010-01-12 10:44:26 +0100 | [diff] [blame] | 196 | if (!model && type != GSM_BTS_TYPE_UNKNOWN) { |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 197 | talloc_free(bts); |
| 198 | return NULL; |
| 199 | } |
| 200 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 201 | bts->network = net; |
| 202 | bts->nr = net->num_bts++; |
| 203 | bts->type = type; |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 204 | bts->model = model; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 205 | bts->tsc = tsc; |
| 206 | bts->bsic = bsic; |
| 207 | bts->num_trx = 0; |
| 208 | INIT_LLIST_HEAD(&bts->trx_list); |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 209 | bts->ms_max_power = 15; /* dBm */ |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 210 | |
| 211 | bts->neigh_list_manual_mode = 0; |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 212 | bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */ |
| 213 | bts->si_common.cell_sel_par.rxlev_acc_min = 0; |
Harald Welte | 6c40def | 2009-12-14 22:07:14 +0100 | [diff] [blame] | 214 | bts->si_common.neigh_list.data = bts->si_common.data.neigh_list; |
| 215 | bts->si_common.neigh_list.data_len = |
| 216 | sizeof(bts->si_common.data.neigh_list); |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 217 | bts->si_common.si5_neigh_list.data = bts->si_common.data.si5_neigh_list; |
| 218 | bts->si_common.si5_neigh_list.data_len = |
| 219 | sizeof(bts->si_common.data.si5_neigh_list); |
Harald Welte | 6c40def | 2009-12-14 22:07:14 +0100 | [diff] [blame] | 220 | bts->si_common.cell_alloc.data = bts->si_common.data.cell_alloc; |
| 221 | bts->si_common.cell_alloc.data_len = |
| 222 | sizeof(bts->si_common.data.cell_alloc); |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 223 | bts->si_common.rach_control.re = 1; /* no re-establishment */ |
| 224 | bts->si_common.rach_control.tx_integer = 9; /* 12 slots spread - 217/115 slots delay */ |
| 225 | bts->si_common.rach_control.max_trans = 3; /* 7 retransmissions */ |
| 226 | bts->si_common.rach_control.t2 = 4; /* no emergency calls */ |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 227 | |
Harald Welte | 55dd443 | 2009-10-24 10:19:14 +0200 | [diff] [blame] | 228 | for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { |
| 229 | bts->gprs.nsvc[i].bts = bts; |
| 230 | bts->gprs.nsvc[i].id = i; |
| 231 | } |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 232 | memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, |
| 233 | sizeof(bts->gprs.nse.timer)); |
| 234 | memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, |
| 235 | sizeof(bts->gprs.cell.timer)); |
Harald Welte | 55dd443 | 2009-10-24 10:19:14 +0200 | [diff] [blame] | 236 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 237 | /* create our primary TRX */ |
| 238 | bts->c0 = gsm_bts_trx_alloc(bts); |
| 239 | if (!bts->c0) { |
| 240 | talloc_free(bts); |
| 241 | return NULL; |
| 242 | } |
| 243 | bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; |
| 244 | |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 245 | bts->rach_b_thresh = -1; |
| 246 | bts->rach_ldavg_slots = -1; |
Holger Hans Peter Freyther | e66bf1f | 2010-09-06 10:11:25 +0800 | [diff] [blame] | 247 | bts->paging.free_chans_need = -1; |
Holger Hans Peter Freyther | 6f61555 | 2010-11-15 20:50:42 +0100 | [diff] [blame] | 248 | INIT_LLIST_HEAD(&bts->abis_queue); |
| 249 | |
Harald Welte | 9fb3b8b | 2009-08-06 19:05:58 +0200 | [diff] [blame] | 250 | llist_add_tail(&bts->list, &net->bts_list); |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 251 | |
| 252 | return bts; |
| 253 | } |
| 254 | |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 255 | struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code, |
Harald Welte | 29b64e9 | 2010-12-23 01:07:46 +0100 | [diff] [blame] | 256 | int (*mncc_recv)(struct gsm_network *, struct msgb *)) |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 257 | { |
| 258 | struct gsm_network *net; |
| 259 | |
Holger Hans Peter Freyther | 5ea7313 | 2009-10-29 02:29:45 +0100 | [diff] [blame] | 260 | net = talloc_zero(tall_bsc_ctx, struct gsm_network); |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 261 | if (!net) |
| 262 | return NULL; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 263 | |
Holger Hans Peter Freyther | 3e8e046 | 2010-09-15 22:29:25 +0800 | [diff] [blame] | 264 | net->msc_data = talloc_zero(net, struct osmo_msc_data); |
| 265 | if (!net->msc_data) { |
| 266 | talloc_free(net); |
| 267 | return NULL; |
| 268 | } |
| 269 | |
Daniel Willmann | 163f612 | 2011-03-03 13:48:28 +0100 | [diff] [blame] | 270 | /* Init back pointer */ |
| 271 | net->msc_data->network = net; |
| 272 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 273 | net->country_code = country_code; |
| 274 | net->network_code = network_code; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 275 | net->num_bts = 0; |
Holger Hans Peter Freyther | d0c5402 | 2010-01-07 16:08:42 +0100 | [diff] [blame] | 276 | net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; |
Harald Welte | b84ddfc | 2009-12-01 17:36:54 +0530 | [diff] [blame] | 277 | net->T3101 = GSM_T3101_DEFAULT; |
| 278 | net->T3113 = GSM_T3113_DEFAULT; |
| 279 | /* FIXME: initialize all other timers! */ |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 280 | |
Harald Welte | f7c28b0 | 2009-12-21 13:30:17 +0100 | [diff] [blame] | 281 | /* default set of handover parameters */ |
| 282 | net->handover.win_rxlev_avg = 10; |
| 283 | net->handover.win_rxqual_avg = 1; |
| 284 | net->handover.win_rxlev_avg_neigh = 10; |
| 285 | net->handover.pwr_interval = 6; |
| 286 | net->handover.pwr_hysteresis = 3; |
| 287 | net->handover.max_distance = 9999; |
| 288 | |
Harald Welte | 4bfdfe7 | 2009-06-10 23:11:52 +0800 | [diff] [blame] | 289 | INIT_LLIST_HEAD(&net->trans_list); |
| 290 | INIT_LLIST_HEAD(&net->upqueue); |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 291 | INIT_LLIST_HEAD(&net->bts_list); |
Harald Welte | 4bfdfe7 | 2009-06-10 23:11:52 +0800 | [diff] [blame] | 292 | |
Harald Welte | ffa55a4 | 2009-12-22 19:07:32 +0100 | [diff] [blame] | 293 | net->stats.chreq.total = counter_alloc("net.chreq.total"); |
| 294 | net->stats.chreq.no_channel = counter_alloc("net.chreq.no_channel"); |
| 295 | net->stats.handover.attempted = counter_alloc("net.handover.attempted"); |
| 296 | net->stats.handover.no_channel = counter_alloc("net.handover.no_channel"); |
| 297 | net->stats.handover.timeout = counter_alloc("net.handover.timeout"); |
| 298 | net->stats.handover.completed = counter_alloc("net.handover.completed"); |
| 299 | net->stats.handover.failed = counter_alloc("net.handover.failed"); |
| 300 | net->stats.loc_upd_type.attach = counter_alloc("net.loc_upd_type.attach"); |
| 301 | net->stats.loc_upd_type.normal = counter_alloc("net.loc_upd_type.normal"); |
| 302 | net->stats.loc_upd_type.periodic = counter_alloc("net.loc_upd_type.periodic"); |
| 303 | net->stats.loc_upd_type.detach = counter_alloc("net.imsi_detach.count"); |
| 304 | net->stats.loc_upd_resp.reject = counter_alloc("net.loc_upd_resp.reject"); |
| 305 | net->stats.loc_upd_resp.accept = counter_alloc("net.loc_upd_resp.accept"); |
| 306 | net->stats.paging.attempted = counter_alloc("net.paging.attempted"); |
| 307 | net->stats.paging.detached = counter_alloc("net.paging.detached"); |
| 308 | net->stats.paging.completed = counter_alloc("net.paging.completed"); |
| 309 | net->stats.paging.expired = counter_alloc("net.paging.expired"); |
| 310 | net->stats.sms.submitted = counter_alloc("net.sms.submitted"); |
| 311 | net->stats.sms.no_receiver = counter_alloc("net.sms.no_receiver"); |
| 312 | net->stats.sms.delivered = counter_alloc("net.sms.delivered"); |
| 313 | net->stats.sms.rp_err_mem = counter_alloc("net.sms.rp_err_mem"); |
| 314 | net->stats.sms.rp_err_other = counter_alloc("net.sms.rp_err_other"); |
Harald Welte | a29e43a | 2010-12-24 16:06:33 +0100 | [diff] [blame] | 315 | net->stats.call.mo_setup = counter_alloc("net.call.mo_setup"); |
| 316 | net->stats.call.mo_connect_ack = counter_alloc("net.call.mo_connect_ack"); |
| 317 | net->stats.call.mt_setup = counter_alloc("net.call.mt_setup"); |
| 318 | net->stats.call.mt_connect = counter_alloc("net.call.mt_connect"); |
Holger Hans Peter Freyther | 3ba36d5 | 2010-04-17 06:48:29 +0200 | [diff] [blame] | 319 | net->stats.chan.rf_fail = counter_alloc("net.chan.rf_fail"); |
| 320 | net->stats.chan.rll_err = counter_alloc("net.chan.rll_err"); |
Holger Hans Peter Freyther | bb110f9 | 2010-04-12 10:45:52 +0200 | [diff] [blame] | 321 | net->stats.bts.oml_fail = counter_alloc("net.bts.oml_fail"); |
| 322 | net->stats.bts.rsl_fail = counter_alloc("net.bts.rsl_fail"); |
Harald Welte | ffa55a4 | 2009-12-22 19:07:32 +0100 | [diff] [blame] | 323 | |
Harald Welte | 4bfdfe7 | 2009-06-10 23:11:52 +0800 | [diff] [blame] | 324 | net->mncc_recv = mncc_recv; |
| 325 | |
Holger Hans Peter Freyther | e1880105 | 2011-04-23 23:31:31 +0200 | [diff] [blame] | 326 | INIT_LLIST_HEAD(&net->msc_data->dests); |
Holger Hans Peter Freyther | 469692c | 2010-09-16 02:00:01 +0800 | [diff] [blame] | 327 | net->msc_data->ping_timeout = 20; |
| 328 | net->msc_data->pong_timeout = 5; |
Holger Hans Peter Freyther | 4de1116 | 2010-11-03 13:12:18 +0100 | [diff] [blame] | 329 | net->msc_data->core_ncc = -1; |
Holger Hans Peter Freyther | 2a8675e | 2010-11-05 19:43:07 +0100 | [diff] [blame] | 330 | net->msc_data->core_mcc = -1; |
Holger Hans Peter Freyther | fe16622 | 2010-11-03 13:32:48 +0100 | [diff] [blame] | 331 | net->msc_data->rtp_base = 4000; |
Holger Hans Peter Freyther | 469692c | 2010-09-16 02:00:01 +0800 | [diff] [blame] | 332 | |
Holger Hans Peter Freyther | 7889107 | 2010-09-06 09:36:02 +0800 | [diff] [blame] | 333 | gsm_net_update_ctype(net); |
| 334 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 335 | return net; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 336 | } |
Harald Welte | 23a6863 | 2009-02-19 17:06:42 +0000 | [diff] [blame] | 337 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 338 | struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) |
| 339 | { |
| 340 | struct gsm_bts *bts; |
| 341 | |
| 342 | if (num >= net->num_bts) |
| 343 | return NULL; |
| 344 | |
| 345 | llist_for_each_entry(bts, &net->bts_list, list) { |
| 346 | if (bts->nr == num) |
| 347 | return bts; |
| 348 | } |
| 349 | |
| 350 | return NULL; |
| 351 | } |
| 352 | |
Harald Welte | 84874c9 | 2009-12-14 22:33:02 +0100 | [diff] [blame] | 353 | /* Get reference to a neighbor cell on a given BCCH ARFCN */ |
Harald Welte | 0b12103 | 2009-12-15 00:21:31 +0100 | [diff] [blame] | 354 | struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 355 | uint16_t arfcn, uint8_t bsic) |
Harald Welte | 84874c9 | 2009-12-14 22:33:02 +0100 | [diff] [blame] | 356 | { |
| 357 | struct gsm_bts *neigh; |
| 358 | /* FIXME: use some better heuristics here to determine which cell |
| 359 | * using this ARFCN really is closest to the target cell. For |
| 360 | * now we simply assume that each ARFCN will only be used by one |
| 361 | * cell */ |
| 362 | |
| 363 | llist_for_each_entry(neigh, &bts->network->bts_list, list) { |
Harald Welte | 0b12103 | 2009-12-15 00:21:31 +0100 | [diff] [blame] | 364 | if (neigh->c0->arfcn == arfcn && |
| 365 | neigh->bsic == bsic) |
Harald Welte | 84874c9 | 2009-12-14 22:33:02 +0100 | [diff] [blame] | 366 | return neigh; |
| 367 | } |
| 368 | |
| 369 | return NULL; |
| 370 | } |
| 371 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 372 | struct gsm_bts_trx *gsm_bts_trx_num(struct gsm_bts *bts, int num) |
| 373 | { |
| 374 | struct gsm_bts_trx *trx; |
| 375 | |
| 376 | if (num >= bts->num_trx) |
| 377 | return NULL; |
| 378 | |
| 379 | llist_for_each_entry(trx, &bts->trx_list, list) { |
| 380 | if (trx->nr == num) |
| 381 | return trx; |
| 382 | } |
| 383 | |
| 384 | return NULL; |
| 385 | } |
| 386 | |
Harald Welte | 23a6863 | 2009-02-19 17:06:42 +0000 | [diff] [blame] | 387 | static char ts2str[255]; |
| 388 | |
Harald Welte (local) | d48f4eb | 2009-12-28 23:14:22 +0100 | [diff] [blame] | 389 | char *gsm_trx_name(struct gsm_bts_trx *trx) |
| 390 | { |
| 391 | snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", |
| 392 | trx->bts->nr, trx->nr); |
| 393 | |
| 394 | return ts2str; |
| 395 | } |
| 396 | |
| 397 | |
Harald Welte | 23a6863 | 2009-02-19 17:06:42 +0000 | [diff] [blame] | 398 | char *gsm_ts_name(struct gsm_bts_trx_ts *ts) |
| 399 | { |
| 400 | snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", |
Mike Haben | 2449b37 | 2009-10-26 20:36:34 +0100 | [diff] [blame] | 401 | ts->trx->bts->nr, ts->trx->nr, ts->nr); |
Harald Welte | 23a6863 | 2009-02-19 17:06:42 +0000 | [diff] [blame] | 402 | |
| 403 | return ts2str; |
| 404 | } |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 405 | |
Harald Welte (local) | 19ef62a | 2009-12-27 18:16:36 +0100 | [diff] [blame] | 406 | char *gsm_lchan_name(struct gsm_lchan *lchan) |
| 407 | { |
| 408 | struct gsm_bts_trx_ts *ts = lchan->ts; |
| 409 | |
| 410 | snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", |
| 411 | ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); |
| 412 | |
| 413 | return ts2str; |
| 414 | } |
| 415 | |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 416 | static const struct value_string bts_types[] = { |
| 417 | { GSM_BTS_TYPE_UNKNOWN, "unknown" }, |
| 418 | { GSM_BTS_TYPE_BS11, "bs11" }, |
| 419 | { GSM_BTS_TYPE_NANOBTS, "nanobts" }, |
Harald Welte | db44f60 | 2011-02-11 18:36:18 +0100 | [diff] [blame] | 420 | { GSM_BTS_TYPE_RBS2000, "rbs2000" }, |
Harald Welte | fd355a3 | 2011-03-04 13:41:31 +0100 | [diff] [blame] | 421 | { GSM_BTS_TYPE_HSL_FEMTO, "hsl_femto" }, |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 422 | { 0, NULL } |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 423 | }; |
| 424 | |
Harald Welte | 1d014a5 | 2009-08-08 15:38:29 +0200 | [diff] [blame] | 425 | enum gsm_bts_type parse_btstype(const char *arg) |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 426 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 427 | return get_string_value(bts_types, arg); |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 428 | } |
| 429 | |
Holger Hans Peter Freyther | 2dceae6 | 2009-06-12 17:39:38 +0200 | [diff] [blame] | 430 | const char *btstype2str(enum gsm_bts_type type) |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 431 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 432 | return get_value_string(bts_types, type); |
Harald Welte | 32201c1 | 2009-03-10 12:15:10 +0000 | [diff] [blame] | 433 | } |
Harald Welte | be99149 | 2009-05-23 13:56:40 +0000 | [diff] [blame] | 434 | |
Harald Welte | 6e670aa | 2010-01-07 20:44:32 +0100 | [diff] [blame] | 435 | struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr) |
| 436 | { |
| 437 | struct gsm_bts_trx *trx; |
| 438 | |
| 439 | llist_for_each_entry(trx, &bts->trx_list, list) { |
| 440 | if (trx->nr == nr) |
| 441 | return trx; |
| 442 | } |
| 443 | return NULL; |
| 444 | } |
| 445 | |
Harald Welte | be99149 | 2009-05-23 13:56:40 +0000 | [diff] [blame] | 446 | /* Search for a BTS in the given Location Area; optionally start searching |
| 447 | * with start_bts (for continuing to search after the first result) */ |
| 448 | struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, |
| 449 | struct gsm_bts *start_bts) |
| 450 | { |
| 451 | int i; |
| 452 | struct gsm_bts *bts; |
| 453 | int skip = 0; |
| 454 | |
| 455 | if (start_bts) |
| 456 | skip = 1; |
| 457 | |
| 458 | for (i = 0; i < net->num_bts; i++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 459 | bts = gsm_bts_num(net, i); |
Harald Welte | be99149 | 2009-05-23 13:56:40 +0000 | [diff] [blame] | 460 | |
| 461 | if (skip) { |
| 462 | if (start_bts == bts) |
| 463 | skip = 0; |
| 464 | continue; |
| 465 | } |
| 466 | |
Holger Hans Peter Freyther | e48b956 | 2009-10-01 04:07:15 +0200 | [diff] [blame] | 467 | if (lac == GSM_LAC_RESERVED_ALL_BTS || bts->location_area_code == lac) |
Harald Welte | be99149 | 2009-05-23 13:56:40 +0000 | [diff] [blame] | 468 | return bts; |
| 469 | } |
| 470 | return NULL; |
| 471 | } |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 472 | |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 473 | static const struct value_string auth_policy_names[] = { |
| 474 | { GSM_AUTH_POLICY_CLOSED, "closed" }, |
| 475 | { GSM_AUTH_POLICY_ACCEPT_ALL, "accept-all" }, |
| 476 | { GSM_AUTH_POLICY_TOKEN, "token" }, |
| 477 | { 0, NULL } |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 478 | }; |
| 479 | |
| 480 | enum gsm_auth_policy gsm_auth_policy_parse(const char *arg) |
| 481 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 482 | return get_string_value(auth_policy_names, arg); |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 483 | } |
| 484 | |
| 485 | const char *gsm_auth_policy_name(enum gsm_auth_policy policy) |
| 486 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 487 | return get_value_string(auth_policy_names, policy); |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 488 | } |
| 489 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 490 | void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) |
| 491 | { |
| 492 | raid->mcc = bts->network->country_code; |
| 493 | raid->mnc = bts->network->network_code; |
| 494 | raid->lac = bts->location_area_code; |
| 495 | raid->rac = bts->gprs.rac; |
| 496 | } |
| 497 | |
Holger Hans Peter Freyther | c42ad8b | 2011-04-18 17:04:00 +0200 | [diff] [blame] | 498 | int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 499 | { |
| 500 | struct gprs_ra_id raid; |
| 501 | |
| 502 | gprs_ra_id_by_bts(&raid, bts); |
| 503 | |
| 504 | return gsm48_construct_ra(buf, &raid); |
| 505 | } |
| 506 | |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 507 | static const struct value_string rrlp_mode_names[] = { |
| 508 | { RRLP_MODE_NONE, "none" }, |
| 509 | { RRLP_MODE_MS_BASED, "ms-based" }, |
| 510 | { RRLP_MODE_MS_PREF, "ms-preferred" }, |
| 511 | { RRLP_MODE_ASS_PREF, "ass-preferred" }, |
| 512 | { 0, NULL } |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 513 | }; |
| 514 | |
| 515 | enum rrlp_mode rrlp_mode_parse(const char *arg) |
| 516 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 517 | return get_string_value(rrlp_mode_names, arg); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 518 | } |
| 519 | |
| 520 | const char *rrlp_mode_name(enum rrlp_mode mode) |
| 521 | { |
Harald Welte | 92b1fe4 | 2010-03-25 11:45:30 +0800 | [diff] [blame] | 522 | return get_value_string(rrlp_mode_names, mode); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 523 | } |
Harald Welte | d12b0fd | 2009-12-15 21:36:05 +0100 | [diff] [blame] | 524 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 525 | static const struct value_string bts_gprs_mode_names[] = { |
| 526 | { BTS_GPRS_NONE, "none" }, |
| 527 | { BTS_GPRS_GPRS, "gprs" }, |
| 528 | { BTS_GPRS_EGPRS, "egprs" }, |
| 529 | { 0, NULL } |
| 530 | }; |
| 531 | |
| 532 | enum bts_gprs_mode bts_gprs_mode_parse(const char *arg) |
| 533 | { |
| 534 | return get_string_value(bts_gprs_mode_names, arg); |
| 535 | } |
| 536 | |
| 537 | const char *bts_gprs_mode_name(enum bts_gprs_mode mode) |
| 538 | { |
| 539 | return get_value_string(bts_gprs_mode_names, mode); |
| 540 | } |
| 541 | |
Harald Welte | d12b0fd | 2009-12-15 21:36:05 +0100 | [diff] [blame] | 542 | struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) |
| 543 | { |
| 544 | struct gsm_meas_rep *meas_rep; |
| 545 | |
| 546 | meas_rep = &lchan->meas_rep[lchan->meas_rep_idx]; |
| 547 | memset(meas_rep, 0, sizeof(*meas_rep)); |
| 548 | meas_rep->lchan = lchan; |
| 549 | lchan->meas_rep_idx = (lchan->meas_rep_idx + 1) |
| 550 | % ARRAY_SIZE(lchan->meas_rep); |
| 551 | |
| 552 | return meas_rep; |
| 553 | } |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 554 | |
Harald Welte | f3d8e92 | 2010-06-14 22:44:42 +0200 | [diff] [blame] | 555 | int gsm_btsmodel_set_feature(struct gsm_bts_model *bts, enum gsm_bts_features feat) |
| 556 | { |
| 557 | return bitvec_set_bit_pos(&bts->features, feat, 1); |
| 558 | } |
| 559 | |
| 560 | int gsm_bts_has_feature(struct gsm_bts *bts, enum gsm_bts_features feat) |
| 561 | { |
| 562 | return bitvec_get_bit_pos(&bts->model->features, feat); |
| 563 | } |
| 564 | |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 565 | int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 566 | { |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 567 | struct gsm_bts_model *model; |
| 568 | |
| 569 | model = bts_model_find(type); |
| 570 | if (!model) |
| 571 | return -EINVAL; |
| 572 | |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 573 | bts->type = type; |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 574 | bts->model = model; |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 575 | |
| 576 | switch (bts->type) { |
Harald Welte | fd355a3 | 2011-03-04 13:41:31 +0100 | [diff] [blame] | 577 | case GSM_BTS_TYPE_HSL_FEMTO: |
| 578 | bts->c0->rsl_tei = 0; |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 579 | case GSM_BTS_TYPE_NANOBTS: |
| 580 | /* Set the default OML Stream ID to 0xff */ |
| 581 | bts->oml_tei = 0xff; |
| 582 | bts->c0->nominal_power = 23; |
| 583 | break; |
| 584 | case GSM_BTS_TYPE_BS11: |
Holger Hans Peter Freyther | 6fc8791 | 2010-05-14 02:53:22 +0800 | [diff] [blame] | 585 | case GSM_BTS_TYPE_UNKNOWN: |
| 586 | break; |
Harald Welte | a8e6a65 | 2011-02-13 22:13:28 +0100 | [diff] [blame] | 587 | case GSM_BTS_TYPE_RBS2000: |
| 588 | INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups); |
Harald Welte | a02085d | 2011-02-13 22:45:02 +0100 | [diff] [blame] | 589 | INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups); |
Harald Welte | a8e6a65 | 2011-02-13 22:13:28 +0100 | [diff] [blame] | 590 | break; |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 591 | } |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 592 | |
| 593 | return 0; |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 594 | } |