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 |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 6 | * it under the terms of the GNU Affero General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 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 |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 13 | * GNU Affero General Public License for more details. |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 14 | * |
Harald Welte | 9af6ddf | 2011-01-01 15:25:50 +0100 | [diff] [blame] | 15 | * You should have received a copy of the GNU Affero General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 17 | * |
| 18 | */ |
| 19 | |
| 20 | #include <stdlib.h> |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 21 | #include <stdbool.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 22 | #include <unistd.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 23 | |
Harald Welte | 4b037e4 | 2010-05-19 19:45:32 +0200 | [diff] [blame] | 24 | #include <osmocom/vty/command.h> |
| 25 | #include <osmocom/vty/buffer.h> |
| 26 | #include <osmocom/vty/vty.h> |
| 27 | #include <osmocom/vty/logging.h> |
Jacob Erlbeck | 64630cc | 2015-10-26 16:25:37 +0100 | [diff] [blame] | 28 | #include <osmocom/vty/stats.h> |
Harald Welte | 4b037e4 | 2010-05-19 19:45:32 +0200 | [diff] [blame] | 29 | #include <osmocom/vty/telnet_interface.h> |
Harald Welte | 4ab9d7c | 2012-08-17 12:42:06 +0200 | [diff] [blame] | 30 | #include <osmocom/vty/misc.h> |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 31 | #include <osmocom/gsm/protocol/gsm_04_08.h> |
Holger Hans Peter Freyther | ec37bb2 | 2013-02-05 09:39:09 +0100 | [diff] [blame] | 32 | #include <osmocom/gsm/gsm0502.h> |
| 33 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 34 | #include <arpa/inet.h> |
| 35 | |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 36 | #include <osmocom/core/linuxlist.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 37 | #include <openbsc/gsm_data.h> |
Pablo Neira Ayuso | ed5cacb | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 38 | #include <osmocom/abis/e1_input.h> |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 39 | #include <openbsc/abis_nm.h> |
Harald Welte | 4d54d0b | 2011-02-19 16:48:17 +0100 | [diff] [blame] | 40 | #include <openbsc/abis_om2000.h> |
Pablo Neira Ayuso | 136f453 | 2011-03-22 16:47:59 +0100 | [diff] [blame] | 41 | #include <osmocom/core/utils.h> |
| 42 | #include <osmocom/gsm/gsm_utils.h> |
Harald Welte | cdc59ff | 2011-05-23 20:42:26 +0200 | [diff] [blame] | 43 | #include <osmocom/gsm/abis_nm.h> |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 44 | #include <openbsc/chan_alloc.h> |
Harald Welte | 8387a49 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 45 | #include <openbsc/meas_rep.h> |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 46 | #include <openbsc/db.h> |
Holger Hans Peter Freyther | 3c71232 | 2010-04-06 11:55:37 +0200 | [diff] [blame] | 47 | #include <openbsc/vty.h> |
Harald Welte | ea34a4e | 2012-06-16 14:59:56 +0800 | [diff] [blame] | 48 | #include <osmocom/gprs/gprs_ns.h> |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 49 | #include <openbsc/system_information.h> |
Harald Welte | 5bc61dc | 2010-05-16 22:02:16 +0200 | [diff] [blame] | 50 | #include <openbsc/debug.h> |
Holger Hans Peter Freyther | 85334f1 | 2010-11-09 17:00:42 +0100 | [diff] [blame] | 51 | #include <openbsc/paging.h> |
Harald Welte | f7a2b19 | 2011-08-20 18:25:02 +0200 | [diff] [blame] | 52 | #include <openbsc/ipaccess.h> |
Harald Welte | d0d2b0b | 2010-12-23 13:18:07 +0100 | [diff] [blame] | 53 | #include <openbsc/abis_rsl.h> |
Neels Hofmeyr | a42855f | 2017-02-23 21:49:55 +0100 | [diff] [blame] | 54 | #include <openbsc/bsc_msc_data.h> |
Holger Hans Peter Freyther | 37ac420 | 2011-02-24 14:19:14 +0100 | [diff] [blame] | 55 | #include <openbsc/osmo_bsc_rf.h> |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 56 | |
Neels Hofmeyr | 06d39fd | 2016-05-12 01:16:58 +0200 | [diff] [blame] | 57 | #include <openbsc/common_cs.h> |
| 58 | |
Holger Hans Peter Freyther | ec37bb2 | 2013-02-05 09:39:09 +0100 | [diff] [blame] | 59 | #include <inttypes.h> |
| 60 | |
Harald Welte | c08e8be | 2011-03-04 13:53:51 +0100 | [diff] [blame] | 61 | #include "../../bscconfig.h" |
Harald Welte | 1353f96 | 2010-05-16 19:20:24 +0200 | [diff] [blame] | 62 | |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 63 | |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 64 | #define LCHAN_NR_STR "Logical Channel Number\n" |
| 65 | |
| 66 | |
Harald Welte | ea4647d | 2010-05-12 17:19:53 +0000 | [diff] [blame] | 67 | /* FIXME: this should go to some common file */ |
| 68 | static const struct value_string gprs_ns_timer_strs[] = { |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 69 | { 0, "tns-block" }, |
| 70 | { 1, "tns-block-retries" }, |
| 71 | { 2, "tns-reset" }, |
| 72 | { 3, "tns-reset-retries" }, |
| 73 | { 4, "tns-test" }, |
| 74 | { 5, "tns-alive" }, |
| 75 | { 6, "tns-alive-retries" }, |
| 76 | { 0, NULL } |
| 77 | }; |
| 78 | |
Harald Welte | ea4647d | 2010-05-12 17:19:53 +0000 | [diff] [blame] | 79 | static const struct value_string gprs_bssgp_cfg_strs[] = { |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 80 | { 0, "blocking-timer" }, |
| 81 | { 1, "blocking-retries" }, |
| 82 | { 2, "unblocking-retries" }, |
| 83 | { 3, "reset-timer" }, |
| 84 | { 4, "reset-retries" }, |
| 85 | { 5, "suspend-timer" }, |
| 86 | { 6, "suspend-retries" }, |
| 87 | { 7, "resume-timer" }, |
| 88 | { 8, "resume-retries" }, |
| 89 | { 9, "capability-update-timer" }, |
| 90 | { 10, "capability-update-retries" }, |
| 91 | { 0, NULL } |
| 92 | }; |
| 93 | |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 94 | static const struct value_string bts_neigh_mode_strs[] = { |
| 95 | { NL_MODE_AUTOMATIC, "automatic" }, |
| 96 | { NL_MODE_MANUAL, "manual" }, |
| 97 | { NL_MODE_MANUAL_SI5SEP, "manual-si5" }, |
| 98 | { 0, NULL } |
| 99 | }; |
| 100 | |
Daniel Willmann | 7d10983 | 2012-05-14 18:43:23 +0200 | [diff] [blame] | 101 | const struct value_string bts_loc_fix_names[] = { |
| 102 | { BTS_LOC_FIX_INVALID, "invalid" }, |
| 103 | { BTS_LOC_FIX_2D, "fix2d" }, |
| 104 | { BTS_LOC_FIX_3D, "fix3d" }, |
| 105 | { 0, NULL } |
| 106 | }; |
| 107 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 108 | struct cmd_node bts_node = { |
| 109 | BTS_NODE, |
Harald Welte | 570ce24 | 2012-08-17 13:16:10 +0200 | [diff] [blame] | 110 | "%s(config-net-bts)# ", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 111 | 1, |
| 112 | }; |
| 113 | |
| 114 | struct cmd_node trx_node = { |
| 115 | TRX_NODE, |
Harald Welte | 570ce24 | 2012-08-17 13:16:10 +0200 | [diff] [blame] | 116 | "%s(config-net-bts-trx)# ", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 117 | 1, |
| 118 | }; |
| 119 | |
| 120 | struct cmd_node ts_node = { |
| 121 | TS_NODE, |
Harald Welte | 570ce24 | 2012-08-17 13:16:10 +0200 | [diff] [blame] | 122 | "%s(config-net-bts-trx-ts)# ", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 123 | 1, |
| 124 | }; |
| 125 | |
| 126 | static int dummy_config_write(struct vty *v) |
| 127 | { |
| 128 | return CMD_SUCCESS; |
| 129 | } |
| 130 | |
| 131 | static void net_dump_nmstate(struct vty *vty, struct gsm_nm_state *nms) |
| 132 | { |
Harald Welte | 1304b35 | 2013-03-15 16:57:33 +0100 | [diff] [blame] | 133 | vty_out(vty,"Oper '%s', Admin '%s', Avail '%s'%s", |
| 134 | abis_nm_opstate_name(nms->operational), |
| 135 | get_value_string(abis_nm_adm_state_names, nms->administrative), |
Harald Welte | 867d9f3 | 2011-05-23 20:30:39 +0200 | [diff] [blame] | 136 | abis_nm_avail_name(nms->availability), VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 137 | } |
| 138 | |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 139 | static void dump_pchan_load_vty(struct vty *vty, char *prefix, |
| 140 | const struct pchan_load *pl) |
| 141 | { |
| 142 | int i; |
| 143 | |
| 144 | for (i = 0; i < ARRAY_SIZE(pl->pchan); i++) { |
| 145 | const struct load_counter *lc = &pl->pchan[i]; |
| 146 | unsigned int percent; |
| 147 | |
| 148 | if (lc->total == 0) |
| 149 | continue; |
| 150 | |
| 151 | percent = (lc->used * 100) / lc->total; |
| 152 | |
| 153 | vty_out(vty, "%s%20s: %3u%% (%u/%u)%s", prefix, |
| 154 | gsm_pchan_name(i), percent, lc->used, lc->total, |
| 155 | VTY_NEWLINE); |
| 156 | } |
| 157 | } |
| 158 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 159 | static void net_dump_vty(struct vty *vty, struct gsm_network *net) |
| 160 | { |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 161 | struct pchan_load pl; |
| 162 | |
Harald Welte | ef235b5 | 2009-03-10 12:34:02 +0000 | [diff] [blame] | 163 | vty_out(vty, "BSC is on Country Code %u, Network Code %u " |
| 164 | "and has %u BTS%s", net->country_code, net->network_code, |
| 165 | net->num_bts, VTY_NEWLINE); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 166 | vty_out(vty, " Long network name: '%s'%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 167 | net->name_long, VTY_NEWLINE); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 168 | vty_out(vty, " Short network name: '%s'%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 169 | net->name_short, VTY_NEWLINE); |
Max | ddee01f | 2016-05-24 14:23:27 +0200 | [diff] [blame] | 170 | vty_out(vty, " Authentication policy: %s", |
| 171 | gsm_auth_policy_name(net->auth_policy)); |
| 172 | if (net->authorized_reg_str) |
| 173 | vty_out(vty, ", authorized regexp: %s", net->authorized_reg_str); |
| 174 | vty_out(vty, "%s", VTY_NEWLINE); |
Max | e6052c4 | 2016-06-30 10:25:49 +0200 | [diff] [blame] | 175 | vty_out(vty, " Auto create subscriber: %s%s", |
| 176 | net->auto_create_subscr ? "yes" : "no", VTY_NEWLINE); |
| 177 | vty_out(vty, " Auto assign extension: %s%s", |
| 178 | net->auto_assign_exten ? "yes" : "no", VTY_NEWLINE); |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 179 | vty_out(vty, " Location updating reject cause: %u%s", |
| 180 | net->reject_cause, VTY_NEWLINE); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 181 | vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption, |
| 182 | VTY_NEWLINE); |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 183 | vty_out(vty, " NECI (TCH/H): %u%s", net->neci, |
| 184 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 76fc4a3 | 2010-09-06 09:41:50 +0800 | [diff] [blame] | 185 | vty_out(vty, " Use TCH for Paging any: %d%s", net->pag_any_tch, |
| 186 | VTY_NEWLINE); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 187 | vty_out(vty, " RRLP Mode: %s%s", rrlp_mode_name(net->rrlp.mode), |
| 188 | VTY_NEWLINE); |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 189 | vty_out(vty, " MM Info: %s%s", net->send_mm_info ? "On" : "Off", |
| 190 | VTY_NEWLINE); |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 191 | vty_out(vty, " Handover: %s%s", net->handover.active ? "On" : "Off", |
| 192 | VTY_NEWLINE); |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 193 | network_chan_load(&pl, net); |
| 194 | vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); |
| 195 | dump_pchan_load_vty(vty, " ", &pl); |
Holger Hans Peter Freyther | 37ac420 | 2011-02-24 14:19:14 +0100 | [diff] [blame] | 196 | |
| 197 | /* show rf */ |
Holger Hans Peter Freyther | a9fae1a | 2014-02-08 12:12:03 +0100 | [diff] [blame] | 198 | if (net->bsc_data) |
Holger Hans Peter Freyther | 37ac420 | 2011-02-24 14:19:14 +0100 | [diff] [blame] | 199 | vty_out(vty, " Last RF Command: %s%s", |
Holger Hans Peter Freyther | 8ec4952 | 2011-08-15 15:53:00 +0200 | [diff] [blame] | 200 | net->bsc_data->rf_ctrl->last_state_command, |
Holger Hans Peter Freyther | 37ac420 | 2011-02-24 14:19:14 +0100 | [diff] [blame] | 201 | VTY_NEWLINE); |
Holger Hans Peter Freyther | a9fae1a | 2014-02-08 12:12:03 +0100 | [diff] [blame] | 202 | if (net->bsc_data) |
Jacob Erlbeck | 779a728 | 2013-09-11 10:46:57 +0200 | [diff] [blame] | 203 | vty_out(vty, " Last RF Lock Command: %s%s", |
| 204 | net->bsc_data->rf_ctrl->last_rf_lock_ctrl_command, |
| 205 | VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 206 | } |
| 207 | |
Neels Hofmeyr | ea11bf8 | 2016-05-12 01:53:23 +0200 | [diff] [blame] | 208 | DEFUN(bsc_show_net, bsc_show_net_cmd, "show network", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 209 | SHOW_STR "Display information about a GSM NETWORK\n") |
| 210 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 211 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 212 | net_dump_vty(vty, net); |
| 213 | |
| 214 | return CMD_SUCCESS; |
| 215 | } |
| 216 | |
| 217 | static void e1isl_dump_vty(struct vty *vty, struct e1inp_sign_link *e1l) |
| 218 | { |
Harald Welte | edb3778 | 2009-05-01 14:59:07 +0000 | [diff] [blame] | 219 | struct e1inp_line *line; |
| 220 | |
| 221 | if (!e1l) { |
| 222 | vty_out(vty, " None%s", VTY_NEWLINE); |
| 223 | return; |
| 224 | } |
| 225 | |
| 226 | line = e1l->ts->line; |
| 227 | |
| 228 | vty_out(vty, " E1 Line %u, Type %s: Timeslot %u, Mode %s%s", |
| 229 | line->num, line->driver->name, e1l->ts->num, |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 230 | e1inp_signtype_name(e1l->type), VTY_NEWLINE); |
Harald Welte | edb3778 | 2009-05-01 14:59:07 +0000 | [diff] [blame] | 231 | vty_out(vty, " E1 TEI %u, SAPI %u%s", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 232 | e1l->tei, e1l->sapi, VTY_NEWLINE); |
| 233 | } |
| 234 | |
| 235 | static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts) |
| 236 | { |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 237 | struct pchan_load pl; |
| 238 | |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 239 | vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " |
Harald Welte | 557c84e | 2015-11-20 10:50:24 +0100 | [diff] [blame] | 240 | "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 241 | bts->nr, btstype2str(bts->type), gsm_band_name(bts->band), |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 242 | bts->cell_identity, |
Harald Welte | a2bbc5e | 2015-11-20 10:43:31 +0100 | [diff] [blame] | 243 | bts->location_area_code, bts->bsic, |
Harald Welte | 557c84e | 2015-11-20 10:50:24 +0100 | [diff] [blame] | 244 | bts->bsic >> 3, bts->bsic & 7, |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 245 | bts->num_trx, VTY_NEWLINE); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 246 | vty_out(vty, "Description: %s%s", |
| 247 | bts->description ? bts->description : "(null)", VTY_NEWLINE); |
Max | f9685c1 | 2017-03-23 12:01:07 +0100 | [diff] [blame] | 248 | if (strnlen(bts->pcu_version, MAX_VERSION_LENGTH)) |
| 249 | vty_out(vty, "PCU version %s connected%s", bts->pcu_version, |
| 250 | VTY_NEWLINE); |
Harald Welte | 1d8dbc4 | 2009-12-12 15:38:16 +0100 | [diff] [blame] | 251 | 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] | 252 | vty_out(vty, "Minimum Rx Level for Access: %i dBm%s", |
Harald Welte | 1d8dbc4 | 2009-12-12 15:38:16 +0100 | [diff] [blame] | 253 | rxlev2dbm(bts->si_common.cell_sel_par.rxlev_acc_min), |
| 254 | VTY_NEWLINE); |
| 255 | vty_out(vty, "Cell Reselection Hysteresis: %u dBm%s", |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 256 | bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 257 | vty_out(vty, "RACH TX-Integer: %u%s", bts->si_common.rach_control.tx_integer, |
| 258 | VTY_NEWLINE); |
| 259 | vty_out(vty, "RACH Max transmissions: %u%s", |
| 260 | rach_max_trans_raw2val(bts->si_common.rach_control.max_trans), |
| 261 | VTY_NEWLINE); |
Harald Welte | 7135501 | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 262 | if (bts->si_common.rach_control.cell_bar) |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 263 | vty_out(vty, " CELL IS BARRED%s", VTY_NEWLINE); |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 264 | if (bts->dtxu != GSM48_DTX_SHALL_NOT_BE_USED) |
| 265 | vty_out(vty, "Uplink DTX: %s%s", |
| 266 | (bts->dtxu != GSM48_DTX_SHALL_BE_USED) ? |
| 267 | "enabled" : "forced", VTY_NEWLINE); |
| 268 | else |
| 269 | vty_out(vty, "Uplink DTX: not enabled%s", VTY_NEWLINE); |
| 270 | vty_out(vty, "Downlink DTX: %senabled%s", bts->dtxd ? "" : "not ", |
| 271 | VTY_NEWLINE); |
Andreas Eversberg | 2ee7ecd | 2012-10-13 07:27:47 +0200 | [diff] [blame] | 272 | vty_out(vty, "Channel Description Attachment: %s%s", |
| 273 | (bts->si_common.chan_desc.att) ? "yes" : "no", VTY_NEWLINE); |
| 274 | vty_out(vty, "Channel Description BS-PA-MFRMS: %u%s", |
| 275 | bts->si_common.chan_desc.bs_pa_mfrms + 2, VTY_NEWLINE); |
| 276 | vty_out(vty, "Channel Description BS-AG_BLKS-RES: %u%s", |
| 277 | bts->si_common.chan_desc.bs_ag_blks_res, VTY_NEWLINE); |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 278 | vty_out(vty, "System Information present: 0x%08x, static: 0x%08x%s", |
| 279 | bts->si_valid, bts->si_mode_static, VTY_NEWLINE); |
Harald Welte | 42def72 | 2017-01-13 00:10:32 +0100 | [diff] [blame] | 280 | vty_out(vty, "Early Classmark Sending: %s%s", |
| 281 | bts->early_classmark_allowed ? "allowed" : "forbidden", |
| 282 | VTY_NEWLINE); |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 283 | if (is_ipaccess_bts(bts)) |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 284 | 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] | 285 | bts->ip_access.site_id, bts->ip_access.bts_id, |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 286 | bts->oml_tei, VTY_NEWLINE); |
Sylvain Munaut | c951946 | 2011-10-17 14:04:55 +0200 | [diff] [blame] | 287 | else if (bts->type == GSM_BTS_TYPE_NOKIA_SITE) |
| 288 | vty_out(vty, " Skip Reset: %d%s", |
| 289 | bts->nokia.skip_reset, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 290 | vty_out(vty, " NM State: "); |
Harald Welte | d64c0bc | 2011-05-30 12:07:53 +0200 | [diff] [blame] | 291 | net_dump_nmstate(vty, &bts->mo.nm_state); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 292 | vty_out(vty, " Site Mgr NM State: "); |
Harald Welte | d64c0bc | 2011-05-30 12:07:53 +0200 | [diff] [blame] | 293 | net_dump_nmstate(vty, &bts->site_mgr.mo.nm_state); |
Holger Hans Peter Freyther | 846d8dc | 2013-05-29 16:22:09 +0200 | [diff] [blame] | 294 | vty_out(vty, " GPRS NSE: "); |
| 295 | net_dump_nmstate(vty, &bts->gprs.nse.mo.nm_state); |
| 296 | vty_out(vty, " GPRS CELL: "); |
| 297 | net_dump_nmstate(vty, &bts->gprs.cell.mo.nm_state); |
| 298 | vty_out(vty, " GPRS NSVC0: "); |
| 299 | net_dump_nmstate(vty, &bts->gprs.nsvc[0].mo.nm_state); |
| 300 | vty_out(vty, " GPRS NSVC1: "); |
| 301 | net_dump_nmstate(vty, &bts->gprs.nsvc[1].mo.nm_state); |
Holger Hans Peter Freyther | 66e14cd | 2011-04-26 15:52:34 +0200 | [diff] [blame] | 302 | vty_out(vty, " Paging: %u pending requests, %u free slots%s", |
| 303 | paging_pending_requests_nr(bts), |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 304 | bts->paging.available_slots, VTY_NEWLINE); |
Holger Hans Peter Freyther | d283db4 | 2010-11-25 16:28:45 +0100 | [diff] [blame] | 305 | if (is_ipaccess_bts(bts)) { |
| 306 | vty_out(vty, " OML Link state: %s.%s", |
| 307 | bts->oml_link ? "connected" : "disconnected", VTY_NEWLINE); |
| 308 | } else { |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 309 | vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); |
| 310 | e1isl_dump_vty(vty, bts->oml_link); |
| 311 | } |
Holger Hans Peter Freyther | d283db4 | 2010-11-25 16:28:45 +0100 | [diff] [blame] | 312 | |
| 313 | /* FIXME: chan_desc */ |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 314 | memset(&pl, 0, sizeof(pl)); |
Neels Hofmeyr | 2afffd5 | 2016-09-25 17:01:20 +0200 | [diff] [blame] | 315 | bts_chan_load(&pl, bts); |
Harald Welte | b908cb7 | 2009-12-22 13:09:29 +0100 | [diff] [blame] | 316 | vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); |
| 317 | dump_pchan_load_vty(vty, " ", &pl); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 318 | } |
| 319 | |
Sylvain Munaut | 39c31de | 2012-12-28 12:15:11 +0100 | [diff] [blame] | 320 | DEFUN(show_bts, show_bts_cmd, "show bts [<0-255>]", |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 321 | SHOW_STR "Display information about a BTS\n" |
| 322 | "BTS number") |
| 323 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 324 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 325 | int bts_nr; |
| 326 | |
| 327 | if (argc != 0) { |
| 328 | /* use the BTS number that the user has specified */ |
| 329 | bts_nr = atoi(argv[0]); |
Harald Welte | 712ddbc | 2010-12-24 12:24:03 +0100 | [diff] [blame] | 330 | if (bts_nr >= net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 331 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 332 | VTY_NEWLINE); |
| 333 | return CMD_WARNING; |
| 334 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 335 | bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 336 | return CMD_SUCCESS; |
| 337 | } |
| 338 | /* print all BTS's */ |
| 339 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 340 | bts_dump_vty(vty, gsm_bts_num(net, bts_nr)); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 341 | |
| 342 | return CMD_SUCCESS; |
| 343 | } |
| 344 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 345 | /* utility functions */ |
| 346 | static void parse_e1_link(struct gsm_e1_subslot *e1_link, const char *line, |
| 347 | const char *ts, const char *ss) |
| 348 | { |
| 349 | e1_link->e1_nr = atoi(line); |
| 350 | e1_link->e1_ts = atoi(ts); |
| 351 | if (!strcmp(ss, "full")) |
| 352 | e1_link->e1_ts_ss = 255; |
| 353 | else |
| 354 | e1_link->e1_ts_ss = atoi(ss); |
| 355 | } |
| 356 | |
| 357 | static void config_write_e1_link(struct vty *vty, struct gsm_e1_subslot *e1_link, |
| 358 | const char *prefix) |
| 359 | { |
| 360 | if (!e1_link->e1_ts) |
| 361 | return; |
| 362 | |
| 363 | if (e1_link->e1_ts_ss == 255) |
| 364 | vty_out(vty, "%se1 line %u timeslot %u sub-slot full%s", |
| 365 | prefix, e1_link->e1_nr, e1_link->e1_ts, VTY_NEWLINE); |
| 366 | else |
| 367 | vty_out(vty, "%se1 line %u timeslot %u sub-slot %u%s", |
| 368 | prefix, e1_link->e1_nr, e1_link->e1_ts, |
| 369 | e1_link->e1_ts_ss, VTY_NEWLINE); |
| 370 | } |
| 371 | |
| 372 | |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 373 | static void config_write_ts_single(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 374 | { |
Neels Hofmeyr | 9c4f1d6 | 2016-01-27 14:20:29 +0100 | [diff] [blame] | 375 | vty_out(vty, " timeslot %u%s", ts->nr, VTY_NEWLINE); |
Harald Welte | a2bbc5e | 2015-11-20 10:43:31 +0100 | [diff] [blame] | 376 | if (ts->tsc != -1) |
Neels Hofmeyr | 9c4f1d6 | 2016-01-27 14:20:29 +0100 | [diff] [blame] | 377 | vty_out(vty, " training_sequence_code %u%s", ts->tsc, VTY_NEWLINE); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 378 | if (ts->pchan != GSM_PCHAN_NONE) |
Neels Hofmeyr | 9c4f1d6 | 2016-01-27 14:20:29 +0100 | [diff] [blame] | 379 | vty_out(vty, " phys_chan_config %s%s", |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 380 | gsm_pchan_name(ts->pchan), VTY_NEWLINE); |
Neels Hofmeyr | 9c4f1d6 | 2016-01-27 14:20:29 +0100 | [diff] [blame] | 381 | vty_out(vty, " hopping enabled %u%s", |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 382 | ts->hopping.enabled, VTY_NEWLINE); |
| 383 | if (ts->hopping.enabled) { |
| 384 | unsigned int i; |
Neels Hofmeyr | 9c4f1d6 | 2016-01-27 14:20:29 +0100 | [diff] [blame] | 385 | vty_out(vty, " hopping sequence-number %u%s", |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 386 | ts->hopping.hsn, VTY_NEWLINE); |
Neels Hofmeyr | 9c4f1d6 | 2016-01-27 14:20:29 +0100 | [diff] [blame] | 387 | vty_out(vty, " hopping maio %u%s", |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 388 | ts->hopping.maio, VTY_NEWLINE); |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 389 | for (i = 0; i < ts->hopping.arfcns.data_len*8; i++) { |
| 390 | if (!bitvec_get_bit_pos(&ts->hopping.arfcns, i)) |
| 391 | continue; |
Neels Hofmeyr | 9c4f1d6 | 2016-01-27 14:20:29 +0100 | [diff] [blame] | 392 | vty_out(vty, " hopping arfcn add %u%s", |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 393 | i, VTY_NEWLINE); |
| 394 | } |
Harald Welte | 127af34 | 2010-12-24 12:07:07 +0100 | [diff] [blame] | 395 | } |
Neels Hofmeyr | 9c4f1d6 | 2016-01-27 14:20:29 +0100 | [diff] [blame] | 396 | config_write_e1_link(vty, &ts->e1_link, " "); |
Harald Welte | face7ed | 2011-02-14 16:15:21 +0100 | [diff] [blame] | 397 | |
| 398 | if (ts->trx->bts->model->config_write_ts) |
| 399 | ts->trx->bts->model->config_write_ts(vty, ts); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 400 | } |
| 401 | |
| 402 | static void config_write_trx_single(struct vty *vty, struct gsm_bts_trx *trx) |
| 403 | { |
| 404 | int i; |
| 405 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 406 | vty_out(vty, " trx %u%s", trx->nr, VTY_NEWLINE); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 407 | if (trx->description) |
| 408 | vty_out(vty, " description %s%s", trx->description, |
| 409 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 2ba40af | 2010-04-17 06:42:07 +0200 | [diff] [blame] | 410 | vty_out(vty, " rf_locked %u%s", |
Harald Welte | d64c0bc | 2011-05-30 12:07:53 +0200 | [diff] [blame] | 411 | trx->mo.nm_state.administrative == NM_STATE_LOCKED ? 1 : 0, |
Holger Hans Peter Freyther | 2ba40af | 2010-04-17 06:42:07 +0200 | [diff] [blame] | 412 | VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 413 | vty_out(vty, " arfcn %u%s", trx->arfcn, VTY_NEWLINE); |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 414 | vty_out(vty, " nominal power %u%s", trx->nominal_power, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 415 | 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] | 416 | config_write_e1_link(vty, &trx->rsl_e1_link, " rsl "); |
| 417 | 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] | 418 | |
Harald Welte | face7ed | 2011-02-14 16:15:21 +0100 | [diff] [blame] | 419 | if (trx->bts->model->config_write_trx) |
| 420 | trx->bts->model->config_write_trx(vty, trx); |
| 421 | |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 422 | for (i = 0; i < TRX_NR_TS; i++) |
| 423 | config_write_ts_single(vty, &trx->ts[i]); |
| 424 | } |
| 425 | |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 426 | static void config_write_bts_gprs(struct vty *vty, struct gsm_bts *bts) |
| 427 | { |
| 428 | unsigned int i; |
| 429 | vty_out(vty, " gprs mode %s%s", bts_gprs_mode_name(bts->gprs.mode), |
| 430 | VTY_NEWLINE); |
| 431 | if (bts->gprs.mode == BTS_GPRS_NONE) |
| 432 | return; |
| 433 | |
bhargava | 350533c | 2016-07-21 11:14:34 +0530 | [diff] [blame] | 434 | vty_out(vty, " gprs 11bit_rach_support_for_egprs %u%s", |
| 435 | bts->gprs.supports_egprs_11bit_rach, VTY_NEWLINE); |
| 436 | |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 437 | vty_out(vty, " gprs routing area %u%s", bts->gprs.rac, |
| 438 | VTY_NEWLINE); |
Andreas Eversberg | 0c8f9ca | 2013-03-16 16:31:26 +0100 | [diff] [blame] | 439 | vty_out(vty, " gprs network-control-order nc%u%s", |
| 440 | bts->gprs.net_ctrl_ord, VTY_NEWLINE); |
Max | 292ec58 | 2016-07-28 11:55:37 +0200 | [diff] [blame] | 441 | if (!bts->gprs.ctrl_ack_type_use_block) |
| 442 | vty_out(vty, " gprs control-ack-type-rach%s", VTY_NEWLINE); |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 443 | vty_out(vty, " gprs cell bvci %u%s", bts->gprs.cell.bvci, |
| 444 | VTY_NEWLINE); |
| 445 | for (i = 0; i < ARRAY_SIZE(bts->gprs.cell.timer); i++) |
| 446 | vty_out(vty, " gprs cell timer %s %u%s", |
| 447 | get_value_string(gprs_bssgp_cfg_strs, i), |
| 448 | bts->gprs.cell.timer[i], VTY_NEWLINE); |
| 449 | vty_out(vty, " gprs nsei %u%s", bts->gprs.nse.nsei, |
| 450 | VTY_NEWLINE); |
| 451 | for (i = 0; i < ARRAY_SIZE(bts->gprs.nse.timer); i++) |
| 452 | vty_out(vty, " gprs ns timer %s %u%s", |
| 453 | get_value_string(gprs_ns_timer_strs, i), |
| 454 | bts->gprs.nse.timer[i], VTY_NEWLINE); |
| 455 | for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { |
| 456 | struct gsm_bts_gprs_nsvc *nsvc = |
| 457 | &bts->gprs.nsvc[i]; |
| 458 | struct in_addr ia; |
| 459 | |
| 460 | ia.s_addr = htonl(nsvc->remote_ip); |
| 461 | vty_out(vty, " gprs nsvc %u nsvci %u%s", i, |
| 462 | nsvc->nsvci, VTY_NEWLINE); |
| 463 | vty_out(vty, " gprs nsvc %u local udp port %u%s", i, |
| 464 | nsvc->local_port, VTY_NEWLINE); |
| 465 | vty_out(vty, " gprs nsvc %u remote udp port %u%s", i, |
| 466 | nsvc->remote_port, VTY_NEWLINE); |
| 467 | vty_out(vty, " gprs nsvc %u remote ip %s%s", i, |
| 468 | inet_ntoa(ia), VTY_NEWLINE); |
| 469 | } |
| 470 | } |
| 471 | |
Holger Hans Peter Freyther | cd40fb4 | 2013-09-15 17:23:34 +0200 | [diff] [blame] | 472 | /* Write the model data if there is one */ |
| 473 | static void config_write_bts_model(struct vty *vty, struct gsm_bts *bts) |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 474 | { |
| 475 | struct gsm_bts_trx *trx; |
Holger Hans Peter Freyther | cd40fb4 | 2013-09-15 17:23:34 +0200 | [diff] [blame] | 476 | |
| 477 | if (!bts->model) |
| 478 | return; |
| 479 | |
| 480 | if (bts->model->config_write_bts) |
| 481 | bts->model->config_write_bts(vty, bts); |
| 482 | |
| 483 | llist_for_each_entry(trx, &bts->trx_list, list) |
| 484 | config_write_trx_single(vty, trx); |
| 485 | } |
| 486 | |
Holger Hans Peter Freyther | a174a47 | 2015-09-24 11:39:38 +0200 | [diff] [blame] | 487 | static void write_amr_modes(struct vty *vty, const char *prefix, |
| 488 | const char *name, struct amr_mode *modes, int num) |
| 489 | { |
| 490 | int i; |
| 491 | |
| 492 | vty_out(vty, " %s threshold %s", prefix, name); |
| 493 | for (i = 0; i < num - 1; i++) |
| 494 | vty_out(vty, " %d", modes[i].threshold); |
| 495 | vty_out(vty, "%s", VTY_NEWLINE); |
| 496 | vty_out(vty, " %s hysteresis %s", prefix, name); |
| 497 | for (i = 0; i < num - 1; i++) |
| 498 | vty_out(vty, " %d", modes[i].hysteresis); |
| 499 | vty_out(vty, "%s", VTY_NEWLINE); |
| 500 | } |
| 501 | |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 502 | static void config_write_bts_amr(struct vty *vty, struct gsm_bts *bts, |
| 503 | struct amr_multirate_conf *mr, int full) |
| 504 | { |
| 505 | struct gsm48_multi_rate_conf *mr_conf; |
| 506 | const char *prefix = (full) ? "amr tch-f" : "amr tch-h"; |
| 507 | int i, num; |
| 508 | |
| 509 | if (!(mr->gsm48_ie[1])) |
| 510 | return; |
| 511 | |
| 512 | mr_conf = (struct gsm48_multi_rate_conf *) mr->gsm48_ie; |
| 513 | |
| 514 | num = 0; |
| 515 | vty_out(vty, " %s modes", prefix); |
| 516 | for (i = 0; i < ((full) ? 8 : 6); i++) { |
| 517 | if ((mr->gsm48_ie[1] & (1 << i))) { |
| 518 | vty_out(vty, " %d", i); |
| 519 | num++; |
| 520 | } |
| 521 | } |
| 522 | vty_out(vty, "%s", VTY_NEWLINE); |
| 523 | if (num > 4) |
| 524 | num = 4; |
| 525 | if (num > 1) { |
Holger Hans Peter Freyther | a174a47 | 2015-09-24 11:39:38 +0200 | [diff] [blame] | 526 | write_amr_modes(vty, prefix, "ms", mr->ms_mode, num); |
| 527 | write_amr_modes(vty, prefix, "bts", mr->bts_mode, num); |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 528 | } |
| 529 | vty_out(vty, " %s start-mode ", prefix); |
| 530 | if (mr_conf->icmi) { |
| 531 | num = 0; |
| 532 | for (i = 0; i < ((full) ? 8 : 6) && num < 4; i++) { |
| 533 | if ((mr->gsm48_ie[1] & (1 << i))) |
| 534 | num++; |
| 535 | if (mr_conf->smod == num - 1) { |
| 536 | vty_out(vty, "%d%s", num, VTY_NEWLINE); |
| 537 | break; |
| 538 | } |
| 539 | } |
| 540 | } else |
| 541 | vty_out(vty, "auto%s", VTY_NEWLINE); |
| 542 | } |
| 543 | |
Holger Hans Peter Freyther | cd40fb4 | 2013-09-15 17:23:34 +0200 | [diff] [blame] | 544 | static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) |
| 545 | { |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 546 | int i; |
Max | 2c16bee | 2017-02-15 13:51:37 +0100 | [diff] [blame] | 547 | uint8_t tmp; |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 548 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 549 | vty_out(vty, " bts %u%s", bts->nr, VTY_NEWLINE); |
| 550 | vty_out(vty, " type %s%s", btstype2str(bts->type), VTY_NEWLINE); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 551 | if (bts->description) |
| 552 | vty_out(vty, " description %s%s", bts->description, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 553 | 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] | 554 | vty_out(vty, " cell_identity %u%s", bts->cell_identity, VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 555 | vty_out(vty, " location_area_code %u%s", bts->location_area_code, |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 556 | VTY_NEWLINE); |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 557 | if (bts->dtxu != GSM48_DTX_SHALL_NOT_BE_USED) |
| 558 | vty_out(vty, " dtx uplink%s%s", |
| 559 | (bts->dtxu != GSM48_DTX_SHALL_BE_USED) ? "" : " force", |
| 560 | VTY_NEWLINE); |
| 561 | if (bts->dtxd) |
| 562 | vty_out(vty, " dtx downlink%s", VTY_NEWLINE); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 563 | 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] | 564 | 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] | 565 | vty_out(vty, " cell reselection hysteresis %u%s", |
| 566 | bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); |
| 567 | vty_out(vty, " rxlev access min %u%s", |
| 568 | bts->si_common.cell_sel_par.rxlev_acc_min, VTY_NEWLINE); |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 569 | |
| 570 | if (bts->si_common.cell_ro_sel_par.present) { |
| 571 | struct gsm48_si_selection_params *sp; |
| 572 | sp = &bts->si_common.cell_ro_sel_par; |
| 573 | |
| 574 | if (sp->cbq) |
| 575 | vty_out(vty, " cell bar qualify %u%s", |
| 576 | sp->cbq, VTY_NEWLINE); |
| 577 | |
| 578 | if (sp->cell_resel_off) |
| 579 | vty_out(vty, " cell reselection offset %u%s", |
| 580 | sp->cell_resel_off*2, VTY_NEWLINE); |
| 581 | |
| 582 | if (sp->temp_offs == 7) |
| 583 | vty_out(vty, " temporary offset infinite%s", |
| 584 | VTY_NEWLINE); |
| 585 | else if (sp->temp_offs) |
| 586 | vty_out(vty, " temporary offset %u%s", |
| 587 | sp->temp_offs*10, VTY_NEWLINE); |
| 588 | |
| 589 | if (sp->penalty_time == 31) |
| 590 | vty_out(vty, " penalty time reserved%s", |
| 591 | VTY_NEWLINE); |
| 592 | else if (sp->penalty_time) |
| 593 | vty_out(vty, " penalty time %u%s", |
| 594 | (sp->penalty_time*20)+20, VTY_NEWLINE); |
| 595 | } |
| 596 | |
Holger Hans Peter Freyther | c63f6f1 | 2013-07-27 21:07:57 +0200 | [diff] [blame] | 597 | /* Is periodic LU enabled or disabled? */ |
| 598 | if (bts->si_common.chan_desc.t3212 == 0) |
| 599 | vty_out(vty, " no periodic location update%s", VTY_NEWLINE); |
| 600 | else |
| 601 | vty_out(vty, " periodic location update %u%s", |
| 602 | bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE); |
| 603 | |
Andreas Eversberg | 4d4944a | 2013-03-10 11:49:35 +0100 | [diff] [blame] | 604 | vty_out(vty, " radio-link-timeout %d%s", |
| 605 | get_radio_link_timeout(&bts->si_common.cell_options), |
| 606 | VTY_NEWLINE); |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 607 | vty_out(vty, " channel allocator %s%s", |
| 608 | bts->chan_alloc_reverse ? "descending" : "ascending", |
| 609 | VTY_NEWLINE); |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 610 | vty_out(vty, " rach tx integer %u%s", |
| 611 | bts->si_common.rach_control.tx_integer, VTY_NEWLINE); |
| 612 | vty_out(vty, " rach max transmission %u%s", |
| 613 | rach_max_trans_raw2val(bts->si_common.rach_control.max_trans), |
| 614 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 615 | |
Andreas Eversberg | 2ee7ecd | 2012-10-13 07:27:47 +0200 | [diff] [blame] | 616 | vty_out(vty, " channel-descrption attach %u%s", |
| 617 | bts->si_common.chan_desc.att, VTY_NEWLINE); |
| 618 | vty_out(vty, " channel-descrption bs-pa-mfrms %u%s", |
| 619 | bts->si_common.chan_desc.bs_pa_mfrms + 2, VTY_NEWLINE); |
| 620 | vty_out(vty, " channel-descrption bs-ag-blks-res %u%s", |
| 621 | bts->si_common.chan_desc.bs_ag_blks_res, VTY_NEWLINE); |
| 622 | |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 623 | if (bts->rach_b_thresh != -1) |
| 624 | vty_out(vty, " rach nm busy threshold %u%s", |
| 625 | bts->rach_b_thresh, VTY_NEWLINE); |
| 626 | if (bts->rach_ldavg_slots != -1) |
| 627 | vty_out(vty, " rach nm load average %u%s", |
| 628 | bts->rach_ldavg_slots, VTY_NEWLINE); |
Harald Welte | 7135501 | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 629 | if (bts->si_common.rach_control.cell_bar) |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 630 | vty_out(vty, " cell barred 1%s", VTY_NEWLINE); |
Holger Hans Peter Freyther | 3a0a463 | 2010-05-14 00:39:19 +0800 | [diff] [blame] | 631 | if ((bts->si_common.rach_control.t2 & 0x4) == 0) |
| 632 | vty_out(vty, " rach emergency call allowed 1%s", VTY_NEWLINE); |
Ivan Kluchnikov | 6792059 | 2013-09-16 13:13:04 +0400 | [diff] [blame] | 633 | if ((bts->si_common.rach_control.t3) != 0) |
| 634 | for (i = 0; i < 8; i++) |
| 635 | if (bts->si_common.rach_control.t3 & (0x1 << i)) |
| 636 | vty_out(vty, " rach access-control-class %d barred%s", i, VTY_NEWLINE); |
| 637 | if ((bts->si_common.rach_control.t2 & 0xfb) != 0) |
| 638 | for (i = 0; i < 8; i++) |
| 639 | if ((i != 2) && (bts->si_common.rach_control.t2 & (0x1 << i))) |
| 640 | vty_out(vty, " rach access-control-class %d barred%s", i+8, VTY_NEWLINE); |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 641 | for (i = SYSINFO_TYPE_1; i < _MAX_SYSINFO_TYPE; i++) { |
| 642 | if (bts->si_mode_static & (1 << i)) { |
| 643 | vty_out(vty, " system-information %s mode static%s", |
| 644 | get_value_string(osmo_sitype_strs, i), VTY_NEWLINE); |
| 645 | vty_out(vty, " system-information %s static %s%s", |
| 646 | get_value_string(osmo_sitype_strs, i), |
Sylvain Munaut | 63ef215 | 2011-11-13 23:05:23 +0100 | [diff] [blame] | 647 | osmo_hexdump_nospc(bts->si_buf[i], sizeof(bts->si_buf[i])), |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 648 | VTY_NEWLINE); |
| 649 | } |
| 650 | } |
Harald Welte | 42def72 | 2017-01-13 00:10:32 +0100 | [diff] [blame] | 651 | vty_out(vty, " early-classmark-sending %s%s", |
| 652 | bts->early_classmark_allowed ? "allowed" : "forbidden", VTY_NEWLINE); |
Harald Welte | fd355a3 | 2011-03-04 13:41:31 +0100 | [diff] [blame] | 653 | switch (bts->type) { |
| 654 | case GSM_BTS_TYPE_NANOBTS: |
Max | f9685c1 | 2017-03-23 12:01:07 +0100 | [diff] [blame] | 655 | case GSM_BTS_TYPE_OSMOBTS: |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 656 | vty_out(vty, " ip.access unit_id %u %u%s", |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 657 | bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE); |
Harald Welte | 8b29180 | 2013-03-12 13:57:05 +0100 | [diff] [blame] | 658 | if (bts->ip_access.rsl_ip) { |
| 659 | struct in_addr ia; |
| 660 | ia.s_addr = htonl(bts->ip_access.rsl_ip); |
| 661 | vty_out(vty, " ip.access rsl-ip %s%s", inet_ntoa(ia), |
| 662 | VTY_NEWLINE); |
| 663 | } |
Pablo Neira Ayuso | ed5cacb | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 664 | vty_out(vty, " oml ip.access stream_id %u line %u%s", |
| 665 | bts->oml_tei, bts->oml_e1_link.e1_nr, VTY_NEWLINE); |
Harald Welte | fd355a3 | 2011-03-04 13:41:31 +0100 | [diff] [blame] | 666 | break; |
Sylvain Munaut | c951946 | 2011-10-17 14:04:55 +0200 | [diff] [blame] | 667 | case GSM_BTS_TYPE_NOKIA_SITE: |
| 668 | vty_out(vty, " nokia_site skip-reset %d%s", bts->nokia.skip_reset, VTY_NEWLINE); |
Andreas Eversberg | 7d8fa34 | 2013-12-05 13:25:06 +0100 | [diff] [blame] | 669 | vty_out(vty, " nokia_site no-local-rel-conf %d%s", |
| 670 | bts->nokia.no_loc_rel_cnf, VTY_NEWLINE); |
Sipos Csaba | 56e1766 | 2015-02-07 13:27:36 +0100 | [diff] [blame] | 671 | vty_out(vty, " nokia_site bts-reset-timer %d%s", bts->nokia.bts_reset_timer_cnf, VTY_NEWLINE); |
Andreas Eversberg | b6f9516 | 2013-12-05 16:02:37 +0100 | [diff] [blame] | 672 | /* fall through: Nokia requires "oml e1" parameters also */ |
Harald Welte | fd355a3 | 2011-03-04 13:41:31 +0100 | [diff] [blame] | 673 | default: |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 674 | config_write_e1_link(vty, &bts->oml_e1_link, " oml "); |
| 675 | vty_out(vty, " oml e1 tei %u%s", bts->oml_tei, VTY_NEWLINE); |
Harald Welte | fd355a3 | 2011-03-04 13:41:31 +0100 | [diff] [blame] | 676 | break; |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 677 | } |
Holger Hans Peter Freyther | e66bf1f | 2010-09-06 10:11:25 +0800 | [diff] [blame] | 678 | |
| 679 | /* if we have a limit, write it */ |
| 680 | if (bts->paging.free_chans_need >= 0) |
| 681 | vty_out(vty, " paging free %d%s", bts->paging.free_chans_need, VTY_NEWLINE); |
| 682 | |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 683 | vty_out(vty, " neighbor-list mode %s%s", |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 684 | get_value_string(bts_neigh_mode_strs, bts->neigh_list_manual_mode), VTY_NEWLINE); |
| 685 | if (bts->neigh_list_manual_mode != NL_MODE_AUTOMATIC) { |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 686 | for (i = 0; i < 1024; i++) { |
| 687 | if (bitvec_get_bit_pos(&bts->si_common.neigh_list, i)) |
| 688 | vty_out(vty, " neighbor-list add arfcn %u%s", |
| 689 | i, VTY_NEWLINE); |
| 690 | } |
| 691 | } |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 692 | if (bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) { |
| 693 | for (i = 0; i < 1024; i++) { |
| 694 | if (bitvec_get_bit_pos(&bts->si_common.si5_neigh_list, i)) |
| 695 | vty_out(vty, " si5 neighbor-list add arfcn %u%s", |
| 696 | i, VTY_NEWLINE); |
| 697 | } |
| 698 | } |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 699 | |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 700 | for (i = 0; i < MAX_EARFCN_LIST; i++) { |
Max | 2c16bee | 2017-02-15 13:51:37 +0100 | [diff] [blame] | 701 | struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; |
| 702 | if (e->arfcn[i] != OSMO_EARFCN_INVALID) { |
| 703 | vty_out(vty, " si2quater neighbor-list add earfcn %u " |
| 704 | "thresh-hi %u", e->arfcn[i], e->thresh_hi); |
| 705 | |
| 706 | vty_out(vty, " thresh-lo %u", |
| 707 | e->thresh_lo_valid ? e->thresh_lo : 32); |
| 708 | |
| 709 | vty_out(vty, " prio %u", |
| 710 | e->prio_valid ? e->prio : 8); |
| 711 | |
| 712 | vty_out(vty, " qrxlv %u", |
| 713 | e->qrxlm_valid ? e->qrxlm : 32); |
| 714 | |
| 715 | tmp = e->meas_bw[i]; |
| 716 | vty_out(vty, " meas %u", |
| 717 | (tmp != OSMO_EARFCN_MEAS_INVALID) ? tmp : 8); |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 718 | |
| 719 | vty_out(vty, "%s", VTY_NEWLINE); |
| 720 | } |
| 721 | } |
| 722 | |
Max | 26679e0 | 2016-04-20 15:57:13 +0200 | [diff] [blame] | 723 | for (i = 0; i < bts->si_common.uarfcn_length; i++) { |
| 724 | vty_out(vty, " si2quater neighbor-list add uarfcn %u %u %u%s", |
| 725 | bts->si_common.data.uarfcn_list[i], |
| 726 | bts->si_common.data.scramble_list[i] & ~(1 << 9), |
| 727 | (bts->si_common.data.scramble_list[i] >> 9) & 1, |
| 728 | VTY_NEWLINE); |
| 729 | } |
| 730 | |
Andreas Eversberg | a83d511 | 2013-12-07 18:32:28 +0100 | [diff] [blame] | 731 | vty_out(vty, " codec-support fr"); |
| 732 | if (bts->codec.hr) |
| 733 | vty_out(vty, " hr"); |
| 734 | if (bts->codec.efr) |
| 735 | vty_out(vty, " efr"); |
| 736 | if (bts->codec.amr) |
| 737 | vty_out(vty, " amr"); |
| 738 | vty_out(vty, "%s", VTY_NEWLINE); |
| 739 | |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 740 | config_write_bts_amr(vty, bts, &bts->mr_full, 1); |
| 741 | config_write_bts_amr(vty, bts, &bts->mr_half, 0); |
| 742 | |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 743 | config_write_bts_gprs(vty, bts); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 744 | |
Holger Hans Peter Freyther | e30d40d | 2012-07-20 10:27:31 +0200 | [diff] [blame] | 745 | if (bts->excl_from_rf_lock) |
| 746 | vty_out(vty, " rf-lock-exclude%s", VTY_NEWLINE); |
| 747 | |
Jacob Erlbeck | 65d114f | 2014-01-16 11:02:14 +0100 | [diff] [blame] | 748 | vty_out(vty, " %sforce-combined-si%s", |
| 749 | bts->force_combined_si ? "" : "no ", VTY_NEWLINE); |
| 750 | |
Holger Hans Peter Freyther | c22930e | 2014-12-17 14:46:17 +0100 | [diff] [blame] | 751 | for (i = 0; i < ARRAY_SIZE(bts->depends_on); ++i) { |
| 752 | int j; |
| 753 | |
| 754 | if (bts->depends_on[i] == 0) |
| 755 | continue; |
| 756 | |
| 757 | for (j = 0; j < sizeof(bts->depends_on[i]) * 8; ++j) { |
| 758 | int bts_nr; |
| 759 | |
| 760 | if ((bts->depends_on[i] & (1<<j)) == 0) |
| 761 | continue; |
| 762 | |
| 763 | bts_nr = (i * sizeof(bts->depends_on[i]) * 8) + j; |
| 764 | vty_out(vty, " depends-on-bts %d%s", bts_nr, VTY_NEWLINE); |
| 765 | } |
| 766 | } |
| 767 | |
Holger Hans Peter Freyther | cd40fb4 | 2013-09-15 17:23:34 +0200 | [diff] [blame] | 768 | config_write_bts_model(vty, bts); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 769 | } |
| 770 | |
| 771 | static int config_write_bts(struct vty *v) |
| 772 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 773 | struct gsm_network *gsmnet = gsmnet_from_vty(v); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 774 | struct gsm_bts *bts; |
| 775 | |
| 776 | llist_for_each_entry(bts, &gsmnet->bts_list, list) |
| 777 | config_write_bts_single(v, bts); |
| 778 | |
| 779 | return CMD_SUCCESS; |
| 780 | } |
| 781 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 782 | static int config_write_net(struct vty *vty) |
| 783 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 784 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 785 | |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 786 | vty_out(vty, "network%s", VTY_NEWLINE); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 787 | 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] | 788 | 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] | 789 | vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE); |
| 790 | 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] | 791 | vty_out(vty, " auth policy %s%s", gsm_auth_policy_name(gsmnet->auth_policy), VTY_NEWLINE); |
Max | ddee01f | 2016-05-24 14:23:27 +0200 | [diff] [blame] | 792 | if (gsmnet->authorized_reg_str) |
| 793 | vty_out(vty, " authorized-regexp %s%s", gsmnet->authorized_reg_str, VTY_NEWLINE); |
Harald Welte | 1085c09 | 2009-11-18 20:33:19 +0100 | [diff] [blame] | 794 | vty_out(vty, " location updating reject cause %u%s", |
| 795 | gsmnet->reject_cause, VTY_NEWLINE); |
Harald Welte | 4381cfe | 2009-08-30 15:47:06 +0900 | [diff] [blame] | 796 | 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] | 797 | vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); |
Holger Hans Peter Freyther | 76fc4a3 | 2010-09-06 09:41:50 +0800 | [diff] [blame] | 798 | vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); |
Harald Welte | eab84a1 | 2009-12-13 10:53:12 +0100 | [diff] [blame] | 799 | vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode), |
| 800 | VTY_NEWLINE); |
Harald Welte | 648b6ce | 2009-12-14 09:00:24 +0100 | [diff] [blame] | 801 | 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] | 802 | vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 803 | vty_out(vty, " handover window rxlev averaging %u%s", |
| 804 | gsmnet->handover.win_rxlev_avg, VTY_NEWLINE); |
| 805 | vty_out(vty, " handover window rxqual averaging %u%s", |
| 806 | gsmnet->handover.win_rxqual_avg, VTY_NEWLINE); |
| 807 | vty_out(vty, " handover window rxlev neighbor averaging %u%s", |
| 808 | gsmnet->handover.win_rxlev_avg_neigh, VTY_NEWLINE); |
| 809 | vty_out(vty, " handover power budget interval %u%s", |
| 810 | gsmnet->handover.pwr_interval, VTY_NEWLINE); |
| 811 | vty_out(vty, " handover power budget hysteresis %u%s", |
| 812 | gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); |
| 813 | vty_out(vty, " handover maximum distance %u%s", |
| 814 | gsmnet->handover.max_distance, VTY_NEWLINE); |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 815 | 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] | 816 | vty_out(vty, " timer t3103 %u%s", gsmnet->T3103, VTY_NEWLINE); |
| 817 | vty_out(vty, " timer t3105 %u%s", gsmnet->T3105, VTY_NEWLINE); |
| 818 | vty_out(vty, " timer t3107 %u%s", gsmnet->T3107, VTY_NEWLINE); |
| 819 | vty_out(vty, " timer t3109 %u%s", gsmnet->T3109, VTY_NEWLINE); |
| 820 | vty_out(vty, " timer t3111 %u%s", gsmnet->T3111, VTY_NEWLINE); |
| 821 | vty_out(vty, " timer t3113 %u%s", gsmnet->T3113, VTY_NEWLINE); |
| 822 | vty_out(vty, " timer t3115 %u%s", gsmnet->T3115, VTY_NEWLINE); |
| 823 | vty_out(vty, " timer t3117 %u%s", gsmnet->T3117, VTY_NEWLINE); |
| 824 | vty_out(vty, " timer t3119 %u%s", gsmnet->T3119, VTY_NEWLINE); |
Harald Welte | 2862dca | 2010-12-23 14:39:29 +0100 | [diff] [blame] | 825 | vty_out(vty, " timer t3122 %u%s", gsmnet->T3122, VTY_NEWLINE); |
Holger Hans Peter Freyther | 23975e7 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 826 | vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); |
Vadim Yanitskiy | 7f3724e | 2017-03-31 23:27:44 +0700 | [diff] [blame] | 827 | vty_out(vty, " dyn_ts_allow_tch_f %d%s", |
| 828 | gsmnet->dyn_ts_allow_tch_f ? 1 : 0, VTY_NEWLINE); |
Holger Hans Peter Freyther | ae9006a | 2010-12-22 16:26:04 +0100 | [diff] [blame] | 829 | vty_out(vty, " subscriber-keep-in-ram %d%s", |
Jacob Erlbeck | 1e30a28 | 2014-12-03 09:28:24 +0100 | [diff] [blame] | 830 | gsmnet->subscr_group->keep_subscr, VTY_NEWLINE); |
Neels Hofmeyr | 7398395 | 2016-05-10 13:29:33 +0200 | [diff] [blame] | 831 | if (gsmnet->tz.override != 0) { |
| 832 | if (gsmnet->tz.dst) |
| 833 | vty_out(vty, " timezone %d %d %d%s", |
| 834 | gsmnet->tz.hr, gsmnet->tz.mn, gsmnet->tz.dst, |
| 835 | VTY_NEWLINE); |
| 836 | else |
| 837 | vty_out(vty, " timezone %d %d%s", |
| 838 | gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); |
| 839 | } |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 840 | |
| 841 | return CMD_SUCCESS; |
| 842 | } |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 843 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 844 | static void trx_dump_vty(struct vty *vty, struct gsm_bts_trx *trx) |
| 845 | { |
| 846 | vty_out(vty, "TRX %u of BTS %u is on ARFCN %u%s", |
| 847 | trx->nr, trx->bts->nr, trx->arfcn, VTY_NEWLINE); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 848 | vty_out(vty, "Description: %s%s", |
| 849 | trx->description ? trx->description : "(null)", VTY_NEWLINE); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 850 | vty_out(vty, " RF Nominal Power: %d dBm, reduced by %u dB, " |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 851 | "resulting BS power: %d dBm%s", |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 852 | trx->nominal_power, trx->max_power_red, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 853 | trx->nominal_power - trx->max_power_red, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 854 | vty_out(vty, " NM State: "); |
Harald Welte | d64c0bc | 2011-05-30 12:07:53 +0200 | [diff] [blame] | 855 | net_dump_nmstate(vty, &trx->mo.nm_state); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 856 | vty_out(vty, " Baseband Transceiver NM State: "); |
Harald Welte | d64c0bc | 2011-05-30 12:07:53 +0200 | [diff] [blame] | 857 | net_dump_nmstate(vty, &trx->bb_transc.mo.nm_state); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 858 | if (is_ipaccess_bts(trx->bts)) { |
| 859 | vty_out(vty, " ip.access stream ID: 0x%02x%s", |
| 860 | trx->rsl_tei, VTY_NEWLINE); |
| 861 | } else { |
| 862 | vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); |
| 863 | e1isl_dump_vty(vty, trx->rsl_link); |
| 864 | } |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 865 | } |
| 866 | |
| 867 | DEFUN(show_trx, |
| 868 | show_trx_cmd, |
Sylvain Munaut | 39c31de | 2012-12-28 12:15:11 +0100 | [diff] [blame] | 869 | "show trx [<0-255>] [<0-255>]", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 870 | SHOW_STR "Display information about a TRX\n" |
| 871 | "BTS Number\n" |
| 872 | "TRX Number\n") |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 873 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 874 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 875 | struct gsm_bts *bts = NULL; |
| 876 | struct gsm_bts_trx *trx; |
| 877 | int bts_nr, trx_nr; |
| 878 | |
| 879 | if (argc >= 1) { |
| 880 | /* use the BTS number that the user has specified */ |
| 881 | bts_nr = atoi(argv[0]); |
| 882 | if (bts_nr >= net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 883 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 884 | VTY_NEWLINE); |
| 885 | return CMD_WARNING; |
| 886 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 887 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 888 | } |
| 889 | if (argc >= 2) { |
| 890 | trx_nr = atoi(argv[1]); |
| 891 | if (trx_nr >= bts->num_trx) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 892 | vty_out(vty, "%% can't find TRX '%s'%s", argv[1], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 893 | VTY_NEWLINE); |
| 894 | return CMD_WARNING; |
| 895 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 896 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 897 | trx_dump_vty(vty, trx); |
| 898 | return CMD_SUCCESS; |
| 899 | } |
| 900 | if (bts) { |
| 901 | /* print all TRX in this BTS */ |
| 902 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 903 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 904 | trx_dump_vty(vty, trx); |
| 905 | } |
| 906 | return CMD_SUCCESS; |
| 907 | } |
| 908 | |
| 909 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 910 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 911 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 912 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 913 | trx_dump_vty(vty, trx); |
| 914 | } |
| 915 | } |
| 916 | |
| 917 | return CMD_SUCCESS; |
| 918 | } |
| 919 | |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 920 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 921 | static void ts_dump_vty(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 922 | { |
Harald Welte | 135a648 | 2011-05-30 12:09:13 +0200 | [diff] [blame] | 923 | vty_out(vty, "BTS %u, TRX %u, Timeslot %u, phys cfg %s, TSC %u", |
Harald Welte | 026b4ca | 2010-12-24 12:12:10 +0100 | [diff] [blame] | 924 | ts->trx->bts->nr, ts->trx->nr, ts->nr, |
Harald Welte | 1fe2412 | 2014-01-19 17:18:21 +0100 | [diff] [blame] | 925 | gsm_pchan_name(ts->pchan), gsm_ts_tsc(ts)); |
Harald Welte | cd103a9 | 2010-12-24 12:14:52 +0100 | [diff] [blame] | 926 | if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) |
Harald Welte | b29cea1 | 2010-12-24 12:26:13 +0100 | [diff] [blame] | 927 | vty_out(vty, " (%s mode)", |
Neels Hofmeyr | 2ebacce | 2016-06-14 14:08:35 +0200 | [diff] [blame] | 928 | ts->flags & TS_F_PDCH_ACTIVE ? "PDCH" : "TCH/F"); |
Harald Welte | cd103a9 | 2010-12-24 12:14:52 +0100 | [diff] [blame] | 929 | vty_out(vty, "%s", VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 930 | vty_out(vty, " NM State: "); |
Harald Welte | d64c0bc | 2011-05-30 12:07:53 +0200 | [diff] [blame] | 931 | net_dump_nmstate(vty, &ts->mo.nm_state); |
Harald Welte | 2c82899 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 932 | if (!is_ipaccess_bts(ts->trx->bts)) |
Harald Welte | ef235b5 | 2009-03-10 12:34:02 +0000 | [diff] [blame] | 933 | vty_out(vty, " E1 Line %u, Timeslot %u, Subslot %u%s", |
| 934 | ts->e1_link.e1_nr, ts->e1_link.e1_ts, |
| 935 | ts->e1_link.e1_ts_ss, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 936 | } |
| 937 | |
| 938 | DEFUN(show_ts, |
| 939 | show_ts_cmd, |
Sylvain Munaut | 39c31de | 2012-12-28 12:15:11 +0100 | [diff] [blame] | 940 | "show timeslot [<0-255>] [<0-255>] [<0-7>]", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 941 | SHOW_STR "Display information about a TS\n" |
| 942 | "BTS Number\n" "TRX Number\n" "Timeslot Number\n") |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 943 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 944 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 274d015 | 2010-12-24 12:05:03 +0100 | [diff] [blame] | 945 | struct gsm_bts *bts = NULL; |
| 946 | struct gsm_bts_trx *trx = NULL; |
| 947 | struct gsm_bts_trx_ts *ts = NULL; |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 948 | int bts_nr, trx_nr, ts_nr; |
| 949 | |
| 950 | if (argc >= 1) { |
| 951 | /* use the BTS number that the user has specified */ |
| 952 | bts_nr = atoi(argv[0]); |
| 953 | if (bts_nr >= net->num_bts) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 954 | vty_out(vty, "%% can't find BTS '%s'%s", argv[0], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 955 | VTY_NEWLINE); |
| 956 | return CMD_WARNING; |
| 957 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 958 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 959 | } |
| 960 | if (argc >= 2) { |
| 961 | trx_nr = atoi(argv[1]); |
| 962 | if (trx_nr >= bts->num_trx) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 963 | vty_out(vty, "%% can't find TRX '%s'%s", argv[1], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 964 | VTY_NEWLINE); |
| 965 | return CMD_WARNING; |
| 966 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 967 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 968 | } |
| 969 | if (argc >= 3) { |
| 970 | ts_nr = atoi(argv[2]); |
| 971 | if (ts_nr >= TRX_NR_TS) { |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 972 | vty_out(vty, "%% can't find TS '%s'%s", argv[2], |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 973 | VTY_NEWLINE); |
| 974 | return CMD_WARNING; |
| 975 | } |
Harald Welte | 274d015 | 2010-12-24 12:05:03 +0100 | [diff] [blame] | 976 | /* Fully Specified: print and exit */ |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 977 | ts = &trx->ts[ts_nr]; |
| 978 | ts_dump_vty(vty, ts); |
| 979 | return CMD_SUCCESS; |
| 980 | } |
Harald Welte | 274d015 | 2010-12-24 12:05:03 +0100 | [diff] [blame] | 981 | |
| 982 | if (bts && trx) { |
| 983 | /* Iterate over all TS in this TRX */ |
| 984 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 985 | ts = &trx->ts[ts_nr]; |
| 986 | ts_dump_vty(vty, ts); |
| 987 | } |
| 988 | } else if (bts) { |
| 989 | /* Iterate over all TRX in this BTS, TS in each TRX */ |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 990 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 991 | trx = gsm_bts_trx_num(bts, trx_nr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 992 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 993 | ts = &trx->ts[ts_nr]; |
| 994 | ts_dump_vty(vty, ts); |
| 995 | } |
| 996 | } |
Harald Welte | 274d015 | 2010-12-24 12:05:03 +0100 | [diff] [blame] | 997 | } else { |
| 998 | /* Iterate over all BTS, TRX in each BTS, TS in each TRX */ |
| 999 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
| 1000 | bts = gsm_bts_num(net, bts_nr); |
| 1001 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
| 1002 | trx = gsm_bts_trx_num(bts, trx_nr); |
| 1003 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 1004 | ts = &trx->ts[ts_nr]; |
| 1005 | ts_dump_vty(vty, ts); |
| 1006 | } |
| 1007 | } |
| 1008 | } |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1009 | } |
| 1010 | |
| 1011 | return CMD_SUCCESS; |
| 1012 | } |
| 1013 | |
Holger Hans Peter Freyther | 424c4f0 | 2010-01-06 06:00:40 +0100 | [diff] [blame] | 1014 | static void subscr_dump_vty(struct vty *vty, struct gsm_subscriber *subscr) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1015 | { |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1016 | vty_out(vty, " ID: %llu, Authorized: %d%s", subscr->id, |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 1017 | subscr->authorized, VTY_NEWLINE); |
Holger Hans Peter Freyther | 7f180e8 | 2013-12-12 15:45:41 +0100 | [diff] [blame] | 1018 | if (strlen(subscr->name)) |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 1019 | vty_out(vty, " Name: '%s'%s", subscr->name, VTY_NEWLINE); |
Holger Hans Peter Freyther | bd30cd3 | 2014-04-04 11:53:18 +0200 | [diff] [blame] | 1020 | if (strlen(subscr->extension)) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1021 | vty_out(vty, " Extension: %s%s", subscr->extension, |
| 1022 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 5ccd015 | 2013-07-14 08:38:24 +0200 | [diff] [blame] | 1023 | vty_out(vty, " IMSI: %s%s", subscr->imsi, VTY_NEWLINE); |
Holger Hans Peter Freyther | 2223025 | 2009-08-19 12:53:57 +0200 | [diff] [blame] | 1024 | if (subscr->tmsi != GSM_RESERVED_TMSI) |
| 1025 | vty_out(vty, " TMSI: %08X%s", subscr->tmsi, |
Harald Welte | 731fd91 | 2009-08-15 03:24:51 +0200 | [diff] [blame] | 1026 | VTY_NEWLINE); |
Sylvain Munaut | af29264 | 2009-12-27 19:29:28 +0100 | [diff] [blame] | 1027 | |
Harald Welte (local) | 15920de | 2009-08-14 20:27:16 +0200 | [diff] [blame] | 1028 | vty_out(vty, " Use count: %u%s", subscr->use_count, VTY_NEWLINE); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1029 | } |
| 1030 | |
Neels Hofmeyr | 6d804b1 | 2017-02-18 22:20:46 +0100 | [diff] [blame] | 1031 | static void bsc_subscr_dump_vty(struct vty *vty, struct bsc_subscr *bsub) |
| 1032 | { |
| 1033 | if (strlen(bsub->imsi)) |
| 1034 | vty_out(vty, " IMSI: %s%s", bsub->imsi, VTY_NEWLINE); |
| 1035 | if (bsub->tmsi != GSM_RESERVED_TMSI) |
| 1036 | vty_out(vty, " TMSI: 0x%08x%s", bsub->tmsi, |
| 1037 | VTY_NEWLINE); |
| 1038 | vty_out(vty, " Use count: %d%s", bsub->use_count, VTY_NEWLINE); |
| 1039 | } |
| 1040 | |
Harald Welte | 8387a49 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 1041 | static void meas_rep_dump_uni_vty(struct vty *vty, |
| 1042 | struct gsm_meas_rep_unidir *mru, |
| 1043 | const char *prefix, |
| 1044 | const char *dir) |
| 1045 | { |
| 1046 | vty_out(vty, "%s RXL-FULL-%s: %4d dBm, RXL-SUB-%s: %4d dBm ", |
| 1047 | prefix, dir, rxlev2dbm(mru->full.rx_lev), |
| 1048 | dir, rxlev2dbm(mru->sub.rx_lev)); |
| 1049 | vty_out(vty, "RXQ-FULL-%s: %d, RXQ-SUB-%s: %d%s", |
| 1050 | dir, mru->full.rx_qual, dir, mru->sub.rx_qual, |
| 1051 | VTY_NEWLINE); |
| 1052 | } |
| 1053 | |
| 1054 | static void meas_rep_dump_vty(struct vty *vty, struct gsm_meas_rep *mr, |
| 1055 | const char *prefix) |
| 1056 | { |
| 1057 | vty_out(vty, "%sMeasurement Report:%s", prefix, VTY_NEWLINE); |
| 1058 | vty_out(vty, "%s Flags: %s%s%s%s%s", prefix, |
| 1059 | mr->flags & MEAS_REP_F_UL_DTX ? "DTXu " : "", |
| 1060 | mr->flags & MEAS_REP_F_DL_DTX ? "DTXd " : "", |
| 1061 | mr->flags & MEAS_REP_F_FPC ? "FPC " : "", |
| 1062 | mr->flags & MEAS_REP_F_DL_VALID ? " " : "DLinval ", |
| 1063 | VTY_NEWLINE); |
| 1064 | if (mr->flags & MEAS_REP_F_MS_TO) |
| 1065 | vty_out(vty, "%s MS Timing Offset: %u%s", prefix, |
| 1066 | mr->ms_timing_offset, VTY_NEWLINE); |
| 1067 | if (mr->flags & MEAS_REP_F_MS_L1) |
| 1068 | vty_out(vty, "%s L1 MS Power: %u dBm, Timing Advance: %u%s", |
| 1069 | prefix, mr->ms_l1.pwr, mr->ms_l1.ta, VTY_NEWLINE); |
| 1070 | if (mr->flags & MEAS_REP_F_DL_VALID) |
| 1071 | meas_rep_dump_uni_vty(vty, &mr->dl, prefix, "dl"); |
| 1072 | meas_rep_dump_uni_vty(vty, &mr->ul, prefix, "ul"); |
| 1073 | } |
| 1074 | |
Harald Welte | 0a8cf32 | 2015-12-05 17:22:49 +0100 | [diff] [blame] | 1075 | /* FIXME: move this to libosmogsm */ |
| 1076 | static const struct value_string gsm48_cmode_names[] = { |
| 1077 | { GSM48_CMODE_SIGN, "signalling" }, |
| 1078 | { GSM48_CMODE_SPEECH_V1, "FR or HR" }, |
| 1079 | { GSM48_CMODE_SPEECH_EFR, "EFR" }, |
| 1080 | { GSM48_CMODE_SPEECH_AMR, "AMR" }, |
| 1081 | { GSM48_CMODE_DATA_14k5, "CSD(14k5)" }, |
| 1082 | { GSM48_CMODE_DATA_12k0, "CSD(12k0)" }, |
| 1083 | { GSM48_CMODE_DATA_6k0, "CSD(6k0)" }, |
| 1084 | { GSM48_CMODE_DATA_3k6, "CSD(3k6)" }, |
| 1085 | { 0, NULL } |
| 1086 | }; |
| 1087 | |
Neels Hofmeyr | b748012 | 2016-11-02 14:28:15 +0100 | [diff] [blame] | 1088 | /* call vty_out() to print a string like " as TCH/H" for dynamic timeslots. |
| 1089 | * Don't do anything if the ts is not dynamic. */ |
| 1090 | static void vty_out_dyn_ts_status(struct vty *vty, struct gsm_bts_trx_ts *ts) |
| 1091 | { |
| 1092 | switch (ts->pchan) { |
| 1093 | case GSM_PCHAN_TCH_F_TCH_H_PDCH: |
| 1094 | if (ts->dyn.pchan_is == ts->dyn.pchan_want) |
| 1095 | vty_out(vty, " as %s", |
| 1096 | gsm_pchan_name(ts->dyn.pchan_is)); |
| 1097 | else |
| 1098 | vty_out(vty, " switching %s -> %s", |
| 1099 | gsm_pchan_name(ts->dyn.pchan_is), |
| 1100 | gsm_pchan_name(ts->dyn.pchan_want)); |
| 1101 | break; |
| 1102 | case GSM_PCHAN_TCH_F_PDCH: |
| 1103 | if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) |
| 1104 | vty_out(vty, " as %s", |
| 1105 | (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" |
| 1106 | : "TCH/F"); |
| 1107 | else |
| 1108 | vty_out(vty, " switching %s -> %s", |
| 1109 | (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" |
| 1110 | : "TCH/F", |
| 1111 | (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" |
| 1112 | : "TCH/F"); |
| 1113 | break; |
| 1114 | default: |
| 1115 | /* no dyn ts */ |
| 1116 | break; |
| 1117 | } |
| 1118 | } |
| 1119 | |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 1120 | 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] | 1121 | { |
Harald Welte | 8387a49 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 1122 | int idx; |
| 1123 | |
Harald Welte | 85bded8 | 2010-12-24 12:22:34 +0100 | [diff] [blame] | 1124 | vty_out(vty, "BTS %u, TRX %u, Timeslot %u, Lchan %u: Type %s%s", |
| 1125 | lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, |
| 1126 | lchan->nr, gsm_lchant_name(lchan->type), VTY_NEWLINE); |
Neels Hofmeyr | b748012 | 2016-11-02 14:28:15 +0100 | [diff] [blame] | 1127 | /* show dyn TS details, if applicable */ |
| 1128 | switch (lchan->ts->pchan) { |
| 1129 | case GSM_PCHAN_TCH_F_TCH_H_PDCH: |
| 1130 | vty_out(vty, " Osmocom Dyn TS:"); |
| 1131 | vty_out_dyn_ts_status(vty, lchan->ts); |
| 1132 | vty_out(vty, VTY_NEWLINE); |
| 1133 | break; |
| 1134 | case GSM_PCHAN_TCH_F_PDCH: |
| 1135 | vty_out(vty, " IPACC Dyn PDCH TS:"); |
| 1136 | vty_out_dyn_ts_status(vty, lchan->ts); |
| 1137 | vty_out(vty, VTY_NEWLINE); |
| 1138 | break; |
| 1139 | default: |
| 1140 | /* no dyn ts */ |
| 1141 | break; |
| 1142 | } |
Holger Hans Peter Freyther | 454140e | 2014-12-28 12:08:28 +0100 | [diff] [blame] | 1143 | vty_out(vty, " Connection: %u, State: %s%s%s%s", |
Holger Hans Peter Freyther | 4049455 | 2010-06-28 17:09:29 +0800 | [diff] [blame] | 1144 | lchan->conn ? 1: 0, |
Holger Hans Peter Freyther | 454140e | 2014-12-28 12:08:28 +0100 | [diff] [blame] | 1145 | gsm_lchans_name(lchan->state), |
| 1146 | lchan->state == LCHAN_S_BROKEN ? " Error reason: " : "", |
| 1147 | lchan->state == LCHAN_S_BROKEN ? lchan->broken_reason : "", |
| 1148 | VTY_NEWLINE); |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 1149 | vty_out(vty, " BS Power: %u dBm, MS Power: %u dBm%s", |
| 1150 | lchan->ts->trx->nominal_power - lchan->ts->trx->max_power_red |
| 1151 | - lchan->bs_power*2, |
| 1152 | ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power), |
| 1153 | VTY_NEWLINE); |
Harald Welte | 0a8cf32 | 2015-12-05 17:22:49 +0100 | [diff] [blame] | 1154 | vty_out(vty, " Channel Mode / Codec: %s%s", |
| 1155 | get_value_string(gsm48_cmode_names, lchan->tch_mode), |
| 1156 | VTY_NEWLINE); |
Holger Hans Peter Freyther | 2412a07 | 2010-06-28 15:47:12 +0800 | [diff] [blame] | 1157 | if (lchan->conn && lchan->conn->subscr) { |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1158 | vty_out(vty, " Subscriber:%s", VTY_NEWLINE); |
Holger Hans Peter Freyther | 2412a07 | 2010-06-28 15:47:12 +0800 | [diff] [blame] | 1159 | subscr_dump_vty(vty, lchan->conn->subscr); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1160 | } else |
| 1161 | vty_out(vty, " No Subscriber%s", VTY_NEWLINE); |
Harald Welte | 2c82899 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 1162 | if (is_ipaccess_bts(lchan->ts->trx->bts)) { |
| 1163 | struct in_addr ia; |
Holger Hans Peter Freyther | 54fa799 | 2010-04-07 15:39:16 +0200 | [diff] [blame] | 1164 | ia.s_addr = htonl(lchan->abis_ip.bound_ip); |
Harald Welte | 2c82899 | 2009-12-02 01:56:49 +0530 | [diff] [blame] | 1165 | vty_out(vty, " Bound IP: %s Port %u RTP_TYPE2=%u CONN_ID=%u%s", |
| 1166 | inet_ntoa(ia), lchan->abis_ip.bound_port, |
| 1167 | lchan->abis_ip.rtp_payload2, lchan->abis_ip.conn_id, |
| 1168 | VTY_NEWLINE); |
| 1169 | } |
Harald Welte | 8387a49 | 2009-12-22 21:43:14 +0100 | [diff] [blame] | 1170 | |
| 1171 | /* we want to report the last measurement report */ |
| 1172 | idx = calc_initial_idx(ARRAY_SIZE(lchan->meas_rep), |
| 1173 | lchan->meas_rep_idx, 1); |
| 1174 | meas_rep_dump_vty(vty, &lchan->meas_rep[idx], " "); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1175 | } |
| 1176 | |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 1177 | static void lchan_dump_short_vty(struct vty *vty, struct gsm_lchan *lchan) |
| 1178 | { |
Holger Hans Peter Freyther | cf5cc5b | 2010-05-14 01:57:02 +0800 | [diff] [blame] | 1179 | struct gsm_meas_rep *mr; |
| 1180 | int idx; |
| 1181 | |
| 1182 | /* we want to report the last measurement report */ |
| 1183 | idx = calc_initial_idx(ARRAY_SIZE(lchan->meas_rep), |
| 1184 | lchan->meas_rep_idx, 1); |
| 1185 | mr = &lchan->meas_rep[idx]; |
| 1186 | |
Neels Hofmeyr | b748012 | 2016-11-02 14:28:15 +0100 | [diff] [blame] | 1187 | vty_out(vty, "BTS %u, TRX %u, Timeslot %u %s", |
Harald Welte | 85bded8 | 2010-12-24 12:22:34 +0100 | [diff] [blame] | 1188 | lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, |
Neels Hofmeyr | b748012 | 2016-11-02 14:28:15 +0100 | [diff] [blame] | 1189 | gsm_pchan_name(lchan->ts->pchan)); |
| 1190 | vty_out_dyn_ts_status(vty, lchan->ts); |
| 1191 | vty_out(vty, ", Lchan %u, Type %s, State %s - " |
| 1192 | "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d dBm%s", |
Neels Hofmeyr | efedf80 | 2016-06-14 01:31:38 +0200 | [diff] [blame] | 1193 | lchan->nr, |
| 1194 | gsm_lchant_name(lchan->type), gsm_lchans_name(lchan->state), |
| 1195 | mr->ms_l1.pwr, |
Holger Hans Peter Freyther | cf5cc5b | 2010-05-14 01:57:02 +0800 | [diff] [blame] | 1196 | rxlev2dbm(mr->dl.full.rx_lev), |
| 1197 | rxlev2dbm(mr->ul.full.rx_lev), |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 1198 | VTY_NEWLINE); |
| 1199 | } |
| 1200 | |
Holger Hans Peter Freyther | 7173f63 | 2011-12-27 16:34:12 +0100 | [diff] [blame] | 1201 | |
| 1202 | static int dump_lchan_trx_ts(struct gsm_bts_trx_ts *ts, struct vty *vty, |
| 1203 | void (*dump_cb)(struct vty *, struct gsm_lchan *)) |
| 1204 | { |
| 1205 | int lchan_nr; |
| 1206 | for (lchan_nr = 0; lchan_nr < TS_MAX_LCHAN; lchan_nr++) { |
| 1207 | struct gsm_lchan *lchan = &ts->lchan[lchan_nr]; |
| 1208 | if ((lchan->type == GSM_LCHAN_NONE) && (lchan->state == LCHAN_S_NONE)) |
| 1209 | continue; |
| 1210 | dump_cb(vty, lchan); |
| 1211 | } |
| 1212 | |
| 1213 | return CMD_SUCCESS; |
| 1214 | } |
| 1215 | |
| 1216 | static int dump_lchan_trx(struct gsm_bts_trx *trx, struct vty *vty, |
| 1217 | void (*dump_cb)(struct vty *, struct gsm_lchan *)) |
| 1218 | { |
| 1219 | int ts_nr; |
| 1220 | |
| 1221 | for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { |
| 1222 | struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; |
| 1223 | dump_lchan_trx_ts(ts, vty, dump_cb); |
| 1224 | } |
| 1225 | |
| 1226 | return CMD_SUCCESS; |
| 1227 | } |
| 1228 | |
| 1229 | static int dump_lchan_bts(struct gsm_bts *bts, struct vty *vty, |
| 1230 | void (*dump_cb)(struct vty *, struct gsm_lchan *)) |
| 1231 | { |
| 1232 | int trx_nr; |
| 1233 | |
| 1234 | for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { |
| 1235 | struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, trx_nr); |
| 1236 | dump_lchan_trx(trx, vty, dump_cb); |
| 1237 | } |
| 1238 | |
| 1239 | return CMD_SUCCESS; |
| 1240 | } |
| 1241 | |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 1242 | static int lchan_summary(struct vty *vty, int argc, const char **argv, |
| 1243 | void (*dump_cb)(struct vty *, struct gsm_lchan *)) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1244 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1245 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1246 | struct gsm_bts *bts; |
| 1247 | struct gsm_bts_trx *trx; |
| 1248 | struct gsm_bts_trx_ts *ts; |
| 1249 | struct gsm_lchan *lchan; |
| 1250 | int bts_nr, trx_nr, ts_nr, lchan_nr; |
| 1251 | |
| 1252 | if (argc >= 1) { |
| 1253 | /* use the BTS number that the user has specified */ |
| 1254 | bts_nr = atoi(argv[0]); |
| 1255 | if (bts_nr >= net->num_bts) { |
| 1256 | vty_out(vty, "%% can't find BTS %s%s", argv[0], |
| 1257 | VTY_NEWLINE); |
| 1258 | return CMD_WARNING; |
| 1259 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1260 | bts = gsm_bts_num(net, bts_nr); |
Holger Hans Peter Freyther | 7173f63 | 2011-12-27 16:34:12 +0100 | [diff] [blame] | 1261 | |
| 1262 | if (argc == 1) |
| 1263 | return dump_lchan_bts(bts, vty, dump_cb); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1264 | } |
| 1265 | if (argc >= 2) { |
| 1266 | trx_nr = atoi(argv[1]); |
| 1267 | if (trx_nr >= bts->num_trx) { |
| 1268 | vty_out(vty, "%% can't find TRX %s%s", argv[1], |
| 1269 | VTY_NEWLINE); |
| 1270 | return CMD_WARNING; |
| 1271 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1272 | trx = gsm_bts_trx_num(bts, trx_nr); |
Holger Hans Peter Freyther | 7173f63 | 2011-12-27 16:34:12 +0100 | [diff] [blame] | 1273 | |
| 1274 | if (argc == 2) |
| 1275 | return dump_lchan_trx(trx, vty, dump_cb); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1276 | } |
| 1277 | if (argc >= 3) { |
| 1278 | ts_nr = atoi(argv[2]); |
| 1279 | if (ts_nr >= TRX_NR_TS) { |
| 1280 | vty_out(vty, "%% can't find TS %s%s", argv[2], |
| 1281 | VTY_NEWLINE); |
| 1282 | return CMD_WARNING; |
| 1283 | } |
| 1284 | ts = &trx->ts[ts_nr]; |
Holger Hans Peter Freyther | 7173f63 | 2011-12-27 16:34:12 +0100 | [diff] [blame] | 1285 | |
| 1286 | if (argc == 3) |
| 1287 | return dump_lchan_trx_ts(ts, vty, dump_cb); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1288 | } |
| 1289 | if (argc >= 4) { |
| 1290 | lchan_nr = atoi(argv[3]); |
| 1291 | if (lchan_nr >= TS_MAX_LCHAN) { |
| 1292 | vty_out(vty, "%% can't find LCHAN %s%s", argv[3], |
| 1293 | VTY_NEWLINE); |
| 1294 | return CMD_WARNING; |
| 1295 | } |
| 1296 | lchan = &ts->lchan[lchan_nr]; |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 1297 | dump_cb(vty, lchan); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1298 | return CMD_SUCCESS; |
| 1299 | } |
Holger Hans Peter Freyther | 7173f63 | 2011-12-27 16:34:12 +0100 | [diff] [blame] | 1300 | |
| 1301 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1302 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1303 | bts = gsm_bts_num(net, bts_nr); |
Holger Hans Peter Freyther | 7173f63 | 2011-12-27 16:34:12 +0100 | [diff] [blame] | 1304 | dump_lchan_bts(bts, vty, dump_cb); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 1305 | } |
| 1306 | |
| 1307 | return CMD_SUCCESS; |
| 1308 | } |
| 1309 | |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 1310 | |
| 1311 | DEFUN(show_lchan, |
| 1312 | show_lchan_cmd, |
Sylvain Munaut | 39c31de | 2012-12-28 12:15:11 +0100 | [diff] [blame] | 1313 | "show lchan [<0-255>] [<0-255>] [<0-7>] [lchan_nr]", |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 1314 | SHOW_STR "Display information about a logical channel\n" |
| 1315 | "BTS Number\n" "TRX Number\n" "Timeslot Number\n" |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1316 | LCHAN_NR_STR) |
Holger Hans Peter Freyther | 029235e | 2010-05-14 02:03:16 +0800 | [diff] [blame] | 1317 | |
| 1318 | { |
| 1319 | return lchan_summary(vty, argc, argv, lchan_dump_full_vty); |
| 1320 | } |
| 1321 | |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 1322 | DEFUN(show_lchan_summary, |
| 1323 | show_lchan_summary_cmd, |
Sylvain Munaut | 39c31de | 2012-12-28 12:15:11 +0100 | [diff] [blame] | 1324 | "show lchan summary [<0-255>] [<0-255>] [<0-7>] [lchan_nr]", |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 1325 | SHOW_STR "Display information about a logical channel\n" |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1326 | "Short summary\n" |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 1327 | "BTS Number\n" "TRX Number\n" "Timeslot Number\n" |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1328 | LCHAN_NR_STR) |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 1329 | { |
| 1330 | return lchan_summary(vty, argc, argv, lchan_dump_short_vty); |
| 1331 | } |
| 1332 | |
Harald Welte | be4b730 | 2009-05-23 16:59:33 +0000 | [diff] [blame] | 1333 | 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] | 1334 | { |
| 1335 | vty_out(vty, "Paging on BTS %u%s", pag->bts->nr, VTY_NEWLINE); |
Neels Hofmeyr | 6d804b1 | 2017-02-18 22:20:46 +0100 | [diff] [blame] | 1336 | bsc_subscr_dump_vty(vty, pag->bsub); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 1337 | } |
| 1338 | |
Harald Welte | be4b730 | 2009-05-23 16:59:33 +0000 | [diff] [blame] | 1339 | 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] | 1340 | { |
| 1341 | struct gsm_paging_request *pag; |
| 1342 | |
Holger Hans Peter Freyther | 9b5192b | 2013-03-03 11:03:17 +0100 | [diff] [blame] | 1343 | if (!bts->paging.bts) |
| 1344 | return; |
| 1345 | |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 1346 | llist_for_each_entry(pag, &bts->paging.pending_requests, entry) |
| 1347 | paging_dump_vty(vty, pag); |
| 1348 | } |
| 1349 | |
| 1350 | DEFUN(show_paging, |
| 1351 | show_paging_cmd, |
Sylvain Munaut | 39c31de | 2012-12-28 12:15:11 +0100 | [diff] [blame] | 1352 | "show paging [<0-255>]", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1353 | SHOW_STR "Display information about paging reuqests of a BTS\n" |
| 1354 | "BTS Number\n") |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 1355 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1356 | struct gsm_network *net = gsmnet_from_vty(vty); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 1357 | struct gsm_bts *bts; |
| 1358 | int bts_nr; |
| 1359 | |
| 1360 | if (argc >= 1) { |
| 1361 | /* use the BTS number that the user has specified */ |
| 1362 | bts_nr = atoi(argv[0]); |
| 1363 | if (bts_nr >= net->num_bts) { |
| 1364 | vty_out(vty, "%% can't find BTS %s%s", argv[0], |
| 1365 | VTY_NEWLINE); |
| 1366 | return CMD_WARNING; |
| 1367 | } |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1368 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 1369 | bts_paging_dump_vty(vty, bts); |
| 1370 | |
| 1371 | return CMD_SUCCESS; |
| 1372 | } |
| 1373 | for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1374 | bts = gsm_bts_num(net, bts_nr); |
Harald Welte | f5025b6 | 2009-03-28 16:55:11 +0000 | [diff] [blame] | 1375 | bts_paging_dump_vty(vty, bts); |
| 1376 | } |
| 1377 | |
| 1378 | return CMD_SUCCESS; |
| 1379 | } |
| 1380 | |
Holger Hans Peter Freyther | ec37bb2 | 2013-02-05 09:39:09 +0100 | [diff] [blame] | 1381 | DEFUN(show_paging_group, |
| 1382 | show_paging_group_cmd, |
| 1383 | "show paging-group <0-255> IMSI", |
| 1384 | SHOW_STR "Display the paging group\n" |
| 1385 | "BTS Number\n" "IMSI\n") |
| 1386 | { |
| 1387 | struct gsm_network *net = gsmnet_from_vty(vty); |
| 1388 | struct gsm_bts *bts; |
| 1389 | unsigned int page_group; |
| 1390 | int bts_nr = atoi(argv[0]); |
| 1391 | |
| 1392 | if (bts_nr >= net->num_bts) { |
| 1393 | vty_out(vty, "%% can't find BTS %s%s", argv[0], VTY_NEWLINE); |
| 1394 | return CMD_WARNING; |
| 1395 | } |
| 1396 | |
| 1397 | bts = gsm_bts_num(net, bts_nr); |
| 1398 | if (!bts) { |
| 1399 | vty_out(vty, "%% can't find BTS %s%s", argv[0], VTY_NEWLINE); |
| 1400 | return CMD_WARNING; |
| 1401 | } |
| 1402 | |
| 1403 | page_group = gsm0502_calc_paging_group(&bts->si_common.chan_desc, |
| 1404 | str_to_imsi(argv[1])); |
| 1405 | vty_out(vty, "%%Paging group for IMSI %" PRIu64 " on BTS #%d is %u%s", |
| 1406 | str_to_imsi(argv[1]), bts->nr, |
| 1407 | page_group, VTY_NEWLINE); |
| 1408 | return CMD_SUCCESS; |
| 1409 | } |
| 1410 | |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 1411 | DEFUN(cfg_net_neci, |
| 1412 | cfg_net_neci_cmd, |
| 1413 | "neci (0|1)", |
Harald Welte | 2832606 | 2010-05-14 20:05:17 +0200 | [diff] [blame] | 1414 | "New Establish Cause Indication\n" |
| 1415 | "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] | 1416 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1417 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
| 1418 | |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 1419 | gsmnet->neci = atoi(argv[0]); |
Holger Hans Peter Freyther | 7889107 | 2010-09-06 09:36:02 +0800 | [diff] [blame] | 1420 | gsm_net_update_ctype(gsmnet); |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 1421 | return CMD_SUCCESS; |
| 1422 | } |
| 1423 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1424 | #define HANDOVER_STR "Handover Options\n" |
| 1425 | |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1426 | DEFUN(cfg_net_handover, cfg_net_handover_cmd, |
| 1427 | "handover (0|1)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1428 | HANDOVER_STR |
| 1429 | "Don't perform in-call handover\n" |
| 1430 | "Perform in-call handover\n") |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1431 | { |
Holger Hans Peter Freyther | cbcfe24 | 2010-01-07 16:14:38 +0100 | [diff] [blame] | 1432 | int enable = atoi(argv[0]); |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1433 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Holger Hans Peter Freyther | cbcfe24 | 2010-01-07 16:14:38 +0100 | [diff] [blame] | 1434 | |
| 1435 | if (enable && ipacc_rtp_direct) { |
Harald Welte | fe03f0d | 2009-12-20 13:51:01 +0100 | [diff] [blame] | 1436 | vty_out(vty, "%% Cannot enable handover unless RTP Proxy mode " |
| 1437 | "is enabled by using the -P command line option%s", |
| 1438 | VTY_NEWLINE); |
| 1439 | return CMD_WARNING; |
| 1440 | } |
Holger Hans Peter Freyther | cbcfe24 | 2010-01-07 16:14:38 +0100 | [diff] [blame] | 1441 | gsmnet->handover.active = enable; |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1442 | |
| 1443 | return CMD_SUCCESS; |
| 1444 | } |
| 1445 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1446 | #define HO_WIN_STR HANDOVER_STR "Measurement Window\n" |
| 1447 | #define HO_WIN_RXLEV_STR HO_WIN_STR "Received Level Averaging\n" |
| 1448 | #define HO_WIN_RXQUAL_STR HO_WIN_STR "Received Quality Averaging\n" |
| 1449 | #define HO_PBUDGET_STR HANDOVER_STR "Power Budget\n" |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1450 | #define HO_AVG_COUNT_STR "Amount to use for Averaging\n" |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1451 | |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1452 | DEFUN(cfg_net_ho_win_rxlev_avg, cfg_net_ho_win_rxlev_avg_cmd, |
| 1453 | "handover window rxlev averaging <1-10>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1454 | HO_WIN_RXLEV_STR |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1455 | "How many RxLev measurements are used for averaging\n" |
| 1456 | HO_AVG_COUNT_STR) |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1457 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1458 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1459 | gsmnet->handover.win_rxlev_avg = atoi(argv[0]); |
| 1460 | return CMD_SUCCESS; |
| 1461 | } |
| 1462 | |
| 1463 | DEFUN(cfg_net_ho_win_rxqual_avg, cfg_net_ho_win_rxqual_avg_cmd, |
| 1464 | "handover window rxqual averaging <1-10>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1465 | HO_WIN_RXQUAL_STR |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1466 | "How many RxQual measurements are used for averaging\n" |
| 1467 | HO_AVG_COUNT_STR) |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1468 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1469 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1470 | gsmnet->handover.win_rxqual_avg = atoi(argv[0]); |
| 1471 | return CMD_SUCCESS; |
| 1472 | } |
| 1473 | |
| 1474 | DEFUN(cfg_net_ho_win_rxlev_neigh_avg, cfg_net_ho_win_rxlev_avg_neigh_cmd, |
| 1475 | "handover window rxlev neighbor averaging <1-10>", |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1476 | HO_WIN_RXLEV_STR "Neighbor\n" |
| 1477 | "How many RxQual measurements are used for averaging\n" |
| 1478 | HO_AVG_COUNT_STR) |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1479 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1480 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1481 | gsmnet->handover.win_rxlev_avg_neigh = atoi(argv[0]); |
| 1482 | return CMD_SUCCESS; |
| 1483 | } |
| 1484 | |
| 1485 | DEFUN(cfg_net_ho_pwr_interval, cfg_net_ho_pwr_interval_cmd, |
| 1486 | "handover power budget interval <1-99>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1487 | HO_PBUDGET_STR |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1488 | "How often to check if we have a better cell (SACCH frames)\n" |
| 1489 | "Interval\n" "Number\n") |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1490 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1491 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1492 | gsmnet->handover.pwr_interval = atoi(argv[0]); |
| 1493 | return CMD_SUCCESS; |
| 1494 | } |
| 1495 | |
| 1496 | DEFUN(cfg_net_ho_pwr_hysteresis, cfg_net_ho_pwr_hysteresis_cmd, |
| 1497 | "handover power budget hysteresis <0-999>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1498 | HO_PBUDGET_STR |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1499 | "How many dB does a neighbor to be stronger to become a HO candidate\n" |
| 1500 | "Hysteresis\n" "Number\n") |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1501 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1502 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1503 | gsmnet->handover.pwr_hysteresis = atoi(argv[0]); |
| 1504 | return CMD_SUCCESS; |
| 1505 | } |
| 1506 | |
| 1507 | DEFUN(cfg_net_ho_max_distance, cfg_net_ho_max_distance_cmd, |
| 1508 | "handover maximum distance <0-9999>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1509 | HANDOVER_STR |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1510 | "How big is the maximum timing advance before HO is forced\n" |
| 1511 | "Distance\n" "Number\n") |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1512 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1513 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 1514 | gsmnet->handover.max_distance = atoi(argv[0]); |
| 1515 | return CMD_SUCCESS; |
| 1516 | } |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 1517 | |
Holger Hans Peter Freyther | 76fc4a3 | 2010-09-06 09:41:50 +0800 | [diff] [blame] | 1518 | DEFUN(cfg_net_pag_any_tch, |
| 1519 | cfg_net_pag_any_tch_cmd, |
| 1520 | "paging any use tch (0|1)", |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1521 | "Assign a TCH when receiving a Paging Any request\n" |
| 1522 | "Any Channel\n" "Use\n" "TCH\n" |
| 1523 | "Do not use TCH for Paging Request Any\n" |
| 1524 | "Do use TCH for Paging Request Any\n") |
Holger Hans Peter Freyther | 76fc4a3 | 2010-09-06 09:41:50 +0800 | [diff] [blame] | 1525 | { |
Holger Hans Peter Freyther | b0e88b8 | 2010-09-06 10:09:19 +0800 | [diff] [blame] | 1526 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Holger Hans Peter Freyther | 76fc4a3 | 2010-09-06 09:41:50 +0800 | [diff] [blame] | 1527 | gsmnet->pag_any_tch = atoi(argv[0]); |
| 1528 | gsm_net_update_ctype(gsmnet); |
| 1529 | return CMD_SUCCESS; |
| 1530 | } |
| 1531 | |
Holger Hans Peter Freyther | c802106 | 2009-12-22 08:27:21 +0100 | [diff] [blame] | 1532 | #define DECLARE_TIMER(number, doc) \ |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1533 | DEFUN(cfg_net_T##number, \ |
| 1534 | cfg_net_T##number##_cmd, \ |
| 1535 | "timer t" #number " <0-65535>", \ |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1536 | "Configure GSM Timers\n" \ |
Holger Hans Peter Freyther | 5dd295f | 2014-04-11 19:30:27 +0200 | [diff] [blame] | 1537 | doc "Timer Value in seconds\n") \ |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1538 | { \ |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1539 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1540 | int value = atoi(argv[0]); \ |
| 1541 | \ |
| 1542 | if (value < 0 || value > 65535) { \ |
| 1543 | vty_out(vty, "Timer value %s out of range.%s", \ |
| 1544 | argv[0], VTY_NEWLINE); \ |
| 1545 | return CMD_WARNING; \ |
| 1546 | } \ |
| 1547 | \ |
| 1548 | gsmnet->T##number = value; \ |
| 1549 | return CMD_SUCCESS; \ |
| 1550 | } |
| 1551 | |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1552 | DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT.\n") |
| 1553 | DECLARE_TIMER(3103, "Set the timeout value for HANDOVER.\n") |
Harald Welte | 67161f2 | 2012-06-03 13:01:47 +0200 | [diff] [blame] | 1554 | DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION.\n") |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1555 | DECLARE_TIMER(3107, "Currently not used.\n") |
Holger Hans Peter Freyther | b348939 | 2011-12-28 16:21:05 +0100 | [diff] [blame] | 1556 | DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout.\n") |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1557 | DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel.\n") |
| 1558 | DECLARE_TIMER(3113, "Set the time to try paging a subscriber.\n") |
| 1559 | DECLARE_TIMER(3115, "Currently not used.\n") |
| 1560 | DECLARE_TIMER(3117, "Currently not used.\n") |
| 1561 | DECLARE_TIMER(3119, "Currently not used.\n") |
| 1562 | DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT\n") |
| 1563 | DECLARE_TIMER(3141, "Currently not used.\n") |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1564 | |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 1565 | DEFUN_DEPRECATED(cfg_net_dtx, |
| 1566 | cfg_net_dtx_cmd, |
| 1567 | "dtx-used (0|1)", |
| 1568 | ".HIDDEN\n""Obsolete\n""Obsolete\n") |
Holger Hans Peter Freyther | 5a3a61d | 2010-09-06 09:25:48 +0800 | [diff] [blame] | 1569 | { |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 1570 | vty_out(vty, "%% 'dtx-used' is now deprecated: use dtx * " |
| 1571 | "configuration options of BTS instead%s", VTY_NEWLINE); |
| 1572 | return CMD_SUCCESS; |
Holger Hans Peter Freyther | 5a3a61d | 2010-09-06 09:25:48 +0800 | [diff] [blame] | 1573 | } |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 1574 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1575 | /* per-BTS configuration */ |
| 1576 | DEFUN(cfg_bts, |
| 1577 | cfg_bts_cmd, |
Harald Welte | 57e0724 | 2012-08-17 12:50:14 +0200 | [diff] [blame] | 1578 | "bts <0-255>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1579 | "Select a BTS to configure\n" |
| 1580 | "BTS Number\n") |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1581 | { |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 1582 | struct gsm_network *gsmnet = gsmnet_from_vty(vty); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1583 | int bts_nr = atoi(argv[0]); |
| 1584 | struct gsm_bts *bts; |
| 1585 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1586 | if (bts_nr > gsmnet->num_bts) { |
| 1587 | vty_out(vty, "%% The next unused BTS number is %u%s", |
| 1588 | gsmnet->num_bts, VTY_NEWLINE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1589 | return CMD_WARNING; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1590 | } else if (bts_nr == gsmnet->num_bts) { |
| 1591 | /* allocate a new one */ |
Harald Welte | 3300c01 | 2011-06-05 13:31:33 +0200 | [diff] [blame] | 1592 | bts = gsm_bts_alloc_register(gsmnet, GSM_BTS_TYPE_UNKNOWN, |
Harald Welte | a2bbc5e | 2015-11-20 10:43:31 +0100 | [diff] [blame] | 1593 | HARDCODED_BSIC); |
Holger Hans Peter Freyther | acf8a0c | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 1594 | } else |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1595 | bts = gsm_bts_num(gsmnet, bts_nr); |
| 1596 | |
Daniel Willmann | f15c276 | 2010-01-11 13:43:07 +0100 | [diff] [blame] | 1597 | if (!bts) { |
| 1598 | vty_out(vty, "%% Unable to allocate BTS %u%s", |
| 1599 | gsmnet->num_bts, VTY_NEWLINE); |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 1600 | return CMD_WARNING; |
Daniel Willmann | f15c276 | 2010-01-11 13:43:07 +0100 | [diff] [blame] | 1601 | } |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1602 | |
| 1603 | vty->index = bts; |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 1604 | vty->index_sub = &bts->description; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1605 | vty->node = BTS_NODE; |
| 1606 | |
| 1607 | return CMD_SUCCESS; |
| 1608 | } |
| 1609 | |
| 1610 | DEFUN(cfg_bts_type, |
| 1611 | cfg_bts_type_cmd, |
Harald Welte | e555c2b | 2012-08-17 13:02:12 +0200 | [diff] [blame] | 1612 | "type TYPE", /* dynamically created */ |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1613 | "Set the BTS type\n" "Type\n") |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1614 | { |
| 1615 | struct gsm_bts *bts = vty->index; |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 1616 | int rc; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1617 | |
Harald Welte | 39315c4 | 2010-01-10 18:01:52 +0100 | [diff] [blame] | 1618 | rc = gsm_set_bts_type(bts, parse_btstype(argv[0])); |
| 1619 | if (rc < 0) |
| 1620 | return CMD_WARNING; |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1621 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1622 | return CMD_SUCCESS; |
| 1623 | } |
| 1624 | |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1625 | DEFUN(cfg_bts_band, |
| 1626 | cfg_bts_band_cmd, |
| 1627 | "band BAND", |
Holger Hans Peter Freyther | 0854256 | 2011-10-03 23:42:06 +0200 | [diff] [blame] | 1628 | "Set the frequency band of this BTS\n" "Frequency band\n") |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1629 | { |
| 1630 | struct gsm_bts *bts = vty->index; |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1631 | int band = gsm_band_parse(argv[0]); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 1632 | |
| 1633 | if (band < 0) { |
| 1634 | vty_out(vty, "%% BAND %d is not a valid GSM band%s", |
| 1635 | band, VTY_NEWLINE); |
| 1636 | return CMD_WARNING; |
| 1637 | } |
| 1638 | |
| 1639 | bts->band = band; |
| 1640 | |
| 1641 | return CMD_SUCCESS; |
| 1642 | } |
| 1643 | |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 1644 | DEFUN(cfg_bts_dtxu, cfg_bts_dtxu_cmd, "dtx uplink [force]", |
| 1645 | "Configure discontinuous transmission\n" |
| 1646 | "Enable Uplink DTX for this BTS\n" |
| 1647 | "MS 'shall' use DTXu instead of 'may' use (might not be supported by " |
| 1648 | "older phones).\n") |
| 1649 | { |
| 1650 | struct gsm_bts *bts = vty->index; |
| 1651 | |
| 1652 | bts->dtxu = (argc > 0) ? GSM48_DTX_SHALL_BE_USED : GSM48_DTX_MAY_BE_USED; |
Max | 6079528 | 2016-06-06 11:30:57 +0200 | [diff] [blame] | 1653 | if (!is_ipaccess_bts(bts)) |
| 1654 | vty_out(vty, "%% DTX enabled on non-IP BTS: this configuration " |
| 1655 | "neither supported nor tested!%s", VTY_NEWLINE); |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 1656 | return CMD_SUCCESS; |
| 1657 | } |
| 1658 | |
| 1659 | DEFUN(cfg_bts_no_dtxu, cfg_bts_no_dtxu_cmd, "no dtx uplink", |
| 1660 | NO_STR |
| 1661 | "Configure discontinuous transmission\n" |
| 1662 | "Disable Uplink DTX for this BTS\n") |
| 1663 | { |
| 1664 | struct gsm_bts *bts = vty->index; |
| 1665 | |
| 1666 | bts->dtxu = GSM48_DTX_SHALL_NOT_BE_USED; |
| 1667 | |
| 1668 | return CMD_SUCCESS; |
| 1669 | } |
| 1670 | |
| 1671 | DEFUN(cfg_bts_dtxd, cfg_bts_dtxd_cmd, "dtx downlink", |
| 1672 | "Configure discontinuous transmission\n" |
| 1673 | "Enable Downlink DTX for this BTS\n") |
| 1674 | { |
| 1675 | struct gsm_bts *bts = vty->index; |
| 1676 | |
| 1677 | bts->dtxd = true; |
Max | 6079528 | 2016-06-06 11:30:57 +0200 | [diff] [blame] | 1678 | if (!is_ipaccess_bts(bts)) |
| 1679 | vty_out(vty, "%% DTX enabled on non-IP BTS: this configuration " |
| 1680 | "neither supported nor tested!%s", VTY_NEWLINE); |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 1681 | return CMD_SUCCESS; |
| 1682 | } |
| 1683 | |
| 1684 | DEFUN(cfg_bts_no_dtxd, cfg_bts_no_dtxd_cmd, "no dtx downlink", |
| 1685 | NO_STR |
| 1686 | "Configure discontinuous transmission\n" |
| 1687 | "Disable Downlink DTX for this BTS\n") |
| 1688 | { |
| 1689 | struct gsm_bts *bts = vty->index; |
| 1690 | |
| 1691 | bts->dtxd = false; |
| 1692 | |
| 1693 | return CMD_SUCCESS; |
| 1694 | } |
| 1695 | |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 1696 | DEFUN(cfg_bts_ci, |
| 1697 | cfg_bts_ci_cmd, |
| 1698 | "cell_identity <0-65535>", |
Holger Hans Peter Freyther | 64c17fa | 2012-07-21 00:27:10 +0200 | [diff] [blame] | 1699 | "Set the Cell identity of this BTS\n" "Cell Identity\n") |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 1700 | { |
| 1701 | struct gsm_bts *bts = vty->index; |
| 1702 | int ci = atoi(argv[0]); |
| 1703 | |
| 1704 | if (ci < 0 || ci > 0xffff) { |
| 1705 | vty_out(vty, "%% CI %d is not in the valid range (0-65535)%s", |
| 1706 | ci, VTY_NEWLINE); |
| 1707 | return CMD_WARNING; |
| 1708 | } |
| 1709 | bts->cell_identity = ci; |
| 1710 | |
| 1711 | return CMD_SUCCESS; |
| 1712 | } |
| 1713 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1714 | DEFUN(cfg_bts_lac, |
| 1715 | cfg_bts_lac_cmd, |
Holger Hans Peter Freyther | 0b7f4b3 | 2009-09-29 14:02:33 +0200 | [diff] [blame] | 1716 | "location_area_code <0-65535>", |
Holger Hans Peter Freyther | 64c17fa | 2012-07-21 00:27:10 +0200 | [diff] [blame] | 1717 | "Set the Location Area Code (LAC) of this BTS\n" "LAC\n") |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1718 | { |
| 1719 | struct gsm_bts *bts = vty->index; |
| 1720 | int lac = atoi(argv[0]); |
| 1721 | |
Holger Hans Peter Freyther | 0b7f4b3 | 2009-09-29 14:02:33 +0200 | [diff] [blame] | 1722 | if (lac < 0 || lac > 0xffff) { |
| 1723 | 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] | 1724 | lac, VTY_NEWLINE); |
| 1725 | return CMD_WARNING; |
| 1726 | } |
Holger Hans Peter Freyther | e48b956 | 2009-10-01 04:07:15 +0200 | [diff] [blame] | 1727 | |
| 1728 | if (lac == GSM_LAC_RESERVED_DETACHED || lac == GSM_LAC_RESERVED_ALL_BTS) { |
| 1729 | vty_out(vty, "%% LAC %d is reserved by GSM 04.08%s", |
| 1730 | lac, VTY_NEWLINE); |
| 1731 | return CMD_WARNING; |
| 1732 | } |
| 1733 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1734 | bts->location_area_code = lac; |
| 1735 | |
| 1736 | return CMD_SUCCESS; |
| 1737 | } |
| 1738 | |
Harald Welte | a43f789 | 2009-12-01 18:04:30 +0530 | [diff] [blame] | 1739 | |
Harald Welte | a2bbc5e | 2015-11-20 10:43:31 +0100 | [diff] [blame] | 1740 | /* compatibility wrapper for old config files */ |
| 1741 | DEFUN_HIDDEN(cfg_bts_tsc, |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1742 | cfg_bts_tsc_cmd, |
Harald Welte | c513ded | 2012-05-31 10:57:08 +0200 | [diff] [blame] | 1743 | "training_sequence_code <0-7>", |
Holger Hans Peter Freyther | 64c17fa | 2012-07-21 00:27:10 +0200 | [diff] [blame] | 1744 | "Set the Training Sequence Code (TSC) of this BTS\n" "TSC\n") |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1745 | { |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 1746 | return CMD_SUCCESS; |
| 1747 | } |
| 1748 | |
Harald Welte | 78f2f50 | 2009-05-23 16:56:52 +0000 | [diff] [blame] | 1749 | DEFUN(cfg_bts_bsic, |
| 1750 | cfg_bts_bsic_cmd, |
| 1751 | "base_station_id_code <0-63>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1752 | "Set the Base Station Identity Code (BSIC) of this BTS\n" |
| 1753 | "BSIC of this BTS\n") |
Harald Welte | 78f2f50 | 2009-05-23 16:56:52 +0000 | [diff] [blame] | 1754 | { |
| 1755 | struct gsm_bts *bts = vty->index; |
| 1756 | int bsic = atoi(argv[0]); |
| 1757 | |
| 1758 | if (bsic < 0 || bsic > 0x3f) { |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1759 | 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] | 1760 | bsic, VTY_NEWLINE); |
| 1761 | return CMD_WARNING; |
| 1762 | } |
| 1763 | bts->bsic = bsic; |
| 1764 | |
| 1765 | return CMD_SUCCESS; |
| 1766 | } |
| 1767 | |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1768 | DEFUN(cfg_bts_unit_id, |
| 1769 | cfg_bts_unit_id_cmd, |
Harald Welte | 07dc73d | 2009-08-07 13:27:09 +0200 | [diff] [blame] | 1770 | "ip.access unit_id <0-65534> <0-255>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1771 | "Abis/IP specific options\n" |
| 1772 | "Set the IPA BTS Unit ID\n" |
| 1773 | "Unit ID (Site)\n" |
| 1774 | "Unit ID (BTS)\n") |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1775 | { |
| 1776 | struct gsm_bts *bts = vty->index; |
| 1777 | int site_id = atoi(argv[0]); |
| 1778 | int bts_id = atoi(argv[1]); |
| 1779 | |
Harald Welte | 07dc73d | 2009-08-07 13:27:09 +0200 | [diff] [blame] | 1780 | if (!is_ipaccess_bts(bts)) { |
| 1781 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1782 | return CMD_WARNING; |
| 1783 | } |
| 1784 | |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 1785 | bts->ip_access.site_id = site_id; |
| 1786 | bts->ip_access.bts_id = bts_id; |
| 1787 | |
| 1788 | return CMD_SUCCESS; |
| 1789 | } |
| 1790 | |
Harald Welte | 8b29180 | 2013-03-12 13:57:05 +0100 | [diff] [blame] | 1791 | DEFUN(cfg_bts_rsl_ip, |
| 1792 | cfg_bts_rsl_ip_cmd, |
| 1793 | "ip.access rsl-ip A.B.C.D", |
| 1794 | "Abis/IP specific options\n" |
| 1795 | "Set the IPA RSL IP Address of the BSC\n" |
| 1796 | "Destination IP address for RSL connection\n") |
| 1797 | { |
| 1798 | struct gsm_bts *bts = vty->index; |
| 1799 | struct in_addr ia; |
| 1800 | |
| 1801 | if (!is_ipaccess_bts(bts)) { |
| 1802 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1803 | return CMD_WARNING; |
| 1804 | } |
| 1805 | |
| 1806 | inet_aton(argv[0], &ia); |
| 1807 | bts->ip_access.rsl_ip = ntohl(ia.s_addr); |
| 1808 | |
| 1809 | return CMD_SUCCESS; |
| 1810 | } |
| 1811 | |
Andreas Eversberg | 7d8fa34 | 2013-12-05 13:25:06 +0100 | [diff] [blame] | 1812 | #define NOKIA_STR "Nokia *Site related commands\n" |
Harald Welte | 8b29180 | 2013-03-12 13:57:05 +0100 | [diff] [blame] | 1813 | |
Sylvain Munaut | c951946 | 2011-10-17 14:04:55 +0200 | [diff] [blame] | 1814 | DEFUN(cfg_bts_nokia_site_skip_reset, |
| 1815 | cfg_bts_nokia_site_skip_reset_cmd, |
| 1816 | "nokia_site skip-reset (0|1)", |
Andreas Eversberg | 7d8fa34 | 2013-12-05 13:25:06 +0100 | [diff] [blame] | 1817 | NOKIA_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1818 | "Skip the reset step during bootstrap process of this BTS\n" |
| 1819 | "Do NOT skip the reset\n" "Skip the reset\n") |
Sylvain Munaut | c951946 | 2011-10-17 14:04:55 +0200 | [diff] [blame] | 1820 | { |
| 1821 | struct gsm_bts *bts = vty->index; |
| 1822 | |
| 1823 | if (bts->type != GSM_BTS_TYPE_NOKIA_SITE) { |
| 1824 | vty_out(vty, "%% BTS is not of Nokia *Site type%s", VTY_NEWLINE); |
| 1825 | return CMD_WARNING; |
| 1826 | } |
| 1827 | |
| 1828 | bts->nokia.skip_reset = atoi(argv[0]); |
| 1829 | |
| 1830 | return CMD_SUCCESS; |
| 1831 | } |
| 1832 | |
Andreas Eversberg | 7d8fa34 | 2013-12-05 13:25:06 +0100 | [diff] [blame] | 1833 | DEFUN(cfg_bts_nokia_site_no_loc_rel_cnf, |
| 1834 | cfg_bts_nokia_site_no_loc_rel_cnf_cmd, |
| 1835 | "nokia_site no-local-rel-conf (0|1)", |
| 1836 | NOKIA_STR |
| 1837 | "Do not wait for RELease CONFirm message when releasing channel locally\n" |
| 1838 | "Wait for RELease CONFirm\n" "Do not wait for RELease CONFirm\n") |
| 1839 | { |
| 1840 | struct gsm_bts *bts = vty->index; |
| 1841 | |
| 1842 | if (!is_nokia_bts(bts)) { |
| 1843 | vty_out(vty, "%% BTS is not of Nokia *Site type%s", |
| 1844 | VTY_NEWLINE); |
| 1845 | return CMD_WARNING; |
| 1846 | } |
| 1847 | |
| 1848 | bts->nokia.no_loc_rel_cnf = atoi(argv[0]); |
| 1849 | |
| 1850 | return CMD_SUCCESS; |
| 1851 | } |
| 1852 | |
Sipos Csaba | 56e1766 | 2015-02-07 13:27:36 +0100 | [diff] [blame] | 1853 | DEFUN(cfg_bts_nokia_site_bts_reset_timer_cnf, |
| 1854 | cfg_bts_nokia_site_bts_reset_timer_cnf_cmd, |
| 1855 | "nokia_site bts-reset-timer <15-100>", |
| 1856 | NOKIA_STR |
| 1857 | "The amount of time (in sec.) between BTS_RESET is sent,\n" |
| 1858 | "and the BTS is being bootstrapped.\n") |
| 1859 | { |
| 1860 | struct gsm_bts *bts = vty->index; |
| 1861 | |
| 1862 | if (!is_nokia_bts(bts)) { |
| 1863 | vty_out(vty, "%% BTS is not of Nokia *Site type%s", |
| 1864 | VTY_NEWLINE); |
| 1865 | return CMD_WARNING; |
| 1866 | } |
| 1867 | |
| 1868 | bts->nokia.bts_reset_timer_cnf = atoi(argv[0]); |
| 1869 | |
| 1870 | return CMD_SUCCESS; |
| 1871 | } |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1872 | #define OML_STR "Organization & Maintenance Link\n" |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1873 | #define IPA_STR "A-bis/IP Specific Options\n" |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1874 | |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1875 | DEFUN(cfg_bts_stream_id, |
| 1876 | cfg_bts_stream_id_cmd, |
Pablo Neira Ayuso | ed5cacb | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 1877 | "oml ip.access stream_id <0-255> line E1_LINE", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1878 | OML_STR IPA_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1879 | "Set the ip.access Stream ID of the OML link of this BTS\n" |
| 1880 | "Stream Identifier\n" "Virtual E1 Line Number\n" "Virtual E1 Line Number\n") |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1881 | { |
| 1882 | struct gsm_bts *bts = vty->index; |
Pablo Neira Ayuso | ed5cacb | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 1883 | int stream_id = atoi(argv[0]), linenr = atoi(argv[1]); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1884 | |
| 1885 | if (!is_ipaccess_bts(bts)) { |
| 1886 | vty_out(vty, "%% BTS is not of ip.access type%s", VTY_NEWLINE); |
| 1887 | return CMD_WARNING; |
| 1888 | } |
| 1889 | |
| 1890 | bts->oml_tei = stream_id; |
Pablo Neira Ayuso | ed5cacb | 2011-08-17 22:44:07 +0200 | [diff] [blame] | 1891 | /* This is used by e1inp_bind_ops callback for each BTS model. */ |
| 1892 | bts->oml_e1_link.e1_nr = linenr; |
| 1893 | |
| 1894 | return CMD_SUCCESS; |
| 1895 | } |
| 1896 | |
Harald Welte | d13e0cd | 2012-08-17 09:52:03 +0200 | [diff] [blame] | 1897 | #define OML_E1_STR OML_STR "OML E1/T1 Configuration\n" |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 1898 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1899 | DEFUN(cfg_bts_oml_e1, |
| 1900 | cfg_bts_oml_e1_cmd, |
| 1901 | "oml e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
Harald Welte | d13e0cd | 2012-08-17 09:52:03 +0200 | [diff] [blame] | 1902 | OML_E1_STR |
| 1903 | "E1/T1 line number to be used for OML\n" |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1904 | "E1/T1 line number to be used for OML\n" |
| 1905 | "E1/T1 timeslot to be used for OML\n" |
| 1906 | "E1/T1 timeslot to be used for OML\n" |
| 1907 | "E1/T1 sub-slot to be used for OML\n" |
| 1908 | "Use E1/T1 sub-slot 0\n" |
| 1909 | "Use E1/T1 sub-slot 1\n" |
| 1910 | "Use E1/T1 sub-slot 2\n" |
| 1911 | "Use E1/T1 sub-slot 3\n" |
| 1912 | "Use full E1 slot 3\n" |
| 1913 | ) |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1914 | { |
| 1915 | struct gsm_bts *bts = vty->index; |
| 1916 | |
| 1917 | parse_e1_link(&bts->oml_e1_link, argv[0], argv[1], argv[2]); |
| 1918 | |
| 1919 | return CMD_SUCCESS; |
| 1920 | } |
| 1921 | |
| 1922 | |
| 1923 | DEFUN(cfg_bts_oml_e1_tei, |
| 1924 | cfg_bts_oml_e1_tei_cmd, |
| 1925 | "oml e1 tei <0-63>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1926 | OML_E1_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1927 | "Set the TEI to be used for OML\n" |
| 1928 | "TEI Number\n") |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 1929 | { |
| 1930 | struct gsm_bts *bts = vty->index; |
| 1931 | |
| 1932 | bts->oml_tei = atoi(argv[0]); |
| 1933 | |
| 1934 | return CMD_SUCCESS; |
| 1935 | } |
| 1936 | |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1937 | DEFUN(cfg_bts_challoc, cfg_bts_challoc_cmd, |
| 1938 | "channel allocator (ascending|descending)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1939 | "Channnel Allocator\n" "Channel Allocator\n" |
| 1940 | "Allocate Timeslots and Transceivers in ascending order\n" |
| 1941 | "Allocate Timeslots and Transceivers in descending order\n") |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 1942 | { |
| 1943 | struct gsm_bts *bts = vty->index; |
| 1944 | |
| 1945 | if (!strcmp(argv[0], "ascending")) |
| 1946 | bts->chan_alloc_reverse = 0; |
| 1947 | else |
| 1948 | bts->chan_alloc_reverse = 1; |
| 1949 | |
| 1950 | return CMD_SUCCESS; |
| 1951 | } |
| 1952 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1953 | #define RACH_STR "Random Access Control Channel\n" |
| 1954 | |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 1955 | DEFUN(cfg_bts_rach_tx_integer, |
| 1956 | cfg_bts_rach_tx_integer_cmd, |
| 1957 | "rach tx integer <0-15>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1958 | RACH_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1959 | "Set the raw tx integer value in RACH Control parameters IE\n" |
| 1960 | "Set the raw tx integer value in RACH Control parameters IE\n" |
| 1961 | "Raw tx integer value in RACH Control parameters IE\n") |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 1962 | { |
| 1963 | struct gsm_bts *bts = vty->index; |
| 1964 | bts->si_common.rach_control.tx_integer = atoi(argv[0]) & 0xf; |
| 1965 | return CMD_SUCCESS; |
| 1966 | } |
| 1967 | |
| 1968 | DEFUN(cfg_bts_rach_max_trans, |
| 1969 | cfg_bts_rach_max_trans_cmd, |
| 1970 | "rach max transmission (1|2|4|7)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 1971 | RACH_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 1972 | "Set the maximum number of RACH burst transmissions\n" |
| 1973 | "Set the maximum number of RACH burst transmissions\n" |
Harald Welte | d13e0cd | 2012-08-17 09:52:03 +0200 | [diff] [blame] | 1974 | "Maximum number of 1 RACH burst transmissions\n" |
| 1975 | "Maximum number of 2 RACH burst transmissions\n" |
| 1976 | "Maximum number of 4 RACH burst transmissions\n" |
| 1977 | "Maximum number of 7 RACH burst transmissions\n") |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 1978 | { |
| 1979 | struct gsm_bts *bts = vty->index; |
| 1980 | bts->si_common.rach_control.max_trans = rach_max_trans_val2raw(atoi(argv[0])); |
| 1981 | return CMD_SUCCESS; |
| 1982 | } |
| 1983 | |
Andreas Eversberg | 2ee7ecd | 2012-10-13 07:27:47 +0200 | [diff] [blame] | 1984 | #define CD_STR "Channel Description\n" |
| 1985 | |
| 1986 | DEFUN(cfg_bts_chan_desc_att, |
| 1987 | cfg_bts_chan_desc_att_cmd, |
| 1988 | "channel-descrption attach (0|1)", |
| 1989 | CD_STR |
| 1990 | "Set if attachment is required\n" |
| 1991 | "Attachment is NOT required\n" |
| 1992 | "Attachment is required (standard)\n") |
| 1993 | { |
| 1994 | struct gsm_bts *bts = vty->index; |
| 1995 | bts->si_common.chan_desc.att = atoi(argv[0]); |
| 1996 | return CMD_SUCCESS; |
| 1997 | } |
| 1998 | |
| 1999 | DEFUN(cfg_bts_chan_desc_bs_pa_mfrms, |
| 2000 | cfg_bts_chan_desc_bs_pa_mfrms_cmd, |
| 2001 | "channel-descrption bs-pa-mfrms <2-9>", |
| 2002 | CD_STR |
| 2003 | "Set number of multiframe periods for paging groups\n" |
| 2004 | "Number of multiframe periods for paging groups\n") |
| 2005 | { |
| 2006 | struct gsm_bts *bts = vty->index; |
| 2007 | int bs_pa_mfrms = atoi(argv[0]); |
| 2008 | |
| 2009 | bts->si_common.chan_desc.bs_pa_mfrms = bs_pa_mfrms - 2; |
| 2010 | return CMD_SUCCESS; |
| 2011 | } |
| 2012 | |
| 2013 | DEFUN(cfg_bts_chan_desc_bs_ag_blks_res, |
| 2014 | cfg_bts_chan_desc_bs_ag_blks_res_cmd, |
| 2015 | "channel-descrption bs-ag-blks-res <0-7>", |
| 2016 | CD_STR |
| 2017 | "Set number of blocks reserved for access grant\n" |
| 2018 | "Number of blocks reserved for access grant\n") |
| 2019 | { |
| 2020 | struct gsm_bts *bts = vty->index; |
| 2021 | int bs_ag_blks_res = atoi(argv[0]); |
| 2022 | |
| 2023 | bts->si_common.chan_desc.bs_ag_blks_res = bs_ag_blks_res; |
| 2024 | return CMD_SUCCESS; |
| 2025 | } |
| 2026 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2027 | #define NM_STR "Network Management\n" |
| 2028 | |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 2029 | DEFUN(cfg_bts_rach_nm_b_thresh, |
| 2030 | cfg_bts_rach_nm_b_thresh_cmd, |
| 2031 | "rach nm busy threshold <0-255>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2032 | RACH_STR NM_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2033 | "Set the NM Busy Threshold\n" |
| 2034 | "Set the NM Busy Threshold\n" |
| 2035 | "NM Busy Threshold in dB") |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 2036 | { |
| 2037 | struct gsm_bts *bts = vty->index; |
| 2038 | bts->rach_b_thresh = atoi(argv[0]); |
| 2039 | return CMD_SUCCESS; |
| 2040 | } |
| 2041 | |
| 2042 | DEFUN(cfg_bts_rach_nm_ldavg, |
| 2043 | cfg_bts_rach_nm_ldavg_cmd, |
| 2044 | "rach nm load average <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2045 | RACH_STR NM_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2046 | "Set the NM Loadaverage Slots value\n" |
| 2047 | "Set the NM Loadaverage Slots value\n" |
| 2048 | "NM Loadaverage Slots value\n") |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 2049 | { |
| 2050 | struct gsm_bts *bts = vty->index; |
| 2051 | bts->rach_ldavg_slots = atoi(argv[0]); |
| 2052 | return CMD_SUCCESS; |
| 2053 | } |
| 2054 | |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 2055 | DEFUN(cfg_bts_cell_barred, cfg_bts_cell_barred_cmd, |
| 2056 | "cell barred (0|1)", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2057 | "Should this cell be barred from access?\n" |
| 2058 | "Should this cell be barred from access?\n" |
| 2059 | "Cell should NOT be barred\n" |
| 2060 | "Cell should be barred\n") |
| 2061 | |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 2062 | { |
| 2063 | struct gsm_bts *bts = vty->index; |
| 2064 | |
Harald Welte | 7135501 | 2009-12-21 23:08:18 +0100 | [diff] [blame] | 2065 | bts->si_common.rach_control.cell_bar = atoi(argv[0]); |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 2066 | |
| 2067 | return CMD_SUCCESS; |
| 2068 | } |
| 2069 | |
Holger Hans Peter Freyther | 3a0a463 | 2010-05-14 00:39:19 +0800 | [diff] [blame] | 2070 | DEFUN(cfg_bts_rach_ec_allowed, cfg_bts_rach_ec_allowed_cmd, |
| 2071 | "rach emergency call allowed (0|1)", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2072 | RACH_STR |
| 2073 | "Should this cell allow emergency calls?\n" |
| 2074 | "Should this cell allow emergency calls?\n" |
| 2075 | "Should this cell allow emergency calls?\n" |
| 2076 | "Do NOT allow emergency calls\n" |
| 2077 | "Allow emergency calls\n") |
Holger Hans Peter Freyther | 3a0a463 | 2010-05-14 00:39:19 +0800 | [diff] [blame] | 2078 | { |
| 2079 | struct gsm_bts *bts = vty->index; |
| 2080 | |
| 2081 | if (atoi(argv[0]) == 0) |
| 2082 | bts->si_common.rach_control.t2 |= 0x4; |
| 2083 | else |
| 2084 | bts->si_common.rach_control.t2 &= ~0x4; |
| 2085 | |
| 2086 | return CMD_SUCCESS; |
| 2087 | } |
| 2088 | |
Ivan Kluchnikov | 6792059 | 2013-09-16 13:13:04 +0400 | [diff] [blame] | 2089 | DEFUN(cfg_bts_rach_ac_class, cfg_bts_rach_ac_class_cmd, |
| 2090 | "rach access-control-class (0|1|2|3|4|5|6|7|8|9|11|12|13|14|15) (barred|allowed)", |
| 2091 | RACH_STR |
| 2092 | "Set access control class\n" |
| 2093 | "Access control class 0\n" |
| 2094 | "Access control class 1\n" |
| 2095 | "Access control class 2\n" |
| 2096 | "Access control class 3\n" |
| 2097 | "Access control class 4\n" |
| 2098 | "Access control class 5\n" |
| 2099 | "Access control class 6\n" |
| 2100 | "Access control class 7\n" |
| 2101 | "Access control class 8\n" |
| 2102 | "Access control class 9\n" |
| 2103 | "Access control class 11 for PLMN use\n" |
| 2104 | "Access control class 12 for security services\n" |
| 2105 | "Access control class 13 for public utilities (e.g. water/gas suppliers)\n" |
| 2106 | "Access control class 14 for emergency services\n" |
| 2107 | "Access control class 15 for PLMN staff\n" |
| 2108 | "barred to use access control class\n" |
| 2109 | "allowed to use access control class\n") |
| 2110 | { |
| 2111 | struct gsm_bts *bts = vty->index; |
| 2112 | |
| 2113 | uint8_t control_class; |
| 2114 | uint8_t allowed = 0; |
| 2115 | |
| 2116 | if (strcmp(argv[1], "allowed") == 0) |
| 2117 | allowed = 1; |
| 2118 | |
| 2119 | control_class = atoi(argv[0]); |
| 2120 | if (control_class < 8) |
| 2121 | if (allowed) |
| 2122 | bts->si_common.rach_control.t3 &= ~(0x1 << control_class); |
| 2123 | else |
| 2124 | bts->si_common.rach_control.t3 |= (0x1 << control_class); |
| 2125 | else |
| 2126 | if (allowed) |
| 2127 | bts->si_common.rach_control.t2 &= ~(0x1 << (control_class - 8)); |
| 2128 | else |
| 2129 | bts->si_common.rach_control.t2 |= (0x1 << (control_class - 8)); |
| 2130 | |
| 2131 | return CMD_SUCCESS; |
| 2132 | } |
| 2133 | |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 2134 | DEFUN(cfg_bts_ms_max_power, cfg_bts_ms_max_power_cmd, |
| 2135 | "ms max power <0-40>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2136 | "MS Options\n" |
Harald Welte | d13e0cd | 2012-08-17 09:52:03 +0200 | [diff] [blame] | 2137 | "Maximum transmit power of the MS\n" |
| 2138 | "Maximum transmit power of the MS\n" |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2139 | "Maximum transmit power of the MS in dBm") |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 2140 | { |
| 2141 | struct gsm_bts *bts = vty->index; |
| 2142 | |
| 2143 | bts->ms_max_power = atoi(argv[0]); |
| 2144 | |
| 2145 | return CMD_SUCCESS; |
| 2146 | } |
| 2147 | |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2148 | #define CELL_STR "Cell Parameters\n" |
| 2149 | |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 2150 | DEFUN(cfg_bts_cell_resel_hyst, cfg_bts_cell_resel_hyst_cmd, |
| 2151 | "cell reselection hysteresis <0-14>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2152 | CELL_STR "Cell re-selection parameters\n" |
| 2153 | "Cell Re-Selection Hysteresis in dB\n" |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 2154 | "Cell Re-Selection Hysteresis in dB") |
| 2155 | { |
| 2156 | struct gsm_bts *bts = vty->index; |
| 2157 | |
| 2158 | bts->si_common.cell_sel_par.cell_resel_hyst = atoi(argv[0])/2; |
| 2159 | |
| 2160 | return CMD_SUCCESS; |
| 2161 | } |
| 2162 | |
| 2163 | DEFUN(cfg_bts_rxlev_acc_min, cfg_bts_rxlev_acc_min_cmd, |
| 2164 | "rxlev access min <0-63>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2165 | "Minimum RxLev needed for cell access\n" |
| 2166 | "Minimum RxLev needed for cell access\n" |
| 2167 | "Minimum RxLev needed for cell access\n" |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 2168 | "Minimum RxLev needed for cell access (better than -110dBm)") |
| 2169 | { |
| 2170 | struct gsm_bts *bts = vty->index; |
| 2171 | |
| 2172 | bts->si_common.cell_sel_par.rxlev_acc_min = atoi(argv[0]); |
| 2173 | |
| 2174 | return CMD_SUCCESS; |
| 2175 | } |
| 2176 | |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 2177 | DEFUN(cfg_bts_cell_bar_qualify, cfg_bts_cell_bar_qualify_cmd, |
| 2178 | "cell bar qualify (0|1)", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2179 | CELL_STR "Cell Bar Qualify\n" "Cell Bar Qualify\n" |
| 2180 | "Set CBQ to 0\n" "Set CBQ to 1\n") |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 2181 | { |
| 2182 | struct gsm_bts *bts = vty->index; |
| 2183 | |
| 2184 | bts->si_common.cell_ro_sel_par.present = 1; |
| 2185 | bts->si_common.cell_ro_sel_par.cbq = atoi(argv[0]); |
| 2186 | |
| 2187 | return CMD_SUCCESS; |
| 2188 | } |
| 2189 | |
| 2190 | DEFUN(cfg_bts_cell_resel_ofs, cfg_bts_cell_resel_ofs_cmd, |
| 2191 | "cell reselection offset <0-126>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2192 | CELL_STR "Cell Re-Selection Parameters\n" |
| 2193 | "Cell Re-Selection Offset (CRO) in dB\n" |
| 2194 | "Cell Re-Selection Offset (CRO) in dB\n" |
| 2195 | ) |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 2196 | { |
| 2197 | struct gsm_bts *bts = vty->index; |
| 2198 | |
| 2199 | bts->si_common.cell_ro_sel_par.present = 1; |
| 2200 | bts->si_common.cell_ro_sel_par.cell_resel_off = atoi(argv[0])/2; |
| 2201 | |
| 2202 | return CMD_SUCCESS; |
| 2203 | } |
| 2204 | |
| 2205 | DEFUN(cfg_bts_temp_ofs, cfg_bts_temp_ofs_cmd, |
| 2206 | "temporary offset <0-60>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2207 | "Cell selection temporary negative offset\n" |
| 2208 | "Cell selection temporary negative offset\n" |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 2209 | "Cell selection temporary negative offset in dB") |
| 2210 | { |
| 2211 | struct gsm_bts *bts = vty->index; |
| 2212 | |
| 2213 | bts->si_common.cell_ro_sel_par.present = 1; |
| 2214 | bts->si_common.cell_ro_sel_par.temp_offs = atoi(argv[0])/10; |
| 2215 | |
| 2216 | return CMD_SUCCESS; |
| 2217 | } |
| 2218 | |
| 2219 | DEFUN(cfg_bts_temp_ofs_inf, cfg_bts_temp_ofs_inf_cmd, |
| 2220 | "temporary offset infinite", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2221 | "Cell selection temporary negative offset\n" |
| 2222 | "Cell selection temporary negative offset\n" |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 2223 | "Sets cell selection temporary negative offset to infinity") |
| 2224 | { |
| 2225 | struct gsm_bts *bts = vty->index; |
| 2226 | |
| 2227 | bts->si_common.cell_ro_sel_par.present = 1; |
| 2228 | bts->si_common.cell_ro_sel_par.temp_offs = 7; |
| 2229 | |
| 2230 | return CMD_SUCCESS; |
| 2231 | } |
| 2232 | |
| 2233 | DEFUN(cfg_bts_penalty_time, cfg_bts_penalty_time_cmd, |
| 2234 | "penalty time <20-620>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2235 | "Cell selection penalty time\n" |
| 2236 | "Cell selection penalty time\n" |
| 2237 | "Cell selection penalty time in seconds (by 20s increments)\n") |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 2238 | { |
| 2239 | struct gsm_bts *bts = vty->index; |
| 2240 | |
| 2241 | bts->si_common.cell_ro_sel_par.present = 1; |
| 2242 | bts->si_common.cell_ro_sel_par.penalty_time = (atoi(argv[0])-20)/20; |
| 2243 | |
| 2244 | return CMD_SUCCESS; |
| 2245 | } |
| 2246 | |
| 2247 | DEFUN(cfg_bts_penalty_time_rsvd, cfg_bts_penalty_time_rsvd_cmd, |
| 2248 | "penalty time reserved", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2249 | "Cell selection penalty time\n" |
| 2250 | "Cell selection penalty time\n" |
| 2251 | "Set cell selection penalty time to reserved value 31, " |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 2252 | "(indicate that CELL_RESELECT_OFFSET is subtracted from C2 " |
| 2253 | "and TEMPORARY_OFFSET is ignored)") |
| 2254 | { |
| 2255 | struct gsm_bts *bts = vty->index; |
| 2256 | |
| 2257 | bts->si_common.cell_ro_sel_par.present = 1; |
| 2258 | bts->si_common.cell_ro_sel_par.penalty_time = 31; |
| 2259 | |
| 2260 | return CMD_SUCCESS; |
| 2261 | } |
| 2262 | |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 2263 | DEFUN(cfg_bts_per_loc_upd, cfg_bts_per_loc_upd_cmd, |
Daniel Willmann | 4d62d63 | 2012-12-27 00:02:01 +0100 | [diff] [blame] | 2264 | "periodic location update <6-1530>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2265 | "Periodic Location Updating Interval\n" |
| 2266 | "Periodic Location Updating Interval\n" |
| 2267 | "Periodic Location Updating Interval\n" |
| 2268 | "Periodic Location Updating Interval in Minutes\n") |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 2269 | { |
| 2270 | struct gsm_bts *bts = vty->index; |
| 2271 | |
Dieter Spaar | d6613e0 | 2010-10-05 21:10:55 +0200 | [diff] [blame] | 2272 | bts->si_common.chan_desc.t3212 = atoi(argv[0]) / 6; |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 2273 | |
| 2274 | return CMD_SUCCESS; |
| 2275 | } |
| 2276 | |
Holger Hans Peter Freyther | c63f6f1 | 2013-07-27 21:07:57 +0200 | [diff] [blame] | 2277 | DEFUN(cfg_bts_no_per_loc_upd, cfg_bts_no_per_loc_upd_cmd, |
| 2278 | "no periodic location update", |
| 2279 | NO_STR |
| 2280 | "Periodic Location Updating Interval\n" |
| 2281 | "Periodic Location Updating Interval\n" |
| 2282 | "Periodic Location Updating Interval\n") |
| 2283 | { |
| 2284 | struct gsm_bts *bts = vty->index; |
| 2285 | |
| 2286 | bts->si_common.chan_desc.t3212 = 0; |
Andreas Eversberg | 4d4944a | 2013-03-10 11:49:35 +0100 | [diff] [blame] | 2287 | |
| 2288 | return CMD_SUCCESS; |
| 2289 | } |
| 2290 | |
| 2291 | DEFUN(cfg_bts_radio_link_timeout, cfg_bts_radio_link_timeout_cmd, |
| 2292 | "radio-link-timeout <4-64>", |
| 2293 | "Radio link timeout criterion (BTS side)\n" |
| 2294 | "Radio link timeout value (lost SACCH block)\n") |
| 2295 | { |
| 2296 | struct gsm_bts *bts = vty->index; |
| 2297 | |
| 2298 | set_radio_link_timeout(&bts->si_common.cell_options, atoi(argv[0])); |
| 2299 | |
Holger Hans Peter Freyther | c63f6f1 | 2013-07-27 21:07:57 +0200 | [diff] [blame] | 2300 | return CMD_SUCCESS; |
| 2301 | } |
| 2302 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2303 | #define GPRS_TEXT "GPRS Packet Network\n" |
| 2304 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2305 | DEFUN(cfg_bts_prs_bvci, cfg_bts_gprs_bvci_cmd, |
Harald Welte | 57ba7e3 | 2010-04-18 14:00:26 +0200 | [diff] [blame] | 2306 | "gprs cell bvci <2-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2307 | GPRS_TEXT |
| 2308 | "GPRS Cell Settings\n" |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2309 | "GPRS BSSGP VC Identifier\n" |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2310 | "GPRS BSSGP VC Identifier") |
| 2311 | { |
| 2312 | struct gsm_bts *bts = vty->index; |
| 2313 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2314 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 2315 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2316 | return CMD_WARNING; |
| 2317 | } |
| 2318 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2319 | bts->gprs.cell.bvci = atoi(argv[0]); |
| 2320 | |
| 2321 | return CMD_SUCCESS; |
| 2322 | } |
| 2323 | |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 2324 | DEFUN(cfg_bts_gprs_nsei, cfg_bts_gprs_nsei_cmd, |
| 2325 | "gprs nsei <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2326 | GPRS_TEXT |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2327 | "GPRS NS Entity Identifier\n" |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 2328 | "GPRS NS Entity Identifier") |
| 2329 | { |
| 2330 | struct gsm_bts *bts = vty->index; |
| 2331 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2332 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 2333 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2334 | return CMD_WARNING; |
| 2335 | } |
| 2336 | |
| 2337 | bts->gprs.nse.nsei = atoi(argv[0]); |
| 2338 | |
| 2339 | return CMD_SUCCESS; |
| 2340 | } |
| 2341 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2342 | #define NSVC_TEXT "Network Service Virtual Connection (NS-VC)\n" \ |
| 2343 | "NSVC Logical Number\n" |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 2344 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2345 | DEFUN(cfg_bts_gprs_nsvci, cfg_bts_gprs_nsvci_cmd, |
| 2346 | "gprs nsvc <0-1> nsvci <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2347 | GPRS_TEXT NSVC_TEXT |
| 2348 | "NS Virtual Connection Identifier\n" |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2349 | "GPRS NS VC Identifier") |
| 2350 | { |
| 2351 | struct gsm_bts *bts = vty->index; |
| 2352 | int idx = atoi(argv[0]); |
| 2353 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2354 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 2355 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2356 | return CMD_WARNING; |
| 2357 | } |
| 2358 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2359 | bts->gprs.nsvc[idx].nsvci = atoi(argv[1]); |
| 2360 | |
| 2361 | return CMD_SUCCESS; |
| 2362 | } |
| 2363 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2364 | DEFUN(cfg_bts_gprs_nsvc_lport, cfg_bts_gprs_nsvc_lport_cmd, |
| 2365 | "gprs nsvc <0-1> local udp port <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2366 | GPRS_TEXT NSVC_TEXT |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2367 | "GPRS NS Local UDP Port\n" |
| 2368 | "GPRS NS Local UDP Port\n" |
| 2369 | "GPRS NS Local UDP Port\n" |
Harald Welte | 13fe219 | 2012-08-17 09:57:25 +0200 | [diff] [blame] | 2370 | "GPRS NS Local UDP Port Number\n") |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2371 | { |
| 2372 | struct gsm_bts *bts = vty->index; |
| 2373 | int idx = atoi(argv[0]); |
| 2374 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2375 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 2376 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2377 | return CMD_WARNING; |
| 2378 | } |
| 2379 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2380 | bts->gprs.nsvc[idx].local_port = atoi(argv[1]); |
| 2381 | |
| 2382 | return CMD_SUCCESS; |
| 2383 | } |
| 2384 | |
| 2385 | DEFUN(cfg_bts_gprs_nsvc_rport, cfg_bts_gprs_nsvc_rport_cmd, |
| 2386 | "gprs nsvc <0-1> remote udp port <0-65535>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2387 | GPRS_TEXT NSVC_TEXT |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2388 | "GPRS NS Remote UDP Port\n" |
| 2389 | "GPRS NS Remote UDP Port\n" |
Harald Welte | 13fe219 | 2012-08-17 09:57:25 +0200 | [diff] [blame] | 2390 | "GPRS NS Remote UDP Port\n" |
| 2391 | "GPRS NS Remote UDP Port Number\n") |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2392 | { |
| 2393 | struct gsm_bts *bts = vty->index; |
| 2394 | int idx = atoi(argv[0]); |
| 2395 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2396 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 2397 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2398 | return CMD_WARNING; |
| 2399 | } |
| 2400 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2401 | bts->gprs.nsvc[idx].remote_port = atoi(argv[1]); |
| 2402 | |
| 2403 | return CMD_SUCCESS; |
| 2404 | } |
| 2405 | |
| 2406 | DEFUN(cfg_bts_gprs_nsvc_rip, cfg_bts_gprs_nsvc_rip_cmd, |
| 2407 | "gprs nsvc <0-1> remote ip A.B.C.D", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2408 | GPRS_TEXT NSVC_TEXT |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2409 | "GPRS NS Remote IP Address\n" |
| 2410 | "GPRS NS Remote IP Address\n" |
| 2411 | "GPRS NS Remote IP Address\n") |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2412 | { |
| 2413 | struct gsm_bts *bts = vty->index; |
| 2414 | int idx = atoi(argv[0]); |
| 2415 | struct in_addr ia; |
| 2416 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2417 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 2418 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2419 | return CMD_WARNING; |
| 2420 | } |
| 2421 | |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2422 | inet_aton(argv[1], &ia); |
| 2423 | bts->gprs.nsvc[idx].remote_ip = ntohl(ia.s_addr); |
| 2424 | |
| 2425 | return CMD_SUCCESS; |
| 2426 | } |
| 2427 | |
Holger Hans Peter Freyther | e66bf1f | 2010-09-06 10:11:25 +0800 | [diff] [blame] | 2428 | DEFUN(cfg_bts_pag_free, cfg_bts_pag_free_cmd, |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2429 | "paging free <-1-1024>", |
| 2430 | "Paging options\n" |
| 2431 | "Only page when having a certain amount of free slots\n" |
| 2432 | "amount of required free paging slots. -1 to disable\n") |
Holger Hans Peter Freyther | e66bf1f | 2010-09-06 10:11:25 +0800 | [diff] [blame] | 2433 | { |
| 2434 | struct gsm_bts *bts = vty->index; |
| 2435 | |
| 2436 | bts->paging.free_chans_need = atoi(argv[0]); |
| 2437 | return CMD_SUCCESS; |
| 2438 | } |
| 2439 | |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 2440 | DEFUN(cfg_bts_gprs_ns_timer, cfg_bts_gprs_ns_timer_cmd, |
| 2441 | "gprs ns timer " NS_TIMERS " <0-255>", |
| 2442 | GPRS_TEXT "Network Service\n" |
| 2443 | "Network Service Timer\n" |
| 2444 | NS_TIMERS_HELP "Timer Value\n") |
| 2445 | { |
| 2446 | struct gsm_bts *bts = vty->index; |
| 2447 | int idx = get_string_value(gprs_ns_timer_strs, argv[0]); |
| 2448 | int val = atoi(argv[1]); |
| 2449 | |
| 2450 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
| 2451 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2452 | return CMD_WARNING; |
| 2453 | } |
| 2454 | |
| 2455 | if (idx < 0 || idx >= ARRAY_SIZE(bts->gprs.nse.timer)) |
| 2456 | return CMD_WARNING; |
| 2457 | |
| 2458 | bts->gprs.nse.timer[idx] = val; |
| 2459 | |
| 2460 | return CMD_SUCCESS; |
| 2461 | } |
| 2462 | |
| 2463 | #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] | 2464 | #define BSSGP_TIMERS_HELP \ |
| 2465 | "Tbvc-block timeout\n" \ |
| 2466 | "Tbvc-block retries\n" \ |
| 2467 | "Tbvc-unblock retries\n" \ |
| 2468 | "Tbvcc-reset timeout\n" \ |
| 2469 | "Tbvc-reset retries\n" \ |
| 2470 | "Tbvc-suspend timeout\n" \ |
| 2471 | "Tbvc-suspend retries\n" \ |
| 2472 | "Tbvc-resume timeout\n" \ |
| 2473 | "Tbvc-resume retries\n" \ |
| 2474 | "Tbvc-capa-update timeout\n" \ |
| 2475 | "Tbvc-capa-update retries\n" |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 2476 | |
| 2477 | DEFUN(cfg_bts_gprs_cell_timer, cfg_bts_gprs_cell_timer_cmd, |
| 2478 | "gprs cell timer " BSSGP_TIMERS " <0-255>", |
| 2479 | GPRS_TEXT "Cell / BSSGP\n" |
| 2480 | "Cell/BSSGP Timer\n" |
| 2481 | BSSGP_TIMERS_HELP "Timer Value\n") |
| 2482 | { |
| 2483 | struct gsm_bts *bts = vty->index; |
| 2484 | int idx = get_string_value(gprs_bssgp_cfg_strs, argv[0]); |
| 2485 | int val = atoi(argv[1]); |
| 2486 | |
| 2487 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
| 2488 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2489 | return CMD_WARNING; |
| 2490 | } |
| 2491 | |
| 2492 | if (idx < 0 || idx >= ARRAY_SIZE(bts->gprs.cell.timer)) |
| 2493 | return CMD_WARNING; |
| 2494 | |
| 2495 | bts->gprs.cell.timer[idx] = val; |
| 2496 | |
| 2497 | return CMD_SUCCESS; |
| 2498 | } |
| 2499 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2500 | DEFUN(cfg_bts_gprs_rac, cfg_bts_gprs_rac_cmd, |
| 2501 | "gprs routing area <0-255>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2502 | GPRS_TEXT |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2503 | "GPRS Routing Area Code\n" |
| 2504 | "GPRS Routing Area Code\n" |
| 2505 | "GPRS Routing Area Code\n") |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2506 | { |
| 2507 | struct gsm_bts *bts = vty->index; |
| 2508 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2509 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
Harald Welte | 9403670 | 2010-03-14 23:56:56 +0800 | [diff] [blame] | 2510 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2511 | return CMD_WARNING; |
| 2512 | } |
| 2513 | |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 2514 | bts->gprs.rac = atoi(argv[0]); |
| 2515 | |
| 2516 | return CMD_SUCCESS; |
| 2517 | } |
| 2518 | |
Max | 292ec58 | 2016-07-28 11:55:37 +0200 | [diff] [blame] | 2519 | DEFUN(cfg_bts_gprs_ctrl_ack, cfg_bts_gprs_ctrl_ack_cmd, |
| 2520 | "gprs control-ack-type-rach", GPRS_TEXT |
| 2521 | "Set GPRS Control Ack Type for PACKET CONTROL ACKNOWLEDGMENT message to " |
| 2522 | "four access bursts format instead of default RLC/MAC control block\n") |
| 2523 | { |
| 2524 | struct gsm_bts *bts = vty->index; |
| 2525 | |
| 2526 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
| 2527 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2528 | return CMD_WARNING; |
| 2529 | } |
| 2530 | |
| 2531 | bts->gprs.ctrl_ack_type_use_block = false; |
| 2532 | |
| 2533 | return CMD_SUCCESS; |
| 2534 | } |
| 2535 | |
| 2536 | DEFUN(cfg_no_bts_gprs_ctrl_ack, cfg_no_bts_gprs_ctrl_ack_cmd, |
| 2537 | "no gprs control-ack-type-rach", NO_STR GPRS_TEXT |
| 2538 | "Set GPRS Control Ack Type for PACKET CONTROL ACKNOWLEDGMENT message to " |
| 2539 | "four access bursts format instead of default RLC/MAC control block\n") |
| 2540 | { |
| 2541 | struct gsm_bts *bts = vty->index; |
| 2542 | |
| 2543 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
| 2544 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2545 | return CMD_WARNING; |
| 2546 | } |
| 2547 | |
| 2548 | bts->gprs.ctrl_ack_type_use_block = true; |
| 2549 | |
| 2550 | return CMD_SUCCESS; |
| 2551 | } |
| 2552 | |
Andreas Eversberg | 0c8f9ca | 2013-03-16 16:31:26 +0100 | [diff] [blame] | 2553 | DEFUN(cfg_bts_gprs_net_ctrl_ord, cfg_bts_gprs_net_ctrl_ord_cmd, |
| 2554 | "gprs network-control-order (nc0|nc1|nc2)", |
| 2555 | GPRS_TEXT |
| 2556 | "GPRS Network Control Order\n" |
| 2557 | "MS controlled cell re-selection, no measurement reporting\n" |
| 2558 | "MS controlled cell re-selection, MS sends measurement reports\n" |
| 2559 | "Network controlled cell re-selection, MS sends measurement reports\n") |
| 2560 | { |
| 2561 | struct gsm_bts *bts = vty->index; |
| 2562 | |
| 2563 | if (bts->gprs.mode == BTS_GPRS_NONE) { |
| 2564 | vty_out(vty, "%% GPRS not enabled on this BTS%s", VTY_NEWLINE); |
| 2565 | return CMD_WARNING; |
| 2566 | } |
| 2567 | |
| 2568 | bts->gprs.net_ctrl_ord = atoi(argv[0] + 2); |
| 2569 | |
| 2570 | return CMD_SUCCESS; |
| 2571 | } |
| 2572 | |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 2573 | DEFUN(cfg_bts_gprs_mode, cfg_bts_gprs_mode_cmd, |
| 2574 | "gprs mode (none|gprs|egprs)", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 2575 | GPRS_TEXT |
| 2576 | "GPRS Mode for this BTS\n" |
| 2577 | "GPRS Disabled on this BTS\n" |
| 2578 | "GPRS Enabled on this BTS\n" |
| 2579 | "EGPRS (EDGE) Enabled on this BTS\n") |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2580 | { |
| 2581 | struct gsm_bts *bts = vty->index; |
Holger Hans Peter Freyther | 4e13a8f | 2015-01-31 22:16:00 +0100 | [diff] [blame] | 2582 | enum bts_gprs_mode mode = bts_gprs_mode_parse(argv[0], NULL); |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2583 | |
Holger Hans Peter Freyther | 4e13a8f | 2015-01-31 22:16:00 +0100 | [diff] [blame] | 2584 | if (!bts_gprs_mode_is_compat(bts, mode)) { |
Harald Welte | f3d8e92 | 2010-06-14 22:44:42 +0200 | [diff] [blame] | 2585 | vty_out(vty, "This BTS type does not support %s%s", argv[0], |
| 2586 | VTY_NEWLINE); |
| 2587 | return CMD_WARNING; |
| 2588 | } |
| 2589 | |
| 2590 | bts->gprs.mode = mode; |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 2591 | |
| 2592 | return CMD_SUCCESS; |
| 2593 | } |
| 2594 | |
bhargava | 350533c | 2016-07-21 11:14:34 +0530 | [diff] [blame] | 2595 | DEFUN(cfg_bts_gprs_11bit_rach_support_for_egprs, |
| 2596 | cfg_bts_gprs_11bit_rach_support_for_egprs_cmd, |
| 2597 | "gprs 11bit_rach_support_for_egprs (0|1)", |
| 2598 | GPRS_TEXT "11 bit RACH options\n" |
| 2599 | "Disable 11 bit RACH for EGPRS\n" |
| 2600 | "Enable 11 bit RACH for EGPRS") |
| 2601 | { |
| 2602 | struct gsm_bts *bts = vty->index; |
| 2603 | |
| 2604 | bts->gprs.supports_egprs_11bit_rach = atoi(argv[0]); |
| 2605 | |
| 2606 | if (bts->gprs.supports_egprs_11bit_rach > 1) { |
| 2607 | vty_out(vty, "Error in RACH type%s", VTY_NEWLINE); |
| 2608 | return CMD_WARNING; |
| 2609 | } |
| 2610 | |
| 2611 | if ((bts->gprs.mode == BTS_GPRS_NONE) && |
| 2612 | (bts->gprs.supports_egprs_11bit_rach == 1)) { |
| 2613 | vty_out(vty, "Error:gprs mode is none and 11bit rach is" |
| 2614 | " enabled%s", VTY_NEWLINE); |
| 2615 | return CMD_WARNING; |
| 2616 | } |
| 2617 | |
| 2618 | return CMD_SUCCESS; |
| 2619 | } |
| 2620 | |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 2621 | #define SI_TEXT "System Information Messages\n" |
| 2622 | #define SI_TYPE_TEXT "(1|2|3|4|5|6|7|8|9|10|13|16|17|18|19|20|2bis|2ter|2quater|5bis|5ter)" |
| 2623 | #define SI_TYPE_HELP "System Information Type 1\n" \ |
| 2624 | "System Information Type 2\n" \ |
| 2625 | "System Information Type 3\n" \ |
| 2626 | "System Information Type 4\n" \ |
| 2627 | "System Information Type 5\n" \ |
| 2628 | "System Information Type 6\n" \ |
| 2629 | "System Information Type 7\n" \ |
| 2630 | "System Information Type 8\n" \ |
| 2631 | "System Information Type 9\n" \ |
| 2632 | "System Information Type 10\n" \ |
| 2633 | "System Information Type 13\n" \ |
| 2634 | "System Information Type 16\n" \ |
| 2635 | "System Information Type 17\n" \ |
| 2636 | "System Information Type 18\n" \ |
| 2637 | "System Information Type 19\n" \ |
| 2638 | "System Information Type 20\n" \ |
| 2639 | "System Information Type 2bis\n" \ |
| 2640 | "System Information Type 2ter\n" \ |
| 2641 | "System Information Type 2quater\n" \ |
| 2642 | "System Information Type 5bis\n" \ |
| 2643 | "System Information Type 5ter\n" |
| 2644 | |
| 2645 | DEFUN(cfg_bts_si_mode, cfg_bts_si_mode_cmd, |
| 2646 | "system-information " SI_TYPE_TEXT " mode (static|computed)", |
| 2647 | SI_TEXT SI_TYPE_HELP |
| 2648 | "System Information Mode\n" |
| 2649 | "Static user-specified\n" |
| 2650 | "Dynamic, BSC-computed\n") |
| 2651 | { |
| 2652 | struct gsm_bts *bts = vty->index; |
| 2653 | int type; |
| 2654 | |
| 2655 | type = get_string_value(osmo_sitype_strs, argv[0]); |
| 2656 | if (type < 0) { |
| 2657 | vty_out(vty, "Error SI Type%s", VTY_NEWLINE); |
| 2658 | return CMD_WARNING; |
| 2659 | } |
| 2660 | |
| 2661 | if (!strcmp(argv[1], "static")) |
| 2662 | bts->si_mode_static |= (1 << type); |
| 2663 | else |
| 2664 | bts->si_mode_static &= ~(1 << type); |
| 2665 | |
| 2666 | return CMD_SUCCESS; |
| 2667 | } |
| 2668 | |
| 2669 | DEFUN(cfg_bts_si_static, cfg_bts_si_static_cmd, |
| 2670 | "system-information " SI_TYPE_TEXT " static HEXSTRING", |
| 2671 | SI_TEXT SI_TYPE_HELP |
| 2672 | "Static System Information filling\n" |
| 2673 | "Static user-specified SI content in HEX notation\n") |
| 2674 | { |
| 2675 | struct gsm_bts *bts = vty->index; |
| 2676 | int rc, type; |
| 2677 | |
| 2678 | type = get_string_value(osmo_sitype_strs, argv[0]); |
| 2679 | if (type < 0) { |
| 2680 | vty_out(vty, "Error SI Type%s", VTY_NEWLINE); |
| 2681 | return CMD_WARNING; |
| 2682 | } |
| 2683 | |
| 2684 | if (!(bts->si_mode_static & (1 << type))) { |
| 2685 | vty_out(vty, "SI Type %s is not configured in static mode%s", |
| 2686 | get_value_string(osmo_sitype_strs, type), VTY_NEWLINE); |
| 2687 | return CMD_WARNING; |
| 2688 | } |
| 2689 | |
Harald Welte | 290aaed | 2010-07-30 11:53:18 +0200 | [diff] [blame] | 2690 | /* Fill buffer with padding pattern */ |
| 2691 | memset(bts->si_buf[type], 0x2b, sizeof(bts->si_buf[type])); |
| 2692 | |
| 2693 | /* Parse the user-specified SI in hex format, [partially] overwriting padding */ |
Pablo Neira Ayuso | c0d17f2 | 2011-05-07 12:12:48 +0200 | [diff] [blame] | 2694 | rc = osmo_hexparse(argv[1], bts->si_buf[type], sizeof(bts->si_buf[0])); |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 2695 | if (rc < 0 || rc > sizeof(bts->si_buf[0])) { |
| 2696 | vty_out(vty, "Error parsing HEXSTRING%s", VTY_NEWLINE); |
| 2697 | return CMD_WARNING; |
| 2698 | } |
| 2699 | |
| 2700 | /* Mark this SI as present */ |
| 2701 | bts->si_valid |= (1 << type); |
| 2702 | |
| 2703 | return CMD_SUCCESS; |
| 2704 | } |
| 2705 | |
Harald Welte | 42def72 | 2017-01-13 00:10:32 +0100 | [diff] [blame] | 2706 | DEFUN(cfg_bts_early_cm, cfg_bts_early_cm_cmd, |
| 2707 | "early-classmark-sending (allowed|forbidden)", |
| 2708 | "Early Classmark Sending\n" |
| 2709 | "Early Classmark Sending is allowed\n" |
| 2710 | "Early Classmark Sending is forbidden\n") |
| 2711 | { |
| 2712 | struct gsm_bts *bts = vty->index; |
Harald Welte | 42def72 | 2017-01-13 00:10:32 +0100 | [diff] [blame] | 2713 | |
| 2714 | if (!strcmp(argv[0], "allowed")) |
| 2715 | bts->early_classmark_allowed = true; |
| 2716 | else |
| 2717 | bts->early_classmark_allowed = false; |
| 2718 | |
| 2719 | return CMD_SUCCESS; |
| 2720 | } |
| 2721 | |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 2722 | DEFUN(cfg_bts_neigh_mode, cfg_bts_neigh_mode_cmd, |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 2723 | "neighbor-list mode (automatic|manual|manual-si5)", |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 2724 | "Neighbor List\n" "Mode of Neighbor List generation\n" |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 2725 | "Automatically from all BTS in this OpenBSC\n" "Manual\n" |
| 2726 | "Manual with different lists for SI2 and SI5\n") |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 2727 | { |
| 2728 | struct gsm_bts *bts = vty->index; |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 2729 | int mode = get_string_value(bts_neigh_mode_strs, argv[0]); |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 2730 | |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 2731 | switch (mode) { |
| 2732 | case NL_MODE_MANUAL_SI5SEP: |
| 2733 | case NL_MODE_MANUAL: |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 2734 | /* make sure we clear the current list when switching to |
| 2735 | * manual mode */ |
| 2736 | if (bts->neigh_list_manual_mode == 0) |
| 2737 | memset(&bts->si_common.data.neigh_list, 0, |
| 2738 | sizeof(bts->si_common.data.neigh_list)); |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 2739 | break; |
| 2740 | default: |
| 2741 | break; |
| 2742 | } |
| 2743 | |
| 2744 | bts->neigh_list_manual_mode = mode; |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 2745 | |
| 2746 | return CMD_SUCCESS; |
| 2747 | } |
| 2748 | |
| 2749 | DEFUN(cfg_bts_neigh, cfg_bts_neigh_cmd, |
Harald Welte | 1fe73a1 | 2012-01-29 13:24:12 +0100 | [diff] [blame] | 2750 | "neighbor-list (add|del) arfcn <0-1023>", |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 2751 | "Neighbor List\n" "Add to manual neighbor list\n" |
| 2752 | "Delete from manual neighbor list\n" "ARFCN of neighbor\n" |
| 2753 | "ARFCN of neighbor\n") |
| 2754 | { |
| 2755 | struct gsm_bts *bts = vty->index; |
| 2756 | struct bitvec *bv = &bts->si_common.neigh_list; |
| 2757 | uint16_t arfcn = atoi(argv[1]); |
| 2758 | |
| 2759 | if (!bts->neigh_list_manual_mode) { |
| 2760 | vty_out(vty, "%% Cannot configure neighbor list in " |
| 2761 | "automatic mode%s", VTY_NEWLINE); |
| 2762 | return CMD_WARNING; |
| 2763 | } |
| 2764 | |
| 2765 | if (!strcmp(argv[0], "add")) |
| 2766 | bitvec_set_bit_pos(bv, arfcn, 1); |
| 2767 | else |
| 2768 | bitvec_set_bit_pos(bv, arfcn, 0); |
| 2769 | |
| 2770 | return CMD_SUCCESS; |
| 2771 | } |
| 2772 | |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2773 | DEFUN(cfg_bts_si2quater_neigh_add, cfg_bts_si2quater_neigh_add_cmd, |
Max | 2c16bee | 2017-02-15 13:51:37 +0100 | [diff] [blame] | 2774 | "si2quater neighbor-list add earfcn <0-65535> thresh-hi <0-31> " |
| 2775 | "thresh-lo <0-32> prio <0-8> qrxlv <0-32> meas <0-8>", |
| 2776 | "SI2quater Neighbor List\n" "SI2quater Neighbor List\n" |
| 2777 | "Add to manual SI2quater neighbor list\n" |
| 2778 | "EARFCN of neighbor\n" "EARFCN of neighbor\n" |
| 2779 | "threshold high bits\n" "threshold high bits\n" |
| 2780 | "threshold low bits\n" "threshold low bits (32 means NA)\n" |
| 2781 | "priority\n" "priority (8 means NA)\n" |
| 2782 | "QRXLEVMIN\n" "QRXLEVMIN (32 means NA)\n" |
| 2783 | "measurement bandwidth\n" "measurement bandwidth (8 means NA)\n") |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2784 | { |
| 2785 | struct gsm_bts *bts = vty->index; |
| 2786 | struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; |
| 2787 | uint16_t arfcn = atoi(argv[0]); |
Max | 2c16bee | 2017-02-15 13:51:37 +0100 | [diff] [blame] | 2788 | uint8_t thresh_hi = atoi(argv[1]), thresh_lo = atoi(argv[2]), |
| 2789 | prio = atoi(argv[3]), qrx = atoi(argv[4]), meas = atoi(argv[5]); |
| 2790 | int r = osmo_earfcn_add(e, arfcn, |
| 2791 | (meas < 8) ? meas : OSMO_EARFCN_MEAS_INVALID); |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2792 | |
| 2793 | if (r < 0) { |
Max | 2c16bee | 2017-02-15 13:51:37 +0100 | [diff] [blame] | 2794 | vty_out(vty, "Unable to add ARFCN %u: %s%s", arfcn, strerror(-r), |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2795 | VTY_NEWLINE); |
| 2796 | return CMD_WARNING; |
| 2797 | } |
| 2798 | |
Max | 2c16bee | 2017-02-15 13:51:37 +0100 | [diff] [blame] | 2799 | if (e->thresh_hi && thresh_hi != e->thresh_hi) |
| 2800 | vty_out(vty, "Warning: multiple threshold-high are not " |
| 2801 | "supported, overriding previous threshold %u%s", |
| 2802 | e->thresh_hi, VTY_NEWLINE); |
| 2803 | |
| 2804 | e->thresh_hi = thresh_hi; |
| 2805 | |
| 2806 | if (thresh_lo != 32) { |
| 2807 | if (e->thresh_lo_valid && e->thresh_lo != thresh_lo) |
| 2808 | vty_out(vty, "Warning: multiple threshold-low are not " |
| 2809 | "supported, overriding previous threshold %u%s", |
| 2810 | e->thresh_lo, VTY_NEWLINE); |
| 2811 | e->thresh_lo = thresh_lo; |
| 2812 | e->thresh_lo_valid = true; |
Max | aafff96 | 2016-04-20 15:57:14 +0200 | [diff] [blame] | 2813 | } |
Max | 2c16bee | 2017-02-15 13:51:37 +0100 | [diff] [blame] | 2814 | |
| 2815 | if (qrx != 32) { |
| 2816 | if (e->qrxlm_valid && e->qrxlm != qrx) |
| 2817 | vty_out(vty, "Warning: multiple QRXLEVMIN are not " |
| 2818 | "supported, overriding previous value %u%s", |
| 2819 | e->qrxlm, VTY_NEWLINE); |
| 2820 | e->qrxlm = qrx; |
| 2821 | e->qrxlm_valid = true; |
| 2822 | } |
| 2823 | |
| 2824 | if (prio != 8) { |
| 2825 | if (e->prio_valid && e->prio != prio) |
| 2826 | vty_out(vty, "Warning: multiple priorities are not " |
| 2827 | "supported, overriding previous value %u%s", |
| 2828 | e->prio, VTY_NEWLINE); |
| 2829 | e->prio = prio; |
| 2830 | e->prio_valid = true; |
| 2831 | } |
| 2832 | |
| 2833 | if (si2q_size_check(bts)) |
| 2834 | return CMD_SUCCESS; |
| 2835 | |
| 2836 | vty_out(vty, "Warning: not enough space in SI2quater for a given EARFCN " |
| 2837 | "%u%s", arfcn, VTY_NEWLINE); |
Max | aafff96 | 2016-04-20 15:57:14 +0200 | [diff] [blame] | 2838 | osmo_earfcn_del(e, arfcn); |
Max | 2c16bee | 2017-02-15 13:51:37 +0100 | [diff] [blame] | 2839 | |
Max | aafff96 | 2016-04-20 15:57:14 +0200 | [diff] [blame] | 2840 | return CMD_WARNING; |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2841 | } |
| 2842 | |
| 2843 | DEFUN(cfg_bts_si2quater_neigh_del, cfg_bts_si2quater_neigh_del_cmd, |
Max | 35697b9 | 2016-04-29 12:51:31 +0200 | [diff] [blame] | 2844 | "si2quater neighbor-list del earfcn <0-65535>", |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2845 | "SI2quater Neighbor List\n" |
| 2846 | "SI2quater Neighbor List\n" |
| 2847 | "Delete from SI2quater manual neighbor list\n" |
Max | 36212f2 | 2016-04-20 12:06:05 +0200 | [diff] [blame] | 2848 | "EARFCN of neighbor\n" |
| 2849 | "EARFCN\n") |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2850 | { |
| 2851 | struct gsm_bts *bts = vty->index; |
| 2852 | struct osmo_earfcn_si2q *e = &bts->si_common.si2quater_neigh_list; |
Max | 0c1bc26 | 2016-04-20 12:06:06 +0200 | [diff] [blame] | 2853 | uint16_t arfcn = atoi(argv[0]); |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2854 | int r = osmo_earfcn_del(e, arfcn); |
| 2855 | if (r < 0) { |
| 2856 | vty_out(vty, "Unable to delete arfcn %u: %s%s", arfcn, |
Max | 0c1bc26 | 2016-04-20 12:06:06 +0200 | [diff] [blame] | 2857 | strerror(-r), VTY_NEWLINE); |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 2858 | return CMD_WARNING; |
| 2859 | } |
| 2860 | |
| 2861 | return CMD_SUCCESS; |
| 2862 | } |
| 2863 | |
Max | 26679e0 | 2016-04-20 15:57:13 +0200 | [diff] [blame] | 2864 | DEFUN(cfg_bts_si2quater_uarfcn_add, cfg_bts_si2quater_uarfcn_add_cmd, |
Max | 35697b9 | 2016-04-29 12:51:31 +0200 | [diff] [blame] | 2865 | "si2quater neighbor-list add uarfcn <0-16383> <0-511> <0-1>", |
Max | 26679e0 | 2016-04-20 15:57:13 +0200 | [diff] [blame] | 2866 | "SI2quater Neighbor List\n" |
| 2867 | "SI2quater Neighbor List\n" "Add to manual SI2quater neighbor list\n" |
| 2868 | "UARFCN of neighbor\n" "UARFCN of neighbor\n" "scrambling code\n" |
| 2869 | "diversity bit\n") |
| 2870 | { |
| 2871 | struct gsm_bts *bts = vty->index; |
| 2872 | uint16_t arfcn = atoi(argv[0]), scramble = atoi(argv[1]); |
| 2873 | |
| 2874 | switch(bts_uarfcn_add(bts, arfcn, scramble, atoi(argv[2]))) { |
| 2875 | case -ENOMEM: |
| 2876 | vty_out(vty, "Unable to add arfcn: max number of UARFCNs (%u) " |
| 2877 | "reached%s", MAX_EARFCN_LIST, VTY_NEWLINE); |
Harald Welte | a191dcd | 2016-11-26 15:06:37 +0100 | [diff] [blame] | 2878 | return CMD_WARNING; |
Max | aafff96 | 2016-04-20 15:57:14 +0200 | [diff] [blame] | 2879 | case -ENOSPC: |
| 2880 | vty_out(vty, "Warning: not enough space in si2quater for a " |
| 2881 | "given arfcn%s", VTY_NEWLINE); |
Harald Welte | a191dcd | 2016-11-26 15:06:37 +0100 | [diff] [blame] | 2882 | return CMD_WARNING; |
Max | 26679e0 | 2016-04-20 15:57:13 +0200 | [diff] [blame] | 2883 | case -EADDRINUSE: |
| 2884 | vty_out(vty, "Unable to add arfcn: (%u, %u) is already added%s", |
| 2885 | arfcn, scramble, VTY_NEWLINE); |
| 2886 | return CMD_WARNING; |
| 2887 | } |
| 2888 | |
| 2889 | return CMD_SUCCESS; |
| 2890 | } |
| 2891 | |
| 2892 | DEFUN(cfg_bts_si2quater_uarfcn_del, cfg_bts_si2quater_uarfcn_del_cmd, |
Max | 35697b9 | 2016-04-29 12:51:31 +0200 | [diff] [blame] | 2893 | "si2quater neighbor-list del uarfcn <0-16383> <0-511>", |
Max | 26679e0 | 2016-04-20 15:57:13 +0200 | [diff] [blame] | 2894 | "SI2quater Neighbor List\n" |
| 2895 | "SI2quater Neighbor List\n" |
| 2896 | "Delete from SI2quater manual neighbor list\n" |
| 2897 | "UARFCN of neighbor\n" |
| 2898 | "UARFCN\n" |
| 2899 | "scrambling code\n") |
| 2900 | { |
| 2901 | struct gsm_bts *bts = vty->index; |
| 2902 | |
| 2903 | if (bts_uarfcn_del(bts, atoi(argv[0]), atoi(argv[1])) < 0) { |
| 2904 | vty_out(vty, "Unable to delete uarfcn: pair not found%s", |
| 2905 | VTY_NEWLINE); |
| 2906 | return CMD_WARNING; |
| 2907 | } |
| 2908 | |
| 2909 | return CMD_SUCCESS; |
| 2910 | } |
| 2911 | |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 2912 | DEFUN(cfg_bts_si5_neigh, cfg_bts_si5_neigh_cmd, |
Harald Welte | 1fe73a1 | 2012-01-29 13:24:12 +0100 | [diff] [blame] | 2913 | "si5 neighbor-list (add|del) arfcn <0-1023>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 2914 | "SI5 Neighbor List\n" |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 2915 | "SI5 Neighbor List\n" "Add to manual SI5 neighbor list\n" |
| 2916 | "Delete from SI5 manual neighbor list\n" "ARFCN of neighbor\n" |
| 2917 | "ARFCN of neighbor\n") |
| 2918 | { |
| 2919 | struct gsm_bts *bts = vty->index; |
| 2920 | struct bitvec *bv = &bts->si_common.si5_neigh_list; |
| 2921 | uint16_t arfcn = atoi(argv[1]); |
| 2922 | |
| 2923 | if (!bts->neigh_list_manual_mode) { |
| 2924 | vty_out(vty, "%% Cannot configure neighbor list in " |
| 2925 | "automatic mode%s", VTY_NEWLINE); |
| 2926 | return CMD_WARNING; |
| 2927 | } |
| 2928 | |
| 2929 | if (!strcmp(argv[0], "add")) |
| 2930 | bitvec_set_bit_pos(bv, arfcn, 1); |
| 2931 | else |
| 2932 | bitvec_set_bit_pos(bv, arfcn, 0); |
| 2933 | |
| 2934 | return CMD_SUCCESS; |
| 2935 | } |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 2936 | |
Holger Hans Peter Freyther | e30d40d | 2012-07-20 10:27:31 +0200 | [diff] [blame] | 2937 | #define EXCL_RFLOCK_STR "Exclude this BTS from the global RF Lock\n" |
| 2938 | |
| 2939 | DEFUN(cfg_bts_excl_rf_lock, |
| 2940 | cfg_bts_excl_rf_lock_cmd, |
| 2941 | "rf-lock-exclude", |
| 2942 | EXCL_RFLOCK_STR) |
| 2943 | { |
| 2944 | struct gsm_bts *bts = vty->index; |
| 2945 | bts->excl_from_rf_lock = 1; |
| 2946 | return CMD_SUCCESS; |
| 2947 | } |
| 2948 | |
| 2949 | DEFUN(cfg_bts_no_excl_rf_lock, |
| 2950 | cfg_bts_no_excl_rf_lock_cmd, |
| 2951 | "no rf-lock-exclude", |
| 2952 | NO_STR EXCL_RFLOCK_STR) |
| 2953 | { |
| 2954 | struct gsm_bts *bts = vty->index; |
| 2955 | bts->excl_from_rf_lock = 0; |
| 2956 | return CMD_SUCCESS; |
| 2957 | } |
| 2958 | |
Jacob Erlbeck | 65d114f | 2014-01-16 11:02:14 +0100 | [diff] [blame] | 2959 | #define FORCE_COMB_SI_STR "Force the generation of a single SI (no ter/bis)\n" |
| 2960 | |
| 2961 | DEFUN(cfg_bts_force_comb_si, |
| 2962 | cfg_bts_force_comb_si_cmd, |
| 2963 | "force-combined-si", |
| 2964 | FORCE_COMB_SI_STR) |
| 2965 | { |
| 2966 | struct gsm_bts *bts = vty->index; |
| 2967 | bts->force_combined_si = 1; |
| 2968 | return CMD_SUCCESS; |
| 2969 | } |
| 2970 | |
| 2971 | DEFUN(cfg_bts_no_force_comb_si, |
| 2972 | cfg_bts_no_force_comb_si_cmd, |
| 2973 | "no force-combined-si", |
| 2974 | NO_STR FORCE_COMB_SI_STR) |
| 2975 | { |
| 2976 | struct gsm_bts *bts = vty->index; |
| 2977 | bts->force_combined_si = 0; |
| 2978 | return CMD_SUCCESS; |
| 2979 | } |
| 2980 | |
Andreas Eversberg | a83d511 | 2013-12-07 18:32:28 +0100 | [diff] [blame] | 2981 | static void _get_codec_from_arg(struct vty *vty, int argc, const char *argv[]) |
| 2982 | { |
| 2983 | struct gsm_bts *bts = vty->index; |
| 2984 | struct bts_codec_conf *codec = &bts->codec; |
| 2985 | int i; |
| 2986 | |
| 2987 | codec->hr = 0; |
| 2988 | codec->efr = 0; |
| 2989 | codec->amr = 0; |
| 2990 | for (i = 0; i < argc; i++) { |
| 2991 | if (!strcmp(argv[i], "hr")) |
| 2992 | codec->hr = 1; |
| 2993 | if (!strcmp(argv[i], "efr")) |
| 2994 | codec->efr = 1; |
| 2995 | if (!strcmp(argv[i], "amr")) |
| 2996 | codec->amr = 1; |
| 2997 | } |
| 2998 | } |
| 2999 | |
| 3000 | #define CODEC_PAR_STR " (hr|efr|amr)" |
| 3001 | #define CODEC_HELP_STR "Half Rate\n" \ |
| 3002 | "Enhanced Full Rate\nAdaptive Multirate\n" |
| 3003 | |
| 3004 | DEFUN(cfg_bts_codec0, cfg_bts_codec0_cmd, |
| 3005 | "codec-support fr", |
| 3006 | "Codec Support settings\nFullrate\n") |
| 3007 | { |
| 3008 | _get_codec_from_arg(vty, 0, argv); |
| 3009 | return CMD_SUCCESS; |
| 3010 | } |
| 3011 | |
| 3012 | DEFUN(cfg_bts_codec1, cfg_bts_codec1_cmd, |
| 3013 | "codec-support fr" CODEC_PAR_STR, |
| 3014 | "Codec Support settings\nFullrate\n" |
| 3015 | CODEC_HELP_STR) |
| 3016 | { |
| 3017 | _get_codec_from_arg(vty, 1, argv); |
| 3018 | return CMD_SUCCESS; |
| 3019 | } |
| 3020 | |
| 3021 | DEFUN(cfg_bts_codec2, cfg_bts_codec2_cmd, |
| 3022 | "codec-support fr" CODEC_PAR_STR CODEC_PAR_STR, |
| 3023 | "Codec Support settings\nFullrate\n" |
| 3024 | CODEC_HELP_STR CODEC_HELP_STR) |
| 3025 | { |
| 3026 | _get_codec_from_arg(vty, 2, argv); |
| 3027 | return CMD_SUCCESS; |
| 3028 | } |
| 3029 | |
| 3030 | DEFUN(cfg_bts_codec3, cfg_bts_codec3_cmd, |
| 3031 | "codec-support fr" CODEC_PAR_STR CODEC_PAR_STR CODEC_PAR_STR, |
| 3032 | "Codec Support settings\nFullrate\n" |
| 3033 | CODEC_HELP_STR CODEC_HELP_STR CODEC_HELP_STR) |
| 3034 | { |
| 3035 | _get_codec_from_arg(vty, 3, argv); |
| 3036 | return CMD_SUCCESS; |
| 3037 | } |
| 3038 | |
| 3039 | DEFUN(cfg_bts_codec4, cfg_bts_codec4_cmd, |
| 3040 | "codec-support fr" CODEC_PAR_STR CODEC_PAR_STR CODEC_PAR_STR CODEC_PAR_STR, |
| 3041 | "Codec Support settings\nFullrate\n" |
| 3042 | CODEC_HELP_STR CODEC_HELP_STR CODEC_HELP_STR CODEC_HELP_STR) |
| 3043 | { |
| 3044 | _get_codec_from_arg(vty, 4, argv); |
| 3045 | return CMD_SUCCESS; |
| 3046 | } |
| 3047 | |
Holger Hans Peter Freyther | c22930e | 2014-12-17 14:46:17 +0100 | [diff] [blame] | 3048 | DEFUN(cfg_bts_depends_on, cfg_bts_depends_on_cmd, |
| 3049 | "depends-on-bts <0-255>", |
| 3050 | "This BTS can only be started if another one is up\n" "BTS Number\n") |
| 3051 | { |
| 3052 | struct gsm_bts *bts = vty->index; |
| 3053 | struct gsm_bts *other_bts; |
| 3054 | int dep = atoi(argv[0]); |
| 3055 | |
| 3056 | |
| 3057 | if (!is_ipaccess_bts(bts)) { |
| 3058 | vty_out(vty, "This feature is only available for IP systems.%s", |
| 3059 | VTY_NEWLINE); |
| 3060 | return CMD_WARNING; |
| 3061 | } |
| 3062 | |
| 3063 | other_bts = gsm_bts_num(bts->network, dep); |
| 3064 | if (!other_bts || !is_ipaccess_bts(other_bts)) { |
| 3065 | vty_out(vty, "This feature is only available for IP systems.%s", |
| 3066 | VTY_NEWLINE); |
| 3067 | return CMD_WARNING; |
| 3068 | } |
| 3069 | |
| 3070 | if (dep >= bts->nr) { |
| 3071 | vty_out(vty, "%%Need to depend on an already declared unit.%s", |
| 3072 | VTY_NEWLINE); |
| 3073 | return CMD_WARNING; |
| 3074 | } |
| 3075 | |
| 3076 | bts_depend_mark(bts, dep); |
| 3077 | return CMD_SUCCESS; |
| 3078 | } |
| 3079 | |
| 3080 | DEFUN(cfg_bts_no_depends_on, cfg_bts_no_depends_on_cmd, |
| 3081 | "depeneds-on-bts <0-255>", |
| 3082 | NO_STR "This BTS can only be started if another one is up\n" |
| 3083 | "BTS Number\n") |
| 3084 | { |
| 3085 | struct gsm_bts *bts = vty->index; |
| 3086 | int dep = atoi(argv[0]); |
| 3087 | |
| 3088 | bts_depend_clear(bts, dep); |
| 3089 | return CMD_SUCCESS; |
| 3090 | } |
| 3091 | |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 3092 | #define AMR_TEXT "Adaptive Multi Rate settings\n" |
| 3093 | #define AMR_MODE_TEXT "Codec modes to use with AMR codec\n" |
| 3094 | #define AMR_START_TEXT "Initial codec to use with AMR\n" \ |
| 3095 | "Automatically\nFirst codec\nSecond codec\nThird codec\nFourth codec\n" |
| 3096 | #define AMR_TH_TEXT "AMR threshold between codecs\nMS side\nBTS side\n" |
| 3097 | #define AMR_HY_TEXT "AMR hysteresis between codecs\nMS side\nBTS side\n" |
| 3098 | |
| 3099 | static void get_amr_from_arg(struct vty *vty, int argc, const char *argv[], int full) |
| 3100 | { |
| 3101 | struct gsm_bts *bts = vty->index; |
| 3102 | struct amr_multirate_conf *mr = (full) ? &bts->mr_full: &bts->mr_half; |
| 3103 | struct gsm48_multi_rate_conf *mr_conf = |
| 3104 | (struct gsm48_multi_rate_conf *) mr->gsm48_ie; |
| 3105 | int i; |
| 3106 | |
| 3107 | mr->gsm48_ie[1] = 0; |
| 3108 | for (i = 0; i < argc; i++) |
| 3109 | mr->gsm48_ie[1] |= 1 << atoi(argv[i]); |
| 3110 | mr_conf->icmi = 0; |
| 3111 | } |
| 3112 | |
| 3113 | static void get_amr_th_from_arg(struct vty *vty, int argc, const char *argv[], int full) |
| 3114 | { |
| 3115 | struct gsm_bts *bts = vty->index; |
| 3116 | struct amr_multirate_conf *mr = (full) ? &bts->mr_full: &bts->mr_half; |
Holger Hans Peter Freyther | a174a47 | 2015-09-24 11:39:38 +0200 | [diff] [blame] | 3117 | struct amr_mode *modes; |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 3118 | int i; |
| 3119 | |
Holger Hans Peter Freyther | a174a47 | 2015-09-24 11:39:38 +0200 | [diff] [blame] | 3120 | modes = argv[0][0]=='m' ? mr->ms_mode : mr->bts_mode; |
| 3121 | for (i = 0; i < argc - 1; i++) |
| 3122 | modes[i].threshold = atoi(argv[i + 1]); |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 3123 | } |
| 3124 | |
| 3125 | static void get_amr_hy_from_arg(struct vty *vty, int argc, const char *argv[], int full) |
| 3126 | { |
| 3127 | struct gsm_bts *bts = vty->index; |
| 3128 | struct amr_multirate_conf *mr = (full) ? &bts->mr_full: &bts->mr_half; |
Holger Hans Peter Freyther | a174a47 | 2015-09-24 11:39:38 +0200 | [diff] [blame] | 3129 | struct amr_mode *modes; |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 3130 | int i; |
| 3131 | |
Holger Hans Peter Freyther | a174a47 | 2015-09-24 11:39:38 +0200 | [diff] [blame] | 3132 | modes = argv[0][0]=='m' ? mr->ms_mode : mr->bts_mode; |
| 3133 | for (i = 0; i < argc - 1; i++) |
| 3134 | modes[i].hysteresis = atoi(argv[i + 1]); |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 3135 | } |
| 3136 | |
| 3137 | static void get_amr_start_from_arg(struct vty *vty, const char *argv[], int full) |
| 3138 | { |
| 3139 | struct gsm_bts *bts = vty->index; |
| 3140 | struct amr_multirate_conf *mr = (full) ? &bts->mr_full: &bts->mr_half; |
| 3141 | struct gsm48_multi_rate_conf *mr_conf = |
| 3142 | (struct gsm48_multi_rate_conf *) mr->gsm48_ie; |
| 3143 | int num = 0, i; |
| 3144 | |
| 3145 | for (i = 0; i < ((full) ? 8 : 6); i++) { |
| 3146 | if ((mr->gsm48_ie[1] & (1 << i))) { |
| 3147 | num++; |
| 3148 | } |
| 3149 | } |
| 3150 | |
| 3151 | if (argv[0][0] == 'a' || num == 0) |
| 3152 | mr_conf->icmi = 0; |
| 3153 | else { |
| 3154 | mr_conf->icmi = 1; |
| 3155 | if (num < atoi(argv[0])) |
| 3156 | mr_conf->smod = num - 1; |
| 3157 | else |
| 3158 | mr_conf->smod = atoi(argv[0]) - 1; |
| 3159 | } |
| 3160 | } |
| 3161 | |
| 3162 | #define AMR_TCHF_PAR_STR " (0|1|2|3|4|5|6|7)" |
| 3163 | #define AMR_TCHF_HELP_STR "4,75k\n5,15k\n5,90k\n6,70k\n7,40k\n7,95k\n" \ |
| 3164 | "10,2k\n12,2k\n" |
| 3165 | |
| 3166 | #define AMR_TCHH_PAR_STR " (0|1|2|3|4|5)" |
| 3167 | #define AMR_TCHH_HELP_STR "4,75k\n5,15k\n5,90k\n6,70k\n7,40k\n7,95k\n" |
| 3168 | |
| 3169 | #define AMR_TH_HELP_STR "Threshold between codec 1 and 2\n" |
| 3170 | #define AMR_HY_HELP_STR "Hysteresis between codec 1 and 2\n" |
| 3171 | |
| 3172 | DEFUN(cfg_bts_amr_fr_modes1, cfg_bts_amr_fr_modes1_cmd, |
| 3173 | "amr tch-f modes" AMR_TCHF_PAR_STR, |
| 3174 | AMR_TEXT "Full Rate\n" AMR_MODE_TEXT |
| 3175 | AMR_TCHF_HELP_STR) |
| 3176 | { |
| 3177 | get_amr_from_arg(vty, 1, argv, 1); |
| 3178 | return CMD_SUCCESS; |
| 3179 | } |
| 3180 | |
| 3181 | DEFUN(cfg_bts_amr_fr_modes2, cfg_bts_amr_fr_modes2_cmd, |
| 3182 | "amr tch-f modes" AMR_TCHF_PAR_STR AMR_TCHF_PAR_STR, |
| 3183 | AMR_TEXT "Full Rate\n" AMR_MODE_TEXT |
| 3184 | AMR_TCHF_HELP_STR AMR_TCHF_HELP_STR) |
| 3185 | { |
| 3186 | get_amr_from_arg(vty, 2, argv, 1); |
| 3187 | return CMD_SUCCESS; |
| 3188 | } |
| 3189 | |
| 3190 | DEFUN(cfg_bts_amr_fr_modes3, cfg_bts_amr_fr_modes3_cmd, |
| 3191 | "amr tch-f modes" AMR_TCHF_PAR_STR AMR_TCHF_PAR_STR AMR_TCHF_PAR_STR, |
| 3192 | AMR_TEXT "Full Rate\n" AMR_MODE_TEXT |
| 3193 | AMR_TCHF_HELP_STR AMR_TCHF_HELP_STR AMR_TCHF_HELP_STR) |
| 3194 | { |
| 3195 | get_amr_from_arg(vty, 3, argv, 1); |
| 3196 | return CMD_SUCCESS; |
| 3197 | } |
| 3198 | |
| 3199 | DEFUN(cfg_bts_amr_fr_modes4, cfg_bts_amr_fr_modes4_cmd, |
| 3200 | "amr tch-f modes" AMR_TCHF_PAR_STR AMR_TCHF_PAR_STR AMR_TCHF_PAR_STR AMR_TCHF_PAR_STR, |
| 3201 | AMR_TEXT "Full Rate\n" AMR_MODE_TEXT |
| 3202 | AMR_TCHF_HELP_STR AMR_TCHF_HELP_STR AMR_TCHF_HELP_STR AMR_TCHF_HELP_STR) |
| 3203 | { |
| 3204 | get_amr_from_arg(vty, 4, argv, 1); |
| 3205 | return CMD_SUCCESS; |
| 3206 | } |
| 3207 | |
| 3208 | DEFUN(cfg_bts_amr_fr_start_mode, cfg_bts_amr_fr_start_mode_cmd, |
| 3209 | "amr tch-f start-mode (auto|1|2|3|4)", |
| 3210 | AMR_TEXT "Full Rate\n" AMR_START_TEXT) |
| 3211 | { |
| 3212 | get_amr_start_from_arg(vty, argv, 1); |
| 3213 | return CMD_SUCCESS; |
| 3214 | } |
| 3215 | |
| 3216 | DEFUN(cfg_bts_amr_fr_thres1, cfg_bts_amr_fr_thres1_cmd, |
| 3217 | "amr tch-f threshold (ms|bts) <0-63>", |
| 3218 | AMR_TEXT "Full Rate\n" AMR_TH_TEXT |
| 3219 | AMR_TH_HELP_STR) |
| 3220 | { |
| 3221 | get_amr_th_from_arg(vty, 2, argv, 1); |
| 3222 | return CMD_SUCCESS; |
| 3223 | } |
| 3224 | |
| 3225 | DEFUN(cfg_bts_amr_fr_thres2, cfg_bts_amr_fr_thres2_cmd, |
| 3226 | "amr tch-f threshold (ms|bts) <0-63> <0-63>", |
| 3227 | AMR_TEXT "Full Rate\n" AMR_TH_TEXT |
| 3228 | AMR_TH_HELP_STR AMR_TH_HELP_STR) |
| 3229 | { |
| 3230 | get_amr_th_from_arg(vty, 3, argv, 1); |
| 3231 | return CMD_SUCCESS; |
| 3232 | } |
| 3233 | |
| 3234 | DEFUN(cfg_bts_amr_fr_thres3, cfg_bts_amr_fr_thres3_cmd, |
| 3235 | "amr tch-f threshold (ms|bts) <0-63> <0-63> <0-63>", |
| 3236 | AMR_TEXT "Full Rate\n" AMR_TH_TEXT |
| 3237 | AMR_TH_HELP_STR AMR_TH_HELP_STR AMR_TH_HELP_STR) |
| 3238 | { |
| 3239 | get_amr_th_from_arg(vty, 4, argv, 1); |
| 3240 | return CMD_SUCCESS; |
| 3241 | } |
| 3242 | |
| 3243 | DEFUN(cfg_bts_amr_fr_hyst1, cfg_bts_amr_fr_hyst1_cmd, |
| 3244 | "amr tch-f hysteresis (ms|bts) <0-15>", |
| 3245 | AMR_TEXT "Full Rate\n" AMR_HY_TEXT |
| 3246 | AMR_HY_HELP_STR) |
| 3247 | { |
| 3248 | get_amr_hy_from_arg(vty, 2, argv, 1); |
| 3249 | return CMD_SUCCESS; |
| 3250 | } |
| 3251 | |
| 3252 | DEFUN(cfg_bts_amr_fr_hyst2, cfg_bts_amr_fr_hyst2_cmd, |
| 3253 | "amr tch-f hysteresis (ms|bts) <0-15> <0-15>", |
| 3254 | AMR_TEXT "Full Rate\n" AMR_HY_TEXT |
| 3255 | AMR_HY_HELP_STR AMR_HY_HELP_STR) |
| 3256 | { |
| 3257 | get_amr_hy_from_arg(vty, 3, argv, 1); |
| 3258 | return CMD_SUCCESS; |
| 3259 | } |
| 3260 | |
| 3261 | DEFUN(cfg_bts_amr_fr_hyst3, cfg_bts_amr_fr_hyst3_cmd, |
| 3262 | "amr tch-f hysteresis (ms|bts) <0-15> <0-15> <0-15>", |
| 3263 | AMR_TEXT "Full Rate\n" AMR_HY_TEXT |
| 3264 | AMR_HY_HELP_STR AMR_HY_HELP_STR AMR_HY_HELP_STR) |
| 3265 | { |
| 3266 | get_amr_hy_from_arg(vty, 4, argv, 1); |
| 3267 | return CMD_SUCCESS; |
| 3268 | } |
| 3269 | |
| 3270 | DEFUN(cfg_bts_amr_hr_modes1, cfg_bts_amr_hr_modes1_cmd, |
| 3271 | "amr tch-h modes" AMR_TCHH_PAR_STR, |
| 3272 | AMR_TEXT "Half Rate\n" AMR_MODE_TEXT |
| 3273 | AMR_TCHH_HELP_STR) |
| 3274 | { |
| 3275 | get_amr_from_arg(vty, 1, argv, 0); |
| 3276 | return CMD_SUCCESS; |
| 3277 | } |
| 3278 | |
| 3279 | DEFUN(cfg_bts_amr_hr_modes2, cfg_bts_amr_hr_modes2_cmd, |
| 3280 | "amr tch-h modes" AMR_TCHH_PAR_STR AMR_TCHH_PAR_STR, |
| 3281 | AMR_TEXT "Half Rate\n" AMR_MODE_TEXT |
| 3282 | AMR_TCHH_HELP_STR AMR_TCHH_HELP_STR) |
| 3283 | { |
| 3284 | get_amr_from_arg(vty, 2, argv, 0); |
| 3285 | return CMD_SUCCESS; |
| 3286 | } |
| 3287 | |
| 3288 | DEFUN(cfg_bts_amr_hr_modes3, cfg_bts_amr_hr_modes3_cmd, |
| 3289 | "amr tch-h modes" AMR_TCHH_PAR_STR AMR_TCHH_PAR_STR AMR_TCHH_PAR_STR, |
| 3290 | AMR_TEXT "Half Rate\n" AMR_MODE_TEXT |
| 3291 | AMR_TCHH_HELP_STR AMR_TCHH_HELP_STR AMR_TCHH_HELP_STR) |
| 3292 | { |
| 3293 | get_amr_from_arg(vty, 3, argv, 0); |
| 3294 | return CMD_SUCCESS; |
| 3295 | } |
| 3296 | |
| 3297 | DEFUN(cfg_bts_amr_hr_modes4, cfg_bts_amr_hr_modes4_cmd, |
| 3298 | "amr tch-h modes" AMR_TCHH_PAR_STR AMR_TCHH_PAR_STR AMR_TCHH_PAR_STR AMR_TCHH_PAR_STR, |
| 3299 | AMR_TEXT "Half Rate\n" AMR_MODE_TEXT |
| 3300 | AMR_TCHH_HELP_STR AMR_TCHH_HELP_STR AMR_TCHH_HELP_STR AMR_TCHH_HELP_STR) |
| 3301 | { |
| 3302 | get_amr_from_arg(vty, 4, argv, 0); |
| 3303 | return CMD_SUCCESS; |
| 3304 | } |
| 3305 | |
| 3306 | DEFUN(cfg_bts_amr_hr_start_mode, cfg_bts_amr_hr_start_mode_cmd, |
| 3307 | "amr tch-h start-mode (auto|1|2|3|4)", |
| 3308 | AMR_TEXT "Half Rate\n" AMR_START_TEXT) |
| 3309 | { |
| 3310 | get_amr_start_from_arg(vty, argv, 0); |
| 3311 | return CMD_SUCCESS; |
| 3312 | } |
| 3313 | |
| 3314 | DEFUN(cfg_bts_amr_hr_thres1, cfg_bts_amr_hr_thres1_cmd, |
| 3315 | "amr tch-h threshold (ms|bts) <0-63>", |
| 3316 | AMR_TEXT "Half Rate\n" AMR_TH_TEXT |
| 3317 | AMR_TH_HELP_STR) |
| 3318 | { |
| 3319 | get_amr_th_from_arg(vty, 2, argv, 0); |
| 3320 | return CMD_SUCCESS; |
| 3321 | } |
| 3322 | |
| 3323 | DEFUN(cfg_bts_amr_hr_thres2, cfg_bts_amr_hr_thres2_cmd, |
| 3324 | "amr tch-h threshold (ms|bts) <0-63> <0-63>", |
| 3325 | AMR_TEXT "Half Rate\n" AMR_TH_TEXT |
| 3326 | AMR_TH_HELP_STR AMR_TH_HELP_STR) |
| 3327 | { |
| 3328 | get_amr_th_from_arg(vty, 3, argv, 0); |
| 3329 | return CMD_SUCCESS; |
| 3330 | } |
| 3331 | |
| 3332 | DEFUN(cfg_bts_amr_hr_thres3, cfg_bts_amr_hr_thres3_cmd, |
| 3333 | "amr tch-h threshold (ms|bts) <0-63> <0-63> <0-63>", |
| 3334 | AMR_TEXT "Half Rate\n" AMR_TH_TEXT |
| 3335 | AMR_TH_HELP_STR AMR_TH_HELP_STR AMR_TH_HELP_STR) |
| 3336 | { |
| 3337 | get_amr_th_from_arg(vty, 4, argv, 0); |
| 3338 | return CMD_SUCCESS; |
| 3339 | } |
| 3340 | |
| 3341 | DEFUN(cfg_bts_amr_hr_hyst1, cfg_bts_amr_hr_hyst1_cmd, |
| 3342 | "amr tch-h hysteresis (ms|bts) <0-15>", |
| 3343 | AMR_TEXT "Half Rate\n" AMR_HY_TEXT |
| 3344 | AMR_HY_HELP_STR) |
| 3345 | { |
| 3346 | get_amr_hy_from_arg(vty, 2, argv, 0); |
| 3347 | return CMD_SUCCESS; |
| 3348 | } |
| 3349 | |
| 3350 | DEFUN(cfg_bts_amr_hr_hyst2, cfg_bts_amr_hr_hyst2_cmd, |
| 3351 | "amr tch-h hysteresis (ms|bts) <0-15> <0-15>", |
| 3352 | AMR_TEXT "Half Rate\n" AMR_HY_TEXT |
| 3353 | AMR_HY_HELP_STR AMR_HY_HELP_STR) |
| 3354 | { |
| 3355 | get_amr_hy_from_arg(vty, 3, argv, 0); |
| 3356 | return CMD_SUCCESS; |
| 3357 | } |
| 3358 | |
| 3359 | DEFUN(cfg_bts_amr_hr_hyst3, cfg_bts_amr_hr_hyst3_cmd, |
| 3360 | "amr tch-h hysteresis (ms|bts) <0-15> <0-15> <0-15>", |
| 3361 | AMR_TEXT "Half Rate\n" AMR_HY_TEXT |
| 3362 | AMR_HY_HELP_STR AMR_HY_HELP_STR AMR_HY_HELP_STR) |
| 3363 | { |
| 3364 | get_amr_hy_from_arg(vty, 4, argv, 0); |
| 3365 | return CMD_SUCCESS; |
| 3366 | } |
| 3367 | |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 3368 | #define TRX_TEXT "Radio Transceiver\n" |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 3369 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3370 | /* per TRX configuration */ |
| 3371 | DEFUN(cfg_trx, |
| 3372 | cfg_trx_cmd, |
Harald Welte | 57e0724 | 2012-08-17 12:50:14 +0200 | [diff] [blame] | 3373 | "trx <0-255>", |
Harald Welte | 8f0ed55 | 2010-05-11 21:53:49 +0200 | [diff] [blame] | 3374 | TRX_TEXT |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3375 | "Select a TRX to configure") |
| 3376 | { |
| 3377 | int trx_nr = atoi(argv[0]); |
| 3378 | struct gsm_bts *bts = vty->index; |
| 3379 | struct gsm_bts_trx *trx; |
| 3380 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 3381 | if (trx_nr > bts->num_trx) { |
| 3382 | vty_out(vty, "%% The next unused TRX number in this BTS is %u%s", |
| 3383 | bts->num_trx, VTY_NEWLINE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3384 | return CMD_WARNING; |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 3385 | } else if (trx_nr == bts->num_trx) { |
| 3386 | /* we need to allocate a new one */ |
| 3387 | trx = gsm_bts_trx_alloc(bts); |
Holger Hans Peter Freyther | acf8a0c | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 3388 | } else |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 3389 | trx = gsm_bts_trx_num(bts, trx_nr); |
Holger Hans Peter Freyther | acf8a0c | 2010-03-29 08:47:44 +0200 | [diff] [blame] | 3390 | |
Harald Welte | e441d9c | 2009-06-21 16:17:15 +0200 | [diff] [blame] | 3391 | if (!trx) |
| 3392 | return CMD_WARNING; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3393 | |
| 3394 | vty->index = trx; |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 3395 | vty->index_sub = &trx->description; |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3396 | vty->node = TRX_NODE; |
| 3397 | |
| 3398 | return CMD_SUCCESS; |
| 3399 | } |
| 3400 | |
| 3401 | DEFUN(cfg_trx_arfcn, |
| 3402 | cfg_trx_arfcn_cmd, |
Harald Welte | 1fe73a1 | 2012-01-29 13:24:12 +0100 | [diff] [blame] | 3403 | "arfcn <0-1023>", |
Harald Welte | 13fe219 | 2012-08-17 09:57:25 +0200 | [diff] [blame] | 3404 | "Set the ARFCN for this TRX\n" |
| 3405 | "Absolute Radio Frequency Channel Number\n") |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3406 | { |
| 3407 | int arfcn = atoi(argv[0]); |
| 3408 | struct gsm_bts_trx *trx = vty->index; |
| 3409 | |
| 3410 | /* FIXME: check if this ARFCN is supported by this TRX */ |
| 3411 | |
| 3412 | trx->arfcn = arfcn; |
| 3413 | |
| 3414 | /* FIXME: patch ARFCN into SYSTEM INFORMATION */ |
| 3415 | /* FIXME: use OML layer to update the ARFCN */ |
| 3416 | /* FIXME: use RSL layer to update SYSTEM INFORMATION */ |
| 3417 | |
| 3418 | return CMD_SUCCESS; |
| 3419 | } |
| 3420 | |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 3421 | DEFUN(cfg_trx_nominal_power, |
| 3422 | cfg_trx_nominal_power_cmd, |
| 3423 | "nominal power <0-100>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3424 | "Nominal TRX RF Power in dBm\n" |
| 3425 | "Nominal TRX RF Power in dBm\n" |
| 3426 | "Nominal TRX RF Power in dBm\n") |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 3427 | { |
| 3428 | struct gsm_bts_trx *trx = vty->index; |
| 3429 | |
| 3430 | trx->nominal_power = atoi(argv[0]); |
| 3431 | |
| 3432 | return CMD_SUCCESS; |
| 3433 | } |
| 3434 | |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 3435 | DEFUN(cfg_trx_max_power_red, |
| 3436 | cfg_trx_max_power_red_cmd, |
| 3437 | "max_power_red <0-100>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3438 | "Reduction of maximum BS RF Power (relative to nominal power)\n" |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 3439 | "Reduction of maximum BS RF Power in dB\n") |
| 3440 | { |
| 3441 | int maxpwr_r = atoi(argv[0]); |
| 3442 | struct gsm_bts_trx *trx = vty->index; |
Harald Welte | 61a83b2 | 2009-11-18 09:20:22 +0100 | [diff] [blame] | 3443 | int upper_limit = 24; /* default 12.21 max power red. */ |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 3444 | |
| 3445 | /* FIXME: check if our BTS type supports more than 12 */ |
| 3446 | if (maxpwr_r < 0 || maxpwr_r > upper_limit) { |
| 3447 | vty_out(vty, "%% Power %d dB is not in the valid range%s", |
| 3448 | maxpwr_r, VTY_NEWLINE); |
| 3449 | return CMD_WARNING; |
| 3450 | } |
| 3451 | if (maxpwr_r & 1) { |
| 3452 | vty_out(vty, "%% Power %d dB is not an even value%s", |
| 3453 | maxpwr_r, VTY_NEWLINE); |
| 3454 | return CMD_WARNING; |
| 3455 | } |
| 3456 | |
| 3457 | trx->max_power_red = maxpwr_r; |
| 3458 | |
| 3459 | /* FIXME: make sure we update this using OML */ |
| 3460 | |
| 3461 | return CMD_SUCCESS; |
| 3462 | } |
| 3463 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3464 | DEFUN(cfg_trx_rsl_e1, |
| 3465 | cfg_trx_rsl_e1_cmd, |
| 3466 | "rsl e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3467 | "RSL Parameters\n" |
| 3468 | "E1/T1 interface to be used for RSL\n" |
| 3469 | "E1/T1 interface to be used for RSL\n" |
| 3470 | "E1/T1 Line Number to be used for RSL\n" |
| 3471 | "E1/T1 Timeslot to be used for RSL\n" |
| 3472 | "E1/T1 Timeslot to be used for RSL\n" |
| 3473 | "E1/T1 Sub-slot to be used for RSL\n" |
| 3474 | "E1/T1 Sub-slot 0 is to be used for RSL\n" |
| 3475 | "E1/T1 Sub-slot 1 is to be used for RSL\n" |
| 3476 | "E1/T1 Sub-slot 2 is to be used for RSL\n" |
| 3477 | "E1/T1 Sub-slot 3 is to be used for RSL\n" |
| 3478 | "E1/T1 full timeslot is to be used for RSL\n") |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3479 | { |
| 3480 | struct gsm_bts_trx *trx = vty->index; |
| 3481 | |
| 3482 | parse_e1_link(&trx->rsl_e1_link, argv[0], argv[1], argv[2]); |
| 3483 | |
| 3484 | return CMD_SUCCESS; |
| 3485 | } |
| 3486 | |
| 3487 | DEFUN(cfg_trx_rsl_e1_tei, |
| 3488 | cfg_trx_rsl_e1_tei_cmd, |
| 3489 | "rsl e1 tei <0-63>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3490 | "RSL Parameters\n" |
| 3491 | "Set the TEI to be used for RSL\n" |
| 3492 | "Set the TEI to be used for RSL\n" |
| 3493 | "TEI to be used for RSL\n") |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3494 | { |
| 3495 | struct gsm_bts_trx *trx = vty->index; |
| 3496 | |
| 3497 | trx->rsl_tei = atoi(argv[0]); |
| 3498 | |
| 3499 | return CMD_SUCCESS; |
| 3500 | } |
| 3501 | |
Holger Hans Peter Freyther | 2d501ea | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 3502 | DEFUN(cfg_trx_rf_locked, |
| 3503 | cfg_trx_rf_locked_cmd, |
| 3504 | "rf_locked (0|1)", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3505 | "Set or unset the RF Locking (Turn off RF of the TRX)\n" |
| 3506 | "TRX is NOT RF locked (active)\n" |
| 3507 | "TRX is RF locked (turned off)\n") |
Holger Hans Peter Freyther | 2d501ea | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 3508 | { |
| 3509 | int locked = atoi(argv[0]); |
| 3510 | struct gsm_bts_trx *trx = vty->index; |
| 3511 | |
| 3512 | gsm_trx_lock_rf(trx, locked); |
| 3513 | return CMD_SUCCESS; |
| 3514 | } |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3515 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3516 | /* per TS configuration */ |
| 3517 | DEFUN(cfg_ts, |
| 3518 | cfg_ts_cmd, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3519 | "timeslot <0-7>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3520 | "Select a Timeslot to configure\n" |
| 3521 | "Timeslot number\n") |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3522 | { |
| 3523 | int ts_nr = atoi(argv[0]); |
| 3524 | struct gsm_bts_trx *trx = vty->index; |
| 3525 | struct gsm_bts_trx_ts *ts; |
| 3526 | |
| 3527 | if (ts_nr >= TRX_NR_TS) { |
| 3528 | vty_out(vty, "%% A GSM TRX only has %u Timeslots per TRX%s", |
| 3529 | TRX_NR_TS, VTY_NEWLINE); |
| 3530 | return CMD_WARNING; |
| 3531 | } |
| 3532 | |
| 3533 | ts = &trx->ts[ts_nr]; |
| 3534 | |
| 3535 | vty->index = ts; |
| 3536 | vty->node = TS_NODE; |
| 3537 | |
| 3538 | return CMD_SUCCESS; |
| 3539 | } |
| 3540 | |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 3541 | DEFUN(cfg_ts_pchan, |
| 3542 | cfg_ts_pchan_cmd, |
Harald Welte | 4ab9d7c | 2012-08-17 12:42:06 +0200 | [diff] [blame] | 3543 | "phys_chan_config PCHAN", /* dynamically generated! */ |
Holger Hans Peter Freyther | 63b0e44 | 2013-03-03 09:32:08 +0100 | [diff] [blame] | 3544 | "Physical Channel configuration (TCH/SDCCH/...)\n" "Physical Channel\n") |
Harald Welte | 4ab9d7c | 2012-08-17 12:42:06 +0200 | [diff] [blame] | 3545 | { |
| 3546 | struct gsm_bts_trx_ts *ts = vty->index; |
| 3547 | int pchanc; |
| 3548 | |
| 3549 | pchanc = gsm_pchan_parse(argv[0]); |
| 3550 | if (pchanc < 0) |
| 3551 | return CMD_WARNING; |
| 3552 | |
| 3553 | ts->pchan = pchanc; |
| 3554 | |
| 3555 | return CMD_SUCCESS; |
| 3556 | } |
| 3557 | |
| 3558 | /* used for backwards compatibility with old config files that still |
| 3559 | * have uppercase pchan type names */ |
| 3560 | DEFUN_HIDDEN(cfg_ts_pchan_compat, |
| 3561 | cfg_ts_pchan_compat_cmd, |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 3562 | "phys_chan_config PCHAN", |
Holger Hans Peter Freyther | 63b0e44 | 2013-03-03 09:32:08 +0100 | [diff] [blame] | 3563 | "Physical Channel configuration (TCH/SDCCH/...)\n" "Physical Channel\n") |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 3564 | { |
| 3565 | struct gsm_bts_trx_ts *ts = vty->index; |
| 3566 | int pchanc; |
| 3567 | |
| 3568 | pchanc = gsm_pchan_parse(argv[0]); |
| 3569 | if (pchanc < 0) |
| 3570 | return CMD_WARNING; |
| 3571 | |
| 3572 | ts->pchan = pchanc; |
| 3573 | |
| 3574 | return CMD_SUCCESS; |
| 3575 | } |
| 3576 | |
Harald Welte | 4ab9d7c | 2012-08-17 12:42:06 +0200 | [diff] [blame] | 3577 | |
| 3578 | |
Harald Welte | 135a648 | 2011-05-30 12:09:13 +0200 | [diff] [blame] | 3579 | DEFUN(cfg_ts_tsc, |
| 3580 | cfg_ts_tsc_cmd, |
| 3581 | "training_sequence_code <0-7>", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3582 | "Training Sequence Code of the Timeslot\n" "TSC\n") |
Harald Welte | 135a648 | 2011-05-30 12:09:13 +0200 | [diff] [blame] | 3583 | { |
| 3584 | struct gsm_bts_trx_ts *ts = vty->index; |
| 3585 | |
Harald Welte | 903aaea | 2014-01-19 17:10:50 +0100 | [diff] [blame] | 3586 | if (!gsm_bts_has_feature(ts->trx->bts, BTS_FEAT_MULTI_TSC)) { |
| 3587 | vty_out(vty, "%% This BTS does not support a TSC != BCC, " |
| 3588 | "falling back to BCC%s", VTY_NEWLINE); |
| 3589 | ts->tsc = -1; |
| 3590 | return CMD_WARNING; |
| 3591 | } |
| 3592 | |
Harald Welte | 135a648 | 2011-05-30 12:09:13 +0200 | [diff] [blame] | 3593 | ts->tsc = atoi(argv[0]); |
| 3594 | |
| 3595 | return CMD_SUCCESS; |
| 3596 | } |
| 3597 | |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3598 | #define HOPPING_STR "Configure frequency hopping\n" |
| 3599 | |
| 3600 | DEFUN(cfg_ts_hopping, |
| 3601 | cfg_ts_hopping_cmd, |
| 3602 | "hopping enabled (0|1)", |
| 3603 | HOPPING_STR "Enable or disable frequency hopping\n" |
| 3604 | "Disable frequency hopping\n" "Enable frequency hopping\n") |
| 3605 | { |
| 3606 | struct gsm_bts_trx_ts *ts = vty->index; |
Harald Welte | c2fb3d0 | 2010-06-14 22:47:37 +0200 | [diff] [blame] | 3607 | int enabled = atoi(argv[0]); |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3608 | |
Harald Welte | c2fb3d0 | 2010-06-14 22:47:37 +0200 | [diff] [blame] | 3609 | if (enabled && !gsm_bts_has_feature(ts->trx->bts, BTS_FEAT_HOPPING)) { |
| 3610 | vty_out(vty, "BTS model does not support hopping%s", |
| 3611 | VTY_NEWLINE); |
| 3612 | return CMD_WARNING; |
| 3613 | } |
| 3614 | |
| 3615 | ts->hopping.enabled = enabled; |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3616 | |
| 3617 | return CMD_SUCCESS; |
| 3618 | } |
| 3619 | |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 3620 | DEFUN(cfg_ts_hsn, |
| 3621 | cfg_ts_hsn_cmd, |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3622 | "hopping sequence-number <0-63>", |
| 3623 | HOPPING_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3624 | "Which hopping sequence to use for this channel\n" |
| 3625 | "Hopping Sequence Number (HSN)\n") |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 3626 | { |
| 3627 | struct gsm_bts_trx_ts *ts = vty->index; |
| 3628 | |
| 3629 | ts->hopping.hsn = atoi(argv[0]); |
| 3630 | |
| 3631 | return CMD_SUCCESS; |
| 3632 | } |
| 3633 | |
| 3634 | DEFUN(cfg_ts_maio, |
| 3635 | cfg_ts_maio_cmd, |
| 3636 | "hopping maio <0-63>", |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3637 | HOPPING_STR |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3638 | "Which hopping MAIO to use for this channel\n" |
| 3639 | "Mobile Allocation Index Offset (MAIO)\n") |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 3640 | { |
| 3641 | struct gsm_bts_trx_ts *ts = vty->index; |
| 3642 | |
| 3643 | ts->hopping.maio = atoi(argv[0]); |
| 3644 | |
| 3645 | return CMD_SUCCESS; |
| 3646 | } |
| 3647 | |
| 3648 | DEFUN(cfg_ts_arfcn_add, |
| 3649 | cfg_ts_arfcn_add_cmd, |
| 3650 | "hopping arfcn add <0-1023>", |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3651 | HOPPING_STR "Configure hopping ARFCN list\n" |
| 3652 | "Add an entry to the hopping ARFCN list\n" "ARFCN\n") |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 3653 | { |
| 3654 | struct gsm_bts_trx_ts *ts = vty->index; |
| 3655 | int arfcn = atoi(argv[0]); |
| 3656 | |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3657 | bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, 1); |
| 3658 | |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 3659 | return CMD_SUCCESS; |
| 3660 | } |
| 3661 | |
| 3662 | DEFUN(cfg_ts_arfcn_del, |
| 3663 | cfg_ts_arfcn_del_cmd, |
| 3664 | "hopping arfcn del <0-1023>", |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3665 | HOPPING_STR "Configure hopping ARFCN list\n" |
| 3666 | "Delete an entry to the hopping ARFCN list\n" "ARFCN\n") |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 3667 | { |
| 3668 | struct gsm_bts_trx_ts *ts = vty->index; |
| 3669 | int arfcn = atoi(argv[0]); |
| 3670 | |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 3671 | bitvec_set_bit_pos(&ts->hopping.arfcns, arfcn, 0); |
| 3672 | |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 3673 | return CMD_SUCCESS; |
| 3674 | } |
| 3675 | |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 3676 | DEFUN(cfg_ts_e1_subslot, |
| 3677 | cfg_ts_e1_subslot_cmd, |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3678 | "e1 line E1_LINE timeslot <1-31> sub-slot (0|1|2|3|full)", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3679 | "E1/T1 channel connected to this on-air timeslot\n" |
| 3680 | "E1/T1 channel connected to this on-air timeslot\n" |
| 3681 | "E1/T1 line connected to this on-air timeslot\n" |
Harald Welte | d13e0cd | 2012-08-17 09:52:03 +0200 | [diff] [blame] | 3682 | "E1/T1 timeslot connected to this on-air timeslot\n" |
| 3683 | "E1/T1 timeslot connected to this on-air timeslot\n" |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3684 | "E1/T1 sub-slot connected to this on-air timeslot\n" |
| 3685 | "E1/T1 sub-slot 0 connected to this on-air timeslot\n" |
| 3686 | "E1/T1 sub-slot 1 connected to this on-air timeslot\n" |
| 3687 | "E1/T1 sub-slot 2 connected to this on-air timeslot\n" |
| 3688 | "E1/T1 sub-slot 3 connected to this on-air timeslot\n" |
| 3689 | "Full E1/T1 timeslot connected to this on-air timeslot\n") |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 3690 | { |
| 3691 | struct gsm_bts_trx_ts *ts = vty->index; |
| 3692 | |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3693 | parse_e1_link(&ts->e1_link, argv[0], argv[1], argv[2]); |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 3694 | |
| 3695 | return CMD_SUCCESS; |
| 3696 | } |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3697 | |
Harald Welte | 4f10c25 | 2010-05-16 21:47:13 +0200 | [diff] [blame] | 3698 | void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) |
| 3699 | { |
| 3700 | vty_out(vty, "Channel Requests : %lu total, %lu no channel%s", |
Alexander Couzens | b847a21 | 2016-08-02 11:34:11 +0200 | [diff] [blame] | 3701 | net->bsc_ctrs->ctr[BSC_CTR_CHREQ_TOTAL].current, |
| 3702 | net->bsc_ctrs->ctr[BSC_CTR_CHREQ_NO_CHANNEL].current, |
Alexander Couzens | 20423ea | 2016-07-12 15:42:02 +0200 | [diff] [blame] | 3703 | VTY_NEWLINE); |
Harald Welte | 4f10c25 | 2010-05-16 21:47:13 +0200 | [diff] [blame] | 3704 | vty_out(vty, "Channel Failures : %lu rf_failures, %lu rll failures%s", |
Alexander Couzens | b847a21 | 2016-08-02 11:34:11 +0200 | [diff] [blame] | 3705 | net->bsc_ctrs->ctr[BSC_CTR_CHAN_RF_FAIL].current, |
| 3706 | net->bsc_ctrs->ctr[BSC_CTR_CHAN_RLL_ERR].current, |
Alexander Couzens | 20423ea | 2016-07-12 15:42:02 +0200 | [diff] [blame] | 3707 | VTY_NEWLINE); |
Harald Welte | 4f10c25 | 2010-05-16 21:47:13 +0200 | [diff] [blame] | 3708 | vty_out(vty, "Paging : %lu attempted, %lu complete, %lu expired%s", |
Alexander Couzens | b847a21 | 2016-08-02 11:34:11 +0200 | [diff] [blame] | 3709 | net->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED].current, |
| 3710 | net->bsc_ctrs->ctr[BSC_CTR_PAGING_COMPLETED].current, |
| 3711 | net->bsc_ctrs->ctr[BSC_CTR_PAGING_EXPIRED].current, |
Alexander Couzens | 20423ea | 2016-07-12 15:42:02 +0200 | [diff] [blame] | 3712 | VTY_NEWLINE); |
Harald Welte | 4f10c25 | 2010-05-16 21:47:13 +0200 | [diff] [blame] | 3713 | vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", |
Alexander Couzens | b847a21 | 2016-08-02 11:34:11 +0200 | [diff] [blame] | 3714 | net->bsc_ctrs->ctr[BSC_CTR_BTS_OML_FAIL].current, |
| 3715 | net->bsc_ctrs->ctr[BSC_CTR_BTS_RSL_FAIL].current, |
Alexander Couzens | 20423ea | 2016-07-12 15:42:02 +0200 | [diff] [blame] | 3716 | VTY_NEWLINE); |
Harald Welte | 4f10c25 | 2010-05-16 21:47:13 +0200 | [diff] [blame] | 3717 | } |
| 3718 | |
Holger Hans Peter Freyther | 2484ceb | 2010-10-26 09:40:13 +0200 | [diff] [blame] | 3719 | DEFUN(drop_bts, |
| 3720 | drop_bts_cmd, |
Holger Hans Peter Freyther | 0586b0f | 2010-04-11 12:46:45 +0200 | [diff] [blame] | 3721 | "drop bts connection <0-65535> (oml|rsl)", |
Harald Welte | cfaabbb | 2012-08-16 23:23:50 +0200 | [diff] [blame] | 3722 | "Debug/Simulation command to drop Abis/IP BTS\n" |
| 3723 | "Debug/Simulation command to drop Abis/IP BTS\n" |
| 3724 | "Debug/Simulation command to drop Abis/IP BTS\n" |
| 3725 | "BTS NR\n" "Drop OML Connection\n" "Drop RSL Connection\n") |
Holger Hans Peter Freyther | 2484ceb | 2010-10-26 09:40:13 +0200 | [diff] [blame] | 3726 | { |
| 3727 | struct gsm_network *gsmnet; |
| 3728 | struct gsm_bts_trx *trx; |
| 3729 | struct gsm_bts *bts; |
| 3730 | unsigned int bts_nr; |
| 3731 | |
| 3732 | gsmnet = gsmnet_from_vty(vty); |
| 3733 | |
| 3734 | bts_nr = atoi(argv[0]); |
| 3735 | if (bts_nr >= gsmnet->num_bts) { |
| 3736 | vty_out(vty, "BTS number must be between 0 and %d. It was %d.%s", |
| 3737 | gsmnet->num_bts, bts_nr, VTY_NEWLINE); |
| 3738 | return CMD_WARNING; |
| 3739 | } |
| 3740 | |
| 3741 | bts = gsm_bts_num(gsmnet, bts_nr); |
| 3742 | if (!bts) { |
| 3743 | vty_out(vty, "BTS Nr. %d could not be found.%s", bts_nr, VTY_NEWLINE); |
| 3744 | return CMD_WARNING; |
| 3745 | } |
| 3746 | |
| 3747 | if (!is_ipaccess_bts(bts)) { |
| 3748 | vty_out(vty, "This command only works for ipaccess.%s", VTY_NEWLINE); |
| 3749 | return CMD_WARNING; |
| 3750 | } |
| 3751 | |
| 3752 | |
| 3753 | /* close all connections */ |
| 3754 | if (strcmp(argv[1], "oml") == 0) { |
Holger Hans Peter Freyther | dab8e27 | 2010-11-15 20:29:46 +0100 | [diff] [blame] | 3755 | ipaccess_drop_oml(bts); |
Holger Hans Peter Freyther | 2484ceb | 2010-10-26 09:40:13 +0200 | [diff] [blame] | 3756 | } else if (strcmp(argv[1], "rsl") == 0) { |
| 3757 | /* close all rsl connections */ |
| 3758 | llist_for_each_entry(trx, &bts->trx_list, list) { |
Holger Hans Peter Freyther | dab8e27 | 2010-11-15 20:29:46 +0100 | [diff] [blame] | 3759 | ipaccess_drop_rsl(trx); |
Holger Hans Peter Freyther | 2484ceb | 2010-10-26 09:40:13 +0200 | [diff] [blame] | 3760 | } |
| 3761 | } else { |
| 3762 | vty_out(vty, "Argument must be 'oml# or 'rsl'.%s", VTY_NEWLINE); |
| 3763 | return CMD_WARNING; |
| 3764 | } |
| 3765 | |
| 3766 | return CMD_SUCCESS; |
| 3767 | } |
| 3768 | |
Holger Hans Peter Freyther | 740e65f | 2016-03-16 13:45:23 +0100 | [diff] [blame] | 3769 | DEFUN(restart_bts, restart_bts_cmd, |
| 3770 | "restart-bts <0-65535>", |
| 3771 | "Restart ip.access nanoBTS through OML\n" |
| 3772 | "BTS Number\n") |
| 3773 | { |
| 3774 | struct gsm_network *gsmnet; |
| 3775 | struct gsm_bts_trx *trx; |
| 3776 | struct gsm_bts *bts; |
| 3777 | unsigned int bts_nr; |
| 3778 | |
| 3779 | gsmnet = gsmnet_from_vty(vty); |
| 3780 | |
| 3781 | bts_nr = atoi(argv[0]); |
| 3782 | if (bts_nr >= gsmnet->num_bts) { |
| 3783 | vty_out(vty, "BTS number must be between 0 and %d. It was %d.%s", |
| 3784 | gsmnet->num_bts, bts_nr, VTY_NEWLINE); |
| 3785 | return CMD_WARNING; |
| 3786 | } |
| 3787 | |
| 3788 | bts = gsm_bts_num(gsmnet, bts_nr); |
| 3789 | if (!bts) { |
| 3790 | vty_out(vty, "BTS Nr. %d could not be found.%s", bts_nr, VTY_NEWLINE); |
| 3791 | return CMD_WARNING; |
| 3792 | } |
| 3793 | |
| 3794 | if (!is_ipaccess_bts(bts) || is_sysmobts_v2(bts)) { |
| 3795 | vty_out(vty, "This command only works for ipaccess nanoBTS.%s", |
| 3796 | VTY_NEWLINE); |
| 3797 | return CMD_WARNING; |
| 3798 | } |
| 3799 | |
| 3800 | /* go from last TRX to c0 */ |
| 3801 | llist_for_each_entry_reverse(trx, &bts->trx_list, list) |
| 3802 | abis_nm_ipaccess_restart(trx); |
| 3803 | |
| 3804 | return CMD_SUCCESS; |
| 3805 | } |
| 3806 | |
Harald Welte | 30f1f37 | 2014-12-28 15:00:45 +0100 | [diff] [blame] | 3807 | DEFUN(smscb_cmd, smscb_cmd_cmd, |
| 3808 | "bts <0-255> smscb-command <1-4> HEXSTRING", |
| 3809 | "BTS related commands\n" "BTS Number\n" |
| 3810 | "SMS Cell Broadcast\n" "Last Valid Block\n" |
| 3811 | "Hex Encoded SMSCB message (up to 88 octets)\n") |
| 3812 | { |
| 3813 | struct gsm_bts *bts; |
| 3814 | int bts_nr = atoi(argv[0]); |
| 3815 | int last_block = atoi(argv[1]); |
| 3816 | struct rsl_ie_cb_cmd_type cb_cmd; |
| 3817 | uint8_t buf[88]; |
| 3818 | int rc; |
| 3819 | |
Neels Hofmeyr | b90eabf | 2016-05-11 18:48:39 +0200 | [diff] [blame] | 3820 | bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr); |
Harald Welte | 30f1f37 | 2014-12-28 15:00:45 +0100 | [diff] [blame] | 3821 | if (!bts) { |
| 3822 | vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE); |
| 3823 | return CMD_WARNING; |
| 3824 | } |
| 3825 | rc = osmo_hexparse(argv[2], buf, sizeof(buf)); |
| 3826 | if (rc < 0 || rc > sizeof(buf)) { |
| 3827 | vty_out(vty, "Error parsing HEXSTRING%s", VTY_NEWLINE); |
| 3828 | return CMD_WARNING; |
| 3829 | } |
| 3830 | |
| 3831 | cb_cmd.spare = 0; |
| 3832 | cb_cmd.def_bcast = 0; |
| 3833 | cb_cmd.command = RSL_CB_CMD_TYPE_NORMAL; |
| 3834 | |
| 3835 | switch (last_block) { |
| 3836 | case 1: |
| 3837 | cb_cmd.last_block = RSL_CB_CMD_LASTBLOCK_1; |
| 3838 | break; |
| 3839 | case 2: |
| 3840 | cb_cmd.last_block = RSL_CB_CMD_LASTBLOCK_2; |
| 3841 | break; |
| 3842 | case 3: |
| 3843 | cb_cmd.last_block = RSL_CB_CMD_LASTBLOCK_3; |
| 3844 | break; |
| 3845 | case 4: |
| 3846 | cb_cmd.last_block = RSL_CB_CMD_LASTBLOCK_4; |
| 3847 | break; |
| 3848 | } |
| 3849 | |
| 3850 | rsl_sms_cb_command(bts, RSL_CHAN_SDCCH4_ACCH, cb_cmd, buf, rc); |
| 3851 | |
| 3852 | return CMD_SUCCESS; |
| 3853 | } |
| 3854 | |
| 3855 | |
Harald Welte | d0d2b0b | 2010-12-23 13:18:07 +0100 | [diff] [blame] | 3856 | DEFUN(pdch_act, pdch_act_cmd, |
| 3857 | "bts <0-255> trx <0-255> timeslot <0-7> pdch (activate|deactivate)", |
| 3858 | "BTS related commands\n" "BTS Number\n" "Transceiver\n" "Transceiver Number\n" |
| 3859 | "TRX Timeslot\n" "Timeslot Number\n" "Packet Data Channel\n" |
| 3860 | "Activate Dynamic PDCH/TCH (-> PDCH mode)\n" |
| 3861 | "Deactivate Dynamic PDCH/TCH (-> TCH mode)\n") |
| 3862 | { |
| 3863 | struct gsm_bts *bts; |
| 3864 | struct gsm_bts_trx *trx; |
| 3865 | struct gsm_bts_trx_ts *ts; |
| 3866 | int bts_nr = atoi(argv[0]); |
| 3867 | int trx_nr = atoi(argv[1]); |
| 3868 | int ts_nr = atoi(argv[2]); |
| 3869 | int activate; |
| 3870 | |
Neels Hofmeyr | b90eabf | 2016-05-11 18:48:39 +0200 | [diff] [blame] | 3871 | bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr); |
Harald Welte | d0d2b0b | 2010-12-23 13:18:07 +0100 | [diff] [blame] | 3872 | if (!bts) { |
| 3873 | vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE); |
| 3874 | return CMD_WARNING; |
| 3875 | } |
| 3876 | |
| 3877 | if (!is_ipaccess_bts(bts)) { |
| 3878 | vty_out(vty, "%% This command only works for ipaccess BTS%s", |
| 3879 | VTY_NEWLINE); |
| 3880 | return CMD_WARNING; |
| 3881 | } |
| 3882 | |
| 3883 | trx = gsm_bts_trx_num(bts, trx_nr); |
| 3884 | if (!trx) { |
| 3885 | vty_out(vty, "%% No such TRX (%d)%s", trx_nr, VTY_NEWLINE); |
| 3886 | return CMD_WARNING; |
| 3887 | } |
| 3888 | |
| 3889 | ts = &trx->ts[ts_nr]; |
| 3890 | if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) { |
| 3891 | vty_out(vty, "%% Timeslot %u is not in dynamic TCH_F/PDCH " |
| 3892 | "mode%s", ts_nr, VTY_NEWLINE); |
| 3893 | return CMD_WARNING; |
| 3894 | } |
| 3895 | |
| 3896 | if (!strcmp(argv[3], "activate")) |
| 3897 | activate = 1; |
| 3898 | else |
| 3899 | activate = 0; |
| 3900 | |
| 3901 | rsl_ipacc_pdch_activate(ts, activate); |
| 3902 | |
| 3903 | return CMD_SUCCESS; |
| 3904 | |
| 3905 | } |
Holger Hans Peter Freyther | 2484ceb | 2010-10-26 09:40:13 +0200 | [diff] [blame] | 3906 | |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 3907 | extern int bsc_vty_init_extra(void); |
Holger Hans Peter Freyther | e1ffc08 | 2010-04-10 00:08:28 +0200 | [diff] [blame] | 3908 | |
Max | db0e380 | 2017-01-12 19:35:11 +0100 | [diff] [blame] | 3909 | int bsc_vty_init(struct gsm_network *network) |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 3910 | { |
Harald Welte | 4ab9d7c | 2012-08-17 12:42:06 +0200 | [diff] [blame] | 3911 | cfg_ts_pchan_cmd.string = |
| 3912 | vty_cmd_string_from_valstr(tall_bsc_ctx, |
| 3913 | gsm_pchant_names, |
| 3914 | "phys_chan_config (", "|", ")", |
| 3915 | VTY_DO_LOWER); |
| 3916 | cfg_ts_pchan_cmd.doc = |
| 3917 | vty_cmd_string_from_valstr(tall_bsc_ctx, |
| 3918 | gsm_pchant_descs, |
| 3919 | "Physical Channel Combination\n", |
| 3920 | "\n", "", 0); |
| 3921 | |
Harald Welte | e555c2b | 2012-08-17 13:02:12 +0200 | [diff] [blame] | 3922 | cfg_bts_type_cmd.string = |
| 3923 | vty_cmd_string_from_valstr(tall_bsc_ctx, |
| 3924 | bts_type_names, |
| 3925 | "type (", "|", ")", |
| 3926 | VTY_DO_LOWER); |
| 3927 | cfg_bts_type_cmd.doc = |
| 3928 | vty_cmd_string_from_valstr(tall_bsc_ctx, |
| 3929 | bts_type_descs, |
| 3930 | "BTS Vendor/Type\n", |
| 3931 | "\n", "", 0); |
| 3932 | |
Neels Hofmeyr | 06d39fd | 2016-05-12 01:16:58 +0200 | [diff] [blame] | 3933 | common_cs_vty_init(network, config_write_net); |
Harald Welte | e555c2b | 2012-08-17 13:02:12 +0200 | [diff] [blame] | 3934 | |
Neels Hofmeyr | ea11bf8 | 2016-05-12 01:53:23 +0200 | [diff] [blame] | 3935 | install_element_ve(&bsc_show_net_cmd); |
Harald Welte | b4d5b17 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 3936 | install_element_ve(&show_bts_cmd); |
| 3937 | install_element_ve(&show_trx_cmd); |
| 3938 | install_element_ve(&show_ts_cmd); |
| 3939 | install_element_ve(&show_lchan_cmd); |
Holger Hans Peter Freyther | 3d6a5d6 | 2010-05-14 02:08:49 +0800 | [diff] [blame] | 3940 | install_element_ve(&show_lchan_summary_cmd); |
Harald Welte | 1bc7735 | 2009-03-10 19:47:51 +0000 | [diff] [blame] | 3941 | |
Harald Welte | b4d5b17 | 2010-05-12 16:10:35 +0000 | [diff] [blame] | 3942 | install_element_ve(&show_paging_cmd); |
Holger Hans Peter Freyther | ec37bb2 | 2013-02-05 09:39:09 +0100 | [diff] [blame] | 3943 | install_element_ve(&show_paging_group_cmd); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3944 | |
Max | db0e380 | 2017-01-12 19:35:11 +0100 | [diff] [blame] | 3945 | logging_vty_add_cmds(NULL); |
Jacob Erlbeck | 64630cc | 2015-10-26 16:25:37 +0100 | [diff] [blame] | 3946 | osmo_stats_vty_add_cmds(); |
Holger Hans Peter Freyther | b61e3b2 | 2009-12-22 22:32:51 +0100 | [diff] [blame] | 3947 | |
Holger Hans Peter Freyther | f7d752f | 2009-11-16 17:12:38 +0100 | [diff] [blame] | 3948 | install_element(GSMNET_NODE, &cfg_net_neci_cmd); |
Harald Welte | bc81450 | 2009-12-19 21:41:52 +0100 | [diff] [blame] | 3949 | install_element(GSMNET_NODE, &cfg_net_handover_cmd); |
Harald Welte | b720bd3 | 2009-12-21 16:51:50 +0100 | [diff] [blame] | 3950 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_cmd); |
| 3951 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxqual_avg_cmd); |
| 3952 | install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_neigh_cmd); |
| 3953 | install_element(GSMNET_NODE, &cfg_net_ho_pwr_interval_cmd); |
| 3954 | install_element(GSMNET_NODE, &cfg_net_ho_pwr_hysteresis_cmd); |
| 3955 | install_element(GSMNET_NODE, &cfg_net_ho_max_distance_cmd); |
Holger Hans Peter Freyther | c4d88ad | 2009-11-21 21:18:38 +0100 | [diff] [blame] | 3956 | install_element(GSMNET_NODE, &cfg_net_T3101_cmd); |
Holger Hans Peter Freyther | 23975e7 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 3957 | install_element(GSMNET_NODE, &cfg_net_T3103_cmd); |
| 3958 | install_element(GSMNET_NODE, &cfg_net_T3105_cmd); |
| 3959 | install_element(GSMNET_NODE, &cfg_net_T3107_cmd); |
| 3960 | install_element(GSMNET_NODE, &cfg_net_T3109_cmd); |
| 3961 | install_element(GSMNET_NODE, &cfg_net_T3111_cmd); |
| 3962 | install_element(GSMNET_NODE, &cfg_net_T3113_cmd); |
| 3963 | install_element(GSMNET_NODE, &cfg_net_T3115_cmd); |
| 3964 | install_element(GSMNET_NODE, &cfg_net_T3117_cmd); |
| 3965 | install_element(GSMNET_NODE, &cfg_net_T3119_cmd); |
Harald Welte | c9f499f | 2010-12-23 22:53:50 +0100 | [diff] [blame] | 3966 | install_element(GSMNET_NODE, &cfg_net_T3122_cmd); |
Holger Hans Peter Freyther | 23975e7 | 2009-11-21 21:42:26 +0100 | [diff] [blame] | 3967 | install_element(GSMNET_NODE, &cfg_net_T3141_cmd); |
Holger Hans Peter Freyther | 5a3a61d | 2010-09-06 09:25:48 +0800 | [diff] [blame] | 3968 | install_element(GSMNET_NODE, &cfg_net_dtx_cmd); |
Holger Hans Peter Freyther | 76fc4a3 | 2010-09-06 09:41:50 +0800 | [diff] [blame] | 3969 | install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); |
Harald Welte | 5013b2a | 2009-08-07 13:29:14 +0200 | [diff] [blame] | 3970 | |
| 3971 | install_element(GSMNET_NODE, &cfg_bts_cmd); |
Harald Welte | 67ce073 | 2009-08-06 19:06:46 +0200 | [diff] [blame] | 3972 | install_node(&bts_node, config_write_bts); |
Jacob Erlbeck | 36722e1 | 2013-10-29 09:30:30 +0100 | [diff] [blame] | 3973 | vty_install_default(BTS_NODE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3974 | install_element(BTS_NODE, &cfg_bts_type_cmd); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 3975 | install_element(BTS_NODE, &cfg_description_cmd); |
| 3976 | install_element(BTS_NODE, &cfg_no_description_cmd); |
Harald Welte | fcd2445 | 2009-06-20 18:15:19 +0200 | [diff] [blame] | 3977 | install_element(BTS_NODE, &cfg_bts_band_cmd); |
Holger Hans Peter Freyther | c4a49e3 | 2009-08-21 14:44:12 +0200 | [diff] [blame] | 3978 | install_element(BTS_NODE, &cfg_bts_ci_cmd); |
Max | c08ee71 | 2016-05-11 12:45:13 +0200 | [diff] [blame] | 3979 | install_element(BTS_NODE, &cfg_bts_dtxu_cmd); |
| 3980 | install_element(BTS_NODE, &cfg_bts_dtxd_cmd); |
| 3981 | install_element(BTS_NODE, &cfg_bts_no_dtxu_cmd); |
| 3982 | install_element(BTS_NODE, &cfg_bts_no_dtxd_cmd); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 3983 | install_element(BTS_NODE, &cfg_bts_lac_cmd); |
| 3984 | install_element(BTS_NODE, &cfg_bts_tsc_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3985 | install_element(BTS_NODE, &cfg_bts_bsic_cmd); |
Harald Welte | 4cc3422 | 2009-05-01 15:12:31 +0000 | [diff] [blame] | 3986 | install_element(BTS_NODE, &cfg_bts_unit_id_cmd); |
Harald Welte | 8b29180 | 2013-03-12 13:57:05 +0100 | [diff] [blame] | 3987 | install_element(BTS_NODE, &cfg_bts_rsl_ip_cmd); |
Sylvain Munaut | c951946 | 2011-10-17 14:04:55 +0200 | [diff] [blame] | 3988 | install_element(BTS_NODE, &cfg_bts_nokia_site_skip_reset_cmd); |
Andreas Eversberg | 7d8fa34 | 2013-12-05 13:25:06 +0100 | [diff] [blame] | 3989 | install_element(BTS_NODE, &cfg_bts_nokia_site_no_loc_rel_cnf_cmd); |
Sipos Csaba | 56e1766 | 2015-02-07 13:27:36 +0100 | [diff] [blame] | 3990 | install_element(BTS_NODE, &cfg_bts_nokia_site_bts_reset_timer_cnf_cmd); |
Harald Welte | 8175e95 | 2009-10-20 00:22:00 +0200 | [diff] [blame] | 3991 | install_element(BTS_NODE, &cfg_bts_stream_id_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 3992 | install_element(BTS_NODE, &cfg_bts_oml_e1_cmd); |
| 3993 | install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd); |
Harald Welte | 7a8fa41 | 2009-08-10 13:48:16 +0200 | [diff] [blame] | 3994 | install_element(BTS_NODE, &cfg_bts_challoc_cmd); |
Sylvain Munaut | 4010f1e | 2009-12-22 13:43:26 +0100 | [diff] [blame] | 3995 | install_element(BTS_NODE, &cfg_bts_rach_tx_integer_cmd); |
| 3996 | install_element(BTS_NODE, &cfg_bts_rach_max_trans_cmd); |
Andreas Eversberg | 2ee7ecd | 2012-10-13 07:27:47 +0200 | [diff] [blame] | 3997 | install_element(BTS_NODE, &cfg_bts_chan_desc_att_cmd); |
| 3998 | install_element(BTS_NODE, &cfg_bts_chan_desc_bs_pa_mfrms_cmd); |
| 3999 | install_element(BTS_NODE, &cfg_bts_chan_desc_bs_ag_blks_res_cmd); |
Holger Hans Peter Freyther | 95c2290 | 2010-04-25 23:08:39 +0800 | [diff] [blame] | 4000 | install_element(BTS_NODE, &cfg_bts_rach_nm_b_thresh_cmd); |
| 4001 | install_element(BTS_NODE, &cfg_bts_rach_nm_ldavg_cmd); |
Harald Welte (local) | 5dececf | 2009-08-12 13:28:23 +0200 | [diff] [blame] | 4002 | install_element(BTS_NODE, &cfg_bts_cell_barred_cmd); |
Holger Hans Peter Freyther | 3a0a463 | 2010-05-14 00:39:19 +0800 | [diff] [blame] | 4003 | install_element(BTS_NODE, &cfg_bts_rach_ec_allowed_cmd); |
Ivan Kluchnikov | 6792059 | 2013-09-16 13:13:04 +0400 | [diff] [blame] | 4004 | install_element(BTS_NODE, &cfg_bts_rach_ac_class_cmd); |
Harald Welte (local) | 0e451d0 | 2009-08-13 10:14:26 +0200 | [diff] [blame] | 4005 | install_element(BTS_NODE, &cfg_bts_ms_max_power_cmd); |
Harald Welte (local) | efc9231 | 2009-08-14 23:09:25 +0200 | [diff] [blame] | 4006 | install_element(BTS_NODE, &cfg_bts_per_loc_upd_cmd); |
Holger Hans Peter Freyther | c63f6f1 | 2013-07-27 21:07:57 +0200 | [diff] [blame] | 4007 | install_element(BTS_NODE, &cfg_bts_no_per_loc_upd_cmd); |
Harald Welte | 7322528 | 2009-12-12 18:17:25 +0100 | [diff] [blame] | 4008 | install_element(BTS_NODE, &cfg_bts_cell_resel_hyst_cmd); |
| 4009 | install_element(BTS_NODE, &cfg_bts_rxlev_acc_min_cmd); |
Sylvain Munaut | e0b06b0 | 2010-11-28 18:17:28 +0100 | [diff] [blame] | 4010 | install_element(BTS_NODE, &cfg_bts_cell_bar_qualify_cmd); |
| 4011 | install_element(BTS_NODE, &cfg_bts_cell_resel_ofs_cmd); |
| 4012 | install_element(BTS_NODE, &cfg_bts_temp_ofs_cmd); |
| 4013 | install_element(BTS_NODE, &cfg_bts_temp_ofs_inf_cmd); |
| 4014 | install_element(BTS_NODE, &cfg_bts_penalty_time_cmd); |
| 4015 | install_element(BTS_NODE, &cfg_bts_penalty_time_rsvd_cmd); |
Andreas Eversberg | 4d4944a | 2013-03-10 11:49:35 +0100 | [diff] [blame] | 4016 | install_element(BTS_NODE, &cfg_bts_radio_link_timeout_cmd); |
Harald Welte | 4511d89 | 2010-04-18 15:51:20 +0200 | [diff] [blame] | 4017 | install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd); |
bhargava | 350533c | 2016-07-21 11:14:34 +0530 | [diff] [blame] | 4018 | install_element(BTS_NODE, &cfg_bts_gprs_11bit_rach_support_for_egprs_cmd); |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 4019 | install_element(BTS_NODE, &cfg_bts_gprs_ns_timer_cmd); |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 4020 | install_element(BTS_NODE, &cfg_bts_gprs_rac_cmd); |
Andreas Eversberg | 0c8f9ca | 2013-03-16 16:31:26 +0100 | [diff] [blame] | 4021 | install_element(BTS_NODE, &cfg_bts_gprs_net_ctrl_ord_cmd); |
Max | 292ec58 | 2016-07-28 11:55:37 +0200 | [diff] [blame] | 4022 | install_element(BTS_NODE, &cfg_bts_gprs_ctrl_ack_cmd); |
| 4023 | install_element(BTS_NODE, &cfg_no_bts_gprs_ctrl_ack_cmd); |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 4024 | install_element(BTS_NODE, &cfg_bts_gprs_bvci_cmd); |
Harald Welte | 615e956 | 2010-05-11 23:50:21 +0200 | [diff] [blame] | 4025 | install_element(BTS_NODE, &cfg_bts_gprs_cell_timer_cmd); |
Harald Welte | a5731cf | 2010-03-22 11:48:36 +0800 | [diff] [blame] | 4026 | install_element(BTS_NODE, &cfg_bts_gprs_nsei_cmd); |
Harald Welte | 97a282b | 2010-03-14 15:37:43 +0800 | [diff] [blame] | 4027 | install_element(BTS_NODE, &cfg_bts_gprs_nsvci_cmd); |
Harald Welte | af38763 | 2010-03-14 23:30:30 +0800 | [diff] [blame] | 4028 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_lport_cmd); |
| 4029 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_rport_cmd); |
| 4030 | install_element(BTS_NODE, &cfg_bts_gprs_nsvc_rip_cmd); |
Holger Hans Peter Freyther | e66bf1f | 2010-09-06 10:11:25 +0800 | [diff] [blame] | 4031 | install_element(BTS_NODE, &cfg_bts_pag_free_cmd); |
Harald Welte | 9fbff4a | 2010-07-30 11:50:09 +0200 | [diff] [blame] | 4032 | install_element(BTS_NODE, &cfg_bts_si_mode_cmd); |
| 4033 | install_element(BTS_NODE, &cfg_bts_si_static_cmd); |
Harald Welte | 42def72 | 2017-01-13 00:10:32 +0100 | [diff] [blame] | 4034 | install_element(BTS_NODE, &cfg_bts_early_cm_cmd); |
Harald Welte | 32c0962 | 2011-01-11 23:44:56 +0100 | [diff] [blame] | 4035 | install_element(BTS_NODE, &cfg_bts_neigh_mode_cmd); |
| 4036 | install_element(BTS_NODE, &cfg_bts_neigh_cmd); |
Harald Welte | 64c07d2 | 2011-02-15 11:43:27 +0100 | [diff] [blame] | 4037 | install_element(BTS_NODE, &cfg_bts_si5_neigh_cmd); |
Max | 59a1bf3 | 2016-04-15 16:04:46 +0200 | [diff] [blame] | 4038 | install_element(BTS_NODE, &cfg_bts_si2quater_neigh_add_cmd); |
| 4039 | install_element(BTS_NODE, &cfg_bts_si2quater_neigh_del_cmd); |
Max | 26679e0 | 2016-04-20 15:57:13 +0200 | [diff] [blame] | 4040 | install_element(BTS_NODE, &cfg_bts_si2quater_uarfcn_add_cmd); |
| 4041 | install_element(BTS_NODE, &cfg_bts_si2quater_uarfcn_del_cmd); |
Holger Hans Peter Freyther | e30d40d | 2012-07-20 10:27:31 +0200 | [diff] [blame] | 4042 | install_element(BTS_NODE, &cfg_bts_excl_rf_lock_cmd); |
| 4043 | install_element(BTS_NODE, &cfg_bts_no_excl_rf_lock_cmd); |
Jacob Erlbeck | 65d114f | 2014-01-16 11:02:14 +0100 | [diff] [blame] | 4044 | install_element(BTS_NODE, &cfg_bts_force_comb_si_cmd); |
| 4045 | install_element(BTS_NODE, &cfg_bts_no_force_comb_si_cmd); |
Andreas Eversberg | a83d511 | 2013-12-07 18:32:28 +0100 | [diff] [blame] | 4046 | install_element(BTS_NODE, &cfg_bts_codec0_cmd); |
| 4047 | install_element(BTS_NODE, &cfg_bts_codec1_cmd); |
| 4048 | install_element(BTS_NODE, &cfg_bts_codec2_cmd); |
| 4049 | install_element(BTS_NODE, &cfg_bts_codec3_cmd); |
| 4050 | install_element(BTS_NODE, &cfg_bts_codec4_cmd); |
Holger Hans Peter Freyther | c22930e | 2014-12-17 14:46:17 +0100 | [diff] [blame] | 4051 | install_element(BTS_NODE, &cfg_bts_depends_on_cmd); |
| 4052 | install_element(BTS_NODE, &cfg_bts_no_depends_on_cmd); |
Andreas Eversberg | 7326652 | 2014-01-19 11:47:44 +0100 | [diff] [blame] | 4053 | install_element(BTS_NODE, &cfg_bts_amr_fr_modes1_cmd); |
| 4054 | install_element(BTS_NODE, &cfg_bts_amr_fr_modes2_cmd); |
| 4055 | install_element(BTS_NODE, &cfg_bts_amr_fr_modes3_cmd); |
| 4056 | install_element(BTS_NODE, &cfg_bts_amr_fr_modes4_cmd); |
| 4057 | install_element(BTS_NODE, &cfg_bts_amr_fr_thres1_cmd); |
| 4058 | install_element(BTS_NODE, &cfg_bts_amr_fr_thres2_cmd); |
| 4059 | install_element(BTS_NODE, &cfg_bts_amr_fr_thres3_cmd); |
| 4060 | install_element(BTS_NODE, &cfg_bts_amr_fr_hyst1_cmd); |
| 4061 | install_element(BTS_NODE, &cfg_bts_amr_fr_hyst2_cmd); |
| 4062 | install_element(BTS_NODE, &cfg_bts_amr_fr_hyst3_cmd); |
| 4063 | install_element(BTS_NODE, &cfg_bts_amr_fr_start_mode_cmd); |
| 4064 | install_element(BTS_NODE, &cfg_bts_amr_hr_modes1_cmd); |
| 4065 | install_element(BTS_NODE, &cfg_bts_amr_hr_modes2_cmd); |
| 4066 | install_element(BTS_NODE, &cfg_bts_amr_hr_modes3_cmd); |
| 4067 | install_element(BTS_NODE, &cfg_bts_amr_hr_modes4_cmd); |
| 4068 | install_element(BTS_NODE, &cfg_bts_amr_hr_thres1_cmd); |
| 4069 | install_element(BTS_NODE, &cfg_bts_amr_hr_thres2_cmd); |
| 4070 | install_element(BTS_NODE, &cfg_bts_amr_hr_thres3_cmd); |
| 4071 | install_element(BTS_NODE, &cfg_bts_amr_hr_hyst1_cmd); |
| 4072 | install_element(BTS_NODE, &cfg_bts_amr_hr_hyst2_cmd); |
| 4073 | install_element(BTS_NODE, &cfg_bts_amr_hr_hyst3_cmd); |
| 4074 | install_element(BTS_NODE, &cfg_bts_amr_hr_start_mode_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 4075 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 4076 | install_element(BTS_NODE, &cfg_trx_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 4077 | install_node(&trx_node, dummy_config_write); |
Jacob Erlbeck | 36722e1 | 2013-10-29 09:30:30 +0100 | [diff] [blame] | 4078 | vty_install_default(TRX_NODE); |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 4079 | install_element(TRX_NODE, &cfg_trx_arfcn_cmd); |
Harald Welte | 197dea9 | 2010-05-14 17:59:53 +0200 | [diff] [blame] | 4080 | install_element(TRX_NODE, &cfg_description_cmd); |
| 4081 | install_element(TRX_NODE, &cfg_no_description_cmd); |
Harald Welte (local) | 7b37d97 | 2009-12-27 20:56:38 +0100 | [diff] [blame] | 4082 | install_element(TRX_NODE, &cfg_trx_nominal_power_cmd); |
Harald Welte | 879dc97 | 2009-06-20 22:36:12 +0200 | [diff] [blame] | 4083 | install_element(TRX_NODE, &cfg_trx_max_power_red_cmd); |
Harald Welte | 4258182 | 2009-08-08 16:12:58 +0200 | [diff] [blame] | 4084 | install_element(TRX_NODE, &cfg_trx_rsl_e1_cmd); |
| 4085 | install_element(TRX_NODE, &cfg_trx_rsl_e1_tei_cmd); |
Holger Hans Peter Freyther | 2d501ea | 2009-11-11 11:54:24 +0100 | [diff] [blame] | 4086 | install_element(TRX_NODE, &cfg_trx_rf_locked_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 4087 | |
Harald Welte | 5258fc4 | 2009-03-28 19:07:53 +0000 | [diff] [blame] | 4088 | install_element(TRX_NODE, &cfg_ts_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 4089 | install_node(&ts_node, dummy_config_write); |
Jacob Erlbeck | 36722e1 | 2013-10-29 09:30:30 +0100 | [diff] [blame] | 4090 | vty_install_default(TS_NODE); |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 4091 | install_element(TS_NODE, &cfg_ts_pchan_cmd); |
Harald Welte | 4ab9d7c | 2012-08-17 12:42:06 +0200 | [diff] [blame] | 4092 | install_element(TS_NODE, &cfg_ts_pchan_compat_cmd); |
Harald Welte | 135a648 | 2011-05-30 12:09:13 +0200 | [diff] [blame] | 4093 | install_element(TS_NODE, &cfg_ts_tsc_cmd); |
Harald Welte | a39b0f2 | 2010-06-14 22:26:10 +0200 | [diff] [blame] | 4094 | install_element(TS_NODE, &cfg_ts_hopping_cmd); |
Harald Welte | 6e0cd04 | 2009-09-12 13:05:33 +0200 | [diff] [blame] | 4095 | install_element(TS_NODE, &cfg_ts_hsn_cmd); |
| 4096 | install_element(TS_NODE, &cfg_ts_maio_cmd); |
| 4097 | install_element(TS_NODE, &cfg_ts_arfcn_add_cmd); |
| 4098 | install_element(TS_NODE, &cfg_ts_arfcn_del_cmd); |
Harald Welte | a6fd58e | 2009-08-07 00:25:23 +0200 | [diff] [blame] | 4099 | install_element(TS_NODE, &cfg_ts_e1_subslot_cmd); |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 4100 | |
Holger Hans Peter Freyther | 2484ceb | 2010-10-26 09:40:13 +0200 | [diff] [blame] | 4101 | install_element(ENABLE_NODE, &drop_bts_cmd); |
Holger Hans Peter Freyther | 740e65f | 2016-03-16 13:45:23 +0100 | [diff] [blame] | 4102 | install_element(ENABLE_NODE, &restart_bts_cmd); |
Harald Welte | d0d2b0b | 2010-12-23 13:18:07 +0100 | [diff] [blame] | 4103 | install_element(ENABLE_NODE, &pdch_act_cmd); |
Harald Welte | 30f1f37 | 2014-12-28 15:00:45 +0100 | [diff] [blame] | 4104 | install_element(ENABLE_NODE, &smscb_cmd_cmd); |
Holger Hans Peter Freyther | 2484ceb | 2010-10-26 09:40:13 +0200 | [diff] [blame] | 4105 | |
Harald Welte | 81c9b9c | 2010-05-31 16:40:40 +0200 | [diff] [blame] | 4106 | abis_nm_vty_init(); |
Harald Welte | e1d5eca | 2011-02-12 14:42:59 +0100 | [diff] [blame] | 4107 | abis_om2k_vty_init(); |
Harald Welte | 3016d9f | 2011-02-05 13:54:41 +0100 | [diff] [blame] | 4108 | e1inp_vty_init(); |
Harald Welte | 42def72 | 2017-01-13 00:10:32 +0100 | [diff] [blame] | 4109 | osmo_fsm_vty_add_cmds(); |
Harald Welte | 81c9b9c | 2010-05-31 16:40:40 +0200 | [diff] [blame] | 4110 | |
Harald Welte | dcccb18 | 2010-05-16 20:52:23 +0200 | [diff] [blame] | 4111 | bsc_vty_init_extra(); |
Harald Welte | 40f8289 | 2009-05-23 17:31:39 +0000 | [diff] [blame] | 4112 | |
Harald Welte | 68628e8 | 2009-03-10 12:17:57 +0000 | [diff] [blame] | 4113 | return 0; |
| 4114 | } |