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