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