Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1 | /* OpenBSC interface to quagga VTY */ |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2 | /* (C) 2009-2010 by Harald Welte <laforge@gnumonks.org> |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 3 | * All Rights Reserved |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 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 |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include <stdlib.h> |
| 22 | #include <unistd.h> |
| 23 | #include <sys/types.h> |
| 24 | |
| 25 | #include <vty/command.h> |
Harald Welte | 684b975 | 2009-08-09 15:13:54 +0200 | [diff] [blame] | 26 | #include <vty/buffer.h> |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 27 | #include <vty/vty.h> |
| 28 | |
| 29 | #include <arpa/inet.h> |
| 30 | |
Harald Welte | f4625b1 | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 31 | #include <osmocore/linuxlist.h> |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 32 | #include <openbsc/gsm_data.h> |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 33 | #include <openbsc/e1_input.h> |
| 34 | #include <openbsc/abis_nm.h> |
Harald Welte | f4625b1 | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 35 | #include <osmocore/gsm_utils.h> |
Harald Welte | fe96f38 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 36 | #include <openbsc/chan_alloc.h> |
Harald Welte | 4400774 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 37 | #include <openbsc/meas_rep.h> |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 38 | #include <openbsc/db.h> |
Harald Welte | f4625b1 | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 39 | #include <osmocore/talloc.h> |
Holger Hans Peter Freyther | c8d862e | 2009-12-22 22:32:51 +0100 | [diff] [blame] | 40 | #include <openbsc/telnet_interface.h> |
Holger Hans Peter Freyther | b70d45b | 2010-04-06 11:55:37 +0200 | [diff] [blame] | 41 | #include <openbsc/vty.h> |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 42 | |
| 43 | static struct gsm_network *gsmnet; |
| 44 | |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 45 | struct cmd_node net_node = { |
| 46 | GSMNET_NODE, |
| 47 | "%s(network)#", |
| 48 | 1, |
| 49 | }; |
| 50 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 51 | struct cmd_node bts_node = { |
| 52 | BTS_NODE, |
| 53 | "%s(bts)#", |
| 54 | 1, |
| 55 | }; |
| 56 | |
| 57 | struct cmd_node trx_node = { |
| 58 | TRX_NODE, |
| 59 | "%s(trx)#", |
| 60 | 1, |
| 61 | }; |
| 62 | |
| 63 | struct cmd_node ts_node = { |
| 64 | TS_NODE, |
| 65 | "%s(ts)#", |
| 66 | 1, |
| 67 | }; |
| 68 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 69 | static int dummy_config_write(struct vty *v) |
| 70 | { |
| 71 | return CMD_SUCCESS; |
| 72 | } |
| 73 | |
| 74 | static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms) |
| 75 | { |
| 76 | vty_out(vty,"Oper '%s', Admin %u, Avail '%s'%s", |
| 77 | nm_opstate_name(nms->operational), nms->administrative, |
| 78 | nm_avail_name(nms->availability), VTY_NEWLINE); |
| 79 | } |
| 80 | |
Harald Welte | fe96f38 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 81 | static void dump_pchan_load_vty(struct vty *vty, char *prefix, |
| 82 | const struct pchan_load *pl) |
| 83 | { |
| 84 | int i; |
| 85 | |
| 86 | for (i = 0; i < ARRAY_SIZE(pl->pchan); i++) { |
| 87 | const struct load_counter *lc = &pl->pchan[i]; |
| 88 | unsigned int percent; |
| 89 | |
| 90 | if (lc->total == 0) |
| 91 | continue; |
| 92 | |
| 93 | percent = (lc->used * 100) / lc->total; |
| 94 | |
| 95 | vty_out(vty, "%s%20s: %3u%% (%u/%u)%s", prefix, |
| 96 | gsm_pchan_name(i), percent, lc->used, lc->total, |
| 97 | VTY_NEWLINE); |
| 98 | } |
| 99 | } |
| 100 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 101 | static void net_dump_vty(struct vty *vty, struct gsm_network *net) |
| 102 | { |
Harald Welte | fe96f38 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 103 | struct pchan_load pl; |
| 104 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 105 | vty_out(vty, "BSC is on Country Code %u, Network Code %u " |
| 106 | "and has %u BTS%s", net->country_code, net->network_code, |
| 107 | net->num_bts, VTY_NEWLINE); |
| 108 | vty_out(vty, " Long network name: '%s'%s", |
| 109 | net->name_long, VTY_NEWLINE); |
| 110 | vty_out(vty, " Short network name: '%s'%s", |
| 111 | net->name_short, VTY_NEWLINE); |
Harald Welte (local) | a59a27e | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 112 | vty_out(vty, " Authentication policy: %s%s", |
| 113 | gsm_auth_policy_name(net->auth_policy), VTY_NEWLINE); |
Harald Welte | 59936d7 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 114 | vty_out(vty, " Location updating reject cause: %u%s", |
| 115 | net->reject_cause, VTY_NEWLINE); |
Harald Welte | cca253a | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 116 | vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption, |
| 117 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 96c8982 | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 118 | vty_out(vty, " NECI (TCH/H): %u%s", net->neci, |
| 119 | VTY_NEWLINE); |
Harald Welte | 52af195 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 120 | vty_out(vty, " RRLP Mode: %s%s", rrlp_mode_name(net->rrlp.mode), |
| 121 | VTY_NEWLINE); |
Harald Welte | a310f3e | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 122 | vty_out(vty, " MM Info: %s%s", net->send_mm_info ? "On" : "Off", |
| 123 | VTY_NEWLINE); |
Harald Welte | 0af9c9f | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 124 | vty_out(vty, " Handover: %s%s", net->handover.active ? "On" : "Off", |
| 125 | VTY_NEWLINE); |
Harald Welte | fe96f38 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 126 | network_chan_load(&pl, net); |
| 127 | vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); |
| 128 | dump_pchan_load_vty(vty, " ", &pl); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | DEFUN(show_net, show_net_cmd, "show network", |
| 132 | SHOW_STR "Display information about a GSM NETWORK\n") |
| 133 | { |
| 134 | struct gsm_network *net = gsmnet; |
| 135 | net_dump_vty(vty, net); |
| 136 | |
| 137 | return CMD_SUCCESS; |
| 138 | } |
| 139 | |
| 140 | static void e1isl_dump_vty(struct vty *vty, struct e1inp_sign_link *e1l) |
| 141 | { |
| 142 | struct e1inp_line *line; |
| 143 | |
| 144 | if (!e1l) { |
| 145 | vty_out(vty, " None%s", VTY_NEWLINE); |
| 146 | return; |
| 147 | } |
| 148 | |
| 149 | line = e1l->ts->line; |
| 150 | |
| 151 | vty_out(vty, " E1 Line %u, Type %s: Timeslot %u, Mode %s%s", |
| 152 | line->num, line->driver->name, e1l->ts->num, |
| 153 | e1inp_signtype_name(e1l->type), VTY_NEWLINE); |
| 154 | vty_out(vty, " E1 TEI %u, SAPI %u%s", |
| 155 | e1l->tei, e1l->sapi, VTY_NEWLINE); |
| 156 | } |
| 157 | |
| 158 | static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) |
| 159 | { |
Harald Welte | fe96f38 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 160 | struct pchan_load pl; |
| 161 | |
Holger Hans Peter Freyther | a098dfb | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 162 | vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 163 | "BSIC %u, TSC %u and %u TRX%s", |
| 164 | bts->nr, btstype2str(bts->type), gsm_band_name(bts->band), |
Holger Hans Peter Freyther | a098dfb | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 165 | bts->cell_identity, |
Holger Hans Peter Freyther | 7113514 | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 166 | bts->location_area_code, bts->bsic, bts->tsc, |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 167 | bts->num_trx, VTY_NEWLINE); |
Harald Welte | 8e9d179 | 2009-12-12 15:38:16 +0100 | [diff] [blame] | 168 | vty_out(vty, "MS Max power: %u dBm%s", bts->ms_max_power, VTY_NEWLINE); |
Harald Welte | b761bf8 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 169 | vty_out(vty, "Minimum Rx Level for Access: %i dBm%s", |
Harald Welte | 8e9d179 | 2009-12-12 15:38:16 +0100 | [diff] [blame] | 170 | rxlev2dbm(bts->si_common.cell_sel_par.rxlev_acc_min), |
| 171 | VTY_NEWLINE); |
| 172 | vty_out(vty, "Cell Reselection Hysteresis: %u dBm%s", |
Harald Welte | b761bf8 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 173 | bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); |
Sylvain Munaut | 8e2d8de | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 174 | vty_out(vty, "RACH TX-Integer: %u%s", bts->si_common.rach_control.tx_integer, |
| 175 | VTY_NEWLINE); |
| 176 | vty_out(vty, "RACH Max transmissions: %u%s", |
| 177 | rach_max_trans_raw2val(bts->si_common.rach_control.max_trans), |
| 178 | VTY_NEWLINE); |
Harald Welte | 8c973ba | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 179 | if (bts->si_common.rach_control.cell_bar) |
Harald Welte (local) | e19be3f | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 180 | vty_out(vty, " CELL IS BARRED%s", VTY_NEWLINE); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 181 | if (is_ipaccess_bts(bts)) |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 182 | vty_out(vty, " Unit ID: %u/%u/0, OML Stream ID 0x%02x%s", |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 183 | bts->ip_access.site_id, bts->ip_access.bts_id, |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 184 | bts->oml_tei, VTY_NEWLINE); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 185 | vty_out(vty, " NM State: "); |
| 186 | net_dump_nmstate(vty, &bts->nm_state); |
| 187 | vty_out(vty, " Site Mgr NM State: "); |
| 188 | net_dump_nmstate(vty, &bts->site_mgr.nm_state); |
| 189 | vty_out(vty, " Paging: FIXME pending requests, %u free slots%s", |
| 190 | bts->paging.available_slots, VTY_NEWLINE); |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 191 | if (!is_ipaccess_bts(bts)) { |
| 192 | vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); |
| 193 | e1isl_dump_vty(vty, bts->oml_link); |
| 194 | } |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 195 | /* FIXME: oml_link, chan_desc */ |
Harald Welte | fe96f38 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 196 | memset(&pl, 0, sizeof(pl)); |
| 197 | bts_chan_load(&pl, bts); |
| 198 | vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); |
| 199 | dump_pchan_load_vty(vty, " ", &pl); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | DEFUN(show_bts, show_bts_cmd, "show bts [number]", |
| 203 | SHOW_STR "Display information about a BTS\n" |
| 204 | "BTS number") |
| 205 | { |
| 206 | struct gsm_network *net = gsmnet; |
| 207 | int bts_nr; |
| 208 | |
| 209 | if (argc != 0) { |
| 210 | /* use the BTS number that the user has specified */ |
| 211 | bts_nr = atoi(argv[0]); |
| 212 | if (bts_nr > net->num_bts) { |
| 213 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
| 214 | VTY_NEWLINE); |
| 215 | return CMD_WARNING; |
| 216 | } |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 217 | bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 218 | return CMD_SUCCESS; |
| 219 | } |
| 220 | /* print all BTS's */ |
| 221 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 222 | bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 223 | |
| 224 | return CMD_SUCCESS; |
| 225 | } |
| 226 | |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 227 | /* utility functions */ |
| 228 | static void parse_e1_link(struct gsm_e1_subslot *e1_link, const char *line, |
| 229 | const char *ts, const char *ss) |
| 230 | { |
| 231 | e1_link->e1_nr = atoi(line); |
| 232 | e1_link->e1_ts = atoi(ts); |
| 233 | if (!strcmp(ss, "full")) |
| 234 | e1_link->e1_ts_ss = 255; |
| 235 | else |
| 236 | e1_link->e1_ts_ss = atoi(ss); |
| 237 | } |
| 238 | |
| 239 | static void config_write_e1_link(struct vty *vty, struct gsm_e1_subslot *e1_link, |
| 240 | const char *prefix) |
| 241 | { |
| 242 | if (!e1_link->e1_ts) |
| 243 | return; |
| 244 | |
| 245 | if (e1_link->e1_ts_ss == 255) |
| 246 | vty_out(vty, "%se1 line %u timeslot %u sub-slot full%s", |
| 247 | prefix, e1_link->e1_nr, e1_link->e1_ts, VTY_NEWLINE); |
| 248 | else |
| 249 | vty_out(vty, "%se1 line %u timeslot %u sub-slot %u%s", |
| 250 | prefix, e1_link->e1_nr, e1_link->e1_ts, |
| 251 | e1_link->e1_ts_ss, VTY_NEWLINE); |
| 252 | } |
| 253 | |
| 254 | |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 255 | static void config_write_ts_single(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 256 | { |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 257 | vty_out(vty, " timeslot %u%s", ts->nr, VTY_NEWLINE); |
| 258 | if (ts->pchan != GSM_PCHAN_NONE) |
| 259 | vty_out(vty, " phys_chan_config %s%s", |
| 260 | gsm_pchan_name(ts->pchan), VTY_NEWLINE); |
| 261 | config_write_e1_link(vty, &ts->e1_link, " "); |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | static void config_write_trx_single(struct vty *vty, struct gsm_bts_trx *trx) |
| 265 | { |
| 266 | int i; |
| 267 | |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 268 | vty_out(vty, " trx %u%s", trx->nr, VTY_NEWLINE); |
Holger Hans Peter Freyther | 32be2aa | 2010-04-17 06:42:07 +0200 | [diff] [blame] | 269 | vty_out(vty, " rf_locked %u%s", |
| 270 | trx->nm_state.administrative == NM_STATE_LOCKED ? 1 : 0, |
| 271 | VTY_NEWLINE); |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 272 | vty_out(vty, " arfcn %u%s", trx->arfcn, VTY_NEWLINE); |
Harald Welte (local) | b709bfe | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 273 | vty_out(vty, " nominal power %u%s", trx->nominal_power, VTY_NEWLINE); |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 274 | vty_out(vty, " max_power_red %u%s", trx->max_power_red, VTY_NEWLINE); |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 275 | config_write_e1_link(vty, &trx->rsl_e1_link, " rsl "); |
| 276 | vty_out(vty, " rsl e1 tei %u%s", trx->rsl_tei, VTY_NEWLINE); |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 277 | |
| 278 | for (i = 0; i < TRX_NR_TS; i++) |
| 279 | config_write_ts_single(vty, &trx->ts[i]); |
| 280 | } |
| 281 | |
| 282 | static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) |
| 283 | { |
| 284 | struct gsm_bts_trx *trx; |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 285 | int i; |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 286 | |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 287 | vty_out(vty, " bts %u%s", bts->nr, VTY_NEWLINE); |
| 288 | vty_out(vty, " type %s%s", btstype2str(bts->type), VTY_NEWLINE); |
| 289 | vty_out(vty, " band %s%s", gsm_band_name(bts->band), VTY_NEWLINE); |
Holger Hans Peter Freyther | 6d82b7c | 2009-11-19 16:38:49 +0100 | [diff] [blame] | 290 | vty_out(vty, " cell_identity %u%s", bts->cell_identity, VTY_NEWLINE); |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 291 | vty_out(vty, " location_area_code %u%s", bts->location_area_code, |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 292 | VTY_NEWLINE); |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 293 | vty_out(vty, " training_sequence_code %u%s", bts->tsc, VTY_NEWLINE); |
| 294 | vty_out(vty, " base_station_id_code %u%s", bts->bsic, VTY_NEWLINE); |
Harald Welte (local) | cbd4610 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 295 | vty_out(vty, " ms max power %u%s", bts->ms_max_power, VTY_NEWLINE); |
Harald Welte | b761bf8 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 296 | vty_out(vty, " cell reselection hysteresis %u%s", |
| 297 | bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); |
| 298 | vty_out(vty, " rxlev access min %u%s", |
| 299 | bts->si_common.cell_sel_par.rxlev_acc_min, VTY_NEWLINE); |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 300 | if (bts->si_common.chan_desc.t3212) |
Harald Welte (local) | b6ea7f7 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 301 | vty_out(vty, " periodic location update %u%s", |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 302 | bts->si_common.chan_desc.t3212 * 10, VTY_NEWLINE); |
Harald Welte | 3e77461 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 303 | vty_out(vty, " channel allocator %s%s", |
| 304 | bts->chan_alloc_reverse ? "descending" : "ascending", |
| 305 | VTY_NEWLINE); |
Sylvain Munaut | 8e2d8de | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 306 | vty_out(vty, " rach tx integer %u%s", |
| 307 | bts->si_common.rach_control.tx_integer, VTY_NEWLINE); |
| 308 | vty_out(vty, " rach max transmission %u%s", |
| 309 | rach_max_trans_raw2val(bts->si_common.rach_control.max_trans), |
| 310 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 697ed2b | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 311 | |
| 312 | if (bts->rach_b_thresh != -1) |
| 313 | vty_out(vty, " rach nm busy threshold %u%s", |
| 314 | bts->rach_b_thresh, VTY_NEWLINE); |
| 315 | if (bts->rach_ldavg_slots != -1) |
| 316 | vty_out(vty, " rach nm load average %u%s", |
| 317 | bts->rach_ldavg_slots, VTY_NEWLINE); |
Harald Welte | 8c973ba | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 318 | if (bts->si_common.rach_control.cell_bar) |
Harald Welte (local) | e19be3f | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 319 | vty_out(vty, " cell barred 1%s", VTY_NEWLINE); |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 320 | if (is_ipaccess_bts(bts)) { |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 321 | vty_out(vty, " ip.access unit_id %u %u%s", |
Harald Welte | 3ffe1b3 | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 322 | bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE); |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 323 | vty_out(vty, " oml ip.access stream_id %u%s", bts->oml_tei, VTY_NEWLINE); |
| 324 | } else { |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 325 | config_write_e1_link(vty, &bts->oml_e1_link, " oml "); |
| 326 | vty_out(vty, " oml e1 tei %u%s", bts->oml_tei, VTY_NEWLINE); |
| 327 | } |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 328 | vty_out(vty, " gprs mode %s%s", bts_gprs_mode_name(bts->gprs.mode), |
| 329 | VTY_NEWLINE); |
| 330 | if (bts->gprs.mode != BTS_GPRS_NONE) { |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 331 | vty_out(vty, " gprs routing area %u%s", bts->gprs.rac, |
| 332 | VTY_NEWLINE); |
| 333 | vty_out(vty, " gprs cell bvci %u%s", bts->gprs.cell.bvci, |
| 334 | VTY_NEWLINE); |
Harald Welte | 4a048c5 | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 335 | vty_out(vty, " gprs nsei %u%s", bts->gprs.nse.nsei, |
| 336 | VTY_NEWLINE); |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 337 | for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { |
| 338 | struct gsm_bts_gprs_nsvc *nsvc = |
| 339 | &bts->gprs.nsvc[i]; |
| 340 | struct in_addr ia; |
| 341 | |
| 342 | ia.s_addr = htonl(nsvc->remote_ip); |
| 343 | vty_out(vty, " gprs nsvc %u nsvci %u%s", i, |
| 344 | nsvc->nsvci, VTY_NEWLINE); |
| 345 | vty_out(vty, " gprs nsvc %u local udp port %u%s", i, |
| 346 | nsvc->local_port, VTY_NEWLINE); |
| 347 | vty_out(vty, " gprs nsvc %u remote udp port %u%s", i, |
| 348 | nsvc->remote_port, VTY_NEWLINE); |
| 349 | vty_out(vty, " gprs nsvc %u remote ip %s%s", i, |
| 350 | inet_ntoa(ia), VTY_NEWLINE); |
| 351 | } |
| 352 | } |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 353 | |
| 354 | llist_for_each_entry(trx, &bts->trx_list, list) |
| 355 | config_write_trx_single(vty, trx); |
| 356 | } |
| 357 | |
| 358 | static int config_write_bts(struct vty *v) |
| 359 | { |
| 360 | struct gsm_bts *bts; |
| 361 | |
| 362 | llist_for_each_entry(bts, &gsmnet->bts_list, list) |
| 363 | config_write_bts_single(v, bts); |
| 364 | |
| 365 | return CMD_SUCCESS; |
| 366 | } |
| 367 | |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 368 | static int config_write_net(struct vty *vty) |
| 369 | { |
| 370 | vty_out(vty, "network%s", VTY_NEWLINE); |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 371 | vty_out(vty, " network country code %u%s", gsmnet->country_code, VTY_NEWLINE); |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 372 | vty_out(vty, " mobile network code %u%s", gsmnet->network_code, VTY_NEWLINE); |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 373 | vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE); |
| 374 | vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE); |
Harald Welte (local) | a59a27e | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 375 | vty_out(vty, " auth policy %s%s", gsm_auth_policy_name(gsmnet->auth_policy), VTY_NEWLINE); |
Harald Welte | 59936d7 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 376 | vty_out(vty, " location updating reject cause %u%s", |
| 377 | gsmnet->reject_cause, VTY_NEWLINE); |
Harald Welte | cca253a | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 378 | vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE); |
Holger Hans Peter Freyther | 6b4f546 | 2009-11-19 16:37:48 +0100 | [diff] [blame] | 379 | vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); |
Harald Welte | 52af195 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 380 | vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode), |
| 381 | VTY_NEWLINE); |
Harald Welte | a310f3e | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 382 | vty_out(vty, " mm info %u%s", gsmnet->send_mm_info, VTY_NEWLINE); |
Harald Welte | 0af9c9f | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 383 | vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE); |
Harald Welte | a8062f1 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 384 | vty_out(vty, " handover window rxlev averaging %u%s", |
| 385 | gsmnet->handover.win_rxlev_avg, VTY_NEWLINE); |
| 386 | vty_out(vty, " handover window rxqual averaging %u%s", |
| 387 | gsmnet->handover.win_rxqual_avg, VTY_NEWLINE); |
| 388 | vty_out(vty, " handover window rxlev neighbor averaging %u%s", |
| 389 | gsmnet->handover.win_rxlev_avg_neigh, VTY_NEWLINE); |
| 390 | vty_out(vty, " handover power budget interval %u%s", |
| 391 | gsmnet->handover.pwr_interval, VTY_NEWLINE); |
| 392 | vty_out(vty, " handover power budget hysteresis %u%s", |
| 393 | gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); |
| 394 | vty_out(vty, " handover maximum distance %u%s", |
| 395 | gsmnet->handover.max_distance, VTY_NEWLINE); |
Holger Hans Peter Freyther | 26ba2e7 | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 396 | vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE); |
Holger Hans Peter Freyther | 8973386 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 397 | vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); |
| 398 | vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); |
| 399 | vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); |
| 400 | vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); |
| 401 | vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); |
| 402 | vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); |
| 403 | vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); |
| 404 | vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); |
| 405 | vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); |
| 406 | vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 407 | |
| 408 | return CMD_SUCCESS; |
| 409 | } |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 410 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 411 | static void trx_dump_vty(struct vty *vty, struct gsm_bts_trx *trx) |
| 412 | { |
| 413 | vty_out(vty, "TRX %u of BTS %u is on ARFCN %u%s", |
| 414 | trx->nr, trx->bts->nr, trx->arfcn, VTY_NEWLINE); |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 415 | vty_out(vty, " RF Nominal Power: %d dBm, reduced by %u dB, " |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 416 | "resulting BS power: %d dBm%s", |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 417 | trx->nominal_power, trx->max_power_red, |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 418 | trx->nominal_power - trx->max_power_red, VTY_NEWLINE); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 419 | vty_out(vty, " NM State: "); |
| 420 | net_dump_nmstate(vty, &trx->nm_state); |
| 421 | vty_out(vty, " Baseband Transceiver NM State: "); |
| 422 | net_dump_nmstate(vty, &trx->bb_transc.nm_state); |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 423 | if (is_ipaccess_bts(trx->bts)) { |
| 424 | vty_out(vty, " ip.access stream ID: 0x%02x%s", |
| 425 | trx->rsl_tei, VTY_NEWLINE); |
| 426 | } else { |
| 427 | vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); |
| 428 | e1isl_dump_vty(vty, trx->rsl_link); |
| 429 | } |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 430 | } |
| 431 | |
| 432 | DEFUN(show_trx, |
| 433 | show_trx_cmd, |
| 434 | "show trx [bts_nr] [trx_nr]", |
| 435 | SHOW_STR "Display information about a TRX\n") |
| 436 | { |
| 437 | struct gsm_network *net = gsmnet; |
| 438 | struct gsm_bts *bts = NULL; |
| 439 | struct gsm_bts_trx *trx; |
| 440 | int bts_nr, trx_nr; |
| 441 | |
| 442 | if (argc >= 1) { |
| 443 | /* use the BTS number that the user has specified */ |
| 444 | bts_nr = atoi(argv[0]); |
| 445 | if (bts_nr >= net->num_bts) { |
| 446 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
| 447 | VTY_NEWLINE); |
| 448 | return CMD_WARNING; |
| 449 | } |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 450 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 451 | } |
| 452 | if (argc >= 2) { |
| 453 | trx_nr = atoi(argv[1]); |
| 454 | if (trx_nr >= bts->num_trx) { |
| 455 | vty_out(vty, "%% can't find TRX '%s'%s", argv[1], |
| 456 | VTY_NEWLINE); |
| 457 | return CMD_WARNING; |
| 458 | } |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 459 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 460 | trx_dump_vty(vty, trx); |
| 461 | return CMD_SUCCESS; |
| 462 | } |
| 463 | if (bts) { |
| 464 | /* print all TRX in this BTS */ |
| 465 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 466 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 467 | trx_dump_vty(vty, trx); |
| 468 | } |
| 469 | return CMD_SUCCESS; |
| 470 | } |
| 471 | |
| 472 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 473 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 474 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 475 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 476 | trx_dump_vty(vty, trx); |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | return CMD_SUCCESS; |
| 481 | } |
| 482 | |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 483 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 484 | static void ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 485 | { |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 486 | vty_out(vty, "Timeslot %u of TRX %u in BTS %u, phys cfg %s%s", |
| 487 | ts->nr, ts->trx->nr, ts->trx->bts->nr, |
| 488 | gsm_pchan_name(ts->pchan), VTY_NEWLINE); |
| 489 | vty_out(vty, " NM State: "); |
| 490 | net_dump_nmstate(vty, &ts->nm_state); |
Harald Welte | 8750421 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 491 | if (!is_ipaccess_bts(ts->trx->bts)) |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 492 | vty_out(vty, " E1 Line %u, Timeslot %u, Subslot %u%s", |
| 493 | ts->e1_link.e1_nr, ts->e1_link.e1_ts, |
| 494 | ts->e1_link.e1_ts_ss, VTY_NEWLINE); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 495 | } |
| 496 | |
| 497 | DEFUN(show_ts, |
| 498 | show_ts_cmd, |
| 499 | "show timeslot [bts_nr] [trx_nr] [ts_nr]", |
| 500 | SHOW_STR "Display information about a TS\n") |
| 501 | { |
| 502 | struct gsm_network *net = gsmnet; |
| 503 | struct gsm_bts *bts; |
| 504 | struct gsm_bts_trx *trx; |
| 505 | struct gsm_bts_trx_ts *ts; |
| 506 | int bts_nr, trx_nr, ts_nr; |
| 507 | |
| 508 | if (argc >= 1) { |
| 509 | /* use the BTS number that the user has specified */ |
| 510 | bts_nr = atoi(argv[0]); |
| 511 | if (bts_nr >= net->num_bts) { |
| 512 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
| 513 | VTY_NEWLINE); |
| 514 | return CMD_WARNING; |
| 515 | } |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 516 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 517 | } |
| 518 | if (argc >= 2) { |
| 519 | trx_nr = atoi(argv[1]); |
| 520 | if (trx_nr >= bts->num_trx) { |
| 521 | vty_out(vty, "%% can't find TRX '%s'%s", argv[1], |
| 522 | VTY_NEWLINE); |
| 523 | return CMD_WARNING; |
| 524 | } |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 525 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 526 | } |
| 527 | if (argc >= 3) { |
| 528 | ts_nr = atoi(argv[2]); |
| 529 | if (ts_nr >= TRX_NR_TS) { |
| 530 | vty_out(vty, "%% can't find TS '%s'%s", argv[2], |
| 531 | VTY_NEWLINE); |
| 532 | return CMD_WARNING; |
| 533 | } |
| 534 | ts = &trx->ts[ts_nr]; |
| 535 | ts_dump_vty(vty, ts); |
| 536 | return CMD_SUCCESS; |
| 537 | } |
| 538 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 539 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 540 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 541 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 542 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 543 | ts = &trx->ts[ts_nr]; |
| 544 | ts_dump_vty(vty, ts); |
| 545 | } |
| 546 | } |
| 547 | } |
| 548 | |
| 549 | return CMD_SUCCESS; |
| 550 | } |
| 551 | |
Holger Hans Peter Freyther | 1dd0a1b | 2010-01-06 06:00:40 +0100 | [diff] [blame] | 552 | static void subscr_dump_vty(struct vty *vty, struct gsm_subscriber *subscr) |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 553 | { |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 554 | vty_out(vty, " ID: %llu, Authorized: %d%s", subscr->id, |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 555 | subscr->authorized, VTY_NEWLINE); |
| 556 | if (subscr->name) |
| 557 | vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE); |
| 558 | if (subscr->extension) |
| 559 | vty_out(vty, " Extension: %s%s", subscr->extension, |
| 560 | VTY_NEWLINE); |
| 561 | if (subscr->imsi) |
| 562 | vty_out(vty, " IMSI: %s%s", subscr->imsi, VTY_NEWLINE); |
Holger Hans Peter Freyther | cd8bacf | 2009-08-19 12:53:57 +0200 | [diff] [blame] | 563 | if (subscr->tmsi != GSM_RESERVED_TMSI) |
| 564 | vty_out(vty, " TMSI: %08X%s", subscr->tmsi, |
Harald Welte | 270c06c | 2009-08-15 03:24:51 +0200 | [diff] [blame] | 565 | VTY_NEWLINE); |
Sylvain Munaut | e5863a2 | 2009-12-27 19:29:28 +0100 | [diff] [blame] | 566 | |
Harald Welte (local) | 02d5efa | 2009-08-14 20:27:16 +0200 | [diff] [blame] | 567 | vty_out(vty, " Use count: %u%s", subscr->use_count, VTY_NEWLINE); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 568 | } |
| 569 | |
Harald Welte | 4400774 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 570 | static void meas_rep_dump_uni_vty(struct vty *vty, |
| 571 | struct gsm_meas_rep_unidir *mru, |
| 572 | const char *prefix, |
| 573 | const char *dir) |
| 574 | { |
| 575 | vty_out(vty, "%s RXL-FULL-%s: %4d dBm, RXL-SUB-%s: %4d dBm ", |
| 576 | prefix, dir, rxlev2dbm(mru->full.rx_lev), |
| 577 | dir, rxlev2dbm(mru->sub.rx_lev)); |
| 578 | vty_out(vty, "RXQ-FULL-%s: %d, RXQ-SUB-%s: %d%s", |
| 579 | dir, mru->full.rx_qual, dir, mru->sub.rx_qual, |
| 580 | VTY_NEWLINE); |
| 581 | } |
| 582 | |
| 583 | static void meas_rep_dump_vty(struct vty *vty, struct gsm_meas_rep *mr, |
| 584 | const char *prefix) |
| 585 | { |
| 586 | vty_out(vty, "%sMeasurement Report:%s", prefix, VTY_NEWLINE); |
| 587 | vty_out(vty, "%s Flags: %s%s%s%s%s", prefix, |
| 588 | mr->flags & MEAS_REP_F_UL_DTX ? "DTXu " : "", |
| 589 | mr->flags & MEAS_REP_F_DL_DTX ? "DTXd " : "", |
| 590 | mr->flags & MEAS_REP_F_FPC ? "FPC " : "", |
| 591 | mr->flags & MEAS_REP_F_DL_VALID ? " " : "DLinval ", |
| 592 | VTY_NEWLINE); |
| 593 | if (mr->flags & MEAS_REP_F_MS_TO) |
| 594 | vty_out(vty, "%s MS Timing Offset: %u%s", prefix, |
| 595 | mr->ms_timing_offset, VTY_NEWLINE); |
| 596 | if (mr->flags & MEAS_REP_F_MS_L1) |
| 597 | vty_out(vty, "%s L1 MS Power: %u dBm, Timing Advance: %u%s", |
| 598 | prefix, mr->ms_l1.pwr, mr->ms_l1.ta, VTY_NEWLINE); |
| 599 | if (mr->flags & MEAS_REP_F_DL_VALID) |
| 600 | meas_rep_dump_uni_vty(vty, &mr->dl, prefix, "dl"); |
| 601 | meas_rep_dump_uni_vty(vty, &mr->ul, prefix, "ul"); |
| 602 | } |
| 603 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 604 | static void lchan_dump_vty(struct vty *vty, struct gsm_lchan *lchan) |
| 605 | { |
Harald Welte | 4400774 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 606 | int idx; |
| 607 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 608 | vty_out(vty, "Lchan %u in Timeslot %u of TRX %u in BTS %u, Type %s%s", |
Holger Hans Peter Freyther | 7113514 | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 609 | lchan->nr, lchan->ts->nr, lchan->ts->trx->nr, |
Harald Welte (local) | 02204d0 | 2009-12-27 18:05:25 +0100 | [diff] [blame] | 610 | lchan->ts->trx->bts->nr, gsm_lchant_name(lchan->type), |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 611 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 065b811 | 2010-03-23 06:41:45 +0100 | [diff] [blame] | 612 | vty_out(vty, " Use Count: %u, State: %s%s", lchan->conn.use_count, |
Harald Welte | ab2534c | 2009-12-29 10:52:38 +0100 | [diff] [blame] | 613 | gsm_lchans_name(lchan->state), VTY_NEWLINE); |
Harald Welte | b761bf8 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 614 | vty_out(vty, " BS Power: %u dBm, MS Power: %u dBm%s", |
| 615 | lchan->ts->trx->nominal_power - lchan->ts->trx->max_power_red |
| 616 | - lchan->bs_power*2, |
| 617 | ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), |
| 618 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 065b811 | 2010-03-23 06:41:45 +0100 | [diff] [blame] | 619 | if (lchan->conn.subscr) { |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 620 | vty_out(vty, " Subscriber:%s", VTY_NEWLINE); |
Holger Hans Peter Freyther | 065b811 | 2010-03-23 06:41:45 +0100 | [diff] [blame] | 621 | subscr_dump_vty(vty, lchan->conn.subscr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 622 | } else |
| 623 | vty_out(vty, " No Subscriber%s", VTY_NEWLINE); |
Harald Welte | 8750421 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 624 | if (is_ipaccess_bts(lchan->ts->trx->bts)) { |
| 625 | struct in_addr ia; |
Holger Hans Peter Freyther | cec1ec5 | 2010-04-07 15:39:16 +0200 | [diff] [blame] | 626 | ia.s_addr = htonl(lchan->abis_ip.bound_ip); |
Harald Welte | 8750421 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 627 | vty_out(vty, " Bound IP: %s Port %u RTP_TYPE2=%u CONN_ID=%u%s", |
| 628 | inet_ntoa(ia), lchan->abis_ip.bound_port, |
| 629 | lchan->abis_ip.rtp_payload2, lchan->abis_ip.conn_id, |
| 630 | VTY_NEWLINE); |
| 631 | } |
Harald Welte | 4400774 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 632 | |
| 633 | /* we want to report the last measurement report */ |
| 634 | idx = calc_initial_idx(ARRAY_SIZE(lchan->meas_rep), |
| 635 | lchan->meas_rep_idx, 1); |
| 636 | meas_rep_dump_vty(vty, &lchan->meas_rep[idx], " "); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 637 | } |
| 638 | |
Harald Welte | 0374084 | 2009-06-10 23:11:52 +0800 | [diff] [blame] | 639 | #if 0 |
| 640 | TODO: callref and remote callref of call must be resolved to get gsm_trans object |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 641 | static void call_dump_vty(struct vty *vty, struct gsm_call *call) |
| 642 | { |
| 643 | vty_out(vty, "Call Type %u, State %u, Transaction ID %u%s", |
| 644 | call->type, call->state, call->transaction_id, VTY_NEWLINE); |
| 645 | |
| 646 | if (call->local_lchan) { |
| 647 | vty_out(vty, "Call Local Channel:%s", VTY_NEWLINE); |
| 648 | lchan_dump_vty(vty, call->local_lchan); |
| 649 | } else |
| 650 | vty_out(vty, "Call has no Local Channel%s", VTY_NEWLINE); |
| 651 | |
| 652 | if (call->remote_lchan) { |
| 653 | vty_out(vty, "Call Remote Channel:%s", VTY_NEWLINE); |
| 654 | lchan_dump_vty(vty, call->remote_lchan); |
| 655 | } else |
| 656 | vty_out(vty, "Call has no Remote Channel%s", VTY_NEWLINE); |
| 657 | |
| 658 | if (call->called_subscr) { |
| 659 | vty_out(vty, "Called Subscriber:%s", VTY_NEWLINE); |
| 660 | subscr_dump_vty(vty, call->called_subscr); |
| 661 | } else |
| 662 | vty_out(vty, "Call has no Called Subscriber%s", VTY_NEWLINE); |
| 663 | } |
Harald Welte | 0374084 | 2009-06-10 23:11:52 +0800 | [diff] [blame] | 664 | #endif |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 665 | |
| 666 | DEFUN(show_lchan, |
| 667 | show_lchan_cmd, |
| 668 | "show lchan [bts_nr] [trx_nr] [ts_nr] [lchan_nr]", |
| 669 | SHOW_STR "Display information about a logical channel\n") |
| 670 | { |
| 671 | struct gsm_network *net = gsmnet; |
| 672 | struct gsm_bts *bts; |
| 673 | struct gsm_bts_trx *trx; |
| 674 | struct gsm_bts_trx_ts *ts; |
| 675 | struct gsm_lchan *lchan; |
| 676 | int bts_nr, trx_nr, ts_nr, lchan_nr; |
| 677 | |
| 678 | if (argc >= 1) { |
| 679 | /* use the BTS number that the user has specified */ |
| 680 | bts_nr = atoi(argv[0]); |
| 681 | if (bts_nr >= net->num_bts) { |
| 682 | vty_out(vty, "%% can't find BTS %s%s", argv[0], |
| 683 | VTY_NEWLINE); |
| 684 | return CMD_WARNING; |
| 685 | } |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 686 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 687 | } |
| 688 | if (argc >= 2) { |
| 689 | trx_nr = atoi(argv[1]); |
| 690 | if (trx_nr >= bts->num_trx) { |
| 691 | vty_out(vty, "%% can't find TRX %s%s", argv[1], |
| 692 | VTY_NEWLINE); |
| 693 | return CMD_WARNING; |
| 694 | } |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 695 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 696 | } |
| 697 | if (argc >= 3) { |
| 698 | ts_nr = atoi(argv[2]); |
| 699 | if (ts_nr >= TRX_NR_TS) { |
| 700 | vty_out(vty, "%% can't find TS %s%s", argv[2], |
| 701 | VTY_NEWLINE); |
| 702 | return CMD_WARNING; |
| 703 | } |
| 704 | ts = &trx->ts[ts_nr]; |
| 705 | } |
| 706 | if (argc >= 4) { |
| 707 | lchan_nr = atoi(argv[3]); |
| 708 | if (lchan_nr >= TS_MAX_LCHAN) { |
| 709 | vty_out(vty, "%% can't find LCHAN %s%s", argv[3], |
| 710 | VTY_NEWLINE); |
| 711 | return CMD_WARNING; |
| 712 | } |
| 713 | lchan = &ts->lchan[lchan_nr]; |
| 714 | lchan_dump_vty(vty, lchan); |
| 715 | return CMD_SUCCESS; |
| 716 | } |
| 717 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 718 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 719 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 720 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 721 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 722 | ts = &trx->ts[ts_nr]; |
| 723 | for (lchan_nr = 0; lchan_nr < TS_MAX_LCHAN; |
| 724 | lchan_nr++) { |
| 725 | lchan = &ts->lchan[lchan_nr]; |
| 726 | if (lchan->type == GSM_LCHAN_NONE) |
| 727 | continue; |
| 728 | lchan_dump_vty(vty, lchan); |
| 729 | } |
| 730 | } |
| 731 | } |
| 732 | } |
| 733 | |
| 734 | return CMD_SUCCESS; |
| 735 | } |
| 736 | |
| 737 | static void e1drv_dump_vty(struct vty *vty, struct e1inp_driver *drv) |
| 738 | { |
| 739 | vty_out(vty, "E1 Input Driver %s%s", drv->name, VTY_NEWLINE); |
| 740 | } |
| 741 | |
| 742 | DEFUN(show_e1drv, |
| 743 | show_e1drv_cmd, |
| 744 | "show e1_driver", |
| 745 | SHOW_STR "Display information about available E1 drivers\n") |
| 746 | { |
| 747 | struct e1inp_driver *drv; |
| 748 | |
| 749 | llist_for_each_entry(drv, &e1inp_driver_list, list) |
| 750 | e1drv_dump_vty(vty, drv); |
| 751 | |
| 752 | return CMD_SUCCESS; |
| 753 | } |
| 754 | |
| 755 | static void e1line_dump_vty(struct vty *vty, struct e1inp_line *line) |
| 756 | { |
| 757 | vty_out(vty, "E1 Line Number %u, Name %s, Driver %s%s", |
| 758 | line->num, line->name ? line->name : "", |
| 759 | line->driver->name, VTY_NEWLINE); |
| 760 | } |
| 761 | |
| 762 | DEFUN(show_e1line, |
| 763 | show_e1line_cmd, |
| 764 | "show e1_line [line_nr]", |
| 765 | SHOW_STR "Display information about a E1 line\n") |
| 766 | { |
| 767 | struct e1inp_line *line; |
| 768 | |
| 769 | if (argc >= 1) { |
| 770 | int num = atoi(argv[0]); |
| 771 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 772 | if (line->num == num) { |
| 773 | e1line_dump_vty(vty, line); |
| 774 | return CMD_SUCCESS; |
| 775 | } |
| 776 | } |
| 777 | return CMD_WARNING; |
| 778 | } |
| 779 | |
| 780 | llist_for_each_entry(line, &e1inp_line_list, list) |
| 781 | e1line_dump_vty(vty, line); |
| 782 | |
| 783 | return CMD_SUCCESS; |
| 784 | } |
| 785 | |
| 786 | static void e1ts_dump_vty(struct vty *vty, struct e1inp_ts *ts) |
| 787 | { |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 788 | if (ts->type == E1INP_TS_TYPE_NONE) |
| 789 | return; |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 790 | vty_out(vty, "E1 Timeslot %2u of Line %u is Type %s%s", |
| 791 | ts->num, ts->line->num, e1inp_tstype_name(ts->type), |
| 792 | VTY_NEWLINE); |
| 793 | } |
| 794 | |
| 795 | DEFUN(show_e1ts, |
| 796 | show_e1ts_cmd, |
| 797 | "show e1_timeslot [line_nr] [ts_nr]", |
| 798 | SHOW_STR "Display information about a E1 timeslot\n") |
| 799 | { |
Harald Welte | 49c7956 | 2009-11-17 06:12:16 +0100 | [diff] [blame] | 800 | struct e1inp_line *line = NULL; |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 801 | struct e1inp_ts *ts; |
| 802 | int ts_nr; |
| 803 | |
| 804 | if (argc == 0) { |
| 805 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 806 | for (ts_nr = 0; ts_nr < NUM_E1_TS; ts_nr++) { |
| 807 | ts = &line->ts[ts_nr]; |
| 808 | e1ts_dump_vty(vty, ts); |
| 809 | } |
| 810 | } |
| 811 | return CMD_SUCCESS; |
| 812 | } |
| 813 | if (argc >= 1) { |
| 814 | int num = atoi(argv[0]); |
| 815 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 816 | if (line->num == num) |
| 817 | break; |
| 818 | } |
| 819 | if (!line || line->num != num) { |
| 820 | vty_out(vty, "E1 line %s is invalid%s", |
| 821 | argv[0], VTY_NEWLINE); |
| 822 | return CMD_WARNING; |
| 823 | } |
| 824 | } |
| 825 | if (argc >= 2) { |
| 826 | ts_nr = atoi(argv[1]); |
| 827 | if (ts_nr > NUM_E1_TS) { |
| 828 | vty_out(vty, "E1 timeslot %s is invalid%s", |
| 829 | argv[1], VTY_NEWLINE); |
| 830 | return CMD_WARNING; |
| 831 | } |
| 832 | ts = &line->ts[ts_nr]; |
| 833 | e1ts_dump_vty(vty, ts); |
| 834 | return CMD_SUCCESS; |
| 835 | } else { |
| 836 | for (ts_nr = 0; ts_nr < NUM_E1_TS; ts_nr++) { |
| 837 | ts = &line->ts[ts_nr]; |
| 838 | e1ts_dump_vty(vty, ts); |
| 839 | } |
| 840 | return CMD_SUCCESS; |
| 841 | } |
| 842 | return CMD_SUCCESS; |
| 843 | } |
| 844 | |
| 845 | static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag) |
| 846 | { |
| 847 | vty_out(vty, "Paging on BTS %u%s", pag->bts->nr, VTY_NEWLINE); |
| 848 | subscr_dump_vty(vty, pag->subscr); |
| 849 | } |
| 850 | |
| 851 | static void bts_paging_dump_vty(struct vty *vty, struct gsm_bts *bts) |
| 852 | { |
| 853 | struct gsm_paging_request *pag; |
| 854 | |
| 855 | llist_for_each_entry(pag, &bts->paging.pending_requests, entry) |
| 856 | paging_dump_vty(vty, pag); |
| 857 | } |
| 858 | |
| 859 | DEFUN(show_paging, |
| 860 | show_paging_cmd, |
| 861 | "show paging [bts_nr]", |
| 862 | SHOW_STR "Display information about paging reuqests of a BTS\n") |
| 863 | { |
| 864 | struct gsm_network *net = gsmnet; |
| 865 | struct gsm_bts *bts; |
| 866 | int bts_nr; |
| 867 | |
| 868 | if (argc >= 1) { |
| 869 | /* use the BTS number that the user has specified */ |
| 870 | bts_nr = atoi(argv[0]); |
| 871 | if (bts_nr >= net->num_bts) { |
| 872 | vty_out(vty, "%% can't find BTS %s%s", argv[0], |
| 873 | VTY_NEWLINE); |
| 874 | return CMD_WARNING; |
| 875 | } |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 876 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 877 | bts_paging_dump_vty(vty, bts); |
| 878 | |
| 879 | return CMD_SUCCESS; |
| 880 | } |
| 881 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 882 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 883 | bts_paging_dump_vty(vty, bts); |
| 884 | } |
| 885 | |
| 886 | return CMD_SUCCESS; |
| 887 | } |
| 888 | |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 889 | DEFUN(cfg_net, |
| 890 | cfg_net_cmd, |
| 891 | "network", |
| 892 | "Configure the GSM network") |
| 893 | { |
| 894 | vty->index = gsmnet; |
| 895 | vty->node = GSMNET_NODE; |
| 896 | |
| 897 | return CMD_SUCCESS; |
| 898 | } |
| 899 | |
| 900 | |
| 901 | DEFUN(cfg_net_ncc, |
| 902 | cfg_net_ncc_cmd, |
| 903 | "network country code <1-999>", |
| 904 | "Set the GSM network country code") |
| 905 | { |
| 906 | gsmnet->country_code = atoi(argv[0]); |
| 907 | |
| 908 | return CMD_SUCCESS; |
| 909 | } |
| 910 | |
| 911 | DEFUN(cfg_net_mnc, |
| 912 | cfg_net_mnc_cmd, |
| 913 | "mobile network code <1-999>", |
| 914 | "Set the GSM mobile network code") |
| 915 | { |
| 916 | gsmnet->network_code = atoi(argv[0]); |
| 917 | |
| 918 | return CMD_SUCCESS; |
| 919 | } |
| 920 | |
| 921 | DEFUN(cfg_net_name_short, |
| 922 | cfg_net_name_short_cmd, |
| 923 | "short name NAME", |
| 924 | "Set the short GSM network name") |
| 925 | { |
| 926 | if (gsmnet->name_short) |
| 927 | talloc_free(gsmnet->name_short); |
| 928 | |
| 929 | gsmnet->name_short = talloc_strdup(gsmnet, argv[0]); |
| 930 | |
| 931 | return CMD_SUCCESS; |
| 932 | } |
| 933 | |
| 934 | DEFUN(cfg_net_name_long, |
| 935 | cfg_net_name_long_cmd, |
| 936 | "long name NAME", |
| 937 | "Set the long GSM network name") |
| 938 | { |
| 939 | if (gsmnet->name_long) |
| 940 | talloc_free(gsmnet->name_long); |
| 941 | |
| 942 | gsmnet->name_long = talloc_strdup(gsmnet, argv[0]); |
| 943 | |
| 944 | return CMD_SUCCESS; |
| 945 | } |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 946 | |
Harald Welte (local) | a59a27e | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 947 | DEFUN(cfg_net_auth_policy, |
| 948 | cfg_net_auth_policy_cmd, |
| 949 | "auth policy (closed|accept-all|token)", |
| 950 | "Set the GSM network authentication policy\n") |
| 951 | { |
| 952 | enum gsm_auth_policy policy = gsm_auth_policy_parse(argv[0]); |
| 953 | |
| 954 | gsmnet->auth_policy = policy; |
| 955 | |
| 956 | return CMD_SUCCESS; |
| 957 | } |
| 958 | |
Harald Welte | 59936d7 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 959 | DEFUN(cfg_net_reject_cause, |
| 960 | cfg_net_reject_cause_cmd, |
| 961 | "location updating reject cause <2-111>", |
| 962 | "Set the reject cause of location updating reject\n") |
| 963 | { |
| 964 | gsmnet->reject_cause = atoi(argv[0]); |
| 965 | |
| 966 | return CMD_SUCCESS; |
| 967 | } |
| 968 | |
Harald Welte | cca253a | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 969 | DEFUN(cfg_net_encryption, |
| 970 | cfg_net_encryption_cmd, |
| 971 | "encryption a5 (0|1|2)", |
| 972 | "Enable or disable encryption (A5) for this network\n") |
| 973 | { |
Andreas.Eversberg | 5329329 | 2009-11-17 09:55:26 +0100 | [diff] [blame] | 974 | gsmnet->a5_encryption= atoi(argv[0]); |
Harald Welte | cca253a | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 975 | |
| 976 | return CMD_SUCCESS; |
| 977 | } |
| 978 | |
Holger Hans Peter Freyther | 96c8982 | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 979 | DEFUN(cfg_net_neci, |
| 980 | cfg_net_neci_cmd, |
| 981 | "neci (0|1)", |
| 982 | "Set if NECI of cell selection is to be set") |
| 983 | { |
| 984 | gsmnet->neci = atoi(argv[0]); |
| 985 | return CMD_SUCCESS; |
| 986 | } |
| 987 | |
Harald Welte | 52af195 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 988 | DEFUN(cfg_net_rrlp_mode, cfg_net_rrlp_mode_cmd, |
| 989 | "rrlp mode (none|ms-based|ms-preferred|ass-preferred)", |
| 990 | "Set the Radio Resource Location Protocol Mode") |
| 991 | { |
| 992 | gsmnet->rrlp.mode = rrlp_mode_parse(argv[0]); |
| 993 | |
| 994 | return CMD_SUCCESS; |
| 995 | } |
| 996 | |
Harald Welte | a310f3e | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 997 | DEFUN(cfg_net_mm_info, cfg_net_mm_info_cmd, |
| 998 | "mm info (0|1)", |
| 999 | "Whether to send MM INFO after LOC UPD ACCEPT") |
| 1000 | { |
| 1001 | gsmnet->send_mm_info = atoi(argv[0]); |
| 1002 | |
| 1003 | return CMD_SUCCESS; |
| 1004 | } |
| 1005 | |
Harald Welte | 0af9c9f | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1006 | DEFUN(cfg_net_handover, cfg_net_handover_cmd, |
| 1007 | "handover (0|1)", |
| 1008 | "Whether or not to use in-call handover") |
| 1009 | { |
Holger Hans Peter Freyther | 3524d4b | 2010-01-07 16:14:38 +0100 | [diff] [blame] | 1010 | int enable = atoi(argv[0]); |
| 1011 | |
| 1012 | if (enable && ipacc_rtp_direct) { |
Harald Welte | aa2c303 | 2009-12-20 13:51:01 +0100 | [diff] [blame] | 1013 | vty_out(vty, "%% Cannot enable handover unless RTP Proxy mode " |
| 1014 | "is enabled by using the -P command line option%s", |
| 1015 | VTY_NEWLINE); |
| 1016 | return CMD_WARNING; |
| 1017 | } |
Holger Hans Peter Freyther | 3524d4b | 2010-01-07 16:14:38 +0100 | [diff] [blame] | 1018 | gsmnet->handover.active = enable; |
Harald Welte | 0af9c9f | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1019 | |
| 1020 | return CMD_SUCCESS; |
| 1021 | } |
| 1022 | |
Harald Welte | a8062f1 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1023 | DEFUN(cfg_net_ho_win_rxlev_avg, cfg_net_ho_win_rxlev_avg_cmd, |
| 1024 | "handover window rxlev averaging <1-10>", |
| 1025 | "How many RxLev measurements are used for averaging") |
| 1026 | { |
| 1027 | gsmnet->handover.win_rxlev_avg = atoi(argv[0]); |
| 1028 | return CMD_SUCCESS; |
| 1029 | } |
| 1030 | |
| 1031 | DEFUN(cfg_net_ho_win_rxqual_avg, cfg_net_ho_win_rxqual_avg_cmd, |
| 1032 | "handover window rxqual averaging <1-10>", |
| 1033 | "How many RxQual measurements are used for averaging") |
| 1034 | { |
| 1035 | gsmnet->handover.win_rxqual_avg = atoi(argv[0]); |
| 1036 | return CMD_SUCCESS; |
| 1037 | } |
| 1038 | |
| 1039 | DEFUN(cfg_net_ho_win_rxlev_neigh_avg, cfg_net_ho_win_rxlev_avg_neigh_cmd, |
| 1040 | "handover window rxlev neighbor averaging <1-10>", |
| 1041 | "How many RxQual measurements are used for averaging") |
| 1042 | { |
| 1043 | gsmnet->handover.win_rxlev_avg_neigh = atoi(argv[0]); |
| 1044 | return CMD_SUCCESS; |
| 1045 | } |
| 1046 | |
| 1047 | DEFUN(cfg_net_ho_pwr_interval, cfg_net_ho_pwr_interval_cmd, |
| 1048 | "handover power budget interval <1-99>", |
| 1049 | "How often to check if we have a better cell (SACCH frames)") |
| 1050 | { |
| 1051 | gsmnet->handover.pwr_interval = atoi(argv[0]); |
| 1052 | return CMD_SUCCESS; |
| 1053 | } |
| 1054 | |
| 1055 | DEFUN(cfg_net_ho_pwr_hysteresis, cfg_net_ho_pwr_hysteresis_cmd, |
| 1056 | "handover power budget hysteresis <0-999>", |
| 1057 | "How many dB does a neighbor to be stronger to become a HO candidate") |
| 1058 | { |
| 1059 | gsmnet->handover.pwr_hysteresis = atoi(argv[0]); |
| 1060 | return CMD_SUCCESS; |
| 1061 | } |
| 1062 | |
| 1063 | DEFUN(cfg_net_ho_max_distance, cfg_net_ho_max_distance_cmd, |
| 1064 | "handover maximum distance <0-9999>", |
| 1065 | "How big is the maximum timing advance before HO is forced") |
| 1066 | { |
| 1067 | gsmnet->handover.max_distance = atoi(argv[0]); |
| 1068 | return CMD_SUCCESS; |
| 1069 | } |
Harald Welte | 0af9c9f | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1070 | |
Holger Hans Peter Freyther | 13ae980 | 2009-12-22 08:27:21 +0100 | [diff] [blame] | 1071 | #define DECLARE_TIMER(number, doc) \ |
Holger Hans Peter Freyther | 26ba2e7 | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1072 | DEFUN(cfg_net_T##number, \ |
| 1073 | cfg_net_T##number##_cmd, \ |
| 1074 | "timer t" #number " <0-65535>", \ |
Holger Hans Peter Freyther | 13ae980 | 2009-12-22 08:27:21 +0100 | [diff] [blame] | 1075 | doc) \ |
Holger Hans Peter Freyther | 26ba2e7 | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1076 | { \ |
| 1077 | int value = atoi(argv[0]); \ |
| 1078 | \ |
| 1079 | if (value < 0 || value > 65535) { \ |
| 1080 | vty_out(vty, "Timer value %s out of range.%s", \ |
| 1081 | argv[0], VTY_NEWLINE); \ |
| 1082 | return CMD_WARNING; \ |
| 1083 | } \ |
| 1084 | \ |
| 1085 | gsmnet->T##number = value; \ |
| 1086 | return CMD_SUCCESS; \ |
| 1087 | } |
| 1088 | |
Holger Hans Peter Freyther | 13ae980 | 2009-12-22 08:27:21 +0100 | [diff] [blame] | 1089 | DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT.") |
| 1090 | DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.") |
| 1091 | DECLARE_TIMER(3105, "Currently not used.") |
| 1092 | DECLARE_TIMER(3107, "Currently not used.") |
| 1093 | DECLARE_TIMER(3109, "Currently not used.") |
| 1094 | DECLARE_TIMER(3111, "Currently not used.") |
| 1095 | DECLARE_TIMER(3113, "Set the time to try paging a subscriber.") |
| 1096 | DECLARE_TIMER(3115, "Currently not used.") |
| 1097 | DECLARE_TIMER(3117, "Currently not used.") |
| 1098 | DECLARE_TIMER(3119, "Currently not used.") |
| 1099 | DECLARE_TIMER(3141, "Currently not used.") |
Holger Hans Peter Freyther | 26ba2e7 | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1100 | |
| 1101 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1102 | /* per-BTS configuration */ |
| 1103 | DEFUN(cfg_bts, |
| 1104 | cfg_bts_cmd, |
| 1105 | "bts BTS_NR", |
| 1106 | "Select a BTS to configure\n") |
| 1107 | { |
| 1108 | int bts_nr = atoi(argv[0]); |
| 1109 | struct gsm_bts *bts; |
| 1110 | |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1111 | if (bts_nr > gsmnet->num_bts) { |
| 1112 | vty_out(vty, "%% The next unused BTS number is %u%s", |
| 1113 | gsmnet->num_bts, VTY_NEWLINE); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1114 | return CMD_WARNING; |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1115 | } else if (bts_nr == gsmnet->num_bts) { |
| 1116 | /* allocate a new one */ |
| 1117 | bts = gsm_bts_alloc(gsmnet, GSM_BTS_TYPE_UNKNOWN, |
| 1118 | HARDCODED_TSC, HARDCODED_BSIC); |
Holger Hans Peter Freyther | 7113514 | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 1119 | } else |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1120 | bts = gsm_bts_num(gsmnet, bts_nr); |
| 1121 | |
Daniel Willmann | 580085f | 2010-01-11 13:43:07 +0100 | [diff] [blame] | 1122 | if (!bts) { |
| 1123 | vty_out(vty, "%% Unable to allocate BTS %u%s", |
| 1124 | gsmnet->num_bts, VTY_NEWLINE); |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1125 | return CMD_WARNING; |
Daniel Willmann | 580085f | 2010-01-11 13:43:07 +0100 | [diff] [blame] | 1126 | } |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1127 | |
| 1128 | vty->index = bts; |
| 1129 | vty->node = BTS_NODE; |
| 1130 | |
| 1131 | return CMD_SUCCESS; |
| 1132 | } |
| 1133 | |
| 1134 | DEFUN(cfg_bts_type, |
| 1135 | cfg_bts_type_cmd, |
| 1136 | "type TYPE", |
| 1137 | "Set the BTS type\n") |
| 1138 | { |
| 1139 | struct gsm_bts *bts = vty->index; |
Harald Welte | 59698fb | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 1140 | int rc; |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1141 | |
Harald Welte | 59698fb | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 1142 | rc = gsm_set_bts_type(bts, parse_btstype(argv[0])); |
| 1143 | if (rc < 0) |
| 1144 | return CMD_WARNING; |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1145 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1146 | return CMD_SUCCESS; |
| 1147 | } |
| 1148 | |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1149 | DEFUN(cfg_bts_band, |
| 1150 | cfg_bts_band_cmd, |
| 1151 | "band BAND", |
| 1152 | "Set the frequency band of this BTS\n") |
| 1153 | { |
| 1154 | struct gsm_bts *bts = vty->index; |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1155 | int band = gsm_band_parse(argv[0]); |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1156 | |
| 1157 | if (band < 0) { |
| 1158 | vty_out(vty, "%% BAND %d is not a valid GSM band%s", |
| 1159 | band, VTY_NEWLINE); |
| 1160 | return CMD_WARNING; |
| 1161 | } |
| 1162 | |
| 1163 | bts->band = band; |
| 1164 | |
| 1165 | return CMD_SUCCESS; |
| 1166 | } |
| 1167 | |
Holger Hans Peter Freyther | a098dfb | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 1168 | DEFUN(cfg_bts_ci, |
| 1169 | cfg_bts_ci_cmd, |
| 1170 | "cell_identity <0-65535>", |
| 1171 | "Set the Cell identity of this BTS\n") |
| 1172 | { |
| 1173 | struct gsm_bts *bts = vty->index; |
| 1174 | int ci = atoi(argv[0]); |
| 1175 | |
| 1176 | if (ci < 0 || ci > 0xffff) { |
| 1177 | vty_out(vty, "%% CI %d is not in the valid range (0-65535)%s", |
| 1178 | ci, VTY_NEWLINE); |
| 1179 | return CMD_WARNING; |
| 1180 | } |
| 1181 | bts->cell_identity = ci; |
| 1182 | |
| 1183 | return CMD_SUCCESS; |
| 1184 | } |
| 1185 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1186 | DEFUN(cfg_bts_lac, |
| 1187 | cfg_bts_lac_cmd, |
Holger Hans Peter Freyther | 54a2283 | 2009-09-29 14:02:33 +0200 | [diff] [blame] | 1188 | "location_area_code <0-65535>", |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1189 | "Set the Location Area Code (LAC) of this BTS\n") |
| 1190 | { |
| 1191 | struct gsm_bts *bts = vty->index; |
| 1192 | int lac = atoi(argv[0]); |
| 1193 | |
Holger Hans Peter Freyther | 54a2283 | 2009-09-29 14:02:33 +0200 | [diff] [blame] | 1194 | if (lac < 0 || lac > 0xffff) { |
| 1195 | vty_out(vty, "%% LAC %d is not in the valid range (0-65535)%s", |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1196 | lac, VTY_NEWLINE); |
| 1197 | return CMD_WARNING; |
| 1198 | } |
Holger Hans Peter Freyther | 6c6ab86 | 2009-10-01 04:07:15 +0200 | [diff] [blame] | 1199 | |
| 1200 | if (lac == GSM_LAC_RESERVED_DETACHED || lac == GSM_LAC_RESERVED_ALL_BTS) { |
| 1201 | vty_out(vty, "%% LAC %d is reserved by GSM 04.08%s", |
| 1202 | lac, VTY_NEWLINE); |
| 1203 | return CMD_WARNING; |
| 1204 | } |
| 1205 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1206 | bts->location_area_code = lac; |
| 1207 | |
| 1208 | return CMD_SUCCESS; |
| 1209 | } |
| 1210 | |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 1211 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1212 | DEFUN(cfg_bts_tsc, |
| 1213 | cfg_bts_tsc_cmd, |
| 1214 | "training_sequence_code <0-255>", |
| 1215 | "Set the Training Sequence Code (TSC) of this BTS\n") |
| 1216 | { |
| 1217 | struct gsm_bts *bts = vty->index; |
| 1218 | int tsc = atoi(argv[0]); |
| 1219 | |
| 1220 | if (tsc < 0 || tsc > 0xff) { |
| 1221 | vty_out(vty, "%% TSC %d is not in the valid range (0-255)%s", |
| 1222 | tsc, VTY_NEWLINE); |
| 1223 | return CMD_WARNING; |
| 1224 | } |
| 1225 | bts->tsc = tsc; |
| 1226 | |
| 1227 | return CMD_SUCCESS; |
| 1228 | } |
| 1229 | |
| 1230 | DEFUN(cfg_bts_bsic, |
| 1231 | cfg_bts_bsic_cmd, |
| 1232 | "base_station_id_code <0-63>", |
| 1233 | "Set the Base Station Identity Code (BSIC) of this BTS\n") |
| 1234 | { |
| 1235 | struct gsm_bts *bts = vty->index; |
| 1236 | int bsic = atoi(argv[0]); |
| 1237 | |
| 1238 | if (bsic < 0 || bsic > 0x3f) { |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1239 | vty_out(vty, "%% BSIC %d is not in the valid range (0-255)%s", |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1240 | bsic, VTY_NEWLINE); |
| 1241 | return CMD_WARNING; |
| 1242 | } |
| 1243 | bts->bsic = bsic; |
| 1244 | |
| 1245 | return CMD_SUCCESS; |
| 1246 | } |
| 1247 | |
| 1248 | |
| 1249 | DEFUN(cfg_bts_unit_id, |
| 1250 | cfg_bts_unit_id_cmd, |
Harald Welte | f515aa0 | 2009-08-07 13:27:09 +0200 | [diff] [blame] | 1251 | "ip.access unit_id <0-65534> <0-255>", |
| 1252 | "Set the ip.access BTS Unit ID of this BTS\n") |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1253 | { |
| 1254 | struct gsm_bts *bts = vty->index; |
| 1255 | int site_id = atoi(argv[0]); |
| 1256 | int bts_id = atoi(argv[1]); |
| 1257 | |
Harald Welte | f515aa0 | 2009-08-07 13:27:09 +0200 | [diff] [blame] | 1258 | if (!is_ipaccess_bts(bts)) { |
| 1259 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1260 | return CMD_WARNING; |
| 1261 | } |
| 1262 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1263 | bts->ip_access.site_id = site_id; |
| 1264 | bts->ip_access.bts_id = bts_id; |
| 1265 | |
| 1266 | return CMD_SUCCESS; |
| 1267 | } |
| 1268 | |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1269 | DEFUN(cfg_bts_stream_id, |
| 1270 | cfg_bts_stream_id_cmd, |
| 1271 | "oml ip.access stream_id <0-255>", |
| 1272 | "Set the ip.access Stream ID of the OML link of this BTS\n") |
| 1273 | { |
| 1274 | struct gsm_bts *bts = vty->index; |
| 1275 | int stream_id = atoi(argv[0]); |
| 1276 | |
| 1277 | if (!is_ipaccess_bts(bts)) { |
| 1278 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1279 | return CMD_WARNING; |
| 1280 | } |
| 1281 | |
| 1282 | bts->oml_tei = stream_id; |
| 1283 | |
| 1284 | return CMD_SUCCESS; |
| 1285 | } |
| 1286 | |
| 1287 | |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1288 | DEFUN(cfg_bts_oml_e1, |
| 1289 | cfg_bts_oml_e1_cmd, |
| 1290 | "oml e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
| 1291 | "E1 interface to be used for OML\n") |
| 1292 | { |
| 1293 | struct gsm_bts *bts = vty->index; |
| 1294 | |
| 1295 | parse_e1_link(&bts->oml_e1_link, argv[0], argv[1], argv[2]); |
| 1296 | |
| 1297 | return CMD_SUCCESS; |
| 1298 | } |
| 1299 | |
| 1300 | |
| 1301 | DEFUN(cfg_bts_oml_e1_tei, |
| 1302 | cfg_bts_oml_e1_tei_cmd, |
| 1303 | "oml e1 tei <0-63>", |
| 1304 | "Set the TEI to be used for OML") |
| 1305 | { |
| 1306 | struct gsm_bts *bts = vty->index; |
| 1307 | |
| 1308 | bts->oml_tei = atoi(argv[0]); |
| 1309 | |
| 1310 | return CMD_SUCCESS; |
| 1311 | } |
| 1312 | |
Harald Welte | 3e77461 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1313 | DEFUN(cfg_bts_challoc, cfg_bts_challoc_cmd, |
| 1314 | "channel allocator (ascending|descending)", |
| 1315 | "Should the channel allocator allocate in reverse TRX order?") |
| 1316 | { |
| 1317 | struct gsm_bts *bts = vty->index; |
| 1318 | |
| 1319 | if (!strcmp(argv[0], "ascending")) |
| 1320 | bts->chan_alloc_reverse = 0; |
| 1321 | else |
| 1322 | bts->chan_alloc_reverse = 1; |
| 1323 | |
| 1324 | return CMD_SUCCESS; |
| 1325 | } |
| 1326 | |
Sylvain Munaut | 8e2d8de | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 1327 | DEFUN(cfg_bts_rach_tx_integer, |
| 1328 | cfg_bts_rach_tx_integer_cmd, |
| 1329 | "rach tx integer <0-15>", |
| 1330 | "Set the raw tx integer value in RACH Control parameters IE") |
| 1331 | { |
| 1332 | struct gsm_bts *bts = vty->index; |
| 1333 | bts->si_common.rach_control.tx_integer = atoi(argv[0]) & 0xf; |
| 1334 | return CMD_SUCCESS; |
| 1335 | } |
| 1336 | |
| 1337 | DEFUN(cfg_bts_rach_max_trans, |
| 1338 | cfg_bts_rach_max_trans_cmd, |
| 1339 | "rach max transmission (1|2|4|7)", |
| 1340 | "Set the maximum number of RACH burst transmissions") |
| 1341 | { |
| 1342 | struct gsm_bts *bts = vty->index; |
| 1343 | bts->si_common.rach_control.max_trans = rach_max_trans_val2raw(atoi(argv[0])); |
| 1344 | return CMD_SUCCESS; |
| 1345 | } |
| 1346 | |
Holger Hans Peter Freyther | 697ed2b | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 1347 | DEFUN(cfg_bts_rach_nm_b_thresh, |
| 1348 | cfg_bts_rach_nm_b_thresh_cmd, |
| 1349 | "rach nm busy threshold <0-255>", |
| 1350 | "Set the NM Busy Threshold in DB") |
| 1351 | { |
| 1352 | struct gsm_bts *bts = vty->index; |
| 1353 | bts->rach_b_thresh = atoi(argv[0]); |
| 1354 | return CMD_SUCCESS; |
| 1355 | } |
| 1356 | |
| 1357 | DEFUN(cfg_bts_rach_nm_ldavg, |
| 1358 | cfg_bts_rach_nm_ldavg_cmd, |
| 1359 | "rach nm load average <0-65535>", |
| 1360 | "Set the NM Loadaver Slots value") |
| 1361 | { |
| 1362 | struct gsm_bts *bts = vty->index; |
| 1363 | bts->rach_ldavg_slots = atoi(argv[0]); |
| 1364 | return CMD_SUCCESS; |
| 1365 | } |
| 1366 | |
Harald Welte (local) | e19be3f | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 1367 | DEFUN(cfg_bts_cell_barred, cfg_bts_cell_barred_cmd, |
| 1368 | "cell barred (0|1)", |
| 1369 | "Should this cell be barred from access?") |
| 1370 | { |
| 1371 | struct gsm_bts *bts = vty->index; |
| 1372 | |
Harald Welte | 8c973ba | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 1373 | bts->si_common.rach_control.cell_bar = atoi(argv[0]); |
Harald Welte (local) | e19be3f | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 1374 | |
| 1375 | return CMD_SUCCESS; |
| 1376 | } |
| 1377 | |
Harald Welte (local) | cbd4610 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 1378 | DEFUN(cfg_bts_ms_max_power, cfg_bts_ms_max_power_cmd, |
| 1379 | "ms max power <0-40>", |
| 1380 | "Maximum transmit power of the MS") |
| 1381 | { |
| 1382 | struct gsm_bts *bts = vty->index; |
| 1383 | |
| 1384 | bts->ms_max_power = atoi(argv[0]); |
| 1385 | |
| 1386 | return CMD_SUCCESS; |
| 1387 | } |
| 1388 | |
Harald Welte | b761bf8 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 1389 | DEFUN(cfg_bts_cell_resel_hyst, cfg_bts_cell_resel_hyst_cmd, |
| 1390 | "cell reselection hysteresis <0-14>", |
| 1391 | "Cell Re-Selection Hysteresis in dB") |
| 1392 | { |
| 1393 | struct gsm_bts *bts = vty->index; |
| 1394 | |
| 1395 | bts->si_common.cell_sel_par.cell_resel_hyst = atoi(argv[0])/2; |
| 1396 | |
| 1397 | return CMD_SUCCESS; |
| 1398 | } |
| 1399 | |
| 1400 | DEFUN(cfg_bts_rxlev_acc_min, cfg_bts_rxlev_acc_min_cmd, |
| 1401 | "rxlev access min <0-63>", |
| 1402 | "Minimum RxLev needed for cell access (better than -110dBm)") |
| 1403 | { |
| 1404 | struct gsm_bts *bts = vty->index; |
| 1405 | |
| 1406 | bts->si_common.cell_sel_par.rxlev_acc_min = atoi(argv[0]); |
| 1407 | |
| 1408 | return CMD_SUCCESS; |
| 1409 | } |
| 1410 | |
Harald Welte (local) | b6ea7f7 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 1411 | DEFUN(cfg_bts_per_loc_upd, cfg_bts_per_loc_upd_cmd, |
| 1412 | "periodic location update <0-1530>", |
| 1413 | "Periodic Location Updating Interval in Minutes") |
| 1414 | { |
| 1415 | struct gsm_bts *bts = vty->index; |
| 1416 | |
Harald Welte | a54a2bb | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 1417 | bts->si_common.chan_desc.t3212 = atoi(argv[0]) / 10; |
Harald Welte (local) | b6ea7f7 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 1418 | |
| 1419 | return CMD_SUCCESS; |
| 1420 | } |
| 1421 | |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1422 | DEFUN(cfg_bts_prs_bvci, cfg_bts_gprs_bvci_cmd, |
Harald Welte | b42fe34 | 2010-04-18 14:00:26 +0200 | [diff] [blame] | 1423 | "gprs cell bvci <2-65535>", |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1424 | "GPRS BSSGP VC Identifier") |
| 1425 | { |
| 1426 | struct gsm_bts *bts = vty->index; |
| 1427 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1428 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | c05a4b1 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1429 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1430 | return CMD_WARNING; |
| 1431 | } |
| 1432 | |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1433 | bts->gprs.cell.bvci = atoi(argv[0]); |
| 1434 | |
| 1435 | return CMD_SUCCESS; |
| 1436 | } |
| 1437 | |
Harald Welte | 4a048c5 | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 1438 | DEFUN(cfg_bts_gprs_nsei, cfg_bts_gprs_nsei_cmd, |
| 1439 | "gprs nsei <0-65535>", |
| 1440 | "GPRS NS Entity Identifier") |
| 1441 | { |
| 1442 | struct gsm_bts *bts = vty->index; |
| 1443 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1444 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 4a048c5 | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 1445 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1446 | return CMD_WARNING; |
| 1447 | } |
| 1448 | |
| 1449 | bts->gprs.nse.nsei = atoi(argv[0]); |
| 1450 | |
| 1451 | return CMD_SUCCESS; |
| 1452 | } |
| 1453 | |
| 1454 | |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1455 | DEFUN(cfg_bts_gprs_nsvci, cfg_bts_gprs_nsvci_cmd, |
| 1456 | "gprs nsvc <0-1> nsvci <0-65535>", |
| 1457 | "GPRS NS VC Identifier") |
| 1458 | { |
| 1459 | struct gsm_bts *bts = vty->index; |
| 1460 | int idx = atoi(argv[0]); |
| 1461 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1462 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | c05a4b1 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1463 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1464 | return CMD_WARNING; |
| 1465 | } |
| 1466 | |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1467 | bts->gprs.nsvc[idx].nsvci = atoi(argv[1]); |
| 1468 | |
| 1469 | return CMD_SUCCESS; |
| 1470 | } |
| 1471 | |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1472 | DEFUN(cfg_bts_gprs_nsvc_lport, cfg_bts_gprs_nsvc_lport_cmd, |
| 1473 | "gprs nsvc <0-1> local udp port <0-65535>", |
| 1474 | "GPRS NS Local UDP Port") |
| 1475 | { |
| 1476 | struct gsm_bts *bts = vty->index; |
| 1477 | int idx = atoi(argv[0]); |
| 1478 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1479 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | c05a4b1 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1480 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1481 | return CMD_WARNING; |
| 1482 | } |
| 1483 | |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1484 | bts->gprs.nsvc[idx].local_port = atoi(argv[1]); |
| 1485 | |
| 1486 | return CMD_SUCCESS; |
| 1487 | } |
| 1488 | |
| 1489 | DEFUN(cfg_bts_gprs_nsvc_rport, cfg_bts_gprs_nsvc_rport_cmd, |
| 1490 | "gprs nsvc <0-1> remote udp port <0-65535>", |
| 1491 | "GPRS NS Remote UDP Port") |
| 1492 | { |
| 1493 | struct gsm_bts *bts = vty->index; |
| 1494 | int idx = atoi(argv[0]); |
| 1495 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1496 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | c05a4b1 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1497 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1498 | return CMD_WARNING; |
| 1499 | } |
| 1500 | |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1501 | bts->gprs.nsvc[idx].remote_port = atoi(argv[1]); |
| 1502 | |
| 1503 | return CMD_SUCCESS; |
| 1504 | } |
| 1505 | |
| 1506 | DEFUN(cfg_bts_gprs_nsvc_rip, cfg_bts_gprs_nsvc_rip_cmd, |
| 1507 | "gprs nsvc <0-1> remote ip A.B.C.D", |
| 1508 | "GPRS NS Remote IP Address") |
| 1509 | { |
| 1510 | struct gsm_bts *bts = vty->index; |
| 1511 | int idx = atoi(argv[0]); |
| 1512 | struct in_addr ia; |
| 1513 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1514 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | c05a4b1 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1515 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1516 | return CMD_WARNING; |
| 1517 | } |
| 1518 | |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1519 | inet_aton(argv[1], &ia); |
| 1520 | bts->gprs.nsvc[idx].remote_ip = ntohl(ia.s_addr); |
| 1521 | |
| 1522 | return CMD_SUCCESS; |
| 1523 | } |
| 1524 | |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1525 | DEFUN(cfg_bts_gprs_rac, cfg_bts_gprs_rac_cmd, |
| 1526 | "gprs routing area <0-255>", |
| 1527 | "GPRS Routing Area Code") |
| 1528 | { |
| 1529 | struct gsm_bts *bts = vty->index; |
| 1530 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1531 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | c05a4b1 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1532 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1533 | return CMD_WARNING; |
| 1534 | } |
| 1535 | |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1536 | bts->gprs.rac = atoi(argv[0]); |
| 1537 | |
| 1538 | return CMD_SUCCESS; |
| 1539 | } |
| 1540 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1541 | DEFUN(cfg_bts_gprs_mode, cfg_bts_gprs_mode_cmd, |
| 1542 | "gprs mode (none|gprs|egprs)", |
| 1543 | "GPRS Mode for this BTS") |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1544 | { |
| 1545 | struct gsm_bts *bts = vty->index; |
| 1546 | |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1547 | bts->gprs.mode = bts_gprs_mode_parse(argv[0]); |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1548 | |
| 1549 | return CMD_SUCCESS; |
| 1550 | } |
| 1551 | |
Harald Welte | 3e77461 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1552 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1553 | /* per TRX configuration */ |
| 1554 | DEFUN(cfg_trx, |
| 1555 | cfg_trx_cmd, |
| 1556 | "trx TRX_NR", |
| 1557 | "Select a TRX to configure") |
| 1558 | { |
| 1559 | int trx_nr = atoi(argv[0]); |
| 1560 | struct gsm_bts *bts = vty->index; |
| 1561 | struct gsm_bts_trx *trx; |
| 1562 | |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1563 | if (trx_nr > bts->num_trx) { |
| 1564 | vty_out(vty, "%% The next unused TRX number in this BTS is %u%s", |
| 1565 | bts->num_trx, VTY_NEWLINE); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1566 | return CMD_WARNING; |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1567 | } else if (trx_nr == bts->num_trx) { |
| 1568 | /* we need to allocate a new one */ |
| 1569 | trx = gsm_bts_trx_alloc(bts); |
Holger Hans Peter Freyther | 7113514 | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 1570 | } else |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1571 | trx = gsm_bts_trx_num(bts, trx_nr); |
Holger Hans Peter Freyther | 7113514 | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 1572 | |
Harald Welte | e712a5f | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1573 | if (!trx) |
| 1574 | return CMD_WARNING; |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1575 | |
| 1576 | vty->index = trx; |
| 1577 | vty->node = TRX_NODE; |
| 1578 | |
| 1579 | return CMD_SUCCESS; |
| 1580 | } |
| 1581 | |
| 1582 | DEFUN(cfg_trx_arfcn, |
| 1583 | cfg_trx_arfcn_cmd, |
| 1584 | "arfcn <1-1024>", |
| 1585 | "Set the ARFCN for this TRX\n") |
| 1586 | { |
| 1587 | int arfcn = atoi(argv[0]); |
| 1588 | struct gsm_bts_trx *trx = vty->index; |
| 1589 | |
| 1590 | /* FIXME: check if this ARFCN is supported by this TRX */ |
| 1591 | |
| 1592 | trx->arfcn = arfcn; |
| 1593 | |
| 1594 | /* FIXME: patch ARFCN into SYSTEM INFORMATION */ |
| 1595 | /* FIXME: use OML layer to update the ARFCN */ |
| 1596 | /* FIXME: use RSL layer to update SYSTEM INFORMATION */ |
| 1597 | |
| 1598 | return CMD_SUCCESS; |
| 1599 | } |
| 1600 | |
Harald Welte (local) | b709bfe | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 1601 | DEFUN(cfg_trx_nominal_power, |
| 1602 | cfg_trx_nominal_power_cmd, |
| 1603 | "nominal power <0-100>", |
| 1604 | "Nominal TRX RF Power in dB\n") |
| 1605 | { |
| 1606 | struct gsm_bts_trx *trx = vty->index; |
| 1607 | |
| 1608 | trx->nominal_power = atoi(argv[0]); |
| 1609 | |
| 1610 | return CMD_SUCCESS; |
| 1611 | } |
| 1612 | |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1613 | DEFUN(cfg_trx_max_power_red, |
| 1614 | cfg_trx_max_power_red_cmd, |
| 1615 | "max_power_red <0-100>", |
| 1616 | "Reduction of maximum BS RF Power in dB\n") |
| 1617 | { |
| 1618 | int maxpwr_r = atoi(argv[0]); |
| 1619 | struct gsm_bts_trx *trx = vty->index; |
Harald Welte | 01acd74 | 2009-11-18 09:20:22 +0100 | [diff] [blame] | 1620 | int upper_limit = 24; /* default 12.21 max power red. */ |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1621 | |
| 1622 | /* FIXME: check if our BTS type supports more than 12 */ |
| 1623 | if (maxpwr_r < 0 || maxpwr_r > upper_limit) { |
| 1624 | vty_out(vty, "%% Power %d dB is not in the valid range%s", |
| 1625 | maxpwr_r, VTY_NEWLINE); |
| 1626 | return CMD_WARNING; |
| 1627 | } |
| 1628 | if (maxpwr_r & 1) { |
| 1629 | vty_out(vty, "%% Power %d dB is not an even value%s", |
| 1630 | maxpwr_r, VTY_NEWLINE); |
| 1631 | return CMD_WARNING; |
| 1632 | } |
| 1633 | |
| 1634 | trx->max_power_red = maxpwr_r; |
| 1635 | |
| 1636 | /* FIXME: make sure we update this using OML */ |
| 1637 | |
| 1638 | return CMD_SUCCESS; |
| 1639 | } |
| 1640 | |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1641 | DEFUN(cfg_trx_rsl_e1, |
| 1642 | cfg_trx_rsl_e1_cmd, |
| 1643 | "rsl e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
| 1644 | "E1 interface to be used for RSL\n") |
| 1645 | { |
| 1646 | struct gsm_bts_trx *trx = vty->index; |
| 1647 | |
| 1648 | parse_e1_link(&trx->rsl_e1_link, argv[0], argv[1], argv[2]); |
| 1649 | |
| 1650 | return CMD_SUCCESS; |
| 1651 | } |
| 1652 | |
| 1653 | DEFUN(cfg_trx_rsl_e1_tei, |
| 1654 | cfg_trx_rsl_e1_tei_cmd, |
| 1655 | "rsl e1 tei <0-63>", |
| 1656 | "Set the TEI to be used for RSL") |
| 1657 | { |
| 1658 | struct gsm_bts_trx *trx = vty->index; |
| 1659 | |
| 1660 | trx->rsl_tei = atoi(argv[0]); |
| 1661 | |
| 1662 | return CMD_SUCCESS; |
| 1663 | } |
| 1664 | |
Holger Hans Peter Freyther | 1c8b480 | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 1665 | DEFUN(cfg_trx_rf_locked, |
| 1666 | cfg_trx_rf_locked_cmd, |
| 1667 | "rf_locked (0|1)", |
| 1668 | "Turn off RF of the TRX.\n") |
| 1669 | { |
| 1670 | int locked = atoi(argv[0]); |
| 1671 | struct gsm_bts_trx *trx = vty->index; |
| 1672 | |
| 1673 | gsm_trx_lock_rf(trx, locked); |
| 1674 | return CMD_SUCCESS; |
| 1675 | } |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1676 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1677 | /* per TS configuration */ |
| 1678 | DEFUN(cfg_ts, |
| 1679 | cfg_ts_cmd, |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1680 | "timeslot <0-7>", |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1681 | "Select a Timeslot to configure") |
| 1682 | { |
| 1683 | int ts_nr = atoi(argv[0]); |
| 1684 | struct gsm_bts_trx *trx = vty->index; |
| 1685 | struct gsm_bts_trx_ts *ts; |
| 1686 | |
| 1687 | if (ts_nr >= TRX_NR_TS) { |
| 1688 | vty_out(vty, "%% A GSM TRX only has %u Timeslots per TRX%s", |
| 1689 | TRX_NR_TS, VTY_NEWLINE); |
| 1690 | return CMD_WARNING; |
| 1691 | } |
| 1692 | |
| 1693 | ts = &trx->ts[ts_nr]; |
| 1694 | |
| 1695 | vty->index = ts; |
| 1696 | vty->node = TS_NODE; |
| 1697 | |
| 1698 | return CMD_SUCCESS; |
| 1699 | } |
| 1700 | |
Harald Welte | 3ffe1b3 | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1701 | DEFUN(cfg_ts_pchan, |
| 1702 | cfg_ts_pchan_cmd, |
| 1703 | "phys_chan_config PCHAN", |
| 1704 | "Physical Channel configuration (TCH/SDCCH/...)") |
| 1705 | { |
| 1706 | struct gsm_bts_trx_ts *ts = vty->index; |
| 1707 | int pchanc; |
| 1708 | |
| 1709 | pchanc = gsm_pchan_parse(argv[0]); |
| 1710 | if (pchanc < 0) |
| 1711 | return CMD_WARNING; |
| 1712 | |
| 1713 | ts->pchan = pchanc; |
| 1714 | |
| 1715 | return CMD_SUCCESS; |
| 1716 | } |
| 1717 | |
| 1718 | DEFUN(cfg_ts_e1_subslot, |
| 1719 | cfg_ts_e1_subslot_cmd, |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1720 | "e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
Harald Welte | 3ffe1b3 | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1721 | "E1 sub-slot connected to this on-air timeslot") |
| 1722 | { |
| 1723 | struct gsm_bts_trx_ts *ts = vty->index; |
| 1724 | |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1725 | parse_e1_link(&ts->e1_link, argv[0], argv[1], argv[2]); |
Harald Welte | 3ffe1b3 | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1726 | |
| 1727 | return CMD_SUCCESS; |
| 1728 | } |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1729 | |
Holger Hans Peter Freyther | c48a2a1 | 2010-04-10 00:08:28 +0200 | [diff] [blame] | 1730 | extern int bsc_vty_init_extra(struct gsm_network *net); |
| 1731 | |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1732 | int bsc_vty_init(struct gsm_network *net) |
| 1733 | { |
| 1734 | gsmnet = net; |
| 1735 | |
| 1736 | cmd_init(1); |
| 1737 | vty_init(); |
| 1738 | |
| 1739 | install_element(VIEW_NODE, &show_net_cmd); |
| 1740 | install_element(VIEW_NODE, &show_bts_cmd); |
| 1741 | install_element(VIEW_NODE, &show_trx_cmd); |
| 1742 | install_element(VIEW_NODE, &show_ts_cmd); |
| 1743 | install_element(VIEW_NODE, &show_lchan_cmd); |
| 1744 | |
| 1745 | install_element(VIEW_NODE, &show_e1drv_cmd); |
| 1746 | install_element(VIEW_NODE, &show_e1line_cmd); |
| 1747 | install_element(VIEW_NODE, &show_e1ts_cmd); |
| 1748 | |
| 1749 | install_element(VIEW_NODE, &show_paging_cmd); |
| 1750 | |
Holger Hans Peter Freyther | b70d45b | 2010-04-06 11:55:37 +0200 | [diff] [blame] | 1751 | openbsc_vty_add_cmds(); |
Holger Hans Peter Freyther | c8d862e | 2009-12-22 22:32:51 +0100 | [diff] [blame] | 1752 | |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1753 | install_element(CONFIG_NODE, &cfg_net_cmd); |
| 1754 | install_node(&net_node, config_write_net); |
| 1755 | install_default(GSMNET_NODE); |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1756 | install_element(GSMNET_NODE, &cfg_net_ncc_cmd); |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1757 | install_element(GSMNET_NODE, &cfg_net_mnc_cmd); |
| 1758 | install_element(GSMNET_NODE, &cfg_net_name_short_cmd); |
| 1759 | install_element(GSMNET_NODE, &cfg_net_name_long_cmd); |
Harald Welte (local) | a59a27e | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 1760 | install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd); |
Harald Welte | 59936d7 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 1761 | install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd); |
Harald Welte | cca253a | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 1762 | install_element(GSMNET_NODE, &cfg_net_encryption_cmd); |
Holger Hans Peter Freyther | 96c8982 | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 1763 | install_element(GSMNET_NODE, &cfg_net_neci_cmd); |
Harald Welte | 52af195 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 1764 | install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd); |
Harald Welte | 284ddba | 2009-12-14 17:49:15 +0100 | [diff] [blame] | 1765 | install_element(GSMNET_NODE, &cfg_net_mm_info_cmd); |
Harald Welte | 0af9c9f | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1766 | install_element(GSMNET_NODE, &cfg_net_handover_cmd); |
Harald Welte | a8062f1 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1767 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_cmd); |
| 1768 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxqual_avg_cmd); |
| 1769 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_neigh_cmd); |
| 1770 | install_element(GSMNET_NODE, &cfg_net_ho_pwr_interval_cmd); |
| 1771 | install_element(GSMNET_NODE, &cfg_net_ho_pwr_hysteresis_cmd); |
| 1772 | install_element(GSMNET_NODE, &cfg_net_ho_max_distance_cmd); |
Holger Hans Peter Freyther | 26ba2e7 | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1773 | install_element(GSMNET_NODE, &cfg_net_T3101_cmd); |
Holger Hans Peter Freyther | 8973386 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 1774 | install_element(GSMNET_NODE, &cfg_net_T3103_cmd); |
| 1775 | install_element(GSMNET_NODE, &cfg_net_T3105_cmd); |
| 1776 | install_element(GSMNET_NODE, &cfg_net_T3107_cmd); |
| 1777 | install_element(GSMNET_NODE, &cfg_net_T3109_cmd); |
| 1778 | install_element(GSMNET_NODE, &cfg_net_T3111_cmd); |
| 1779 | install_element(GSMNET_NODE, &cfg_net_T3113_cmd); |
| 1780 | install_element(GSMNET_NODE, &cfg_net_T3115_cmd); |
| 1781 | install_element(GSMNET_NODE, &cfg_net_T3117_cmd); |
| 1782 | install_element(GSMNET_NODE, &cfg_net_T3119_cmd); |
| 1783 | install_element(GSMNET_NODE, &cfg_net_T3141_cmd); |
Harald Welte | e87eb46 | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1784 | |
| 1785 | install_element(GSMNET_NODE, &cfg_bts_cmd); |
Harald Welte | 97ceef9 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 1786 | install_node(&bts_node, config_write_bts); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1787 | install_default(BTS_NODE); |
| 1788 | install_element(BTS_NODE, &cfg_bts_type_cmd); |
Harald Welte | 91afe4c | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1789 | install_element(BTS_NODE, &cfg_bts_band_cmd); |
Holger Hans Peter Freyther | a098dfb | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 1790 | install_element(BTS_NODE, &cfg_bts_ci_cmd); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1791 | install_element(BTS_NODE, &cfg_bts_lac_cmd); |
| 1792 | install_element(BTS_NODE, &cfg_bts_tsc_cmd); |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1793 | install_element(BTS_NODE, &cfg_bts_bsic_cmd); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1794 | install_element(BTS_NODE, &cfg_bts_unit_id_cmd); |
Harald Welte | 2557287 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1795 | install_element(BTS_NODE, &cfg_bts_stream_id_cmd); |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1796 | install_element(BTS_NODE, &cfg_bts_oml_e1_cmd); |
| 1797 | install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd); |
Harald Welte | 3e77461 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1798 | install_element(BTS_NODE, &cfg_bts_challoc_cmd); |
Sylvain Munaut | 8e2d8de | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 1799 | install_element(BTS_NODE, &cfg_bts_rach_tx_integer_cmd); |
| 1800 | install_element(BTS_NODE, &cfg_bts_rach_max_trans_cmd); |
Holger Hans Peter Freyther | 697ed2b | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 1801 | install_element(BTS_NODE, &cfg_bts_rach_nm_b_thresh_cmd); |
| 1802 | install_element(BTS_NODE, &cfg_bts_rach_nm_ldavg_cmd); |
Harald Welte (local) | e19be3f | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 1803 | install_element(BTS_NODE, &cfg_bts_cell_barred_cmd); |
Harald Welte (local) | cbd4610 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 1804 | install_element(BTS_NODE, &cfg_bts_ms_max_power_cmd); |
Harald Welte (local) | b6ea7f7 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 1805 | install_element(BTS_NODE, &cfg_bts_per_loc_upd_cmd); |
Harald Welte | b761bf8 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 1806 | install_element(BTS_NODE, &cfg_bts_cell_resel_hyst_cmd); |
| 1807 | install_element(BTS_NODE, &cfg_bts_rxlev_acc_min_cmd); |
Harald Welte | cb20b7a | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1808 | install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd); |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1809 | install_element(BTS_NODE, &cfg_bts_gprs_rac_cmd); |
| 1810 | install_element(BTS_NODE, &cfg_bts_gprs_bvci_cmd); |
Harald Welte | 4a048c5 | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 1811 | install_element(BTS_NODE, &cfg_bts_gprs_nsei_cmd); |
Harald Welte | 3055e33 | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1812 | install_element(BTS_NODE, &cfg_bts_gprs_nsvci_cmd); |
Harald Welte | 410575a | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1813 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_lport_cmd); |
| 1814 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_rport_cmd); |
| 1815 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_rip_cmd); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1816 | |
| 1817 | install_element(BTS_NODE, &cfg_trx_cmd); |
| 1818 | install_node(&trx_node, dummy_config_write); |
| 1819 | install_default(TRX_NODE); |
| 1820 | install_element(TRX_NODE, &cfg_trx_arfcn_cmd); |
Harald Welte (local) | b709bfe | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 1821 | install_element(TRX_NODE, &cfg_trx_nominal_power_cmd); |
Harald Welte | 7f597bc | 2009-06-20 22:36:12 +0200 | [diff] [blame] | 1822 | install_element(TRX_NODE, &cfg_trx_max_power_red_cmd); |
Harald Welte | 6286888 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1823 | install_element(TRX_NODE, &cfg_trx_rsl_e1_cmd); |
| 1824 | install_element(TRX_NODE, &cfg_trx_rsl_e1_tei_cmd); |
Holger Hans Peter Freyther | 1c8b480 | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 1825 | install_element(TRX_NODE, &cfg_trx_rf_locked_cmd); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1826 | |
| 1827 | install_element(TRX_NODE, &cfg_ts_cmd); |
| 1828 | install_node(&ts_node, dummy_config_write); |
| 1829 | install_default(TS_NODE); |
Harald Welte | 3ffe1b3 | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1830 | install_element(TS_NODE, &cfg_ts_pchan_cmd); |
| 1831 | install_element(TS_NODE, &cfg_ts_e1_subslot_cmd); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1832 | |
Holger Hans Peter Freyther | bdae6f9 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 1833 | bsc_vty_init_extra(net); |
Harald Welte | 59b0468 | 2009-06-10 05:40:52 +0800 | [diff] [blame] | 1834 | |
| 1835 | return 0; |
| 1836 | } |