Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1 | /* OpenBSC interface to quagga VTY */ |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2 | /* (C) 2009-2010 by Harald Welte <laforge@gnumonks.org> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 3 | * All Rights Reserved |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include <stdlib.h> |
| 22 | #include <unistd.h> |
| 23 | #include <sys/types.h> |
| 24 | |
Harald Welte | 4b037e4 | 2010-05-19 19:45:32 +0200 | [diff] [blame] | 25 | #include <osmocom/vty/command.h> |
| 26 | #include <osmocom/vty/buffer.h> |
| 27 | #include <osmocom/vty/vty.h> |
| 28 | #include <osmocom/vty/logging.h> |
| 29 | #include <osmocom/vty/telnet_interface.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 30 | |
| 31 | #include <arpa/inet.h> |
| 32 | |
Harald Welte | dfe6c7d | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 33 | #include <osmocore/linuxlist.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 34 | #include <openbsc/gsm_data.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 35 | #include <openbsc/e1_input.h> |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 36 | #include <openbsc/abis_nm.h> |
Harald Welte | dfe6c7d | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 37 | #include <osmocore/gsm_utils.h> |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 38 | #include <openbsc/chan_alloc.h> |
Harald Welte | 8387a49 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 39 | #include <openbsc/meas_rep.h> |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 40 | #include <openbsc/db.h> |
Harald Welte | dfe6c7d | 2010-02-20 16:24:02 +0100 | [diff] [blame] | 41 | #include <osmocore/talloc.h> |
Holger Hans Peter Freyther | 3c71232 | 2010-04-06 11:55:37 +0200 | [diff] [blame] | 42 | #include <openbsc/vty.h> |
Harald Welte | 22229d6 | 2010-05-12 20:28:04 +0200 | [diff] [blame] | 43 | #include <openbsc/gprs_ns.h> |
Harald Welte | 5bc61dc | 2010-05-16 22:02:16 +0200 | [diff] [blame] | 44 | #include <openbsc/debug.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 45 | |
Harald Welte | 1353f96 | 2010-05-16 19:20:24 +0200 | [diff] [blame] | 46 | #include "../bscconfig.h" |
| 47 | |
Harald Welte | ea4647d | 2010-05-12 17:19:53 +0000 | [diff] [blame] | 48 | /* FIXME: this should go to some common file */ |
| 49 | static const struct value_string gprs_ns_timer_strs[] = { |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 50 | { 0, "tns-block" }, |
| 51 | { 1, "tns-block-retries" }, |
| 52 | { 2, "tns-reset" }, |
| 53 | { 3, "tns-reset-retries" }, |
| 54 | { 4, "tns-test" }, |
| 55 | { 5, "tns-alive" }, |
| 56 | { 6, "tns-alive-retries" }, |
| 57 | { 0, NULL } |
| 58 | }; |
| 59 | |
Harald Welte | ea4647d | 2010-05-12 17:19:53 +0000 | [diff] [blame] | 60 | static const struct value_string gprs_bssgp_cfg_strs[] = { |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 61 | { 0, "blocking-timer" }, |
| 62 | { 1, "blocking-retries" }, |
| 63 | { 2, "unblocking-retries" }, |
| 64 | { 3, "reset-timer" }, |
| 65 | { 4, "reset-retries" }, |
| 66 | { 5, "suspend-timer" }, |
| 67 | { 6, "suspend-retries" }, |
| 68 | { 7, "resume-timer" }, |
| 69 | { 8, "resume-retries" }, |
| 70 | { 9, "capability-update-timer" }, |
| 71 | { 10, "capability-update-retries" }, |
| 72 | { 0, NULL } |
| 73 | }; |
| 74 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 75 | struct cmd_node net_node = { |
| 76 | GSMNET_NODE, |
| 77 | "%s(network)#", |
| 78 | 1, |
| 79 | }; |
| 80 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 81 | struct cmd_node bts_node = { |
| 82 | BTS_NODE, |
| 83 | "%s(bts)#", |
| 84 | 1, |
| 85 | }; |
| 86 | |
| 87 | struct cmd_node trx_node = { |
| 88 | TRX_NODE, |
| 89 | "%s(trx)#", |
| 90 | 1, |
| 91 | }; |
| 92 | |
| 93 | struct cmd_node ts_node = { |
| 94 | TS_NODE, |
| 95 | "%s(ts)#", |
| 96 | 1, |
| 97 | }; |
| 98 | |
Harald Welte | 3923115 | 2010-05-27 13:39:40 +0200 | [diff] [blame] | 99 | extern struct gsm_network *bsc_gsmnet; |
| 100 | |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 101 | struct gsm_network *gsmnet_from_vty(struct vty *v) |
| 102 | { |
Harald Welte | 3923115 | 2010-05-27 13:39:40 +0200 | [diff] [blame] | 103 | /* In case we read from the config file, the vty->priv cannot |
| 104 | * point to a struct telnet_connection, and thus conn->priv |
| 105 | * will not point to the gsm_network structure */ |
| 106 | #if 0 |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 107 | struct telnet_connection *conn = v->priv; |
| 108 | return (struct gsm_network *) conn->priv; |
Harald Welte | 3923115 | 2010-05-27 13:39:40 +0200 | [diff] [blame] | 109 | #else |
| 110 | return bsc_gsmnet; |
| 111 | #endif |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 112 | } |
| 113 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 114 | static int dummy_config_write(struct vty *v) |
| 115 | { |
| 116 | return CMD_SUCCESS; |
| 117 | } |
| 118 | |
| 119 | static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms) |
| 120 | { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 121 | vty_out(vty,"Oper '%s', Admin %u, Avail '%s'%s", |
| 122 | nm_opstate_name(nms->operational), nms->administrative, |
| 123 | nm_avail_name(nms->availability), VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 124 | } |
| 125 | |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 126 | static void dump_pchan_load_vty(struct vty *vty, char *prefix, |
| 127 | const struct pchan_load *pl) |
| 128 | { |
| 129 | int i; |
| 130 | |
| 131 | for (i = 0; i < ARRAY_SIZE(pl->pchan); i++) { |
| 132 | const struct load_counter *lc = &pl->pchan[i]; |
| 133 | unsigned int percent; |
| 134 | |
| 135 | if (lc->total == 0) |
| 136 | continue; |
| 137 | |
| 138 | percent = (lc->used * 100) / lc->total; |
| 139 | |
| 140 | vty_out(vty, "%s%20s: %3u%% (%u/%u)%s", prefix, |
| 141 | gsm_pchan_name(i), percent, lc->used, lc->total, |
| 142 | VTY_NEWLINE); |
| 143 | } |
| 144 | } |
| 145 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 146 | static void net_dump_vty(struct vty *vty, struct gsm_network *net) |
| 147 | { |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 148 | struct pchan_load pl; |
| 149 | |
Harald Welte | ef235b5 | 2009-03-10 12:34:02 +0000 | [diff] [blame] | 150 | vty_out(vty, "BSC is on Country Code %u, Network Code %u " |
| 151 | "and has %u BTS%s", net->country_code, net->network_code, |
| 152 | net->num_bts, VTY_NEWLINE); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 153 | vty_out(vty, " Long network name: '%s'%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 154 | net->name_long, VTY_NEWLINE); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 155 | vty_out(vty, " Short network name: '%s'%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 156 | net->name_short, VTY_NEWLINE); |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 157 | vty_out(vty, " Authentication policy: %s%s", |
| 158 | gsm_auth_policy_name(net->auth_policy), VTY_NEWLINE); |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 159 | vty_out(vty, " Location updating reject cause: %u%s", |
| 160 | net->reject_cause, VTY_NEWLINE); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 161 | vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption, |
| 162 | VTY_NEWLINE); |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 163 | vty_out(vty, " NECI (TCH/H): %u%s", net->neci, |
| 164 | VTY_NEWLINE); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 165 | vty_out(vty, " RRLP Mode: %s%s", rrlp_mode_name(net->rrlp.mode), |
| 166 | VTY_NEWLINE); |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 167 | vty_out(vty, " MM Info: %s%s", net->send_mm_info ? "On" : "Off", |
| 168 | VTY_NEWLINE); |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 169 | vty_out(vty, " Handover: %s%s", net->handover.active ? "On" : "Off", |
| 170 | VTY_NEWLINE); |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 171 | network_chan_load(&pl, net); |
| 172 | vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); |
| 173 | dump_pchan_load_vty(vty, " ", &pl); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | DEFUN(show_net, show_net_cmd, "show network", |
| 177 | SHOW_STR "Display information about a GSM NETWORK\n") |
| 178 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 179 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 180 | net_dump_vty(vty, net); |
| 181 | |
| 182 | return CMD_SUCCESS; |
| 183 | } |
| 184 | |
| 185 | static void e1isl_dump_vty(struct vty *vty, struct e1inp_sign_link *e1l) |
| 186 | { |
Harald Welte | edb3778 | 2009-05-01 14:59:07 +0000 | [diff] [blame] | 187 | struct e1inp_line *line; |
| 188 | |
| 189 | if (!e1l) { |
| 190 | vty_out(vty, " None%s", VTY_NEWLINE); |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | line = e1l->ts->line; |
| 195 | |
| 196 | vty_out(vty, " E1 Line %u, Type %s: Timeslot %u, Mode %s%s", |
| 197 | line->num, line->driver->name, e1l->ts->num, |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 198 | e1inp_signtype_name(e1l->type), VTY_NEWLINE); |
Harald Welte | edb3778 | 2009-05-01 14:59:07 +0000 | [diff] [blame] | 199 | vty_out(vty, " E1 TEI %u, SAPI %u%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 200 | e1l->tei, e1l->sapi, VTY_NEWLINE); |
| 201 | } |
| 202 | |
| 203 | static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) |
| 204 | { |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 205 | struct pchan_load pl; |
| 206 | |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 207 | 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] | 208 | "BSIC %u, TSC %u and %u TRX%s", |
| 209 | bts->nr, btstype2str(bts->type), gsm_band_name(bts->band), |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 210 | bts->cell_identity, |
Holger Hans Peter Freyther | acf8a0c | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 211 | bts->location_area_code, bts->bsic, bts->tsc, |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 212 | bts->num_trx, VTY_NEWLINE); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 213 | vty_out(vty, "Description: %s%s", |
| 214 | bts->description ? bts->description : "(null)", VTY_NEWLINE); |
Harald Welte | 1d8dbc4 | 2009-12-12 15:38:16 +0100 | [diff] [blame] | 215 | 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] | 216 | vty_out(vty, "Minimum Rx Level for Access: %i dBm%s", |
Harald Welte | 1d8dbc4 | 2009-12-12 15:38:16 +0100 | [diff] [blame] | 217 | rxlev2dbm(bts->si_common.cell_sel_par.rxlev_acc_min), |
| 218 | VTY_NEWLINE); |
| 219 | vty_out(vty, "Cell Reselection Hysteresis: %u dBm%s", |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 220 | bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 221 | vty_out(vty, "RACH TX-Integer: %u%s", bts->si_common.rach_control.tx_integer, |
| 222 | VTY_NEWLINE); |
| 223 | vty_out(vty, "RACH Max transmissions: %u%s", |
| 224 | rach_max_trans_raw2val(bts->si_common.rach_control.max_trans), |
| 225 | VTY_NEWLINE); |
Harald Welte | 7135501 | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 226 | if (bts->si_common.rach_control.cell_bar) |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 227 | vty_out(vty, " CELL IS BARRED%s", VTY_NEWLINE); |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 228 | if (is_ipaccess_bts(bts)) |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 229 | 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] | 230 | bts->ip_access.site_id, bts->ip_access.bts_id, |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 231 | bts->oml_tei, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 232 | vty_out(vty, " NM State: "); |
| 233 | net_dump_nmstate(vty, &bts->nm_state); |
| 234 | vty_out(vty, " Site Mgr NM State: "); |
| 235 | net_dump_nmstate(vty, &bts->site_mgr.nm_state); |
| 236 | vty_out(vty, " Paging: FIXME pending requests, %u free slots%s", |
| 237 | bts->paging.available_slots, VTY_NEWLINE); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 238 | if (!is_ipaccess_bts(bts)) { |
| 239 | vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); |
| 240 | e1isl_dump_vty(vty, bts->oml_link); |
| 241 | } |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 242 | /* FIXME: oml_link, chan_desc */ |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 243 | memset(&pl, 0, sizeof(pl)); |
| 244 | bts_chan_load(&pl, bts); |
| 245 | vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); |
| 246 | dump_pchan_load_vty(vty, " ", &pl); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | DEFUN(show_bts, show_bts_cmd, "show bts [number]", |
| 250 | SHOW_STR "Display information about a BTS\n" |
| 251 | "BTS number") |
| 252 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 253 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 254 | int bts_nr; |
| 255 | |
| 256 | if (argc != 0) { |
| 257 | /* use the BTS number that the user has specified */ |
| 258 | bts_nr = atoi(argv[0]); |
| 259 | if (bts_nr > net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 260 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 261 | VTY_NEWLINE); |
| 262 | return CMD_WARNING; |
| 263 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 264 | bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 265 | return CMD_SUCCESS; |
| 266 | } |
| 267 | /* print all BTS's */ |
| 268 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 269 | bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 270 | |
| 271 | return CMD_SUCCESS; |
| 272 | } |
| 273 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 274 | /* utility functions */ |
| 275 | static void parse_e1_link(struct gsm_e1_subslot *e1_link, const char *line, |
| 276 | const char *ts, const char *ss) |
| 277 | { |
| 278 | e1_link->e1_nr = atoi(line); |
| 279 | e1_link->e1_ts = atoi(ts); |
| 280 | if (!strcmp(ss, "full")) |
| 281 | e1_link->e1_ts_ss = 255; |
| 282 | else |
| 283 | e1_link->e1_ts_ss = atoi(ss); |
| 284 | } |
| 285 | |
| 286 | static void config_write_e1_link(struct vty *vty, struct gsm_e1_subslot *e1_link, |
| 287 | const char *prefix) |
| 288 | { |
| 289 | if (!e1_link->e1_ts) |
| 290 | return; |
| 291 | |
| 292 | if (e1_link->e1_ts_ss == 255) |
| 293 | vty_out(vty, "%se1 line %u timeslot %u sub-slot full%s", |
| 294 | prefix, e1_link->e1_nr, e1_link->e1_ts, VTY_NEWLINE); |
| 295 | else |
| 296 | vty_out(vty, "%se1 line %u timeslot %u sub-slot %u%s", |
| 297 | prefix, e1_link->e1_nr, e1_link->e1_ts, |
| 298 | e1_link->e1_ts_ss, VTY_NEWLINE); |
| 299 | } |
| 300 | |
| 301 | |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 302 | static void config_write_ts_single(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 303 | { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 304 | vty_out(vty, " timeslot %u%s", ts->nr, VTY_NEWLINE); |
| 305 | if (ts->pchan != GSM_PCHAN_NONE) |
| 306 | vty_out(vty, " phys_chan_config %s%s", |
| 307 | gsm_pchan_name(ts->pchan), VTY_NEWLINE); |
| 308 | config_write_e1_link(vty, &ts->e1_link, " "); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | static void config_write_trx_single(struct vty *vty, struct gsm_bts_trx *trx) |
| 312 | { |
| 313 | int i; |
| 314 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 315 | vty_out(vty, " trx %u%s", trx->nr, VTY_NEWLINE); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 316 | if (trx->description) |
| 317 | vty_out(vty, " description %s%s", trx->description, |
| 318 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 2ba40af | 2010-04-17 06:42:07 +0200 | [diff] [blame] | 319 | vty_out(vty, " rf_locked %u%s", |
| 320 | trx->nm_state.administrative == NM_STATE_LOCKED ? 1 : 0, |
| 321 | VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 322 | vty_out(vty, " arfcn %u%s", trx->arfcn, VTY_NEWLINE); |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 323 | vty_out(vty, " nominal power %u%s", trx->nominal_power, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 324 | 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] | 325 | config_write_e1_link(vty, &trx->rsl_e1_link, " rsl "); |
| 326 | 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] | 327 | |
| 328 | for (i = 0; i < TRX_NR_TS; i++) |
| 329 | config_write_ts_single(vty, &trx->ts[i]); |
| 330 | } |
| 331 | |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 332 | static void config_write_bts_gprs(struct vty *vty, struct gsm_bts *bts) |
| 333 | { |
| 334 | unsigned int i; |
| 335 | vty_out(vty, " gprs mode %s%s", bts_gprs_mode_name(bts->gprs.mode), |
| 336 | VTY_NEWLINE); |
| 337 | if (bts->gprs.mode == BTS_GPRS_NONE) |
| 338 | return; |
| 339 | |
| 340 | vty_out(vty, " gprs routing area %u%s", bts->gprs.rac, |
| 341 | VTY_NEWLINE); |
| 342 | vty_out(vty, " gprs cell bvci %u%s", bts->gprs.cell.bvci, |
| 343 | VTY_NEWLINE); |
| 344 | for (i = 0; i < ARRAY_SIZE(bts->gprs.cell.timer); i++) |
| 345 | vty_out(vty, " gprs cell timer %s %u%s", |
| 346 | get_value_string(gprs_bssgp_cfg_strs, i), |
| 347 | bts->gprs.cell.timer[i], VTY_NEWLINE); |
| 348 | vty_out(vty, " gprs nsei %u%s", bts->gprs.nse.nsei, |
| 349 | VTY_NEWLINE); |
| 350 | for (i = 0; i < ARRAY_SIZE(bts->gprs.nse.timer); i++) |
| 351 | vty_out(vty, " gprs ns timer %s %u%s", |
| 352 | get_value_string(gprs_ns_timer_strs, i), |
| 353 | bts->gprs.nse.timer[i], VTY_NEWLINE); |
| 354 | for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { |
| 355 | struct gsm_bts_gprs_nsvc *nsvc = |
| 356 | &bts->gprs.nsvc[i]; |
| 357 | struct in_addr ia; |
| 358 | |
| 359 | ia.s_addr = htonl(nsvc->remote_ip); |
| 360 | vty_out(vty, " gprs nsvc %u nsvci %u%s", i, |
| 361 | nsvc->nsvci, VTY_NEWLINE); |
| 362 | vty_out(vty, " gprs nsvc %u local udp port %u%s", i, |
| 363 | nsvc->local_port, VTY_NEWLINE); |
| 364 | vty_out(vty, " gprs nsvc %u remote udp port %u%s", i, |
| 365 | nsvc->remote_port, VTY_NEWLINE); |
| 366 | vty_out(vty, " gprs nsvc %u remote ip %s%s", i, |
| 367 | inet_ntoa(ia), VTY_NEWLINE); |
| 368 | } |
| 369 | } |
| 370 | |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 371 | static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) |
| 372 | { |
| 373 | struct gsm_bts_trx *trx; |
| 374 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 375 | vty_out(vty, " bts %u%s", bts->nr, VTY_NEWLINE); |
| 376 | vty_out(vty, " type %s%s", btstype2str(bts->type), VTY_NEWLINE); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 377 | if (bts->description) |
| 378 | vty_out(vty, " description %s%s", bts->description, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 379 | 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] | 380 | vty_out(vty, " cell_identity %u%s", bts->cell_identity, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 381 | vty_out(vty, " location_area_code %u%s", bts->location_area_code, |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 382 | VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 383 | vty_out(vty, " training_sequence_code %u%s", bts->tsc, VTY_NEWLINE); |
| 384 | 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] | 385 | 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] | 386 | vty_out(vty, " cell reselection hysteresis %u%s", |
| 387 | bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); |
| 388 | vty_out(vty, " rxlev access min %u%s", |
| 389 | bts->si_common.cell_sel_par.rxlev_acc_min, VTY_NEWLINE); |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 390 | if (bts->si_common.chan_desc.t3212) |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 391 | vty_out(vty, " periodic location update %u%s", |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 392 | bts->si_common.chan_desc.t3212 * 10, VTY_NEWLINE); |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 393 | vty_out(vty, " channel allocator %s%s", |
| 394 | bts->chan_alloc_reverse ? "descending" : "ascending", |
| 395 | VTY_NEWLINE); |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 396 | vty_out(vty, " rach tx integer %u%s", |
| 397 | bts->si_common.rach_control.tx_integer, VTY_NEWLINE); |
| 398 | vty_out(vty, " rach max transmission %u%s", |
| 399 | rach_max_trans_raw2val(bts->si_common.rach_control.max_trans), |
| 400 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 401 | |
| 402 | if (bts->rach_b_thresh != -1) |
| 403 | vty_out(vty, " rach nm busy threshold %u%s", |
| 404 | bts->rach_b_thresh, VTY_NEWLINE); |
| 405 | if (bts->rach_ldavg_slots != -1) |
| 406 | vty_out(vty, " rach nm load average %u%s", |
| 407 | bts->rach_ldavg_slots, VTY_NEWLINE); |
Harald Welte | 7135501 | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 408 | if (bts->si_common.rach_control.cell_bar) |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 409 | vty_out(vty, " cell barred 1%s", VTY_NEWLINE); |
Holger Hans Peter Freyther | 3a0a463 | 2010-05-14 00:39:19 +0800 | [diff] [blame] | 410 | if ((bts->si_common.rach_control.t2 & 0x4) == 0) |
| 411 | vty_out(vty, " rach emergency call allowed 1%s", VTY_NEWLINE); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 412 | if (is_ipaccess_bts(bts)) { |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 413 | vty_out(vty, " ip.access unit_id %u %u%s", |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 414 | bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 415 | vty_out(vty, " oml ip.access stream_id %u%s", bts->oml_tei, VTY_NEWLINE); |
| 416 | } else { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 417 | config_write_e1_link(vty, &bts->oml_e1_link, " oml "); |
| 418 | vty_out(vty, " oml e1 tei %u%s", bts->oml_tei, VTY_NEWLINE); |
| 419 | } |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 420 | config_write_bts_gprs(vty, bts); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 421 | |
| 422 | llist_for_each_entry(trx, &bts->trx_list, list) |
| 423 | config_write_trx_single(vty, trx); |
| 424 | } |
| 425 | |
| 426 | static int config_write_bts(struct vty *v) |
| 427 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 428 | struct gsm_network *gsmnet = gsmnet_from_vty(v); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 429 | struct gsm_bts *bts; |
| 430 | |
| 431 | llist_for_each_entry(bts, &gsmnet->bts_list, list) |
| 432 | config_write_bts_single(v, bts); |
| 433 | |
| 434 | return CMD_SUCCESS; |
| 435 | } |
| 436 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 437 | static int config_write_net(struct vty *vty) |
| 438 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 439 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 440 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 441 | vty_out(vty, "network%s", VTY_NEWLINE); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 442 | 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] | 443 | 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] | 444 | vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE); |
| 445 | 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] | 446 | 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] | 447 | vty_out(vty, " location updating reject cause %u%s", |
| 448 | gsmnet->reject_cause, VTY_NEWLINE); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 449 | 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] | 450 | vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 451 | vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode), |
| 452 | VTY_NEWLINE); |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 453 | 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] | 454 | vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 455 | vty_out(vty, " handover window rxlev averaging %u%s", |
| 456 | gsmnet->handover.win_rxlev_avg, VTY_NEWLINE); |
| 457 | vty_out(vty, " handover window rxqual averaging %u%s", |
| 458 | gsmnet->handover.win_rxqual_avg, VTY_NEWLINE); |
| 459 | vty_out(vty, " handover window rxlev neighbor averaging %u%s", |
| 460 | gsmnet->handover.win_rxlev_avg_neigh, VTY_NEWLINE); |
| 461 | vty_out(vty, " handover power budget interval %u%s", |
| 462 | gsmnet->handover.pwr_interval, VTY_NEWLINE); |
| 463 | vty_out(vty, " handover power budget hysteresis %u%s", |
| 464 | gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); |
| 465 | vty_out(vty, " handover maximum distance %u%s", |
| 466 | gsmnet->handover.max_distance, VTY_NEWLINE); |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 467 | 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] | 468 | vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); |
| 469 | vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); |
| 470 | vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); |
| 471 | vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); |
| 472 | vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); |
| 473 | vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); |
| 474 | vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); |
| 475 | vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); |
| 476 | vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); |
| 477 | vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 478 | |
| 479 | return CMD_SUCCESS; |
| 480 | } |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 481 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 482 | static void trx_dump_vty(struct vty *vty, struct gsm_bts_trx *trx) |
| 483 | { |
| 484 | vty_out(vty, "TRX %u of BTS %u is on ARFCN %u%s", |
| 485 | trx->nr, trx->bts->nr, trx->arfcn, VTY_NEWLINE); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 486 | vty_out(vty, "Description: %s%s", |
| 487 | trx->description ? trx->description : "(null)", VTY_NEWLINE); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 488 | vty_out(vty, " RF Nominal Power: %d dBm, reduced by %u dB, " |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 489 | "resulting BS power: %d dBm%s", |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 490 | trx->nominal_power, trx->max_power_red, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 491 | trx->nominal_power - trx->max_power_red, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 492 | vty_out(vty, " NM State: "); |
| 493 | net_dump_nmstate(vty, &trx->nm_state); |
| 494 | vty_out(vty, " Baseband Transceiver NM State: "); |
| 495 | net_dump_nmstate(vty, &trx->bb_transc.nm_state); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 496 | if (is_ipaccess_bts(trx->bts)) { |
| 497 | vty_out(vty, " ip.access stream ID: 0x%02x%s", |
| 498 | trx->rsl_tei, VTY_NEWLINE); |
| 499 | } else { |
| 500 | vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); |
| 501 | e1isl_dump_vty(vty, trx->rsl_link); |
| 502 | } |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 503 | } |
| 504 | |
| 505 | DEFUN(show_trx, |
| 506 | show_trx_cmd, |
| 507 | "show trx [bts_nr] [trx_nr]", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 508 | SHOW_STR "Display information about a TRX\n" |
| 509 | "BTS Number\n" |
| 510 | "TRX Number\n") |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 511 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 512 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 513 | struct gsm_bts *bts = NULL; |
| 514 | struct gsm_bts_trx *trx; |
| 515 | int bts_nr, trx_nr; |
| 516 | |
| 517 | if (argc >= 1) { |
| 518 | /* use the BTS number that the user has specified */ |
| 519 | bts_nr = atoi(argv[0]); |
| 520 | if (bts_nr >= net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 521 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 522 | VTY_NEWLINE); |
| 523 | return CMD_WARNING; |
| 524 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 525 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 526 | } |
| 527 | if (argc >= 2) { |
| 528 | trx_nr = atoi(argv[1]); |
| 529 | if (trx_nr >= bts->num_trx) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 530 | vty_out(vty, "%% can't find TRX '%s'%s", argv[1], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 531 | VTY_NEWLINE); |
| 532 | return CMD_WARNING; |
| 533 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 534 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 535 | trx_dump_vty(vty, trx); |
| 536 | return CMD_SUCCESS; |
| 537 | } |
| 538 | if (bts) { |
| 539 | /* print all TRX in this BTS */ |
| 540 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 541 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 542 | trx_dump_vty(vty, trx); |
| 543 | } |
| 544 | return CMD_SUCCESS; |
| 545 | } |
| 546 | |
| 547 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 548 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 549 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 550 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 551 | trx_dump_vty(vty, trx); |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | return CMD_SUCCESS; |
| 556 | } |
| 557 | |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 558 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 559 | static void ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 560 | { |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 561 | vty_out(vty, "Timeslot %u of TRX %u in BTS %u, phys cfg %s%s", |
| 562 | ts->nr, ts->trx->nr, ts->trx->bts->nr, |
| 563 | gsm_pchan_name(ts->pchan), VTY_NEWLINE); |
| 564 | vty_out(vty, " NM State: "); |
| 565 | net_dump_nmstate(vty, &ts->nm_state); |
Harald Welte | 2c82899 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 566 | if (!is_ipaccess_bts(ts->trx->bts)) |
Harald Welte | ef235b5 | 2009-03-10 12:34:02 +0000 | [diff] [blame] | 567 | vty_out(vty, " E1 Line %u, Timeslot %u, Subslot %u%s", |
| 568 | ts->e1_link.e1_nr, ts->e1_link.e1_ts, |
| 569 | ts->e1_link.e1_ts_ss, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 570 | } |
| 571 | |
| 572 | DEFUN(show_ts, |
| 573 | show_ts_cmd, |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 574 | "show timeslot [bts_nr] [trx_nr] [ts_nr]", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 575 | SHOW_STR "Display information about a TS\n" |
| 576 | "BTS Number\n" "TRX Number\n" "Timeslot Number\n") |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 577 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 578 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 579 | struct gsm_bts *bts; |
| 580 | struct gsm_bts_trx *trx; |
| 581 | struct gsm_bts_trx_ts *ts; |
| 582 | int bts_nr, trx_nr, ts_nr; |
| 583 | |
| 584 | if (argc >= 1) { |
| 585 | /* use the BTS number that the user has specified */ |
| 586 | bts_nr = atoi(argv[0]); |
| 587 | if (bts_nr >= net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 588 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 589 | VTY_NEWLINE); |
| 590 | return CMD_WARNING; |
| 591 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 592 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 593 | } |
| 594 | if (argc >= 2) { |
| 595 | trx_nr = atoi(argv[1]); |
| 596 | if (trx_nr >= bts->num_trx) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 597 | vty_out(vty, "%% can't find TRX '%s'%s", argv[1], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 598 | VTY_NEWLINE); |
| 599 | return CMD_WARNING; |
| 600 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 601 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 602 | } |
| 603 | if (argc >= 3) { |
| 604 | ts_nr = atoi(argv[2]); |
| 605 | if (ts_nr >= TRX_NR_TS) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 606 | vty_out(vty, "%% can't find TS '%s'%s", argv[2], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 607 | VTY_NEWLINE); |
| 608 | return CMD_WARNING; |
| 609 | } |
| 610 | ts = &trx->ts[ts_nr]; |
| 611 | ts_dump_vty(vty, ts); |
| 612 | return CMD_SUCCESS; |
| 613 | } |
| 614 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 615 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 616 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 617 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 618 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 619 | ts = &trx->ts[ts_nr]; |
| 620 | ts_dump_vty(vty, ts); |
| 621 | } |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | return CMD_SUCCESS; |
| 626 | } |
| 627 | |
Holger Hans Peter Freyther | 424c4f0 | 2010-01-06 06:00:40 +0100 | [diff] [blame] | 628 | static void subscr_dump_vty(struct vty *vty, struct gsm_subscriber *subscr) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 629 | { |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 630 | vty_out(vty, " ID: %llu, Authorized: %d%s", subscr->id, |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 631 | subscr->authorized, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 632 | if (subscr->name) |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 633 | vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 634 | if (subscr->extension) |
| 635 | vty_out(vty, " Extension: %s%s", subscr->extension, |
| 636 | VTY_NEWLINE); |
| 637 | if (subscr->imsi) |
| 638 | vty_out(vty, " IMSI: %s%s", subscr->imsi, VTY_NEWLINE); |
Holger Hans Peter Freyther | 2223025 | 2009-08-19 12:53:57 +0200 | [diff] [blame] | 639 | if (subscr->tmsi != GSM_RESERVED_TMSI) |
| 640 | vty_out(vty, " TMSI: %08X%s", subscr->tmsi, |
Harald Welte | 731fd91 | 2009-08-15 03:24:51 +0200 | [diff] [blame] | 641 | VTY_NEWLINE); |
Sylvain Munaut | af29264 | 2009-12-27 19:29:28 +0100 | [diff] [blame] | 642 | |
Harald Welte (local) | 15920de | 2009-08-14 20:27:16 +0200 | [diff] [blame] | 643 | vty_out(vty, " Use count: %u%s", subscr->use_count, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 644 | } |
| 645 | |
Harald Welte | 8387a49 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 646 | static void meas_rep_dump_uni_vty(struct vty *vty, |
| 647 | struct gsm_meas_rep_unidir *mru, |
| 648 | const char *prefix, |
| 649 | const char *dir) |
| 650 | { |
| 651 | vty_out(vty, "%s RXL-FULL-%s: %4d dBm, RXL-SUB-%s: %4d dBm ", |
| 652 | prefix, dir, rxlev2dbm(mru->full.rx_lev), |
| 653 | dir, rxlev2dbm(mru->sub.rx_lev)); |
| 654 | vty_out(vty, "RXQ-FULL-%s: %d, RXQ-SUB-%s: %d%s", |
| 655 | dir, mru->full.rx_qual, dir, mru->sub.rx_qual, |
| 656 | VTY_NEWLINE); |
| 657 | } |
| 658 | |
| 659 | static void meas_rep_dump_vty(struct vty *vty, struct gsm_meas_rep *mr, |
| 660 | const char *prefix) |
| 661 | { |
| 662 | vty_out(vty, "%sMeasurement Report:%s", prefix, VTY_NEWLINE); |
| 663 | vty_out(vty, "%s Flags: %s%s%s%s%s", prefix, |
| 664 | mr->flags & MEAS_REP_F_UL_DTX ? "DTXu " : "", |
| 665 | mr->flags & MEAS_REP_F_DL_DTX ? "DTXd " : "", |
| 666 | mr->flags & MEAS_REP_F_FPC ? "FPC " : "", |
| 667 | mr->flags & MEAS_REP_F_DL_VALID ? " " : "DLinval ", |
| 668 | VTY_NEWLINE); |
| 669 | if (mr->flags & MEAS_REP_F_MS_TO) |
| 670 | vty_out(vty, "%s MS Timing Offset: %u%s", prefix, |
| 671 | mr->ms_timing_offset, VTY_NEWLINE); |
| 672 | if (mr->flags & MEAS_REP_F_MS_L1) |
| 673 | vty_out(vty, "%s L1 MS Power: %u dBm, Timing Advance: %u%s", |
| 674 | prefix, mr->ms_l1.pwr, mr->ms_l1.ta, VTY_NEWLINE); |
| 675 | if (mr->flags & MEAS_REP_F_DL_VALID) |
| 676 | meas_rep_dump_uni_vty(vty, &mr->dl, prefix, "dl"); |
| 677 | meas_rep_dump_uni_vty(vty, &mr->ul, prefix, "ul"); |
| 678 | } |
| 679 | |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 680 | static void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 681 | { |
Harald Welte | 8387a49 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 682 | int idx; |
| 683 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 684 | vty_out(vty, "Lchan %u in Timeslot %u of TRX %u in BTS %u, Type %s%s", |
Holger Hans Peter Freyther | acf8a0c | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 685 | lchan->nr, lchan->ts->nr, lchan->ts->trx->nr, |
Harald Welte (local) | ccd8845 | 2009-12-27 18:05:25 +0100 | [diff] [blame] | 686 | lchan->ts->trx->bts->nr, gsm_lchant_name(lchan->type), |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 687 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 68884aa | 2010-03-23 06:41:45 +0100 | [diff] [blame] | 688 | vty_out(vty, " Use Count: %u, State: %s%s", lchan->conn.use_count, |
Harald Welte | 1887f9d | 2009-12-29 10:52:38 +0100 | [diff] [blame] | 689 | gsm_lchans_name(lchan->state), VTY_NEWLINE); |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 690 | vty_out(vty, " BS Power: %u dBm, MS Power: %u dBm%s", |
| 691 | lchan->ts->trx->nominal_power - lchan->ts->trx->max_power_red |
| 692 | - lchan->bs_power*2, |
| 693 | ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), |
| 694 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 68884aa | 2010-03-23 06:41:45 +0100 | [diff] [blame] | 695 | if (lchan->conn.subscr) { |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 696 | vty_out(vty, " Subscriber:%s", VTY_NEWLINE); |
Holger Hans Peter Freyther | 68884aa | 2010-03-23 06:41:45 +0100 | [diff] [blame] | 697 | subscr_dump_vty(vty, lchan->conn.subscr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 698 | } else |
| 699 | vty_out(vty, " No Subscriber%s", VTY_NEWLINE); |
Harald Welte | 2c82899 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 700 | if (is_ipaccess_bts(lchan->ts->trx->bts)) { |
| 701 | struct in_addr ia; |
Holger Hans Peter Freyther | 54fa799 | 2010-04-07 15:39:16 +0200 | [diff] [blame] | 702 | ia.s_addr = htonl(lchan->abis_ip.bound_ip); |
Harald Welte | 2c82899 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 703 | vty_out(vty, " Bound IP: %s Port %u RTP_TYPE2=%u CONN_ID=%u%s", |
| 704 | inet_ntoa(ia), lchan->abis_ip.bound_port, |
| 705 | lchan->abis_ip.rtp_payload2, lchan->abis_ip.conn_id, |
| 706 | VTY_NEWLINE); |
| 707 | } |
Harald Welte | 8387a49 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 708 | |
| 709 | /* we want to report the last measurement report */ |
| 710 | idx = calc_initial_idx(ARRAY_SIZE(lchan->meas_rep), |
| 711 | lchan->meas_rep_idx, 1); |
| 712 | meas_rep_dump_vty(vty, &lchan->meas_rep[idx], " "); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 713 | } |
| 714 | |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 715 | static void lchan_dump_short_vty(struct vty *vty, struct gsm_lchan *lchan) |
| 716 | { |
Holger Hans Peter Freyther | cf5cc5b | 2010-05-14 01:57:02 +0800 | [diff] [blame] | 717 | struct gsm_meas_rep *mr; |
| 718 | int idx; |
| 719 | |
| 720 | /* we want to report the last measurement report */ |
| 721 | idx = calc_initial_idx(ARRAY_SIZE(lchan->meas_rep), |
| 722 | lchan->meas_rep_idx, 1); |
| 723 | mr = &lchan->meas_rep[idx]; |
| 724 | |
| 725 | vty_out(vty, "Lchan: %u Timeslot: %u TRX: %u BTS: %u Type: %s - L1 MS Power: %u dBm " |
| 726 | "RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d dBm%s", |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 727 | lchan->nr, lchan->ts->nr, lchan->ts->trx->nr, |
| 728 | lchan->ts->trx->bts->nr, gsm_lchant_name(lchan->type), |
Holger Hans Peter Freyther | cf5cc5b | 2010-05-14 01:57:02 +0800 | [diff] [blame] | 729 | mr->ms_l1.pwr, |
| 730 | rxlev2dbm(mr->dl.full.rx_lev), |
| 731 | rxlev2dbm(mr->ul.full.rx_lev), |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 732 | VTY_NEWLINE); |
| 733 | } |
| 734 | |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 735 | static int lchan_summary(struct vty *vty, int argc, const char **argv, |
| 736 | void (*dump_cb)(struct vty *, struct gsm_lchan *)) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 737 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 738 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 739 | struct gsm_bts *bts; |
| 740 | struct gsm_bts_trx *trx; |
| 741 | struct gsm_bts_trx_ts *ts; |
| 742 | struct gsm_lchan *lchan; |
| 743 | int bts_nr, trx_nr, ts_nr, lchan_nr; |
| 744 | |
| 745 | if (argc >= 1) { |
| 746 | /* use the BTS number that the user has specified */ |
| 747 | bts_nr = atoi(argv[0]); |
| 748 | if (bts_nr >= net->num_bts) { |
| 749 | vty_out(vty, "%% can't find BTS %s%s", argv[0], |
| 750 | VTY_NEWLINE); |
| 751 | return CMD_WARNING; |
| 752 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 753 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 754 | } |
| 755 | if (argc >= 2) { |
| 756 | trx_nr = atoi(argv[1]); |
| 757 | if (trx_nr >= bts->num_trx) { |
| 758 | vty_out(vty, "%% can't find TRX %s%s", argv[1], |
| 759 | VTY_NEWLINE); |
| 760 | return CMD_WARNING; |
| 761 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 762 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 763 | } |
| 764 | if (argc >= 3) { |
| 765 | ts_nr = atoi(argv[2]); |
| 766 | if (ts_nr >= TRX_NR_TS) { |
| 767 | vty_out(vty, "%% can't find TS %s%s", argv[2], |
| 768 | VTY_NEWLINE); |
| 769 | return CMD_WARNING; |
| 770 | } |
| 771 | ts = &trx->ts[ts_nr]; |
| 772 | } |
| 773 | if (argc >= 4) { |
| 774 | lchan_nr = atoi(argv[3]); |
| 775 | if (lchan_nr >= TS_MAX_LCHAN) { |
| 776 | vty_out(vty, "%% can't find LCHAN %s%s", argv[3], |
| 777 | VTY_NEWLINE); |
| 778 | return CMD_WARNING; |
| 779 | } |
| 780 | lchan = &ts->lchan[lchan_nr]; |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 781 | dump_cb(vty, lchan); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 782 | return CMD_SUCCESS; |
| 783 | } |
| 784 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 785 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 786 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 787 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 788 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 789 | ts = &trx->ts[ts_nr]; |
| 790 | for (lchan_nr = 0; lchan_nr < TS_MAX_LCHAN; |
| 791 | lchan_nr++) { |
| 792 | lchan = &ts->lchan[lchan_nr]; |
Harald Welte | ef235b5 | 2009-03-10 12:34:02 +0000 | [diff] [blame] | 793 | if (lchan->type == GSM_LCHAN_NONE) |
| 794 | continue; |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 795 | dump_cb(vty, lchan); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 796 | } |
| 797 | } |
| 798 | } |
| 799 | } |
| 800 | |
| 801 | return CMD_SUCCESS; |
| 802 | } |
| 803 | |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 804 | |
| 805 | DEFUN(show_lchan, |
| 806 | show_lchan_cmd, |
| 807 | "show lchan [bts_nr] [trx_nr] [ts_nr] [lchan_nr]", |
| 808 | SHOW_STR "Display information about a logical channel\n" |
| 809 | "BTS Number\n" "TRX Number\n" "Timeslot Number\n" |
| 810 | "Logical Channel Number\n") |
| 811 | |
| 812 | { |
| 813 | return lchan_summary(vty, argc, argv, lchan_dump_full_vty); |
| 814 | } |
| 815 | |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 816 | DEFUN(show_lchan_summary, |
| 817 | show_lchan_summary_cmd, |
| 818 | "show lchan summary [bts_nr] [trx_nr] [ts_nr] [lchan_nr]", |
| 819 | SHOW_STR "Display information about a logical channel\n" |
| 820 | "BTS Number\n" "TRX Number\n" "Timeslot Number\n" |
| 821 | "Logical Channel Number\n") |
| 822 | { |
| 823 | return lchan_summary(vty, argc, argv, lchan_dump_short_vty); |
| 824 | } |
| 825 | |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 826 | static void e1drv_dump_vty(struct vty *vty, struct e1inp_driver *drv) |
| 827 | { |
| 828 | vty_out(vty, "E1 Input Driver %s%s", drv->name, VTY_NEWLINE); |
| 829 | } |
| 830 | |
| 831 | DEFUN(show_e1drv, |
| 832 | show_e1drv_cmd, |
| 833 | "show e1_driver", |
| 834 | SHOW_STR "Display information about available E1 drivers\n") |
| 835 | { |
| 836 | struct e1inp_driver *drv; |
| 837 | |
| 838 | llist_for_each_entry(drv, &e1inp_driver_list, list) |
| 839 | e1drv_dump_vty(vty, drv); |
| 840 | |
| 841 | return CMD_SUCCESS; |
| 842 | } |
| 843 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 844 | static void e1line_dump_vty(struct vty *vty, struct e1inp_line *line) |
| 845 | { |
| 846 | vty_out(vty, "E1 Line Number %u, Name %s, Driver %s%s", |
| 847 | line->num, line->name ? line->name : "", |
| 848 | line->driver->name, VTY_NEWLINE); |
| 849 | } |
| 850 | |
| 851 | DEFUN(show_e1line, |
| 852 | show_e1line_cmd, |
| 853 | "show e1_line [line_nr]", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 854 | SHOW_STR "Display information about a E1 line\n" |
| 855 | "E1 Line Number\n") |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 856 | { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 857 | struct e1inp_line *line; |
| 858 | |
| 859 | if (argc >= 1) { |
| 860 | int num = atoi(argv[0]); |
| 861 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 862 | if (line->num == num) { |
| 863 | e1line_dump_vty(vty, line); |
| 864 | return CMD_SUCCESS; |
| 865 | } |
| 866 | } |
| 867 | return CMD_WARNING; |
| 868 | } |
| 869 | |
| 870 | llist_for_each_entry(line, &e1inp_line_list, list) |
| 871 | e1line_dump_vty(vty, line); |
| 872 | |
| 873 | return CMD_SUCCESS; |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 874 | } |
| 875 | |
| 876 | static void e1ts_dump_vty(struct vty *vty, struct e1inp_ts *ts) |
| 877 | { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 878 | if (ts->type == E1INP_TS_TYPE_NONE) |
| 879 | return; |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 880 | vty_out(vty, "E1 Timeslot %2u of Line %u is Type %s%s", |
| 881 | ts->num, ts->line->num, e1inp_tstype_name(ts->type), |
| 882 | VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 883 | } |
| 884 | |
| 885 | DEFUN(show_e1ts, |
| 886 | show_e1ts_cmd, |
| 887 | "show e1_timeslot [line_nr] [ts_nr]", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 888 | SHOW_STR "Display information about a E1 timeslot\n" |
| 889 | "E1 Line Number\n" "E1 Timeslot Number\n") |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 890 | { |
Harald Welte | 986c3d7 | 2009-11-17 06:12:16 +0100 | [diff] [blame] | 891 | struct e1inp_line *line = NULL; |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 892 | struct e1inp_ts *ts; |
| 893 | int ts_nr; |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 894 | |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 895 | if (argc == 0) { |
| 896 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 897 | for (ts_nr = 0; ts_nr < NUM_E1_TS; ts_nr++) { |
| 898 | ts = &line->ts[ts_nr]; |
| 899 | e1ts_dump_vty(vty, ts); |
| 900 | } |
| 901 | } |
| 902 | return CMD_SUCCESS; |
| 903 | } |
| 904 | if (argc >= 1) { |
| 905 | int num = atoi(argv[0]); |
| 906 | llist_for_each_entry(line, &e1inp_line_list, list) { |
| 907 | if (line->num == num) |
| 908 | break; |
| 909 | } |
| 910 | if (!line || line->num != num) { |
| 911 | vty_out(vty, "E1 line %s is invalid%s", |
| 912 | argv[0], VTY_NEWLINE); |
| 913 | return CMD_WARNING; |
| 914 | } |
| 915 | } |
| 916 | if (argc >= 2) { |
| 917 | ts_nr = atoi(argv[1]); |
| 918 | if (ts_nr > NUM_E1_TS) { |
| 919 | vty_out(vty, "E1 timeslot %s is invalid%s", |
| 920 | argv[1], VTY_NEWLINE); |
| 921 | return CMD_WARNING; |
| 922 | } |
| 923 | ts = &line->ts[ts_nr]; |
| 924 | e1ts_dump_vty(vty, ts); |
| 925 | return CMD_SUCCESS; |
| 926 | } else { |
| 927 | for (ts_nr = 0; ts_nr < NUM_E1_TS; ts_nr++) { |
| 928 | ts = &line->ts[ts_nr]; |
| 929 | e1ts_dump_vty(vty, ts); |
| 930 | } |
| 931 | return CMD_SUCCESS; |
| 932 | } |
| 933 | return CMD_SUCCESS; |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 934 | } |
| 935 | |
Harald Welte | be4b730 | 2009-05-23 16:59:33 +0000 | [diff] [blame] | 936 | 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] | 937 | { |
| 938 | vty_out(vty, "Paging on BTS %u%s", pag->bts->nr, VTY_NEWLINE); |
| 939 | subscr_dump_vty(vty, pag->subscr); |
| 940 | } |
| 941 | |
Harald Welte | be4b730 | 2009-05-23 16:59:33 +0000 | [diff] [blame] | 942 | 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] | 943 | { |
| 944 | struct gsm_paging_request *pag; |
| 945 | |
| 946 | llist_for_each_entry(pag, &bts->paging.pending_requests, entry) |
| 947 | paging_dump_vty(vty, pag); |
| 948 | } |
| 949 | |
| 950 | DEFUN(show_paging, |
| 951 | show_paging_cmd, |
| 952 | "show paging [bts_nr]", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 953 | SHOW_STR "Display information about paging reuqests of a BTS\n" |
| 954 | "BTS Number\n") |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 955 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 956 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 957 | struct gsm_bts *bts; |
| 958 | int bts_nr; |
| 959 | |
| 960 | if (argc >= 1) { |
| 961 | /* use the BTS number that the user has specified */ |
| 962 | bts_nr = atoi(argv[0]); |
| 963 | if (bts_nr >= net->num_bts) { |
| 964 | vty_out(vty, "%% can't find BTS %s%s", argv[0], |
| 965 | VTY_NEWLINE); |
| 966 | return CMD_WARNING; |
| 967 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 968 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 969 | bts_paging_dump_vty(vty, bts); |
| 970 | |
| 971 | return CMD_SUCCESS; |
| 972 | } |
| 973 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 974 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 975 | bts_paging_dump_vty(vty, bts); |
| 976 | } |
| 977 | |
| 978 | return CMD_SUCCESS; |
| 979 | } |
| 980 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 981 | #define NETWORK_STR "Configure the GSM network\n" |
| 982 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 983 | DEFUN(cfg_net, |
| 984 | cfg_net_cmd, |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 985 | "network", NETWORK_STR) |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 986 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 987 | vty->index = gsmnet_from_vty(vty); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 988 | vty->node = GSMNET_NODE; |
| 989 | |
| 990 | return CMD_SUCCESS; |
| 991 | } |
| 992 | |
| 993 | |
| 994 | DEFUN(cfg_net_ncc, |
| 995 | cfg_net_ncc_cmd, |
| 996 | "network country code <1-999>", |
| 997 | "Set the GSM network country code") |
| 998 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 999 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1000 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1001 | gsmnet->country_code = atoi(argv[0]); |
| 1002 | |
| 1003 | return CMD_SUCCESS; |
| 1004 | } |
| 1005 | |
| 1006 | DEFUN(cfg_net_mnc, |
| 1007 | cfg_net_mnc_cmd, |
| 1008 | "mobile network code <1-999>", |
| 1009 | "Set the GSM mobile network code") |
| 1010 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1011 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1012 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1013 | gsmnet->network_code = atoi(argv[0]); |
| 1014 | |
| 1015 | return CMD_SUCCESS; |
| 1016 | } |
| 1017 | |
| 1018 | DEFUN(cfg_net_name_short, |
| 1019 | cfg_net_name_short_cmd, |
| 1020 | "short name NAME", |
| 1021 | "Set the short GSM network name") |
| 1022 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1023 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1024 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1025 | if (gsmnet->name_short) |
| 1026 | talloc_free(gsmnet->name_short); |
| 1027 | |
| 1028 | gsmnet->name_short = talloc_strdup(gsmnet, argv[0]); |
| 1029 | |
| 1030 | return CMD_SUCCESS; |
| 1031 | } |
| 1032 | |
| 1033 | DEFUN(cfg_net_name_long, |
| 1034 | cfg_net_name_long_cmd, |
| 1035 | "long name NAME", |
| 1036 | "Set the long GSM network name") |
| 1037 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1038 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1039 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 1040 | if (gsmnet->name_long) |
| 1041 | talloc_free(gsmnet->name_long); |
| 1042 | |
| 1043 | gsmnet->name_long = talloc_strdup(gsmnet, argv[0]); |
| 1044 | |
| 1045 | return CMD_SUCCESS; |
| 1046 | } |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 1047 | |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 1048 | DEFUN(cfg_net_auth_policy, |
| 1049 | cfg_net_auth_policy_cmd, |
| 1050 | "auth policy (closed|accept-all|token)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1051 | "Authentication (not cryptographic)\n" |
| 1052 | "Set the GSM network authentication policy\n" |
| 1053 | "Require the MS to be activated in HLR\n" |
| 1054 | "Accept all MS, whether in HLR or not\n" |
| 1055 | "Use SMS-token based authentication\n") |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 1056 | { |
| 1057 | enum gsm_auth_policy policy = gsm_auth_policy_parse(argv[0]); |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1058 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 1059 | |
| 1060 | gsmnet->auth_policy = policy; |
| 1061 | |
| 1062 | return CMD_SUCCESS; |
| 1063 | } |
| 1064 | |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 1065 | DEFUN(cfg_net_reject_cause, |
| 1066 | cfg_net_reject_cause_cmd, |
| 1067 | "location updating reject cause <2-111>", |
| 1068 | "Set the reject cause of location updating reject\n") |
| 1069 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1070 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1071 | |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 1072 | gsmnet->reject_cause = atoi(argv[0]); |
| 1073 | |
| 1074 | return CMD_SUCCESS; |
| 1075 | } |
| 1076 | |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 1077 | DEFUN(cfg_net_encryption, |
| 1078 | cfg_net_encryption_cmd, |
| 1079 | "encryption a5 (0|1|2)", |
Harald Welte | 2832606 | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 1080 | "Encryption options\n" |
| 1081 | "A5 encryption\n" "A5/0: No encryption\n" |
| 1082 | "A5/1: Encryption\n" "A5/2: Export-grade Encryption\n") |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 1083 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1084 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1085 | |
Andreas.Eversberg | 1059deb | 2009-11-17 09:55:26 +0100 | [diff] [blame] | 1086 | gsmnet->a5_encryption= atoi(argv[0]); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 1087 | |
| 1088 | return CMD_SUCCESS; |
| 1089 | } |
| 1090 | |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 1091 | DEFUN(cfg_net_neci, |
| 1092 | cfg_net_neci_cmd, |
| 1093 | "neci (0|1)", |
Harald Welte | 2832606 | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 1094 | "New Establish Cause Indication\n" |
| 1095 | "Don't set the NECI bit\n" "Set the NECI bit\n") |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 1096 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1097 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1098 | |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 1099 | gsmnet->neci = atoi(argv[0]); |
| 1100 | return CMD_SUCCESS; |
| 1101 | } |
| 1102 | |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 1103 | DEFUN(cfg_net_rrlp_mode, cfg_net_rrlp_mode_cmd, |
| 1104 | "rrlp mode (none|ms-based|ms-preferred|ass-preferred)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1105 | "Radio Resource Location Protocol\n" |
| 1106 | "Set the Radio Resource Location Protocol Mode\n" |
| 1107 | "Don't send RRLP request\n" |
| 1108 | "Request MS-based location\n" |
| 1109 | "Request any location, prefer MS-based\n" |
| 1110 | "Request any location, prefer MS-assisted\n") |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 1111 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1112 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1113 | |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 1114 | gsmnet->rrlp.mode = rrlp_mode_parse(argv[0]); |
| 1115 | |
| 1116 | return CMD_SUCCESS; |
| 1117 | } |
| 1118 | |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 1119 | DEFUN(cfg_net_mm_info, cfg_net_mm_info_cmd, |
| 1120 | "mm info (0|1)", |
| 1121 | "Whether to send MM INFO after LOC UPD ACCEPT") |
| 1122 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1123 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1124 | |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 1125 | gsmnet->send_mm_info = atoi(argv[0]); |
| 1126 | |
| 1127 | return CMD_SUCCESS; |
| 1128 | } |
| 1129 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1130 | #define HANDOVER_STR "Handover Options\n" |
| 1131 | |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1132 | DEFUN(cfg_net_handover, cfg_net_handover_cmd, |
| 1133 | "handover (0|1)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1134 | HANDOVER_STR |
| 1135 | "Don't perform in-call handover\n" |
| 1136 | "Perform in-call handover\n") |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1137 | { |
Holger Hans Peter Freyther | cbcfe24 | 2010-01-07 16:14:38 +0100 | [diff] [blame] | 1138 | int enable = atoi(argv[0]); |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1139 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Holger Hans Peter Freyther | cbcfe24 | 2010-01-07 16:14:38 +0100 | [diff] [blame] | 1140 | |
| 1141 | if (enable && ipacc_rtp_direct) { |
Harald Welte | fe03f0d | 2009-12-20 13:51:01 +0100 | [diff] [blame] | 1142 | vty_out(vty, "%% Cannot enable handover unless RTP Proxy mode " |
| 1143 | "is enabled by using the -P command line option%s", |
| 1144 | VTY_NEWLINE); |
| 1145 | return CMD_WARNING; |
| 1146 | } |
Holger Hans Peter Freyther | cbcfe24 | 2010-01-07 16:14:38 +0100 | [diff] [blame] | 1147 | gsmnet->handover.active = enable; |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1148 | |
| 1149 | return CMD_SUCCESS; |
| 1150 | } |
| 1151 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1152 | #define HO_WIN_STR HANDOVER_STR "Measurement Window\n" |
| 1153 | #define HO_WIN_RXLEV_STR HO_WIN_STR "Received Level Averaging\n" |
| 1154 | #define HO_WIN_RXQUAL_STR HO_WIN_STR "Received Quality Averaging\n" |
| 1155 | #define HO_PBUDGET_STR HANDOVER_STR "Power Budget\n" |
| 1156 | |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1157 | DEFUN(cfg_net_ho_win_rxlev_avg, cfg_net_ho_win_rxlev_avg_cmd, |
| 1158 | "handover window rxlev averaging <1-10>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1159 | HO_WIN_RXLEV_STR |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1160 | "How many RxLev measurements are used for averaging") |
| 1161 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1162 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1163 | gsmnet->handover.win_rxlev_avg = atoi(argv[0]); |
| 1164 | return CMD_SUCCESS; |
| 1165 | } |
| 1166 | |
| 1167 | DEFUN(cfg_net_ho_win_rxqual_avg, cfg_net_ho_win_rxqual_avg_cmd, |
| 1168 | "handover window rxqual averaging <1-10>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1169 | HO_WIN_RXQUAL_STR |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1170 | "How many RxQual measurements are used for averaging") |
| 1171 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1172 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1173 | gsmnet->handover.win_rxqual_avg = atoi(argv[0]); |
| 1174 | return CMD_SUCCESS; |
| 1175 | } |
| 1176 | |
| 1177 | DEFUN(cfg_net_ho_win_rxlev_neigh_avg, cfg_net_ho_win_rxlev_avg_neigh_cmd, |
| 1178 | "handover window rxlev neighbor averaging <1-10>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1179 | HO_WIN_RXLEV_STR |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1180 | "How many RxQual measurements are used for averaging") |
| 1181 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1182 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1183 | gsmnet->handover.win_rxlev_avg_neigh = atoi(argv[0]); |
| 1184 | return CMD_SUCCESS; |
| 1185 | } |
| 1186 | |
| 1187 | DEFUN(cfg_net_ho_pwr_interval, cfg_net_ho_pwr_interval_cmd, |
| 1188 | "handover power budget interval <1-99>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1189 | HO_PBUDGET_STR |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1190 | "How often to check if we have a better cell (SACCH frames)") |
| 1191 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1192 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1193 | gsmnet->handover.pwr_interval = atoi(argv[0]); |
| 1194 | return CMD_SUCCESS; |
| 1195 | } |
| 1196 | |
| 1197 | DEFUN(cfg_net_ho_pwr_hysteresis, cfg_net_ho_pwr_hysteresis_cmd, |
| 1198 | "handover power budget hysteresis <0-999>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1199 | HO_PBUDGET_STR |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1200 | "How many dB does a neighbor to be stronger to become a HO candidate") |
| 1201 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1202 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1203 | gsmnet->handover.pwr_hysteresis = atoi(argv[0]); |
| 1204 | return CMD_SUCCESS; |
| 1205 | } |
| 1206 | |
| 1207 | DEFUN(cfg_net_ho_max_distance, cfg_net_ho_max_distance_cmd, |
| 1208 | "handover maximum distance <0-9999>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1209 | HANDOVER_STR |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1210 | "How big is the maximum timing advance before HO is forced") |
| 1211 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1212 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1213 | gsmnet->handover.max_distance = atoi(argv[0]); |
| 1214 | return CMD_SUCCESS; |
| 1215 | } |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1216 | |
Holger Hans Peter Freyther | c802106 | 2009-12-22 08:27:21 +0100 | [diff] [blame] | 1217 | #define DECLARE_TIMER(number, doc) \ |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1218 | DEFUN(cfg_net_T##number, \ |
| 1219 | cfg_net_T##number##_cmd, \ |
| 1220 | "timer t" #number " <0-65535>", \ |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1221 | "Configure GSM Timers\n" \ |
Holger Hans Peter Freyther | c802106 | 2009-12-22 08:27:21 +0100 | [diff] [blame] | 1222 | doc) \ |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1223 | { \ |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1224 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1225 | int value = atoi(argv[0]); \ |
| 1226 | \ |
| 1227 | if (value < 0 || value > 65535) { \ |
| 1228 | vty_out(vty, "Timer value %s out of range.%s", \ |
| 1229 | argv[0], VTY_NEWLINE); \ |
| 1230 | return CMD_WARNING; \ |
| 1231 | } \ |
| 1232 | \ |
| 1233 | gsmnet->T##number = value; \ |
| 1234 | return CMD_SUCCESS; \ |
| 1235 | } |
| 1236 | |
Holger Hans Peter Freyther | c802106 | 2009-12-22 08:27:21 +0100 | [diff] [blame] | 1237 | DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT.") |
| 1238 | DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.") |
| 1239 | DECLARE_TIMER(3105, "Currently not used.") |
| 1240 | DECLARE_TIMER(3107, "Currently not used.") |
| 1241 | DECLARE_TIMER(3109, "Currently not used.") |
Holger Hans Peter Freyther | f30c0dc | 2010-05-31 21:33:15 +0800 | [diff] [blame] | 1242 | DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel.") |
Holger Hans Peter Freyther | c802106 | 2009-12-22 08:27:21 +0100 | [diff] [blame] | 1243 | DECLARE_TIMER(3113, "Set the time to try paging a subscriber.") |
| 1244 | DECLARE_TIMER(3115, "Currently not used.") |
| 1245 | DECLARE_TIMER(3117, "Currently not used.") |
| 1246 | DECLARE_TIMER(3119, "Currently not used.") |
| 1247 | DECLARE_TIMER(3141, "Currently not used.") |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1248 | |
| 1249 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1250 | /* per-BTS configuration */ |
| 1251 | DEFUN(cfg_bts, |
| 1252 | cfg_bts_cmd, |
| 1253 | "bts BTS_NR", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1254 | "Select a BTS to configure\n" |
| 1255 | "BTS Number\n") |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1256 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1257 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1258 | int bts_nr = atoi(argv[0]); |
| 1259 | struct gsm_bts *bts; |
| 1260 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1261 | if (bts_nr > gsmnet->num_bts) { |
| 1262 | vty_out(vty, "%% The next unused BTS number is %u%s", |
| 1263 | gsmnet->num_bts, VTY_NEWLINE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1264 | return CMD_WARNING; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1265 | } else if (bts_nr == gsmnet->num_bts) { |
| 1266 | /* allocate a new one */ |
| 1267 | bts = gsm_bts_alloc(gsmnet, GSM_BTS_TYPE_UNKNOWN, |
| 1268 | HARDCODED_TSC, HARDCODED_BSIC); |
Holger Hans Peter Freyther | acf8a0c | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 1269 | } else |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1270 | bts = gsm_bts_num(gsmnet, bts_nr); |
| 1271 | |
Daniel Willmann | f15c276 | 2010-01-11 13:43:07 +0100 | [diff] [blame] | 1272 | if (!bts) { |
| 1273 | vty_out(vty, "%% Unable to allocate BTS %u%s", |
| 1274 | gsmnet->num_bts, VTY_NEWLINE); |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1275 | return CMD_WARNING; |
Daniel Willmann | f15c276 | 2010-01-11 13:43:07 +0100 | [diff] [blame] | 1276 | } |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1277 | |
| 1278 | vty->index = bts; |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 1279 | vty->index_sub = &bts->description; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1280 | vty->node = BTS_NODE; |
| 1281 | |
| 1282 | return CMD_SUCCESS; |
| 1283 | } |
| 1284 | |
| 1285 | DEFUN(cfg_bts_type, |
| 1286 | cfg_bts_type_cmd, |
| 1287 | "type TYPE", |
| 1288 | "Set the BTS type\n") |
| 1289 | { |
| 1290 | struct gsm_bts *bts = vty->index; |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 1291 | int rc; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1292 | |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 1293 | rc = gsm_set_bts_type(bts, parse_btstype(argv[0])); |
| 1294 | if (rc < 0) |
| 1295 | return CMD_WARNING; |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1296 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1297 | return CMD_SUCCESS; |
| 1298 | } |
| 1299 | |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1300 | DEFUN(cfg_bts_band, |
| 1301 | cfg_bts_band_cmd, |
| 1302 | "band BAND", |
| 1303 | "Set the frequency band of this BTS\n") |
| 1304 | { |
| 1305 | struct gsm_bts *bts = vty->index; |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1306 | int band = gsm_band_parse(argv[0]); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1307 | |
| 1308 | if (band < 0) { |
| 1309 | vty_out(vty, "%% BAND %d is not a valid GSM band%s", |
| 1310 | band, VTY_NEWLINE); |
| 1311 | return CMD_WARNING; |
| 1312 | } |
| 1313 | |
| 1314 | bts->band = band; |
| 1315 | |
| 1316 | return CMD_SUCCESS; |
| 1317 | } |
| 1318 | |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 1319 | DEFUN(cfg_bts_ci, |
| 1320 | cfg_bts_ci_cmd, |
| 1321 | "cell_identity <0-65535>", |
| 1322 | "Set the Cell identity of this BTS\n") |
| 1323 | { |
| 1324 | struct gsm_bts *bts = vty->index; |
| 1325 | int ci = atoi(argv[0]); |
| 1326 | |
| 1327 | if (ci < 0 || ci > 0xffff) { |
| 1328 | vty_out(vty, "%% CI %d is not in the valid range (0-65535)%s", |
| 1329 | ci, VTY_NEWLINE); |
| 1330 | return CMD_WARNING; |
| 1331 | } |
| 1332 | bts->cell_identity = ci; |
| 1333 | |
| 1334 | return CMD_SUCCESS; |
| 1335 | } |
| 1336 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1337 | DEFUN(cfg_bts_lac, |
| 1338 | cfg_bts_lac_cmd, |
Holger Hans Peter Freyther | 0b7f4b3 | 2009-09-29 14:02:33 +0200 | [diff] [blame] | 1339 | "location_area_code <0-65535>", |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1340 | "Set the Location Area Code (LAC) of this BTS\n") |
| 1341 | { |
| 1342 | struct gsm_bts *bts = vty->index; |
| 1343 | int lac = atoi(argv[0]); |
| 1344 | |
Holger Hans Peter Freyther | 0b7f4b3 | 2009-09-29 14:02:33 +0200 | [diff] [blame] | 1345 | if (lac < 0 || lac > 0xffff) { |
| 1346 | 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] | 1347 | lac, VTY_NEWLINE); |
| 1348 | return CMD_WARNING; |
| 1349 | } |
Holger Hans Peter Freyther | e48b956 | 2009-10-01 04:07:15 +0200 | [diff] [blame] | 1350 | |
| 1351 | if (lac == GSM_LAC_RESERVED_DETACHED || lac == GSM_LAC_RESERVED_ALL_BTS) { |
| 1352 | vty_out(vty, "%% LAC %d is reserved by GSM 04.08%s", |
| 1353 | lac, VTY_NEWLINE); |
| 1354 | return CMD_WARNING; |
| 1355 | } |
| 1356 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1357 | bts->location_area_code = lac; |
| 1358 | |
| 1359 | return CMD_SUCCESS; |
| 1360 | } |
| 1361 | |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 1362 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1363 | DEFUN(cfg_bts_tsc, |
| 1364 | cfg_bts_tsc_cmd, |
| 1365 | "training_sequence_code <0-255>", |
| 1366 | "Set the Training Sequence Code (TSC) of this BTS\n") |
| 1367 | { |
| 1368 | struct gsm_bts *bts = vty->index; |
| 1369 | int tsc = atoi(argv[0]); |
| 1370 | |
| 1371 | if (tsc < 0 || tsc > 0xff) { |
| 1372 | vty_out(vty, "%% TSC %d is not in the valid range (0-255)%s", |
| 1373 | tsc, VTY_NEWLINE); |
| 1374 | return CMD_WARNING; |
| 1375 | } |
| 1376 | bts->tsc = tsc; |
| 1377 | |
| 1378 | return CMD_SUCCESS; |
| 1379 | } |
| 1380 | |
Harald Welte | 78f2f50 | 2009-05-23 16:56:52 +0000 | [diff] [blame] | 1381 | DEFUN(cfg_bts_bsic, |
| 1382 | cfg_bts_bsic_cmd, |
| 1383 | "base_station_id_code <0-63>", |
| 1384 | "Set the Base Station Identity Code (BSIC) of this BTS\n") |
| 1385 | { |
| 1386 | struct gsm_bts *bts = vty->index; |
| 1387 | int bsic = atoi(argv[0]); |
| 1388 | |
| 1389 | if (bsic < 0 || bsic > 0x3f) { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1390 | 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] | 1391 | bsic, VTY_NEWLINE); |
| 1392 | return CMD_WARNING; |
| 1393 | } |
| 1394 | bts->bsic = bsic; |
| 1395 | |
| 1396 | return CMD_SUCCESS; |
| 1397 | } |
| 1398 | |
| 1399 | |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1400 | DEFUN(cfg_bts_unit_id, |
| 1401 | cfg_bts_unit_id_cmd, |
Harald Welte | 07dc73d | 2009-08-07 13:27:09 +0200 | [diff] [blame] | 1402 | "ip.access unit_id <0-65534> <0-255>", |
| 1403 | "Set the ip.access BTS Unit ID of this BTS\n") |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1404 | { |
| 1405 | struct gsm_bts *bts = vty->index; |
| 1406 | int site_id = atoi(argv[0]); |
| 1407 | int bts_id = atoi(argv[1]); |
| 1408 | |
Harald Welte | 07dc73d | 2009-08-07 13:27:09 +0200 | [diff] [blame] | 1409 | if (!is_ipaccess_bts(bts)) { |
| 1410 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1411 | return CMD_WARNING; |
| 1412 | } |
| 1413 | |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1414 | bts->ip_access.site_id = site_id; |
| 1415 | bts->ip_access.bts_id = bts_id; |
| 1416 | |
| 1417 | return CMD_SUCCESS; |
| 1418 | } |
| 1419 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1420 | #define OML_STR "Organization & Maintenance Link\n" |
| 1421 | #define IPA_STR "ip.access Specific Options\n" |
| 1422 | |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1423 | DEFUN(cfg_bts_stream_id, |
| 1424 | cfg_bts_stream_id_cmd, |
| 1425 | "oml ip.access stream_id <0-255>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1426 | OML_STR IPA_STR |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1427 | "Set the ip.access Stream ID of the OML link of this BTS\n") |
| 1428 | { |
| 1429 | struct gsm_bts *bts = vty->index; |
| 1430 | int stream_id = atoi(argv[0]); |
| 1431 | |
| 1432 | if (!is_ipaccess_bts(bts)) { |
| 1433 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1434 | return CMD_WARNING; |
| 1435 | } |
| 1436 | |
| 1437 | bts->oml_tei = stream_id; |
| 1438 | |
| 1439 | return CMD_SUCCESS; |
| 1440 | } |
| 1441 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1442 | #define OML_E1_STR OML_STR "E1 Line\n" |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1443 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1444 | DEFUN(cfg_bts_oml_e1, |
| 1445 | cfg_bts_oml_e1_cmd, |
| 1446 | "oml e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1447 | OML_E1_STR |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1448 | "E1 interface to be used for OML\n") |
| 1449 | { |
| 1450 | struct gsm_bts *bts = vty->index; |
| 1451 | |
| 1452 | parse_e1_link(&bts->oml_e1_link, argv[0], argv[1], argv[2]); |
| 1453 | |
| 1454 | return CMD_SUCCESS; |
| 1455 | } |
| 1456 | |
| 1457 | |
| 1458 | DEFUN(cfg_bts_oml_e1_tei, |
| 1459 | cfg_bts_oml_e1_tei_cmd, |
| 1460 | "oml e1 tei <0-63>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1461 | OML_E1_STR |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1462 | "Set the TEI to be used for OML") |
| 1463 | { |
| 1464 | struct gsm_bts *bts = vty->index; |
| 1465 | |
| 1466 | bts->oml_tei = atoi(argv[0]); |
| 1467 | |
| 1468 | return CMD_SUCCESS; |
| 1469 | } |
| 1470 | |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1471 | DEFUN(cfg_bts_challoc, cfg_bts_challoc_cmd, |
| 1472 | "channel allocator (ascending|descending)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1473 | "Channnel Allocator\n" "Channel Allocator\n" |
| 1474 | "Allocate Timeslots and Transceivers in ascending order\n" |
| 1475 | "Allocate Timeslots and Transceivers in descending order\n") |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1476 | { |
| 1477 | struct gsm_bts *bts = vty->index; |
| 1478 | |
| 1479 | if (!strcmp(argv[0], "ascending")) |
| 1480 | bts->chan_alloc_reverse = 0; |
| 1481 | else |
| 1482 | bts->chan_alloc_reverse = 1; |
| 1483 | |
| 1484 | return CMD_SUCCESS; |
| 1485 | } |
| 1486 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1487 | #define RACH_STR "Random Access Control Channel\n" |
| 1488 | |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 1489 | DEFUN(cfg_bts_rach_tx_integer, |
| 1490 | cfg_bts_rach_tx_integer_cmd, |
| 1491 | "rach tx integer <0-15>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1492 | RACH_STR |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 1493 | "Set the raw tx integer value in RACH Control parameters IE") |
| 1494 | { |
| 1495 | struct gsm_bts *bts = vty->index; |
| 1496 | bts->si_common.rach_control.tx_integer = atoi(argv[0]) & 0xf; |
| 1497 | return CMD_SUCCESS; |
| 1498 | } |
| 1499 | |
| 1500 | DEFUN(cfg_bts_rach_max_trans, |
| 1501 | cfg_bts_rach_max_trans_cmd, |
| 1502 | "rach max transmission (1|2|4|7)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1503 | RACH_STR |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 1504 | "Set the maximum number of RACH burst transmissions") |
| 1505 | { |
| 1506 | struct gsm_bts *bts = vty->index; |
| 1507 | bts->si_common.rach_control.max_trans = rach_max_trans_val2raw(atoi(argv[0])); |
| 1508 | return CMD_SUCCESS; |
| 1509 | } |
| 1510 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1511 | #define NM_STR "Network Management\n" |
| 1512 | |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 1513 | DEFUN(cfg_bts_rach_nm_b_thresh, |
| 1514 | cfg_bts_rach_nm_b_thresh_cmd, |
| 1515 | "rach nm busy threshold <0-255>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1516 | RACH_STR NM_STR |
| 1517 | "Set the NM Busy Threshold in dB") |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 1518 | { |
| 1519 | struct gsm_bts *bts = vty->index; |
| 1520 | bts->rach_b_thresh = atoi(argv[0]); |
| 1521 | return CMD_SUCCESS; |
| 1522 | } |
| 1523 | |
| 1524 | DEFUN(cfg_bts_rach_nm_ldavg, |
| 1525 | cfg_bts_rach_nm_ldavg_cmd, |
| 1526 | "rach nm load average <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1527 | RACH_STR NM_STR |
| 1528 | "Set the NM Loadaverage Slots value") |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 1529 | { |
| 1530 | struct gsm_bts *bts = vty->index; |
| 1531 | bts->rach_ldavg_slots = atoi(argv[0]); |
| 1532 | return CMD_SUCCESS; |
| 1533 | } |
| 1534 | |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 1535 | DEFUN(cfg_bts_cell_barred, cfg_bts_cell_barred_cmd, |
| 1536 | "cell barred (0|1)", |
| 1537 | "Should this cell be barred from access?") |
| 1538 | { |
| 1539 | struct gsm_bts *bts = vty->index; |
| 1540 | |
Harald Welte | 7135501 | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 1541 | bts->si_common.rach_control.cell_bar = atoi(argv[0]); |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 1542 | |
| 1543 | return CMD_SUCCESS; |
| 1544 | } |
| 1545 | |
Holger Hans Peter Freyther | 3a0a463 | 2010-05-14 00:39:19 +0800 | [diff] [blame] | 1546 | DEFUN(cfg_bts_rach_ec_allowed, cfg_bts_rach_ec_allowed_cmd, |
| 1547 | "rach emergency call allowed (0|1)", |
| 1548 | "Should this cell allow emergency calls?") |
| 1549 | { |
| 1550 | struct gsm_bts *bts = vty->index; |
| 1551 | |
| 1552 | if (atoi(argv[0]) == 0) |
| 1553 | bts->si_common.rach_control.t2 |= 0x4; |
| 1554 | else |
| 1555 | bts->si_common.rach_control.t2 &= ~0x4; |
| 1556 | |
| 1557 | return CMD_SUCCESS; |
| 1558 | } |
| 1559 | |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 1560 | DEFUN(cfg_bts_ms_max_power, cfg_bts_ms_max_power_cmd, |
| 1561 | "ms max power <0-40>", |
| 1562 | "Maximum transmit power of the MS") |
| 1563 | { |
| 1564 | struct gsm_bts *bts = vty->index; |
| 1565 | |
| 1566 | bts->ms_max_power = atoi(argv[0]); |
| 1567 | |
| 1568 | return CMD_SUCCESS; |
| 1569 | } |
| 1570 | |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 1571 | DEFUN(cfg_bts_cell_resel_hyst, cfg_bts_cell_resel_hyst_cmd, |
| 1572 | "cell reselection hysteresis <0-14>", |
| 1573 | "Cell Re-Selection Hysteresis in dB") |
| 1574 | { |
| 1575 | struct gsm_bts *bts = vty->index; |
| 1576 | |
| 1577 | bts->si_common.cell_sel_par.cell_resel_hyst = atoi(argv[0])/2; |
| 1578 | |
| 1579 | return CMD_SUCCESS; |
| 1580 | } |
| 1581 | |
| 1582 | DEFUN(cfg_bts_rxlev_acc_min, cfg_bts_rxlev_acc_min_cmd, |
| 1583 | "rxlev access min <0-63>", |
| 1584 | "Minimum RxLev needed for cell access (better than -110dBm)") |
| 1585 | { |
| 1586 | struct gsm_bts *bts = vty->index; |
| 1587 | |
| 1588 | bts->si_common.cell_sel_par.rxlev_acc_min = atoi(argv[0]); |
| 1589 | |
| 1590 | return CMD_SUCCESS; |
| 1591 | } |
| 1592 | |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 1593 | DEFUN(cfg_bts_per_loc_upd, cfg_bts_per_loc_upd_cmd, |
| 1594 | "periodic location update <0-1530>", |
| 1595 | "Periodic Location Updating Interval in Minutes") |
| 1596 | { |
| 1597 | struct gsm_bts *bts = vty->index; |
| 1598 | |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 1599 | bts->si_common.chan_desc.t3212 = atoi(argv[0]) / 10; |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 1600 | |
| 1601 | return CMD_SUCCESS; |
| 1602 | } |
| 1603 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1604 | #define GPRS_TEXT "GPRS Packet Network\n" |
| 1605 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1606 | DEFUN(cfg_bts_prs_bvci, cfg_bts_gprs_bvci_cmd, |
Harald Welte | 57ba7e3 | 2010-04-18 14:00:26 +0200 | [diff] [blame] | 1607 | "gprs cell bvci <2-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1608 | GPRS_TEXT |
| 1609 | "GPRS Cell Settings\n" |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1610 | "GPRS BSSGP VC Identifier") |
| 1611 | { |
| 1612 | struct gsm_bts *bts = vty->index; |
| 1613 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1614 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1615 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1616 | return CMD_WARNING; |
| 1617 | } |
| 1618 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1619 | bts->gprs.cell.bvci = atoi(argv[0]); |
| 1620 | |
| 1621 | return CMD_SUCCESS; |
| 1622 | } |
| 1623 | |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 1624 | DEFUN(cfg_bts_gprs_nsei, cfg_bts_gprs_nsei_cmd, |
| 1625 | "gprs nsei <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1626 | GPRS_TEXT |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 1627 | "GPRS NS Entity Identifier") |
| 1628 | { |
| 1629 | struct gsm_bts *bts = vty->index; |
| 1630 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1631 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 1632 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1633 | return CMD_WARNING; |
| 1634 | } |
| 1635 | |
| 1636 | bts->gprs.nse.nsei = atoi(argv[0]); |
| 1637 | |
| 1638 | return CMD_SUCCESS; |
| 1639 | } |
| 1640 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1641 | #define NSVC_TEXT "Network Service Virtual Connection (NS-VC)\n" \ |
| 1642 | "NSVC Logical Number\n" |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 1643 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1644 | DEFUN(cfg_bts_gprs_nsvci, cfg_bts_gprs_nsvci_cmd, |
| 1645 | "gprs nsvc <0-1> nsvci <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1646 | GPRS_TEXT NSVC_TEXT |
| 1647 | "NS Virtual Connection Identifier\n" |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1648 | "GPRS NS VC Identifier") |
| 1649 | { |
| 1650 | struct gsm_bts *bts = vty->index; |
| 1651 | int idx = atoi(argv[0]); |
| 1652 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1653 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1654 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1655 | return CMD_WARNING; |
| 1656 | } |
| 1657 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1658 | bts->gprs.nsvc[idx].nsvci = atoi(argv[1]); |
| 1659 | |
| 1660 | return CMD_SUCCESS; |
| 1661 | } |
| 1662 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1663 | DEFUN(cfg_bts_gprs_nsvc_lport, cfg_bts_gprs_nsvc_lport_cmd, |
| 1664 | "gprs nsvc <0-1> local udp port <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1665 | GPRS_TEXT NSVC_TEXT |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1666 | "GPRS NS Local UDP Port") |
| 1667 | { |
| 1668 | struct gsm_bts *bts = vty->index; |
| 1669 | int idx = atoi(argv[0]); |
| 1670 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1671 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1672 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1673 | return CMD_WARNING; |
| 1674 | } |
| 1675 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1676 | bts->gprs.nsvc[idx].local_port = atoi(argv[1]); |
| 1677 | |
| 1678 | return CMD_SUCCESS; |
| 1679 | } |
| 1680 | |
| 1681 | DEFUN(cfg_bts_gprs_nsvc_rport, cfg_bts_gprs_nsvc_rport_cmd, |
| 1682 | "gprs nsvc <0-1> remote udp port <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1683 | GPRS_TEXT NSVC_TEXT |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1684 | "GPRS NS Remote UDP Port") |
| 1685 | { |
| 1686 | struct gsm_bts *bts = vty->index; |
| 1687 | int idx = atoi(argv[0]); |
| 1688 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1689 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1690 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1691 | return CMD_WARNING; |
| 1692 | } |
| 1693 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1694 | bts->gprs.nsvc[idx].remote_port = atoi(argv[1]); |
| 1695 | |
| 1696 | return CMD_SUCCESS; |
| 1697 | } |
| 1698 | |
| 1699 | DEFUN(cfg_bts_gprs_nsvc_rip, cfg_bts_gprs_nsvc_rip_cmd, |
| 1700 | "gprs nsvc <0-1> remote ip A.B.C.D", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1701 | GPRS_TEXT NSVC_TEXT |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1702 | "GPRS NS Remote IP Address") |
| 1703 | { |
| 1704 | struct gsm_bts *bts = vty->index; |
| 1705 | int idx = atoi(argv[0]); |
| 1706 | struct in_addr ia; |
| 1707 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1708 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1709 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1710 | return CMD_WARNING; |
| 1711 | } |
| 1712 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1713 | inet_aton(argv[1], &ia); |
| 1714 | bts->gprs.nsvc[idx].remote_ip = ntohl(ia.s_addr); |
| 1715 | |
| 1716 | return CMD_SUCCESS; |
| 1717 | } |
| 1718 | |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 1719 | DEFUN(cfg_bts_gprs_ns_timer, cfg_bts_gprs_ns_timer_cmd, |
| 1720 | "gprs ns timer " NS_TIMERS " <0-255>", |
| 1721 | GPRS_TEXT "Network Service\n" |
| 1722 | "Network Service Timer\n" |
| 1723 | NS_TIMERS_HELP "Timer Value\n") |
| 1724 | { |
| 1725 | struct gsm_bts *bts = vty->index; |
| 1726 | int idx = get_string_value(gprs_ns_timer_strs, argv[0]); |
| 1727 | int val = atoi(argv[1]); |
| 1728 | |
| 1729 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
| 1730 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1731 | return CMD_WARNING; |
| 1732 | } |
| 1733 | |
| 1734 | if (idx < 0 || idx >= ARRAY_SIZE(bts->gprs.nse.timer)) |
| 1735 | return CMD_WARNING; |
| 1736 | |
| 1737 | bts->gprs.nse.timer[idx] = val; |
| 1738 | |
| 1739 | return CMD_SUCCESS; |
| 1740 | } |
| 1741 | |
| 1742 | #define BSSGP_TIMERS "(blocking-timer|blocking-retries|unblocking-retries|reset-timer|reset-retries|suspend-timer|suspend-retries|resume-timer|resume-retries|capability-update-timer|capability-update-retries)" |
Harald Welte | 2832606 | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 1743 | #define BSSGP_TIMERS_HELP \ |
| 1744 | "Tbvc-block timeout\n" \ |
| 1745 | "Tbvc-block retries\n" \ |
| 1746 | "Tbvc-unblock retries\n" \ |
| 1747 | "Tbvcc-reset timeout\n" \ |
| 1748 | "Tbvc-reset retries\n" \ |
| 1749 | "Tbvc-suspend timeout\n" \ |
| 1750 | "Tbvc-suspend retries\n" \ |
| 1751 | "Tbvc-resume timeout\n" \ |
| 1752 | "Tbvc-resume retries\n" \ |
| 1753 | "Tbvc-capa-update timeout\n" \ |
| 1754 | "Tbvc-capa-update retries\n" |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 1755 | |
| 1756 | DEFUN(cfg_bts_gprs_cell_timer, cfg_bts_gprs_cell_timer_cmd, |
| 1757 | "gprs cell timer " BSSGP_TIMERS " <0-255>", |
| 1758 | GPRS_TEXT "Cell / BSSGP\n" |
| 1759 | "Cell/BSSGP Timer\n" |
| 1760 | BSSGP_TIMERS_HELP "Timer Value\n") |
| 1761 | { |
| 1762 | struct gsm_bts *bts = vty->index; |
| 1763 | int idx = get_string_value(gprs_bssgp_cfg_strs, argv[0]); |
| 1764 | int val = atoi(argv[1]); |
| 1765 | |
| 1766 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
| 1767 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1768 | return CMD_WARNING; |
| 1769 | } |
| 1770 | |
| 1771 | if (idx < 0 || idx >= ARRAY_SIZE(bts->gprs.cell.timer)) |
| 1772 | return CMD_WARNING; |
| 1773 | |
| 1774 | bts->gprs.cell.timer[idx] = val; |
| 1775 | |
| 1776 | return CMD_SUCCESS; |
| 1777 | } |
| 1778 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1779 | DEFUN(cfg_bts_gprs_rac, cfg_bts_gprs_rac_cmd, |
| 1780 | "gprs routing area <0-255>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1781 | GPRS_TEXT |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1782 | "GPRS Routing Area Code") |
| 1783 | { |
| 1784 | struct gsm_bts *bts = vty->index; |
| 1785 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1786 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 1787 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 1788 | return CMD_WARNING; |
| 1789 | } |
| 1790 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 1791 | bts->gprs.rac = atoi(argv[0]); |
| 1792 | |
| 1793 | return CMD_SUCCESS; |
| 1794 | } |
| 1795 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1796 | DEFUN(cfg_bts_gprs_mode, cfg_bts_gprs_mode_cmd, |
| 1797 | "gprs mode (none|gprs|egprs)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1798 | GPRS_TEXT |
| 1799 | "GPRS Mode for this BTS\n" |
| 1800 | "GPRS Disabled on this BTS\n" |
| 1801 | "GPRS Enabled on this BTS\n" |
| 1802 | "EGPRS (EDGE) Enabled on this BTS\n") |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1803 | { |
| 1804 | struct gsm_bts *bts = vty->index; |
| 1805 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 1806 | bts->gprs.mode = bts_gprs_mode_parse(argv[0]); |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 1807 | |
| 1808 | return CMD_SUCCESS; |
| 1809 | } |
| 1810 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1811 | #define TRX_TEXT "Radio Transceiver\n" |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1812 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1813 | /* per TRX configuration */ |
| 1814 | DEFUN(cfg_trx, |
| 1815 | cfg_trx_cmd, |
| 1816 | "trx TRX_NR", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1817 | TRX_TEXT |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1818 | "Select a TRX to configure") |
| 1819 | { |
| 1820 | int trx_nr = atoi(argv[0]); |
| 1821 | struct gsm_bts *bts = vty->index; |
| 1822 | struct gsm_bts_trx *trx; |
| 1823 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1824 | if (trx_nr > bts->num_trx) { |
| 1825 | vty_out(vty, "%% The next unused TRX number in this BTS is %u%s", |
| 1826 | bts->num_trx, VTY_NEWLINE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1827 | return CMD_WARNING; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1828 | } else if (trx_nr == bts->num_trx) { |
| 1829 | /* we need to allocate a new one */ |
| 1830 | trx = gsm_bts_trx_alloc(bts); |
Holger Hans Peter Freyther | acf8a0c | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 1831 | } else |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1832 | trx = gsm_bts_trx_num(bts, trx_nr); |
Holger Hans Peter Freyther | acf8a0c | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 1833 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1834 | if (!trx) |
| 1835 | return CMD_WARNING; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1836 | |
| 1837 | vty->index = trx; |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 1838 | vty->index_sub = &trx->description; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1839 | vty->node = TRX_NODE; |
| 1840 | |
| 1841 | return CMD_SUCCESS; |
| 1842 | } |
| 1843 | |
| 1844 | DEFUN(cfg_trx_arfcn, |
| 1845 | cfg_trx_arfcn_cmd, |
Harald Welte | 93e9020 | 2010-05-14 19:00:52 +0200 | [diff] [blame] | 1846 | "arfcn <0-1024>", |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1847 | "Set the ARFCN for this TRX\n") |
| 1848 | { |
| 1849 | int arfcn = atoi(argv[0]); |
| 1850 | struct gsm_bts_trx *trx = vty->index; |
| 1851 | |
| 1852 | /* FIXME: check if this ARFCN is supported by this TRX */ |
| 1853 | |
| 1854 | trx->arfcn = arfcn; |
| 1855 | |
| 1856 | /* FIXME: patch ARFCN into SYSTEM INFORMATION */ |
| 1857 | /* FIXME: use OML layer to update the ARFCN */ |
| 1858 | /* FIXME: use RSL layer to update SYSTEM INFORMATION */ |
| 1859 | |
| 1860 | return CMD_SUCCESS; |
| 1861 | } |
| 1862 | |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 1863 | DEFUN(cfg_trx_nominal_power, |
| 1864 | cfg_trx_nominal_power_cmd, |
| 1865 | "nominal power <0-100>", |
| 1866 | "Nominal TRX RF Power in dB\n") |
| 1867 | { |
| 1868 | struct gsm_bts_trx *trx = vty->index; |
| 1869 | |
| 1870 | trx->nominal_power = atoi(argv[0]); |
| 1871 | |
| 1872 | return CMD_SUCCESS; |
| 1873 | } |
| 1874 | |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1875 | DEFUN(cfg_trx_max_power_red, |
| 1876 | cfg_trx_max_power_red_cmd, |
| 1877 | "max_power_red <0-100>", |
| 1878 | "Reduction of maximum BS RF Power in dB\n") |
| 1879 | { |
| 1880 | int maxpwr_r = atoi(argv[0]); |
| 1881 | struct gsm_bts_trx *trx = vty->index; |
Harald Welte | 61a83b2 | 2009-11-18 09:20:22 +0100 | [diff] [blame] | 1882 | int upper_limit = 24; /* default 12.21 max power red. */ |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1883 | |
| 1884 | /* FIXME: check if our BTS type supports more than 12 */ |
| 1885 | if (maxpwr_r < 0 || maxpwr_r > upper_limit) { |
| 1886 | vty_out(vty, "%% Power %d dB is not in the valid range%s", |
| 1887 | maxpwr_r, VTY_NEWLINE); |
| 1888 | return CMD_WARNING; |
| 1889 | } |
| 1890 | if (maxpwr_r & 1) { |
| 1891 | vty_out(vty, "%% Power %d dB is not an even value%s", |
| 1892 | maxpwr_r, VTY_NEWLINE); |
| 1893 | return CMD_WARNING; |
| 1894 | } |
| 1895 | |
| 1896 | trx->max_power_red = maxpwr_r; |
| 1897 | |
| 1898 | /* FIXME: make sure we update this using OML */ |
| 1899 | |
| 1900 | return CMD_SUCCESS; |
| 1901 | } |
| 1902 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1903 | DEFUN(cfg_trx_rsl_e1, |
| 1904 | cfg_trx_rsl_e1_cmd, |
| 1905 | "rsl e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
| 1906 | "E1 interface to be used for RSL\n") |
| 1907 | { |
| 1908 | struct gsm_bts_trx *trx = vty->index; |
| 1909 | |
| 1910 | parse_e1_link(&trx->rsl_e1_link, argv[0], argv[1], argv[2]); |
| 1911 | |
| 1912 | return CMD_SUCCESS; |
| 1913 | } |
| 1914 | |
| 1915 | DEFUN(cfg_trx_rsl_e1_tei, |
| 1916 | cfg_trx_rsl_e1_tei_cmd, |
| 1917 | "rsl e1 tei <0-63>", |
| 1918 | "Set the TEI to be used for RSL") |
| 1919 | { |
| 1920 | struct gsm_bts_trx *trx = vty->index; |
| 1921 | |
| 1922 | trx->rsl_tei = atoi(argv[0]); |
| 1923 | |
| 1924 | return CMD_SUCCESS; |
| 1925 | } |
| 1926 | |
Holger Hans Peter Freyther | 2d501ea | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 1927 | DEFUN(cfg_trx_rf_locked, |
| 1928 | cfg_trx_rf_locked_cmd, |
| 1929 | "rf_locked (0|1)", |
| 1930 | "Turn off RF of the TRX.\n") |
| 1931 | { |
| 1932 | int locked = atoi(argv[0]); |
| 1933 | struct gsm_bts_trx *trx = vty->index; |
| 1934 | |
| 1935 | gsm_trx_lock_rf(trx, locked); |
| 1936 | return CMD_SUCCESS; |
| 1937 | } |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1938 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1939 | /* per TS configuration */ |
| 1940 | DEFUN(cfg_ts, |
| 1941 | cfg_ts_cmd, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1942 | "timeslot <0-7>", |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1943 | "Select a Timeslot to configure") |
| 1944 | { |
| 1945 | int ts_nr = atoi(argv[0]); |
| 1946 | struct gsm_bts_trx *trx = vty->index; |
| 1947 | struct gsm_bts_trx_ts *ts; |
| 1948 | |
| 1949 | if (ts_nr >= TRX_NR_TS) { |
| 1950 | vty_out(vty, "%% A GSM TRX only has %u Timeslots per TRX%s", |
| 1951 | TRX_NR_TS, VTY_NEWLINE); |
| 1952 | return CMD_WARNING; |
| 1953 | } |
| 1954 | |
| 1955 | ts = &trx->ts[ts_nr]; |
| 1956 | |
| 1957 | vty->index = ts; |
| 1958 | vty->node = TS_NODE; |
| 1959 | |
| 1960 | return CMD_SUCCESS; |
| 1961 | } |
| 1962 | |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1963 | DEFUN(cfg_ts_pchan, |
| 1964 | cfg_ts_pchan_cmd, |
| 1965 | "phys_chan_config PCHAN", |
| 1966 | "Physical Channel configuration (TCH/SDCCH/...)") |
| 1967 | { |
| 1968 | struct gsm_bts_trx_ts *ts = vty->index; |
| 1969 | int pchanc; |
| 1970 | |
| 1971 | pchanc = gsm_pchan_parse(argv[0]); |
| 1972 | if (pchanc < 0) |
| 1973 | return CMD_WARNING; |
| 1974 | |
| 1975 | ts->pchan = pchanc; |
| 1976 | |
| 1977 | return CMD_SUCCESS; |
| 1978 | } |
| 1979 | |
| 1980 | DEFUN(cfg_ts_e1_subslot, |
| 1981 | cfg_ts_e1_subslot_cmd, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1982 | "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] | 1983 | "E1 sub-slot connected to this on-air timeslot") |
| 1984 | { |
| 1985 | struct gsm_bts_trx_ts *ts = vty->index; |
| 1986 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1987 | parse_e1_link(&ts->e1_link, argv[0], argv[1], argv[2]); |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 1988 | |
| 1989 | return CMD_SUCCESS; |
| 1990 | } |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1991 | |
Harald Welte | 4f10c25 | 2010-05-16 21:47:13 +0200 | [diff] [blame] | 1992 | void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) |
| 1993 | { |
| 1994 | vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", |
| 1995 | counter_get(net->stats.chreq.total), |
| 1996 | counter_get(net->stats.chreq.no_channel), VTY_NEWLINE); |
| 1997 | vty_out(vty, "Channel Failures : %lu rf_failures, %lu rll failures%s", |
| 1998 | counter_get(net->stats.chan.rf_fail), |
| 1999 | counter_get(net->stats.chan.rll_err), VTY_NEWLINE); |
| 2000 | vty_out(vty, "Paging : %lu attempted, %lu complete, %lu expired%s", |
| 2001 | counter_get(net->stats.paging.attempted), |
| 2002 | counter_get(net->stats.paging.completed), |
| 2003 | counter_get(net->stats.paging.expired), VTY_NEWLINE); |
| 2004 | vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", |
| 2005 | counter_get(net->stats.bts.oml_fail), |
| 2006 | counter_get(net->stats.bts.rsl_fail), VTY_NEWLINE); |
| 2007 | } |
| 2008 | |
Harald Welte | 5bc61dc | 2010-05-16 22:02:16 +0200 | [diff] [blame] | 2009 | DEFUN(logging_fltr_imsi, |
| 2010 | logging_fltr_imsi_cmd, |
| 2011 | "logging filter imsi IMSI", |
| 2012 | LOGGING_STR FILTER_STR |
| 2013 | "Filter log messages by IMSI\n" "IMSI to be used as filter\n") |
| 2014 | { |
| 2015 | struct telnet_connection *conn; |
| 2016 | |
| 2017 | conn = (struct telnet_connection *) vty->priv; |
| 2018 | if (!conn->dbg) { |
| 2019 | vty_out(vty, "Logging was not enabled.%s", VTY_NEWLINE); |
| 2020 | return CMD_WARNING; |
| 2021 | } |
| 2022 | |
| 2023 | log_set_imsi_filter(conn->dbg, argv[0]); |
| 2024 | return CMD_SUCCESS; |
| 2025 | } |
| 2026 | |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 2027 | extern int bsc_vty_init_extra(void); |
Harald Welte | 1353f96 | 2010-05-16 19:20:24 +0200 | [diff] [blame] | 2028 | extern const char *openbsc_copyright; |
Holger Hans Peter Freyther | e1ffc08 | 2010-04-10 00:08:28 +0200 | [diff] [blame] | 2029 | |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 2030 | int bsc_vty_init(void) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2031 | { |
Harald Welte | b4d5b17 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 2032 | install_element_ve(&show_net_cmd); |
| 2033 | install_element_ve(&show_bts_cmd); |
| 2034 | install_element_ve(&show_trx_cmd); |
| 2035 | install_element_ve(&show_ts_cmd); |
| 2036 | install_element_ve(&show_lchan_cmd); |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 2037 | install_element_ve(&show_lchan_summary_cmd); |
Harald Welte | 5bc61dc | 2010-05-16 22:02:16 +0200 | [diff] [blame] | 2038 | install_element_ve(&logging_fltr_imsi_cmd); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 2039 | |
Harald Welte | b4d5b17 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 2040 | install_element_ve(&show_e1drv_cmd); |
| 2041 | install_element_ve(&show_e1line_cmd); |
| 2042 | install_element_ve(&show_e1ts_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2043 | |
Harald Welte | b4d5b17 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 2044 | install_element_ve(&show_paging_cmd); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 2045 | |
Harald Welte | 5bc61dc | 2010-05-16 22:02:16 +0200 | [diff] [blame] | 2046 | logging_vty_add_cmds(); |
Holger Hans Peter Freyther | b61e3b2 | 2009-12-22 22:32:51 +0100 | [diff] [blame] | 2047 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 2048 | install_element(CONFIG_NODE, &cfg_net_cmd); |
| 2049 | install_node(&net_node, config_write_net); |
| 2050 | install_default(GSMNET_NODE); |
Harald Welte | 62ab20c | 2010-05-14 18:59:17 +0200 | [diff] [blame] | 2051 | install_element(GSMNET_NODE, &ournode_exit_cmd); |
Harald Welte | 54f7424 | 2010-05-14 19:11:04 +0200 | [diff] [blame] | 2052 | install_element(GSMNET_NODE, &ournode_end_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 2053 | install_element(GSMNET_NODE, &cfg_net_ncc_cmd); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 2054 | install_element(GSMNET_NODE, &cfg_net_mnc_cmd); |
| 2055 | install_element(GSMNET_NODE, &cfg_net_name_short_cmd); |
| 2056 | install_element(GSMNET_NODE, &cfg_net_name_long_cmd); |
Harald Welte (local) | 69de397 | 2009-08-12 14:42:23 +0200 | [diff] [blame] | 2057 | install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd); |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 2058 | install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 2059 | install_element(GSMNET_NODE, &cfg_net_encryption_cmd); |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 2060 | install_element(GSMNET_NODE, &cfg_net_neci_cmd); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 2061 | install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd); |
Harald Welte | 3d23db4 | 2009-12-14 17:49:15 +0100 | [diff] [blame] | 2062 | install_element(GSMNET_NODE, &cfg_net_mm_info_cmd); |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 2063 | install_element(GSMNET_NODE, &cfg_net_handover_cmd); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 2064 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_cmd); |
| 2065 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxqual_avg_cmd); |
| 2066 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_neigh_cmd); |
| 2067 | install_element(GSMNET_NODE, &cfg_net_ho_pwr_interval_cmd); |
| 2068 | install_element(GSMNET_NODE, &cfg_net_ho_pwr_hysteresis_cmd); |
| 2069 | install_element(GSMNET_NODE, &cfg_net_ho_max_distance_cmd); |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 2070 | install_element(GSMNET_NODE, &cfg_net_T3101_cmd); |
Holger Hans Peter Freyther | 23975e7 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 2071 | install_element(GSMNET_NODE, &cfg_net_T3103_cmd); |
| 2072 | install_element(GSMNET_NODE, &cfg_net_T3105_cmd); |
| 2073 | install_element(GSMNET_NODE, &cfg_net_T3107_cmd); |
| 2074 | install_element(GSMNET_NODE, &cfg_net_T3109_cmd); |
| 2075 | install_element(GSMNET_NODE, &cfg_net_T3111_cmd); |
| 2076 | install_element(GSMNET_NODE, &cfg_net_T3113_cmd); |
| 2077 | install_element(GSMNET_NODE, &cfg_net_T3115_cmd); |
| 2078 | install_element(GSMNET_NODE, &cfg_net_T3117_cmd); |
| 2079 | install_element(GSMNET_NODE, &cfg_net_T3119_cmd); |
| 2080 | install_element(GSMNET_NODE, &cfg_net_T3141_cmd); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 2081 | |
| 2082 | install_element(GSMNET_NODE, &cfg_bts_cmd); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 2083 | install_node(&bts_node, config_write_bts); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2084 | install_default(BTS_NODE); |
Harald Welte | 62ab20c | 2010-05-14 18:59:17 +0200 | [diff] [blame] | 2085 | install_element(BTS_NODE, &ournode_exit_cmd); |
Harald Welte | 54f7424 | 2010-05-14 19:11:04 +0200 | [diff] [blame] | 2086 | install_element(BTS_NODE, &ournode_end_cmd); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 2087 | install_element(BTS_NODE, &cfg_bts_type_cmd); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 2088 | install_element(BTS_NODE, &cfg_description_cmd); |
| 2089 | install_element(BTS_NODE, &cfg_no_description_cmd); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 2090 | install_element(BTS_NODE, &cfg_bts_band_cmd); |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 2091 | install_element(BTS_NODE, &cfg_bts_ci_cmd); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 2092 | install_element(BTS_NODE, &cfg_bts_lac_cmd); |
| 2093 | install_element(BTS_NODE, &cfg_bts_tsc_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 2094 | install_element(BTS_NODE, &cfg_bts_bsic_cmd); |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 2095 | install_element(BTS_NODE, &cfg_bts_unit_id_cmd); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 2096 | install_element(BTS_NODE, &cfg_bts_stream_id_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 2097 | install_element(BTS_NODE, &cfg_bts_oml_e1_cmd); |
| 2098 | install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd); |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 2099 | install_element(BTS_NODE, &cfg_bts_challoc_cmd); |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 2100 | install_element(BTS_NODE, &cfg_bts_rach_tx_integer_cmd); |
| 2101 | install_element(BTS_NODE, &cfg_bts_rach_max_trans_cmd); |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 2102 | install_element(BTS_NODE, &cfg_bts_rach_nm_b_thresh_cmd); |
| 2103 | install_element(BTS_NODE, &cfg_bts_rach_nm_ldavg_cmd); |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 2104 | install_element(BTS_NODE, &cfg_bts_cell_barred_cmd); |
Holger Hans Peter Freyther | 3a0a463 | 2010-05-14 00:39:19 +0800 | [diff] [blame] | 2105 | install_element(BTS_NODE, &cfg_bts_rach_ec_allowed_cmd); |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 2106 | install_element(BTS_NODE, &cfg_bts_ms_max_power_cmd); |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 2107 | install_element(BTS_NODE, &cfg_bts_per_loc_upd_cmd); |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 2108 | install_element(BTS_NODE, &cfg_bts_cell_resel_hyst_cmd); |
| 2109 | install_element(BTS_NODE, &cfg_bts_rxlev_acc_min_cmd); |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2110 | install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd); |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 2111 | install_element(BTS_NODE, &cfg_bts_gprs_ns_timer_cmd); |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2112 | install_element(BTS_NODE, &cfg_bts_gprs_rac_cmd); |
| 2113 | install_element(BTS_NODE, &cfg_bts_gprs_bvci_cmd); |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 2114 | install_element(BTS_NODE, &cfg_bts_gprs_cell_timer_cmd); |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 2115 | install_element(BTS_NODE, &cfg_bts_gprs_nsei_cmd); |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2116 | install_element(BTS_NODE, &cfg_bts_gprs_nsvci_cmd); |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2117 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_lport_cmd); |
| 2118 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_rport_cmd); |
| 2119 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_rip_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2120 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 2121 | install_element(BTS_NODE, &cfg_trx_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2122 | install_node(&trx_node, dummy_config_write); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2123 | install_default(TRX_NODE); |
Harald Welte | 62ab20c | 2010-05-14 18:59:17 +0200 | [diff] [blame] | 2124 | install_element(TRX_NODE, &ournode_exit_cmd); |
Harald Welte | 54f7424 | 2010-05-14 19:11:04 +0200 | [diff] [blame] | 2125 | install_element(TRX_NODE, &ournode_end_cmd); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 2126 | install_element(TRX_NODE, &cfg_trx_arfcn_cmd); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 2127 | install_element(TRX_NODE, &cfg_description_cmd); |
| 2128 | install_element(TRX_NODE, &cfg_no_description_cmd); |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 2129 | install_element(TRX_NODE, &cfg_trx_nominal_power_cmd); |
Harald Welte | 879dc97 | 2009-06-20 22:36:12 +0200 | [diff] [blame] | 2130 | install_element(TRX_NODE, &cfg_trx_max_power_red_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 2131 | install_element(TRX_NODE, &cfg_trx_rsl_e1_cmd); |
| 2132 | install_element(TRX_NODE, &cfg_trx_rsl_e1_tei_cmd); |
Holger Hans Peter Freyther | 2d501ea | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 2133 | install_element(TRX_NODE, &cfg_trx_rf_locked_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2134 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 2135 | install_element(TRX_NODE, &cfg_ts_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2136 | install_node(&ts_node, dummy_config_write); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2137 | install_default(TS_NODE); |
Harald Welte | 62ab20c | 2010-05-14 18:59:17 +0200 | [diff] [blame] | 2138 | install_element(TS_NODE, &ournode_exit_cmd); |
Harald Welte | 54f7424 | 2010-05-14 19:11:04 +0200 | [diff] [blame] | 2139 | install_element(TS_NODE, &ournode_end_cmd); |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 2140 | install_element(TS_NODE, &cfg_ts_pchan_cmd); |
| 2141 | install_element(TS_NODE, &cfg_ts_e1_subslot_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2142 | |
Harald Welte | 81c9b9c | 2010-05-31 16:40:40 +0200 | [diff] [blame] | 2143 | abis_nm_vty_init(); |
| 2144 | |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 2145 | bsc_vty_init_extra(); |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 2146 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 2147 | return 0; |
| 2148 | } |