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