Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1 | /* OpenBSC interface to quagga VTY */ |
| 2 | /* (C) 2009 by Harald Welte <laforge@gnumonks.org> |
| 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 | f9daefd | 2009-08-09 15:13:54 +0200 | [diff] [blame] | 26 | #include <vty/buffer.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 27 | #include <vty/vty.h> |
| 28 | |
| 29 | #include <arpa/inet.h> |
| 30 | |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 31 | #include <openbsc/linuxlist.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 32 | #include <openbsc/gsm_data.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 33 | #include <openbsc/e1_input.h> |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 34 | #include <openbsc/abis_nm.h> |
Harald Welte | f9daefd | 2009-08-09 15:13:54 +0200 | [diff] [blame] | 35 | #include <openbsc/gsm_utils.h> |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 36 | #include <openbsc/db.h> |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 37 | #include <openbsc/talloc.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 38 | |
| 39 | static struct gsm_network *gsmnet; |
| 40 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 41 | struct cmd_node net_node = { |
| 42 | GSMNET_NODE, |
| 43 | "%s(network)#", |
| 44 | 1, |
| 45 | }; |
| 46 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 47 | struct cmd_node bts_node = { |
| 48 | BTS_NODE, |
| 49 | "%s(bts)#", |
| 50 | 1, |
| 51 | }; |
| 52 | |
| 53 | struct cmd_node trx_node = { |
| 54 | TRX_NODE, |
| 55 | "%s(trx)#", |
| 56 | 1, |
| 57 | }; |
| 58 | |
| 59 | struct cmd_node ts_node = { |
| 60 | TS_NODE, |
| 61 | "%s(ts)#", |
| 62 | 1, |
| 63 | }; |
| 64 | |
| 65 | static int dummy_config_write(struct vty *v) |
| 66 | { |
| 67 | return CMD_SUCCESS; |
| 68 | } |
| 69 | |
| 70 | static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms) |
| 71 | { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 72 | vty_out(vty,"Oper '%s', Admin %u, Avail '%s'%s", |
| 73 | nm_opstate_name(nms->operational), nms->administrative, |
| 74 | nm_avail_name(nms->availability), VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | static void net_dump_vty(struct vty *vty, struct gsm_network *net) |
| 78 | { |
Harald Welte | ef235b5 | 2009-03-10 12:34:02 +0000 | [diff] [blame] | 79 | vty_out(vty, "BSC is on Country Code %u, Network Code %u " |
| 80 | "and has %u BTS%s", net->country_code, net->network_code, |
| 81 | net->num_bts, VTY_NEWLINE); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 82 | vty_out(vty, " Long network name: '%s'%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 83 | net->name_long, VTY_NEWLINE); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 84 | vty_out(vty, " Short network name: '%s'%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 85 | net->name_short, VTY_NEWLINE); |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 86 | vty_out(vty, " Authentication policy: %s%s", |
| 87 | gsm_auth_policy_name(net->auth_policy), VTY_NEWLINE); |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 88 | vty_out(vty, " Location updating reject cause: %u%s", |
| 89 | net->reject_cause, VTY_NEWLINE); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 90 | vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption, |
| 91 | VTY_NEWLINE); |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 92 | vty_out(vty, " NECI (TCH/H): %u%s", net->neci, |
| 93 | VTY_NEWLINE); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 94 | vty_out(vty, " RRLP Mode: %s%s", rrlp_mode_name(net->rrlp.mode), |
| 95 | VTY_NEWLINE); |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 96 | vty_out(vty, " MM Info: %s%s", net->send_mm_info ? "On" : "Off", |
| 97 | VTY_NEWLINE); |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 98 | vty_out(vty, " Handover: %s%s", net->handover.active ? "On" : "Off", |
| 99 | VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | DEFUN(show_net, show_net_cmd, "show network", |
| 103 | SHOW_STR "Display information about a GSM NETWORK\n") |
| 104 | { |
| 105 | struct gsm_network *net = gsmnet; |
| 106 | net_dump_vty(vty, net); |
| 107 | |
| 108 | return CMD_SUCCESS; |
| 109 | } |
| 110 | |
| 111 | static void e1isl_dump_vty(struct vty *vty, struct e1inp_sign_link *e1l) |
| 112 | { |
Harald Welte | edb3778 | 2009-05-01 14:59:07 +0000 | [diff] [blame] | 113 | struct e1inp_line *line; |
| 114 | |
| 115 | if (!e1l) { |
| 116 | vty_out(vty, " None%s", VTY_NEWLINE); |
| 117 | return; |
| 118 | } |
| 119 | |
| 120 | line = e1l->ts->line; |
| 121 | |
| 122 | vty_out(vty, " E1 Line %u, Type %s: Timeslot %u, Mode %s%s", |
| 123 | line->num, line->driver->name, e1l->ts->num, |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 124 | e1inp_signtype_name(e1l->type), VTY_NEWLINE); |
Harald Welte | edb3778 | 2009-05-01 14:59:07 +0000 | [diff] [blame] | 125 | vty_out(vty, " E1 TEI %u, SAPI %u%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 126 | e1l->tei, e1l->sapi, VTY_NEWLINE); |
| 127 | } |
| 128 | |
| 129 | static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) |
| 130 | { |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 131 | vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 132 | "BSIC %u, TSC %u and %u TRX%s", |
| 133 | bts->nr, btstype2str(bts->type), gsm_band_name(bts->band), |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 134 | bts->cell_identity, |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 135 | bts->location_area_code, bts->bsic, bts->tsc, |
| 136 | bts->num_trx, VTY_NEWLINE); |
Harald Welte | 1d8dbc4 | 2009-12-12 15:38:16 +0100 | [diff] [blame] | 137 | vty_out(vty, "MS Max power: %u dBm%s", bts->ms_max_power, VTY_NEWLINE); |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 138 | vty_out(vty, "Minimum Rx Level for Access: %i dBm%s", |
Harald Welte | 1d8dbc4 | 2009-12-12 15:38:16 +0100 | [diff] [blame] | 139 | rxlev2dbm(bts->si_common.cell_sel_par.rxlev_acc_min), |
| 140 | VTY_NEWLINE); |
| 141 | vty_out(vty, "Cell Reselection Hysteresis: %u dBm%s", |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 142 | bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 143 | if (bts->cell_barred) |
| 144 | vty_out(vty, " CELL IS BARRED%s", VTY_NEWLINE); |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 145 | if (is_ipaccess_bts(bts)) |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 146 | vty_out(vty, " Unit ID: %u/%u/0, OML Stream ID 0x%02x%s", |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 147 | bts->ip_access.site_id, bts->ip_access.bts_id, |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 148 | bts->oml_tei, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 149 | vty_out(vty, " NM State: "); |
| 150 | net_dump_nmstate(vty, &bts->nm_state); |
| 151 | vty_out(vty, " Site Mgr NM State: "); |
| 152 | net_dump_nmstate(vty, &bts->site_mgr.nm_state); |
| 153 | vty_out(vty, " Paging: FIXME pending requests, %u free slots%s", |
| 154 | bts->paging.available_slots, VTY_NEWLINE); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 155 | if (!is_ipaccess_bts(bts)) { |
| 156 | vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); |
| 157 | e1isl_dump_vty(vty, bts->oml_link); |
| 158 | } |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 159 | /* FIXME: oml_link, chan_desc */ |
| 160 | } |
| 161 | |
| 162 | DEFUN(show_bts, show_bts_cmd, "show bts [number]", |
| 163 | SHOW_STR "Display information about a BTS\n" |
| 164 | "BTS number") |
| 165 | { |
| 166 | struct gsm_network *net = gsmnet; |
| 167 | int bts_nr; |
| 168 | |
| 169 | if (argc != 0) { |
| 170 | /* use the BTS number that the user has specified */ |
| 171 | bts_nr = atoi(argv[0]); |
| 172 | if (bts_nr > net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 173 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 174 | VTY_NEWLINE); |
| 175 | return CMD_WARNING; |
| 176 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 177 | bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 178 | return CMD_SUCCESS; |
| 179 | } |
| 180 | /* print all BTS's */ |
| 181 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 182 | bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 183 | |
| 184 | return CMD_SUCCESS; |
| 185 | } |
| 186 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 187 | /* utility functions */ |
| 188 | static void parse_e1_link(struct gsm_e1_subslot *e1_link, const char *line, |
| 189 | const char *ts, const char *ss) |
| 190 | { |
| 191 | e1_link->e1_nr = atoi(line); |
| 192 | e1_link->e1_ts = atoi(ts); |
| 193 | if (!strcmp(ss, "full")) |
| 194 | e1_link->e1_ts_ss = 255; |
| 195 | else |
| 196 | e1_link->e1_ts_ss = atoi(ss); |
| 197 | } |
| 198 | |
| 199 | static void config_write_e1_link(struct vty *vty, struct gsm_e1_subslot *e1_link, |
| 200 | const char *prefix) |
| 201 | { |
| 202 | if (!e1_link->e1_ts) |
| 203 | return; |
| 204 | |
| 205 | if (e1_link->e1_ts_ss == 255) |
| 206 | vty_out(vty, "%se1 line %u timeslot %u sub-slot full%s", |
| 207 | prefix, e1_link->e1_nr, e1_link->e1_ts, VTY_NEWLINE); |
| 208 | else |
| 209 | vty_out(vty, "%se1 line %u timeslot %u sub-slot %u%s", |
| 210 | prefix, e1_link->e1_nr, e1_link->e1_ts, |
| 211 | e1_link->e1_ts_ss, VTY_NEWLINE); |
| 212 | } |
| 213 | |
| 214 | |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 215 | static void config_write_ts_single(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 216 | { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 217 | vty_out(vty, " timeslot %u%s", ts->nr, VTY_NEWLINE); |
| 218 | if (ts->pchan != GSM_PCHAN_NONE) |
| 219 | vty_out(vty, " phys_chan_config %s%s", |
| 220 | gsm_pchan_name(ts->pchan), VTY_NEWLINE); |
| 221 | config_write_e1_link(vty, &ts->e1_link, " "); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 222 | } |
| 223 | |
| 224 | static void config_write_trx_single(struct vty *vty, struct gsm_bts_trx *trx) |
| 225 | { |
| 226 | int i; |
| 227 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 228 | vty_out(vty, " trx %u%s", trx->nr, VTY_NEWLINE); |
| 229 | vty_out(vty, " arfcn %u%s", trx->arfcn, VTY_NEWLINE); |
| 230 | vty_out(vty, " max_power_red %u%s", trx->max_power_red, VTY_NEWLINE); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 231 | config_write_e1_link(vty, &trx->rsl_e1_link, " rsl "); |
| 232 | vty_out(vty, " rsl e1 tei %u%s", trx->rsl_tei, VTY_NEWLINE); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 233 | |
| 234 | for (i = 0; i < TRX_NR_TS; i++) |
| 235 | config_write_ts_single(vty, &trx->ts[i]); |
| 236 | } |
| 237 | |
| 238 | static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) |
| 239 | { |
| 240 | struct gsm_bts_trx *trx; |
| 241 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 242 | vty_out(vty, " bts %u%s", bts->nr, VTY_NEWLINE); |
| 243 | vty_out(vty, " type %s%s", btstype2str(bts->type), VTY_NEWLINE); |
| 244 | vty_out(vty, " band %s%s", gsm_band_name(bts->band), VTY_NEWLINE); |
Holger Hans Peter Freyther | f926ed6 | 2009-11-19 16:38:49 +0100 | [diff] [blame] | 245 | vty_out(vty, " cell_identity %u%s", bts->cell_identity, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 246 | vty_out(vty, " location_area_code %u%s", bts->location_area_code, |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 247 | VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 248 | vty_out(vty, " training_sequence_code %u%s", bts->tsc, VTY_NEWLINE); |
| 249 | vty_out(vty, " base_station_id_code %u%s", bts->bsic, VTY_NEWLINE); |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 250 | vty_out(vty, " ms max power %u%s", bts->ms_max_power, VTY_NEWLINE); |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 251 | vty_out(vty, " cell reselection hysteresis %u%s", |
| 252 | bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); |
| 253 | vty_out(vty, " rxlev access min %u%s", |
| 254 | bts->si_common.cell_sel_par.rxlev_acc_min, VTY_NEWLINE); |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 255 | if (bts->si_common.chan_desc.t3212) |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 256 | vty_out(vty, " periodic location update %u%s", |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 257 | bts->si_common.chan_desc.t3212 * 10, VTY_NEWLINE); |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 258 | vty_out(vty, " channel allocator %s%s", |
| 259 | bts->chan_alloc_reverse ? "descending" : "ascending", |
| 260 | VTY_NEWLINE); |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 261 | if (bts->cell_barred) |
| 262 | vty_out(vty, " cell barred 1%s", VTY_NEWLINE); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 263 | if (is_ipaccess_bts(bts)) { |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 264 | vty_out(vty, " ip.access unit_id %u %u%s", |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 265 | bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 266 | vty_out(vty, " oml ip.access stream_id %u%s", bts->oml_tei, VTY_NEWLINE); |
| 267 | } else { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 268 | config_write_e1_link(vty, &bts->oml_e1_link, " oml "); |
| 269 | vty_out(vty, " oml e1 tei %u%s", bts->oml_tei, VTY_NEWLINE); |
| 270 | } |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 271 | |
| 272 | llist_for_each_entry(trx, &bts->trx_list, list) |
| 273 | config_write_trx_single(vty, trx); |
| 274 | } |
| 275 | |
| 276 | static int config_write_bts(struct vty *v) |
| 277 | { |
| 278 | struct gsm_bts *bts; |
| 279 | |
| 280 | llist_for_each_entry(bts, &gsmnet->bts_list, list) |
| 281 | config_write_bts_single(v, bts); |
| 282 | |
| 283 | return CMD_SUCCESS; |
| 284 | } |
| 285 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 286 | static int config_write_net(struct vty *vty) |
| 287 | { |
| 288 | vty_out(vty, "network%s", VTY_NEWLINE); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 289 | vty_out(vty, " network country code %u%s", gsmnet->country_code, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 290 | vty_out(vty, " mobile network code %u%s", gsmnet->network_code, VTY_NEWLINE); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 291 | vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE); |
| 292 | vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE); |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 293 | vty_out(vty, " auth policy %s%s", gsm_auth_policy_name(gsmnet->auth_policy), VTY_NEWLINE); |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 294 | vty_out(vty, " location updating reject cause %u%s", |
| 295 | gsmnet->reject_cause, VTY_NEWLINE); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 296 | vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE); |
Holger Hans Peter Freyther | d54c337 | 2009-11-19 16:37:48 +0100 | [diff] [blame] | 297 | vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 298 | vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode), |
| 299 | VTY_NEWLINE); |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 300 | vty_out(vty, " mm info %u%s", gsmnet->send_mm_info, VTY_NEWLINE); |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 301 | vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE); |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 302 | vty_out(vty, " timer t3101 %u%s", gsmnet->T3101, VTY_NEWLINE); |
Holger Hans Peter Freyther | 23975e7 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 303 | vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); |
| 304 | vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); |
| 305 | vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); |
| 306 | vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); |
| 307 | vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); |
| 308 | vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); |
| 309 | vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); |
| 310 | vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); |
| 311 | vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); |
| 312 | vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 313 | |
| 314 | return CMD_SUCCESS; |
| 315 | } |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 316 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 317 | static void trx_dump_vty(struct vty *vty, struct gsm_bts_trx *trx) |
| 318 | { |
| 319 | vty_out(vty, "TRX %u of BTS %u is on ARFCN %u%s", |
| 320 | trx->nr, trx->bts->nr, trx->arfcn, VTY_NEWLINE); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 321 | vty_out(vty, " RF Nominal Power: %d dBm, reduced by %u dB, " |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 322 | "resulting BS power: %d dBm%s", |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 323 | trx->nominal_power, trx->max_power_red, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 324 | trx->nominal_power - trx->max_power_red, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 325 | vty_out(vty, " NM State: "); |
| 326 | net_dump_nmstate(vty, &trx->nm_state); |
| 327 | vty_out(vty, " Baseband Transceiver NM State: "); |
| 328 | net_dump_nmstate(vty, &trx->bb_transc.nm_state); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 329 | if (is_ipaccess_bts(trx->bts)) { |
| 330 | vty_out(vty, " ip.access stream ID: 0x%02x%s", |
| 331 | trx->rsl_tei, VTY_NEWLINE); |
| 332 | } else { |
| 333 | vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); |
| 334 | e1isl_dump_vty(vty, trx->rsl_link); |
| 335 | } |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | DEFUN(show_trx, |
| 339 | show_trx_cmd, |
| 340 | "show trx [bts_nr] [trx_nr]", |
| 341 | SHOW_STR "Display information about a TRX\n") |
| 342 | { |
| 343 | struct gsm_network *net = gsmnet; |
| 344 | struct gsm_bts *bts = NULL; |
| 345 | struct gsm_bts_trx *trx; |
| 346 | int bts_nr, trx_nr; |
| 347 | |
| 348 | if (argc >= 1) { |
| 349 | /* use the BTS number that the user has specified */ |
| 350 | bts_nr = atoi(argv[0]); |
| 351 | if (bts_nr >= net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 352 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 353 | VTY_NEWLINE); |
| 354 | return CMD_WARNING; |
| 355 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 356 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 357 | } |
| 358 | if (argc >= 2) { |
| 359 | trx_nr = atoi(argv[1]); |
| 360 | if (trx_nr >= bts->num_trx) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 361 | vty_out(vty, "%% can't find TRX '%s'%s", argv[1], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 362 | VTY_NEWLINE); |
| 363 | return CMD_WARNING; |
| 364 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 365 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 366 | trx_dump_vty(vty, trx); |
| 367 | return CMD_SUCCESS; |
| 368 | } |
| 369 | if (bts) { |
| 370 | /* print all TRX in this BTS */ |
| 371 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 372 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 373 | trx_dump_vty(vty, trx); |
| 374 | } |
| 375 | return CMD_SUCCESS; |
| 376 | } |
| 377 | |
| 378 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 379 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 380 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 381 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 382 | trx_dump_vty(vty, trx); |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | return CMD_SUCCESS; |
| 387 | } |
| 388 | |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 389 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 390 | static void ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 391 | { |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 392 | vty_out(vty, "Timeslot %u of TRX %u in BTS %u, phys cfg %s%s", |
| 393 | ts->nr, ts->trx->nr, ts->trx->bts->nr, |
| 394 | gsm_pchan_name(ts->pchan), VTY_NEWLINE); |
| 395 | vty_out(vty, " NM State: "); |
| 396 | net_dump_nmstate(vty, &ts->nm_state); |
Harald Welte | 2c82899 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 397 | if (!is_ipaccess_bts(ts->trx->bts)) |
Harald Welte | ef235b5 | 2009-03-10 12:34:02 +0000 | [diff] [blame] | 398 | vty_out(vty, " E1 Line %u, Timeslot %u, Subslot %u%s", |
| 399 | ts->e1_link.e1_nr, ts->e1_link.e1_ts, |
| 400 | ts->e1_link.e1_ts_ss, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 401 | } |
| 402 | |
| 403 | DEFUN(show_ts, |
| 404 | show_ts_cmd, |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 405 | "show timeslot [bts_nr] [trx_nr] [ts_nr]", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 406 | SHOW_STR "Display information about a TS\n") |
| 407 | { |
| 408 | struct gsm_network *net = gsmnet; |
| 409 | struct gsm_bts *bts; |
| 410 | struct gsm_bts_trx *trx; |
| 411 | struct gsm_bts_trx_ts *ts; |
| 412 | int bts_nr, trx_nr, ts_nr; |
| 413 | |
| 414 | if (argc >= 1) { |
| 415 | /* use the BTS number that the user has specified */ |
| 416 | bts_nr = atoi(argv[0]); |
| 417 | if (bts_nr >= net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 418 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 419 | VTY_NEWLINE); |
| 420 | return CMD_WARNING; |
| 421 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 422 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 423 | } |
| 424 | if (argc >= 2) { |
| 425 | trx_nr = atoi(argv[1]); |
| 426 | if (trx_nr >= bts->num_trx) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 427 | vty_out(vty, "%% can't find TRX '%s'%s", argv[1], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 428 | VTY_NEWLINE); |
| 429 | return CMD_WARNING; |
| 430 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 431 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 432 | } |
| 433 | if (argc >= 3) { |
| 434 | ts_nr = atoi(argv[2]); |
| 435 | if (ts_nr >= TRX_NR_TS) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 436 | vty_out(vty, "%% can't find TS '%s'%s", argv[2], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 437 | VTY_NEWLINE); |
| 438 | return CMD_WARNING; |
| 439 | } |
| 440 | ts = &trx->ts[ts_nr]; |
| 441 | ts_dump_vty(vty, ts); |
| 442 | return CMD_SUCCESS; |
| 443 | } |
| 444 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 445 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 446 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 447 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 448 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 449 | ts = &trx->ts[ts_nr]; |
| 450 | ts_dump_vty(vty, ts); |
| 451 | } |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | return CMD_SUCCESS; |
| 456 | } |
| 457 | |
Holger Hans Peter Freyther | cfa90d4 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 458 | void subscr_dump_vty(struct vty *vty, struct gsm_subscriber *subscr) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 459 | { |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 460 | vty_out(vty, " ID: %llu, Authorized: %d%s", subscr->id, |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 461 | subscr->authorized, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 462 | if (subscr->name) |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 463 | vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 464 | if (subscr->extension) |
| 465 | vty_out(vty, " Extension: %s%s", subscr->extension, |
| 466 | VTY_NEWLINE); |
| 467 | if (subscr->imsi) |
| 468 | vty_out(vty, " IMSI: %s%s", subscr->imsi, VTY_NEWLINE); |
Holger Hans Peter Freyther | 2223025 | 2009-08-19 12:53:57 +0200 | [diff] [blame] | 469 | if (subscr->tmsi != GSM_RESERVED_TMSI) |
| 470 | vty_out(vty, " TMSI: %08X%s", subscr->tmsi, |
Harald Welte | 731fd91 | 2009-08-15 03:24:51 +0200 | [diff] [blame] | 471 | VTY_NEWLINE); |
Harald Welte (local) | 15920de | 2009-08-14 20:27:16 +0200 | [diff] [blame] | 472 | vty_out(vty, " Use count: %u%s", subscr->use_count, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 473 | } |
| 474 | |
| 475 | static void lchan_dump_vty(struct vty *vty, struct gsm_lchan *lchan) |
| 476 | { |
| 477 | vty_out(vty, "Lchan %u in Timeslot %u of TRX %u in BTS %u, Type %s%s", |
| 478 | lchan->nr, lchan->ts->nr, lchan->ts->trx->nr, |
| 479 | lchan->ts->trx->bts->nr, gsm_lchan_name(lchan->type), |
| 480 | VTY_NEWLINE); |
| 481 | vty_out(vty, " Use Count: %u%s", lchan->use_count, VTY_NEWLINE); |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 482 | vty_out(vty, " BS Power: %u dBm, MS Power: %u dBm%s", |
| 483 | lchan->ts->trx->nominal_power - lchan->ts->trx->max_power_red |
| 484 | - lchan->bs_power*2, |
| 485 | ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), |
| 486 | VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 487 | if (lchan->subscr) { |
| 488 | vty_out(vty, " Subscriber:%s", VTY_NEWLINE); |
| 489 | subscr_dump_vty(vty, lchan->subscr); |
| 490 | } else |
| 491 | vty_out(vty, " No Subscriber%s", VTY_NEWLINE); |
Harald Welte | 2c82899 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 492 | if (is_ipaccess_bts(lchan->ts->trx->bts)) { |
| 493 | struct in_addr ia; |
| 494 | ia.s_addr = lchan->abis_ip.bound_ip; |
| 495 | vty_out(vty, " Bound IP: %s Port %u RTP_TYPE2=%u CONN_ID=%u%s", |
| 496 | inet_ntoa(ia), lchan->abis_ip.bound_port, |
| 497 | lchan->abis_ip.rtp_payload2, lchan->abis_ip.conn_id, |
| 498 | VTY_NEWLINE); |
| 499 | } |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 500 | } |
| 501 | |
Harald Welte | 4bfdfe7 | 2009-06-10 23:11:52 +0800 | [diff] [blame] | 502 | #if 0 |
| 503 | TODO: callref and remote callref of call must be resolved to get gsm_trans object |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 504 | static void call_dump_vty(struct vty *vty, struct gsm_call *call) |
| 505 | { |
| 506 | vty_out(vty, "Call Type %u, State %u, Transaction ID %u%s", |
| 507 | call->type, call->state, call->transaction_id, VTY_NEWLINE); |
| 508 | |
| 509 | if (call->local_lchan) { |
| 510 | vty_out(vty, "Call Local Channel:%s", VTY_NEWLINE); |
| 511 | lchan_dump_vty(vty, call->local_lchan); |
| 512 | } else |
| 513 | vty_out(vty, "Call has no Local Channel%s", VTY_NEWLINE); |
| 514 | |
| 515 | if (call->remote_lchan) { |
| 516 | vty_out(vty, "Call Remote Channel:%s", VTY_NEWLINE); |
| 517 | lchan_dump_vty(vty, call->remote_lchan); |
| 518 | } else |
| 519 | vty_out(vty, "Call has no Remote Channel%s", VTY_NEWLINE); |
| 520 | |
| 521 | if (call->called_subscr) { |
| 522 | vty_out(vty, "Called Subscriber:%s", VTY_NEWLINE); |
| 523 | subscr_dump_vty(vty, call->called_subscr); |
| 524 | } else |
| 525 | vty_out(vty, "Call has no Called Subscriber%s", VTY_NEWLINE); |
| 526 | } |
Harald Welte | 4bfdfe7 | 2009-06-10 23:11:52 +0800 | [diff] [blame] | 527 | #endif |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 528 | |
| 529 | DEFUN(show_lchan, |
| 530 | show_lchan_cmd, |
| 531 | "show lchan [bts_nr] [trx_nr] [ts_nr] [lchan_nr]", |
| 532 | SHOW_STR "Display information about a logical channel\n") |
| 533 | { |
| 534 | struct gsm_network *net = gsmnet; |
| 535 | struct gsm_bts *bts; |
| 536 | struct gsm_bts_trx *trx; |
| 537 | struct gsm_bts_trx_ts *ts; |
| 538 | struct gsm_lchan *lchan; |
| 539 | int bts_nr, trx_nr, ts_nr, lchan_nr; |
| 540 | |
| 541 | if (argc >= 1) { |
| 542 | /* use the BTS number that the user has specified */ |
| 543 | bts_nr = atoi(argv[0]); |
| 544 | if (bts_nr >= net->num_bts) { |
| 545 | vty_out(vty, "%% can't find BTS %s%s", argv[0], |
| 546 | VTY_NEWLINE); |
| 547 | return CMD_WARNING; |
| 548 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 549 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 550 | } |
| 551 | if (argc >= 2) { |
| 552 | trx_nr = atoi(argv[1]); |
| 553 | if (trx_nr >= bts->num_trx) { |
| 554 | vty_out(vty, "%% can't find TRX %s%s", argv[1], |
| 555 | VTY_NEWLINE); |
| 556 | return CMD_WARNING; |
| 557 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 558 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 559 | } |
| 560 | if (argc >= 3) { |
| 561 | ts_nr = atoi(argv[2]); |
| 562 | if (ts_nr >= TRX_NR_TS) { |
| 563 | vty_out(vty, "%% can't find TS %s%s", argv[2], |
| 564 | VTY_NEWLINE); |
| 565 | return CMD_WARNING; |
| 566 | } |
| 567 | ts = &trx->ts[ts_nr]; |
| 568 | } |
| 569 | if (argc >= 4) { |
| 570 | lchan_nr = atoi(argv[3]); |
| 571 | if (lchan_nr >= TS_MAX_LCHAN) { |
| 572 | vty_out(vty, "%% can't find LCHAN %s%s", argv[3], |
| 573 | VTY_NEWLINE); |
| 574 | return CMD_WARNING; |
| 575 | } |
| 576 | lchan = &ts->lchan[lchan_nr]; |
| 577 | lchan_dump_vty(vty, lchan); |
| 578 | return CMD_SUCCESS; |
| 579 | } |
| 580 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 581 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 582 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 583 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 584 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 585 | ts = &trx->ts[ts_nr]; |
| 586 | for (lchan_nr = 0; lchan_nr < TS_MAX_LCHAN; |
| 587 | lchan_nr++) { |
| 588 | lchan = &ts->lchan[lchan_nr]; |
Harald Welte | ef235b5 | 2009-03-10 12:34:02 +0000 | [diff] [blame] | 589 | if (lchan->type == GSM_LCHAN_NONE) |
| 590 | continue; |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 591 | lchan_dump_vty(vty, lchan); |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | return CMD_SUCCESS; |
| 598 | } |
| 599 | |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 600 | static void e1drv_dump_vty(struct vty *vty, struct e1inp_driver *drv) |
| 601 | { |
| 602 | vty_out(vty, "E1 Input Driver %s%s", drv->name, VTY_NEWLINE); |
| 603 | } |
| 604 | |
| 605 | DEFUN(show_e1drv, |
| 606 | show_e1drv_cmd, |
| 607 | "show e1_driver", |
| 608 | SHOW_STR "Display information about available E1 drivers\n") |
| 609 | { |
| 610 | struct e1inp_driver *drv; |
| 611 | |
| 612 | llist_for_each_entry(drv, &e1inp_driver_list, list) |
| 613 | e1drv_dump_vty(vty, drv); |
| 614 | |
| 615 | return CMD_SUCCESS; |
| 616 | } |
| 617 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 618 | static void e1line_dump_vty(struct vty *vty, struct e1inp_line *line) |
| 619 | { |
| 620 | vty_out(vty, "E1 Line Number %u, Name %s, Driver %s%s", |
| 621 | line->num, line->name ? line->name : "", |
| 622 | line->driver->name, VTY_NEWLINE); |
| 623 | } |
| 624 | |
| 625 | DEFUN(show_e1line, |
| 626 | show_e1line_cmd, |
| 627 | "show e1_line [line_nr]", |
| 628 | SHOW_STR "Display information about a E1 line\n") |
| 629 | { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 630 | struct e1inp_line *line; |
| 631 | |
| 632 | if (argc >= 1) { |
| 633 | int num = atoi(argv[0]); |
| 634 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 635 | if (line->num == num) { |
| 636 | e1line_dump_vty(vty, line); |
| 637 | return CMD_SUCCESS; |
| 638 | } |
| 639 | } |
| 640 | return CMD_WARNING; |
| 641 | } |
| 642 | |
| 643 | llist_for_each_entry(line, &e1inp_line_list, list) |
| 644 | e1line_dump_vty(vty, line); |
| 645 | |
| 646 | return CMD_SUCCESS; |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 647 | } |
| 648 | |
| 649 | static void e1ts_dump_vty(struct vty *vty, struct e1inp_ts *ts) |
| 650 | { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 651 | if (ts->type == E1INP_TS_TYPE_NONE) |
| 652 | return; |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 653 | vty_out(vty, "E1 Timeslot %2u of Line %u is Type %s%s", |
| 654 | ts->num, ts->line->num, e1inp_tstype_name(ts->type), |
| 655 | VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 656 | } |
| 657 | |
| 658 | DEFUN(show_e1ts, |
| 659 | show_e1ts_cmd, |
| 660 | "show e1_timeslot [line_nr] [ts_nr]", |
| 661 | SHOW_STR "Display information about a E1 timeslot\n") |
| 662 | { |
Harald Welte | 986c3d7 | 2009-11-17 06:12:16 +0100 | [diff] [blame] | 663 | struct e1inp_line *line = NULL; |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 664 | struct e1inp_ts *ts; |
| 665 | int ts_nr; |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 666 | |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 667 | if (argc == 0) { |
| 668 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 669 | for (ts_nr = 0; ts_nr < NUM_E1_TS; ts_nr++) { |
| 670 | ts = &line->ts[ts_nr]; |
| 671 | e1ts_dump_vty(vty, ts); |
| 672 | } |
| 673 | } |
| 674 | return CMD_SUCCESS; |
| 675 | } |
| 676 | if (argc >= 1) { |
| 677 | int num = atoi(argv[0]); |
| 678 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 679 | if (line->num == num) |
| 680 | break; |
| 681 | } |
| 682 | if (!line || line->num != num) { |
| 683 | vty_out(vty, "E1 line %s is invalid%s", |
| 684 | argv[0], VTY_NEWLINE); |
| 685 | return CMD_WARNING; |
| 686 | } |
| 687 | } |
| 688 | if (argc >= 2) { |
| 689 | ts_nr = atoi(argv[1]); |
| 690 | if (ts_nr > NUM_E1_TS) { |
| 691 | vty_out(vty, "E1 timeslot %s is invalid%s", |
| 692 | argv[1], VTY_NEWLINE); |
| 693 | return CMD_WARNING; |
| 694 | } |
| 695 | ts = &line->ts[ts_nr]; |
| 696 | e1ts_dump_vty(vty, ts); |
| 697 | return CMD_SUCCESS; |
| 698 | } else { |
| 699 | for (ts_nr = 0; ts_nr < NUM_E1_TS; ts_nr++) { |
| 700 | ts = &line->ts[ts_nr]; |
| 701 | e1ts_dump_vty(vty, ts); |
| 702 | } |
| 703 | return CMD_SUCCESS; |
| 704 | } |
| 705 | return CMD_SUCCESS; |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 706 | } |
| 707 | |
Harald Welte | be4b730 | 2009-05-23 16:59:33 +0000 | [diff] [blame] | 708 | static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag) |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 709 | { |
| 710 | vty_out(vty, "Paging on BTS %u%s", pag->bts->nr, VTY_NEWLINE); |
| 711 | subscr_dump_vty(vty, pag->subscr); |
| 712 | } |
| 713 | |
Harald Welte | be4b730 | 2009-05-23 16:59:33 +0000 | [diff] [blame] | 714 | static void bts_paging_dump_vty(struct vty *vty, struct gsm_bts *bts) |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 715 | { |
| 716 | struct gsm_paging_request *pag; |
| 717 | |
| 718 | llist_for_each_entry(pag, &bts->paging.pending_requests, entry) |
| 719 | paging_dump_vty(vty, pag); |
| 720 | } |
| 721 | |
| 722 | DEFUN(show_paging, |
| 723 | show_paging_cmd, |
| 724 | "show paging [bts_nr]", |
Harald Welte | be4b730 | 2009-05-23 16:59:33 +0000 | [diff] [blame] | 725 | SHOW_STR "Display information about paging reuqests of a BTS\n") |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 726 | { |
| 727 | struct gsm_network *net = gsmnet; |
| 728 | struct gsm_bts *bts; |
| 729 | int bts_nr; |
| 730 | |
| 731 | if (argc >= 1) { |
| 732 | /* use the BTS number that the user has specified */ |
| 733 | bts_nr = atoi(argv[0]); |
| 734 | if (bts_nr >= net->num_bts) { |
| 735 | vty_out(vty, "%% can't find BTS %s%s", argv[0], |
| 736 | VTY_NEWLINE); |
| 737 | return CMD_WARNING; |
| 738 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 739 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 740 | bts_paging_dump_vty(vty, bts); |
| 741 | |
| 742 | return CMD_SUCCESS; |
| 743 | } |
| 744 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 745 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 746 | bts_paging_dump_vty(vty, bts); |
| 747 | } |
| 748 | |
| 749 | return CMD_SUCCESS; |
| 750 | } |
| 751 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 752 | DEFUN(cfg_net, |
| 753 | cfg_net_cmd, |
| 754 | "network", |
| 755 | "Configure the GSM network") |
| 756 | { |
| 757 | vty->index = gsmnet; |
| 758 | vty->node = GSMNET_NODE; |
| 759 | |
| 760 | return CMD_SUCCESS; |
| 761 | } |
| 762 | |
| 763 | |
| 764 | DEFUN(cfg_net_ncc, |
| 765 | cfg_net_ncc_cmd, |
| 766 | "network country code <1-999>", |
| 767 | "Set the GSM network country code") |
| 768 | { |
| 769 | gsmnet->country_code = atoi(argv[0]); |
| 770 | |
| 771 | return CMD_SUCCESS; |
| 772 | } |
| 773 | |
| 774 | DEFUN(cfg_net_mnc, |
| 775 | cfg_net_mnc_cmd, |
| 776 | "mobile network code <1-999>", |
| 777 | "Set the GSM mobile network code") |
| 778 | { |
| 779 | gsmnet->network_code = atoi(argv[0]); |
| 780 | |
| 781 | return CMD_SUCCESS; |
| 782 | } |
| 783 | |
| 784 | DEFUN(cfg_net_name_short, |
| 785 | cfg_net_name_short_cmd, |
| 786 | "short name NAME", |
| 787 | "Set the short GSM network name") |
| 788 | { |
| 789 | if (gsmnet->name_short) |
| 790 | talloc_free(gsmnet->name_short); |
| 791 | |
| 792 | gsmnet->name_short = talloc_strdup(gsmnet, argv[0]); |
| 793 | |
| 794 | return CMD_SUCCESS; |
| 795 | } |
| 796 | |
| 797 | DEFUN(cfg_net_name_long, |
| 798 | cfg_net_name_long_cmd, |
| 799 | "long name NAME", |
| 800 | "Set the long GSM network name") |
| 801 | { |
| 802 | if (gsmnet->name_long) |
| 803 | talloc_free(gsmnet->name_long); |
| 804 | |
| 805 | gsmnet->name_long = talloc_strdup(gsmnet, argv[0]); |
| 806 | |
| 807 | return CMD_SUCCESS; |
| 808 | } |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 809 | |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 810 | DEFUN(cfg_net_auth_policy, |
| 811 | cfg_net_auth_policy_cmd, |
| 812 | "auth policy (closed|accept-all|token)", |
| 813 | "Set the GSM network authentication policy\n") |
| 814 | { |
| 815 | enum gsm_auth_policy policy = gsm_auth_policy_parse(argv[0]); |
| 816 | |
| 817 | gsmnet->auth_policy = policy; |
| 818 | |
| 819 | return CMD_SUCCESS; |
| 820 | } |
| 821 | |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 822 | DEFUN(cfg_net_reject_cause, |
| 823 | cfg_net_reject_cause_cmd, |
| 824 | "location updating reject cause <2-111>", |
| 825 | "Set the reject cause of location updating reject\n") |
| 826 | { |
| 827 | gsmnet->reject_cause = atoi(argv[0]); |
| 828 | |
| 829 | return CMD_SUCCESS; |
| 830 | } |
| 831 | |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 832 | DEFUN(cfg_net_encryption, |
| 833 | cfg_net_encryption_cmd, |
| 834 | "encryption a5 (0|1|2)", |
| 835 | "Enable or disable encryption (A5) for this network\n") |
| 836 | { |
Andreas.Eversberg | 1059deb | 2009-11-17 09:55:26 +0100 | [diff] [blame] | 837 | gsmnet->a5_encryption= atoi(argv[0]); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 838 | |
| 839 | return CMD_SUCCESS; |
| 840 | } |
| 841 | |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 842 | DEFUN(cfg_net_neci, |
| 843 | cfg_net_neci_cmd, |
| 844 | "neci (0|1)", |
| 845 | "Set if NECI of cell selection is to be set") |
| 846 | { |
| 847 | gsmnet->neci = atoi(argv[0]); |
| 848 | return CMD_SUCCESS; |
| 849 | } |
| 850 | |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 851 | DEFUN(cfg_net_rrlp_mode, cfg_net_rrlp_mode_cmd, |
| 852 | "rrlp mode (none|ms-based|ms-preferred|ass-preferred)", |
| 853 | "Set the Radio Resource Location Protocol Mode") |
| 854 | { |
| 855 | gsmnet->rrlp.mode = rrlp_mode_parse(argv[0]); |
| 856 | |
| 857 | return CMD_SUCCESS; |
| 858 | } |
| 859 | |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 860 | DEFUN(cfg_net_mm_info, cfg_net_mm_info_cmd, |
| 861 | "mm info (0|1)", |
| 862 | "Whether to send MM INFO after LOC UPD ACCEPT") |
| 863 | { |
| 864 | gsmnet->send_mm_info = atoi(argv[0]); |
| 865 | |
| 866 | return CMD_SUCCESS; |
| 867 | } |
| 868 | |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 869 | DEFUN(cfg_net_handover, cfg_net_handover_cmd, |
| 870 | "handover (0|1)", |
| 871 | "Whether or not to use in-call handover") |
| 872 | { |
| 873 | gsmnet->handover.active = atoi(argv[0]); |
| 874 | |
| 875 | return CMD_SUCCESS; |
| 876 | } |
| 877 | |
| 878 | |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 879 | #define DECLARE_TIMER(number) \ |
| 880 | DEFUN(cfg_net_T##number, \ |
| 881 | cfg_net_T##number##_cmd, \ |
| 882 | "timer t" #number " <0-65535>", \ |
| 883 | "Set the T" #number " value.") \ |
| 884 | { \ |
| 885 | int value = atoi(argv[0]); \ |
| 886 | \ |
| 887 | if (value < 0 || value > 65535) { \ |
| 888 | vty_out(vty, "Timer value %s out of range.%s", \ |
| 889 | argv[0], VTY_NEWLINE); \ |
| 890 | return CMD_WARNING; \ |
| 891 | } \ |
| 892 | \ |
| 893 | gsmnet->T##number = value; \ |
| 894 | return CMD_SUCCESS; \ |
| 895 | } |
| 896 | |
| 897 | DECLARE_TIMER(3101) |
Holger Hans Peter Freyther | 23975e7 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 898 | DECLARE_TIMER(3103) |
| 899 | DECLARE_TIMER(3105) |
| 900 | DECLARE_TIMER(3107) |
| 901 | DECLARE_TIMER(3109) |
| 902 | DECLARE_TIMER(3111) |
| 903 | DECLARE_TIMER(3113) |
| 904 | DECLARE_TIMER(3115) |
| 905 | DECLARE_TIMER(3117) |
| 906 | DECLARE_TIMER(3119) |
| 907 | DECLARE_TIMER(3141) |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 908 | |
| 909 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 910 | /* per-BTS configuration */ |
| 911 | DEFUN(cfg_bts, |
| 912 | cfg_bts_cmd, |
| 913 | "bts BTS_NR", |
| 914 | "Select a BTS to configure\n") |
| 915 | { |
| 916 | int bts_nr = atoi(argv[0]); |
| 917 | struct gsm_bts *bts; |
| 918 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 919 | if (bts_nr > gsmnet->num_bts) { |
| 920 | vty_out(vty, "%% The next unused BTS number is %u%s", |
| 921 | gsmnet->num_bts, VTY_NEWLINE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 922 | return CMD_WARNING; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 923 | } else if (bts_nr == gsmnet->num_bts) { |
| 924 | /* allocate a new one */ |
| 925 | bts = gsm_bts_alloc(gsmnet, GSM_BTS_TYPE_UNKNOWN, |
| 926 | HARDCODED_TSC, HARDCODED_BSIC); |
| 927 | } else |
| 928 | bts = gsm_bts_num(gsmnet, bts_nr); |
| 929 | |
| 930 | if (!bts) |
| 931 | return CMD_WARNING; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 932 | |
| 933 | vty->index = bts; |
| 934 | vty->node = BTS_NODE; |
| 935 | |
| 936 | return CMD_SUCCESS; |
| 937 | } |
| 938 | |
| 939 | DEFUN(cfg_bts_type, |
| 940 | cfg_bts_type_cmd, |
| 941 | "type TYPE", |
| 942 | "Set the BTS type\n") |
| 943 | { |
| 944 | struct gsm_bts *bts = vty->index; |
| 945 | |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 946 | bts->type = parse_btstype(argv[0]); |
| 947 | |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 948 | if (is_ipaccess_bts(bts)) { |
| 949 | /* Set the default OML Stream ID to 0xff */ |
| 950 | bts->oml_tei = 0xff; |
| 951 | } |
| 952 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 953 | return CMD_SUCCESS; |
| 954 | } |
| 955 | |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 956 | DEFUN(cfg_bts_band, |
| 957 | cfg_bts_band_cmd, |
| 958 | "band BAND", |
| 959 | "Set the frequency band of this BTS\n") |
| 960 | { |
| 961 | struct gsm_bts *bts = vty->index; |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 962 | int band = gsm_band_parse(argv[0]); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 963 | |
| 964 | if (band < 0) { |
| 965 | vty_out(vty, "%% BAND %d is not a valid GSM band%s", |
| 966 | band, VTY_NEWLINE); |
| 967 | return CMD_WARNING; |
| 968 | } |
| 969 | |
| 970 | bts->band = band; |
| 971 | |
| 972 | return CMD_SUCCESS; |
| 973 | } |
| 974 | |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 975 | DEFUN(cfg_bts_ci, |
| 976 | cfg_bts_ci_cmd, |
| 977 | "cell_identity <0-65535>", |
| 978 | "Set the Cell identity of this BTS\n") |
| 979 | { |
| 980 | struct gsm_bts *bts = vty->index; |
| 981 | int ci = atoi(argv[0]); |
| 982 | |
| 983 | if (ci < 0 || ci > 0xffff) { |
| 984 | vty_out(vty, "%% CI %d is not in the valid range (0-65535)%s", |
| 985 | ci, VTY_NEWLINE); |
| 986 | return CMD_WARNING; |
| 987 | } |
| 988 | bts->cell_identity = ci; |
| 989 | |
| 990 | return CMD_SUCCESS; |
| 991 | } |
| 992 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 993 | DEFUN(cfg_bts_lac, |
| 994 | cfg_bts_lac_cmd, |
Holger Hans Peter Freyther | 0b7f4b3 | 2009-09-29 14:02:33 +0200 | [diff] [blame] | 995 | "location_area_code <0-65535>", |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 996 | "Set the Location Area Code (LAC) of this BTS\n") |
| 997 | { |
| 998 | struct gsm_bts *bts = vty->index; |
| 999 | int lac = atoi(argv[0]); |
| 1000 | |
Holger Hans Peter Freyther | 0b7f4b3 | 2009-09-29 14:02:33 +0200 | [diff] [blame] | 1001 | if (lac < 0 || lac > 0xffff) { |
| 1002 | vty_out(vty, "%% LAC %d is not in the valid range (0-65535)%s", |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1003 | lac, VTY_NEWLINE); |
| 1004 | return CMD_WARNING; |
| 1005 | } |
Holger Hans Peter Freyther | e48b956 | 2009-10-01 04:07:15 +0200 | [diff] [blame] | 1006 | |
| 1007 | if (lac == GSM_LAC_RESERVED_DETACHED || lac == GSM_LAC_RESERVED_ALL_BTS) { |
| 1008 | vty_out(vty, "%% LAC %d is reserved by GSM 04.08%s", |
| 1009 | lac, VTY_NEWLINE); |
| 1010 | return CMD_WARNING; |
| 1011 | } |
| 1012 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1013 | bts->location_area_code = lac; |
| 1014 | |
| 1015 | return CMD_SUCCESS; |
| 1016 | } |
| 1017 | |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 1018 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1019 | DEFUN(cfg_bts_tsc, |
| 1020 | cfg_bts_tsc_cmd, |
| 1021 | "training_sequence_code <0-255>", |
| 1022 | "Set the Training Sequence Code (TSC) of this BTS\n") |
| 1023 | { |
| 1024 | struct gsm_bts *bts = vty->index; |
| 1025 | int tsc = atoi(argv[0]); |
| 1026 | |
| 1027 | if (tsc < 0 || tsc > 0xff) { |
| 1028 | vty_out(vty, "%% TSC %d is not in the valid range (0-255)%s", |
| 1029 | tsc, VTY_NEWLINE); |
| 1030 | return CMD_WARNING; |
| 1031 | } |
| 1032 | bts->tsc = tsc; |
| 1033 | |
| 1034 | return CMD_SUCCESS; |
| 1035 | } |
| 1036 | |
Harald Welte | 78f2f50 | 2009-05-23 16:56:52 +0000 | [diff] [blame] | 1037 | DEFUN(cfg_bts_bsic, |
| 1038 | cfg_bts_bsic_cmd, |
| 1039 | "base_station_id_code <0-63>", |
| 1040 | "Set the Base Station Identity Code (BSIC) of this BTS\n") |
| 1041 | { |
| 1042 | struct gsm_bts *bts = vty->index; |
| 1043 | int bsic = atoi(argv[0]); |
| 1044 | |
| 1045 | if (bsic < 0 || bsic > 0x3f) { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1046 | vty_out(vty, "%% BSIC %d is not in the valid range (0-255)%s", |
Harald Welte | 78f2f50 | 2009-05-23 16:56:52 +0000 | [diff] [blame] | 1047 | bsic, VTY_NEWLINE); |
| 1048 | return CMD_WARNING; |
| 1049 | } |
| 1050 | bts->bsic = bsic; |
| 1051 | |
| 1052 | return CMD_SUCCESS; |
| 1053 | } |
| 1054 | |
| 1055 | |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1056 | DEFUN(cfg_bts_unit_id, |
| 1057 | cfg_bts_unit_id_cmd, |
Harald Welte | 07dc73d | 2009-08-07 13:27:09 +0200 | [diff] [blame] | 1058 | "ip.access unit_id <0-65534> <0-255>", |
| 1059 | "Set the ip.access BTS Unit ID of this BTS\n") |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1060 | { |
| 1061 | struct gsm_bts *bts = vty->index; |
| 1062 | int site_id = atoi(argv[0]); |
| 1063 | int bts_id = atoi(argv[1]); |
| 1064 | |
Harald Welte | 07dc73d | 2009-08-07 13:27:09 +0200 | [diff] [blame] | 1065 | if (!is_ipaccess_bts(bts)) { |
| 1066 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1067 | return CMD_WARNING; |
| 1068 | } |
| 1069 | |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1070 | bts->ip_access.site_id = site_id; |
| 1071 | bts->ip_access.bts_id = bts_id; |
| 1072 | |
| 1073 | return CMD_SUCCESS; |
| 1074 | } |
| 1075 | |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1076 | DEFUN(cfg_bts_stream_id, |
| 1077 | cfg_bts_stream_id_cmd, |
| 1078 | "oml ip.access stream_id <0-255>", |
| 1079 | "Set the ip.access Stream ID of the OML link of this BTS\n") |
| 1080 | { |
| 1081 | struct gsm_bts *bts = vty->index; |
| 1082 | int stream_id = atoi(argv[0]); |
| 1083 | |
| 1084 | if (!is_ipaccess_bts(bts)) { |
| 1085 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1086 | return CMD_WARNING; |
| 1087 | } |
| 1088 | |
| 1089 | bts->oml_tei = stream_id; |
| 1090 | |
| 1091 | return CMD_SUCCESS; |
| 1092 | } |
| 1093 | |
| 1094 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1095 | DEFUN(cfg_bts_oml_e1, |
| 1096 | cfg_bts_oml_e1_cmd, |
| 1097 | "oml e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
| 1098 | "E1 interface to be used for OML\n") |
| 1099 | { |
| 1100 | struct gsm_bts *bts = vty->index; |
| 1101 | |
| 1102 | parse_e1_link(&bts->oml_e1_link, argv[0], argv[1], argv[2]); |
| 1103 | |
| 1104 | return CMD_SUCCESS; |
| 1105 | } |
| 1106 | |
| 1107 | |
| 1108 | DEFUN(cfg_bts_oml_e1_tei, |
| 1109 | cfg_bts_oml_e1_tei_cmd, |
| 1110 | "oml e1 tei <0-63>", |
| 1111 | "Set the TEI to be used for OML") |
| 1112 | { |
| 1113 | struct gsm_bts *bts = vty->index; |
| 1114 | |
| 1115 | bts->oml_tei = atoi(argv[0]); |
| 1116 | |
| 1117 | return CMD_SUCCESS; |
| 1118 | } |
| 1119 | |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1120 | DEFUN(cfg_bts_challoc, cfg_bts_challoc_cmd, |
| 1121 | "channel allocator (ascending|descending)", |
| 1122 | "Should the channel allocator allocate in reverse TRX order?") |
| 1123 | { |
| 1124 | struct gsm_bts *bts = vty->index; |
| 1125 | |
| 1126 | if (!strcmp(argv[0], "ascending")) |
| 1127 | bts->chan_alloc_reverse = 0; |
| 1128 | else |
| 1129 | bts->chan_alloc_reverse = 1; |
| 1130 | |
| 1131 | return CMD_SUCCESS; |
| 1132 | } |
| 1133 | |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 1134 | DEFUN(cfg_bts_cell_barred, cfg_bts_cell_barred_cmd, |
| 1135 | "cell barred (0|1)", |
| 1136 | "Should this cell be barred from access?") |
| 1137 | { |
| 1138 | struct gsm_bts *bts = vty->index; |
| 1139 | |
| 1140 | bts->cell_barred = atoi(argv[0]); |
| 1141 | |
| 1142 | return CMD_SUCCESS; |
| 1143 | } |
| 1144 | |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 1145 | DEFUN(cfg_bts_ms_max_power, cfg_bts_ms_max_power_cmd, |
| 1146 | "ms max power <0-40>", |
| 1147 | "Maximum transmit power of the MS") |
| 1148 | { |
| 1149 | struct gsm_bts *bts = vty->index; |
| 1150 | |
| 1151 | bts->ms_max_power = atoi(argv[0]); |
| 1152 | |
| 1153 | return CMD_SUCCESS; |
| 1154 | } |
| 1155 | |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 1156 | DEFUN(cfg_bts_cell_resel_hyst, cfg_bts_cell_resel_hyst_cmd, |
| 1157 | "cell reselection hysteresis <0-14>", |
| 1158 | "Cell Re-Selection Hysteresis in dB") |
| 1159 | { |
| 1160 | struct gsm_bts *bts = vty->index; |
| 1161 | |
| 1162 | bts->si_common.cell_sel_par.cell_resel_hyst = atoi(argv[0])/2; |
| 1163 | |
| 1164 | return CMD_SUCCESS; |
| 1165 | } |
| 1166 | |
| 1167 | DEFUN(cfg_bts_rxlev_acc_min, cfg_bts_rxlev_acc_min_cmd, |
| 1168 | "rxlev access min <0-63>", |
| 1169 | "Minimum RxLev needed for cell access (better than -110dBm)") |
| 1170 | { |
| 1171 | struct gsm_bts *bts = vty->index; |
| 1172 | |
| 1173 | bts->si_common.cell_sel_par.rxlev_acc_min = atoi(argv[0]); |
| 1174 | |
| 1175 | return CMD_SUCCESS; |
| 1176 | } |
| 1177 | |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 1178 | DEFUN(cfg_bts_per_loc_upd, cfg_bts_per_loc_upd_cmd, |
| 1179 | "periodic location update <0-1530>", |
| 1180 | "Periodic Location Updating Interval in Minutes") |
| 1181 | { |
| 1182 | struct gsm_bts *bts = vty->index; |
| 1183 | |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 1184 | bts->si_common.chan_desc.t3212 = atoi(argv[0]) / 10; |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 1185 | |
| 1186 | return CMD_SUCCESS; |
| 1187 | } |
| 1188 | |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1189 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1190 | /* per TRX configuration */ |
| 1191 | DEFUN(cfg_trx, |
| 1192 | cfg_trx_cmd, |
| 1193 | "trx TRX_NR", |
| 1194 | "Select a TRX to configure") |
| 1195 | { |
| 1196 | int trx_nr = atoi(argv[0]); |
| 1197 | struct gsm_bts *bts = vty->index; |
| 1198 | struct gsm_bts_trx *trx; |
| 1199 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1200 | if (trx_nr > bts->num_trx) { |
| 1201 | vty_out(vty, "%% The next unused TRX number in this BTS is %u%s", |
| 1202 | bts->num_trx, VTY_NEWLINE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1203 | return CMD_WARNING; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1204 | } else if (trx_nr == bts->num_trx) { |
| 1205 | /* we need to allocate a new one */ |
| 1206 | trx = gsm_bts_trx_alloc(bts); |
| 1207 | } else |
| 1208 | trx = gsm_bts_trx_num(bts, trx_nr); |
| 1209 | |
| 1210 | if (!trx) |
| 1211 | return CMD_WARNING; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1212 | |
| 1213 | vty->index = trx; |
| 1214 | vty->node = TRX_NODE; |
| 1215 | |
| 1216 | return CMD_SUCCESS; |
| 1217 | } |
| 1218 | |
| 1219 | DEFUN(cfg_trx_arfcn, |
| 1220 | cfg_trx_arfcn_cmd, |
| 1221 | "arfcn <1-1024>", |
| 1222 | "Set the ARFCN for this TRX\n") |
| 1223 | { |
| 1224 | int arfcn = atoi(argv[0]); |
| 1225 | struct gsm_bts_trx *trx = vty->index; |
| 1226 | |
| 1227 | /* FIXME: check if this ARFCN is supported by this TRX */ |
| 1228 | |
| 1229 | trx->arfcn = arfcn; |
| 1230 | |
| 1231 | /* FIXME: patch ARFCN into SYSTEM INFORMATION */ |
| 1232 | /* FIXME: use OML layer to update the ARFCN */ |
| 1233 | /* FIXME: use RSL layer to update SYSTEM INFORMATION */ |
| 1234 | |
| 1235 | return CMD_SUCCESS; |
| 1236 | } |
| 1237 | |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1238 | DEFUN(cfg_trx_max_power_red, |
| 1239 | cfg_trx_max_power_red_cmd, |
| 1240 | "max_power_red <0-100>", |
| 1241 | "Reduction of maximum BS RF Power in dB\n") |
| 1242 | { |
| 1243 | int maxpwr_r = atoi(argv[0]); |
| 1244 | struct gsm_bts_trx *trx = vty->index; |
Harald Welte | 61a83b2 | 2009-11-18 09:20:22 +0100 | [diff] [blame] | 1245 | int upper_limit = 24; /* default 12.21 max power red. */ |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1246 | |
| 1247 | /* FIXME: check if our BTS type supports more than 12 */ |
| 1248 | if (maxpwr_r < 0 || maxpwr_r > upper_limit) { |
| 1249 | vty_out(vty, "%% Power %d dB is not in the valid range%s", |
| 1250 | maxpwr_r, VTY_NEWLINE); |
| 1251 | return CMD_WARNING; |
| 1252 | } |
| 1253 | if (maxpwr_r & 1) { |
| 1254 | vty_out(vty, "%% Power %d dB is not an even value%s", |
| 1255 | maxpwr_r, VTY_NEWLINE); |
| 1256 | return CMD_WARNING; |
| 1257 | } |
| 1258 | |
| 1259 | trx->max_power_red = maxpwr_r; |
| 1260 | |
| 1261 | /* FIXME: make sure we update this using OML */ |
| 1262 | |
| 1263 | return CMD_SUCCESS; |
| 1264 | } |
| 1265 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1266 | DEFUN(cfg_trx_rsl_e1, |
| 1267 | cfg_trx_rsl_e1_cmd, |
| 1268 | "rsl e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
| 1269 | "E1 interface to be used for RSL\n") |
| 1270 | { |
| 1271 | struct gsm_bts_trx *trx = vty->index; |
| 1272 | |
| 1273 | parse_e1_link(&trx->rsl_e1_link, argv[0], argv[1], argv[2]); |
| 1274 | |
| 1275 | return CMD_SUCCESS; |
| 1276 | } |
| 1277 | |
| 1278 | DEFUN(cfg_trx_rsl_e1_tei, |
| 1279 | cfg_trx_rsl_e1_tei_cmd, |
| 1280 | "rsl e1 tei <0-63>", |
| 1281 | "Set the TEI to be used for RSL") |
| 1282 | { |
| 1283 | struct gsm_bts_trx *trx = vty->index; |
| 1284 | |
| 1285 | trx->rsl_tei = atoi(argv[0]); |
| 1286 | |
| 1287 | return CMD_SUCCESS; |
| 1288 | } |
| 1289 | |
Holger Hans Peter Freyther | 2d501ea | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 1290 | DEFUN(cfg_trx_rf_locked, |
| 1291 | cfg_trx_rf_locked_cmd, |
| 1292 | "rf_locked (0|1)", |
| 1293 | "Turn off RF of the TRX.\n") |
| 1294 | { |
| 1295 | int locked = atoi(argv[0]); |
| 1296 | struct gsm_bts_trx *trx = vty->index; |
| 1297 | |
| 1298 | gsm_trx_lock_rf(trx, locked); |
| 1299 | return CMD_SUCCESS; |
| 1300 | } |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1301 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1302 | /* per TS configuration */ |
| 1303 | DEFUN(cfg_ts, |
| 1304 | cfg_ts_cmd, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1305 | "timeslot <0-7>", |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1306 | "Select a Timeslot to configure") |
| 1307 | { |
| 1308 | int ts_nr = atoi(argv[0]); |
| 1309 | struct gsm_bts_trx *trx = vty->index; |
| 1310 | struct gsm_bts_trx_ts *ts; |
| 1311 | |
| 1312 | if (ts_nr >= TRX_NR_TS) { |
| 1313 | vty_out(vty, "%% A GSM TRX only has %u Timeslots per TRX%s", |
| 1314 | TRX_NR_TS, VTY_NEWLINE); |
| 1315 | return CMD_WARNING; |
| 1316 | } |
| 1317 | |
| 1318 | ts = &trx->ts[ts_nr]; |
| 1319 | |
| 1320 | vty->index = ts; |
| 1321 | vty->node = TS_NODE; |
| 1322 | |
| 1323 | return CMD_SUCCESS; |
| 1324 | } |
| 1325 | |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1326 | DEFUN(cfg_ts_pchan, |
| 1327 | cfg_ts_pchan_cmd, |
| 1328 | "phys_chan_config PCHAN", |
| 1329 | "Physical Channel configuration (TCH/SDCCH/...)") |
| 1330 | { |
| 1331 | struct gsm_bts_trx_ts *ts = vty->index; |
| 1332 | int pchanc; |
| 1333 | |
| 1334 | pchanc = gsm_pchan_parse(argv[0]); |
| 1335 | if (pchanc < 0) |
| 1336 | return CMD_WARNING; |
| 1337 | |
| 1338 | ts->pchan = pchanc; |
| 1339 | |
| 1340 | return CMD_SUCCESS; |
| 1341 | } |
| 1342 | |
| 1343 | DEFUN(cfg_ts_e1_subslot, |
| 1344 | cfg_ts_e1_subslot_cmd, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1345 | "e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1346 | "E1 sub-slot connected to this on-air timeslot") |
| 1347 | { |
| 1348 | struct gsm_bts_trx_ts *ts = vty->index; |
| 1349 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1350 | parse_e1_link(&ts->e1_link, argv[0], argv[1], argv[2]); |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1351 | |
| 1352 | return CMD_SUCCESS; |
| 1353 | } |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1354 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1355 | int bsc_vty_init(struct gsm_network *net) |
| 1356 | { |
| 1357 | gsmnet = net; |
| 1358 | |
| 1359 | cmd_init(1); |
| 1360 | vty_init(); |
| 1361 | |
| 1362 | install_element(VIEW_NODE, &show_net_cmd); |
| 1363 | install_element(VIEW_NODE, &show_bts_cmd); |
| 1364 | install_element(VIEW_NODE, &show_trx_cmd); |
| 1365 | install_element(VIEW_NODE, &show_ts_cmd); |
| 1366 | install_element(VIEW_NODE, &show_lchan_cmd); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 1367 | |
| 1368 | install_element(VIEW_NODE, &show_e1drv_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1369 | install_element(VIEW_NODE, &show_e1line_cmd); |
| 1370 | install_element(VIEW_NODE, &show_e1ts_cmd); |
| 1371 | |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 1372 | install_element(VIEW_NODE, &show_paging_cmd); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1373 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1374 | install_element(CONFIG_NODE, &cfg_net_cmd); |
| 1375 | install_node(&net_node, config_write_net); |
| 1376 | install_default(GSMNET_NODE); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1377 | install_element(GSMNET_NODE, &cfg_net_ncc_cmd); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1378 | install_element(GSMNET_NODE, &cfg_net_mnc_cmd); |
| 1379 | install_element(GSMNET_NODE, &cfg_net_name_short_cmd); |
| 1380 | install_element(GSMNET_NODE, &cfg_net_name_long_cmd); |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 1381 | install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd); |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 1382 | install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 1383 | install_element(GSMNET_NODE, &cfg_net_encryption_cmd); |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 1384 | install_element(GSMNET_NODE, &cfg_net_neci_cmd); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 1385 | install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd); |
Harald Welte | 3d23db4 | 2009-12-14 17:49:15 +0100 | [diff] [blame] | 1386 | install_element(GSMNET_NODE, &cfg_net_mm_info_cmd); |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1387 | install_element(GSMNET_NODE, &cfg_net_handover_cmd); |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1388 | install_element(GSMNET_NODE, &cfg_net_T3101_cmd); |
Holger Hans Peter Freyther | 23975e7 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 1389 | install_element(GSMNET_NODE, &cfg_net_T3103_cmd); |
| 1390 | install_element(GSMNET_NODE, &cfg_net_T3105_cmd); |
| 1391 | install_element(GSMNET_NODE, &cfg_net_T3107_cmd); |
| 1392 | install_element(GSMNET_NODE, &cfg_net_T3109_cmd); |
| 1393 | install_element(GSMNET_NODE, &cfg_net_T3111_cmd); |
| 1394 | install_element(GSMNET_NODE, &cfg_net_T3113_cmd); |
| 1395 | install_element(GSMNET_NODE, &cfg_net_T3115_cmd); |
| 1396 | install_element(GSMNET_NODE, &cfg_net_T3117_cmd); |
| 1397 | install_element(GSMNET_NODE, &cfg_net_T3119_cmd); |
| 1398 | install_element(GSMNET_NODE, &cfg_net_T3141_cmd); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1399 | |
| 1400 | install_element(GSMNET_NODE, &cfg_bts_cmd); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 1401 | install_node(&bts_node, config_write_bts); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1402 | install_default(BTS_NODE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1403 | install_element(BTS_NODE, &cfg_bts_type_cmd); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1404 | install_element(BTS_NODE, &cfg_bts_band_cmd); |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 1405 | install_element(BTS_NODE, &cfg_bts_ci_cmd); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1406 | install_element(BTS_NODE, &cfg_bts_lac_cmd); |
| 1407 | install_element(BTS_NODE, &cfg_bts_tsc_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1408 | install_element(BTS_NODE, &cfg_bts_bsic_cmd); |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1409 | install_element(BTS_NODE, &cfg_bts_unit_id_cmd); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1410 | install_element(BTS_NODE, &cfg_bts_stream_id_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1411 | install_element(BTS_NODE, &cfg_bts_oml_e1_cmd); |
| 1412 | install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd); |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1413 | install_element(BTS_NODE, &cfg_bts_challoc_cmd); |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 1414 | install_element(BTS_NODE, &cfg_bts_cell_barred_cmd); |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 1415 | install_element(BTS_NODE, &cfg_bts_ms_max_power_cmd); |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 1416 | install_element(BTS_NODE, &cfg_bts_per_loc_upd_cmd); |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 1417 | install_element(BTS_NODE, &cfg_bts_cell_resel_hyst_cmd); |
| 1418 | install_element(BTS_NODE, &cfg_bts_rxlev_acc_min_cmd); |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1419 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1420 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1421 | install_element(BTS_NODE, &cfg_trx_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1422 | install_node(&trx_node, dummy_config_write); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1423 | install_default(TRX_NODE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1424 | install_element(TRX_NODE, &cfg_trx_arfcn_cmd); |
Harald Welte | 879dc97 | 2009-06-20 22:36:12 +0200 | [diff] [blame] | 1425 | install_element(TRX_NODE, &cfg_trx_max_power_red_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1426 | install_element(TRX_NODE, &cfg_trx_rsl_e1_cmd); |
| 1427 | install_element(TRX_NODE, &cfg_trx_rsl_e1_tei_cmd); |
Holger Hans Peter Freyther | 2d501ea | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 1428 | install_element(TRX_NODE, &cfg_trx_rf_locked_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1429 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1430 | install_element(TRX_NODE, &cfg_ts_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1431 | install_node(&ts_node, dummy_config_write); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1432 | install_default(TS_NODE); |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1433 | install_element(TS_NODE, &cfg_ts_pchan_cmd); |
| 1434 | install_element(TS_NODE, &cfg_ts_e1_subslot_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1435 | |
Holger Hans Peter Freyther | cfa90d4 | 2009-08-10 10:17:50 +0200 | [diff] [blame] | 1436 | bsc_vty_init_extra(net); |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 1437 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1438 | return 0; |
| 1439 | } |