Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 1 | /* OsmoBTS VTY interface */ |
| 2 | |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 3 | |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 4 | #include <stdint.h> |
Holger Hans Peter Freyther | 2c98f1d | 2014-07-02 14:56:36 +0200 | [diff] [blame] | 5 | #include <stdlib.h> |
Neels Hofmeyr | d34646a | 2017-02-08 17:07:40 +0100 | [diff] [blame] | 6 | #include <string.h> |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 7 | #include <inttypes.h> |
| 8 | |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 9 | #include <osmocom/core/tdef.h> |
Vadim Yanitskiy | 657a4c0 | 2019-11-30 20:15:22 +0700 | [diff] [blame] | 10 | #include <osmocom/core/utils.h> |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 11 | #include <osmocom/vty/tdef_vty.h> |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 12 | #include <osmocom/vty/logging.h> |
Jacob Erlbeck | 42aba81 | 2015-11-10 15:32:00 +0100 | [diff] [blame] | 13 | #include <osmocom/vty/stats.h> |
Jacob Erlbeck | c0c580c | 2015-04-30 15:59:01 +0200 | [diff] [blame] | 14 | #include <osmocom/vty/misc.h> |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 15 | #include <osmocom/core/linuxlist.h> |
Holger Hans Peter Freyther | e8915b9 | 2014-07-02 14:57:47 +0200 | [diff] [blame] | 16 | #include <osmocom/core/rate_ctr.h> |
Pau Espin Pedrol | c0a250d | 2021-01-21 18:46:13 +0100 | [diff] [blame] | 17 | #include <osmocom/ctrl/ports.h> |
Pau Espin Pedrol | c4178e5 | 2017-08-08 15:03:50 +0200 | [diff] [blame] | 18 | #include <osmocom/pcu/pcuif_proto.h> |
Alexander Couzens | 290d903 | 2020-09-16 21:52:02 +0200 | [diff] [blame] | 19 | #include <osmocom/gprs/gprs_ns2.h> |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 20 | #include "pcu_vty.h" |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 21 | #include "gprs_rlcmac.h" |
Max | 6dc90b8 | 2018-02-19 17:17:28 +0100 | [diff] [blame] | 22 | #include <pdch.h> |
Holger Hans Peter Freyther | 67ed34e | 2013-10-17 17:01:54 +0200 | [diff] [blame] | 23 | #include "bts.h" |
Jacob Erlbeck | c0c580c | 2015-04-30 15:59:01 +0200 | [diff] [blame] | 24 | #include "tbf.h" |
Jacob Erlbeck | 62e96a3 | 2015-06-04 09:42:14 +0200 | [diff] [blame] | 25 | #include "pcu_vty_functions.h" |
Pau Espin Pedrol | ff7c581 | 2022-12-14 18:49:06 +0100 | [diff] [blame] | 26 | #include "alloc_algo.h" |
Jacob Erlbeck | 62e96a3 | 2015-06-04 09:42:14 +0200 | [diff] [blame] | 27 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 28 | #define X(x) (1 << x) |
| 29 | |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 30 | extern void *tall_pcu_ctx; |
| 31 | |
| 32 | static const struct value_string pcu_gsmtap_categ_names[] = { |
| 33 | { PCU_GSMTAP_C_DL_UNKNOWN, "dl-unknown" }, |
| 34 | { PCU_GSMTAP_C_DL_DUMMY, "dl-dummy" }, |
| 35 | { PCU_GSMTAP_C_DL_CTRL, "dl-ctrl" }, |
| 36 | { PCU_GSMTAP_C_DL_DATA_GPRS, "dl-data-gprs" }, |
| 37 | { PCU_GSMTAP_C_DL_DATA_EGPRS, "dl-data-egprs" }, |
Harald Welte | bc219d5 | 2017-07-29 13:42:27 +0200 | [diff] [blame] | 38 | { PCU_GSMTAP_C_DL_PTCCH, "dl-ptcch" }, |
Pau Espin Pedrol | 5854370 | 2019-09-30 19:07:16 +0200 | [diff] [blame] | 39 | { PCU_GSMTAP_C_DL_AGCH, "dl-agch" }, |
| 40 | { PCU_GSMTAP_C_DL_PCH, "dl-pch" }, |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 41 | |
| 42 | { PCU_GSMTAP_C_UL_UNKNOWN, "ul-unknown" }, |
| 43 | { PCU_GSMTAP_C_UL_DUMMY, "ul-dummy" }, |
| 44 | { PCU_GSMTAP_C_UL_CTRL, "ul-ctrl" }, |
| 45 | { PCU_GSMTAP_C_UL_DATA_GPRS, "ul-data-gprs" }, |
| 46 | { PCU_GSMTAP_C_UL_DATA_EGPRS, "ul-data-egprs" }, |
Pau Espin Pedrol | 1ec211f | 2019-09-30 18:33:14 +0200 | [diff] [blame] | 47 | { PCU_GSMTAP_C_UL_RACH, "ul-rach" }, |
Vadim Yanitskiy | 07b6487 | 2020-06-11 00:26:15 +0700 | [diff] [blame] | 48 | { PCU_GSMTAP_C_UL_PTCCH, "ul-ptcch" }, |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 49 | |
| 50 | { 0, NULL } |
| 51 | }; |
| 52 | |
| 53 | static const struct value_string pcu_gsmtap_categ_help[] = { |
| 54 | { PCU_GSMTAP_C_DL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" }, |
| 55 | { PCU_GSMTAP_C_DL_DUMMY, "Downlink Dummy Blocks" }, |
| 56 | { PCU_GSMTAP_C_DL_CTRL, "Downlink Control Blocks" }, |
| 57 | { PCU_GSMTAP_C_DL_DATA_GPRS, "Downlink Data Blocks (GPRS)" }, |
| 58 | { PCU_GSMTAP_C_DL_DATA_EGPRS, "Downlink Data Blocks (EGPRS)" }, |
Harald Welte | bc219d5 | 2017-07-29 13:42:27 +0200 | [diff] [blame] | 59 | { PCU_GSMTAP_C_DL_PTCCH, "Downlink PTCCH Blocks" }, |
Pau Espin Pedrol | 5854370 | 2019-09-30 19:07:16 +0200 | [diff] [blame] | 60 | { PCU_GSMTAP_C_DL_AGCH, "Downlink AGCH Blocks" }, |
| 61 | { PCU_GSMTAP_C_DL_PCH, "Downlink PCH Blocks" }, |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 62 | |
| 63 | { PCU_GSMTAP_C_UL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" }, |
| 64 | { PCU_GSMTAP_C_UL_DUMMY, "Uplink Dummy Blocks" }, |
| 65 | { PCU_GSMTAP_C_UL_CTRL, "Uplink Control Blocks" }, |
| 66 | { PCU_GSMTAP_C_UL_DATA_GPRS, "Uplink Data Blocks (GPRS)" }, |
| 67 | { PCU_GSMTAP_C_UL_DATA_EGPRS, "Uplink Data Blocks (EGPRS)" }, |
Pau Espin Pedrol | 1ec211f | 2019-09-30 18:33:14 +0200 | [diff] [blame] | 68 | { PCU_GSMTAP_C_UL_RACH, "Uplink RACH Bursts" }, |
Vadim Yanitskiy | 07b6487 | 2020-06-11 00:26:15 +0700 | [diff] [blame] | 69 | { PCU_GSMTAP_C_UL_PTCCH, "Uplink PTCCH Bursts" }, |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 70 | |
| 71 | { 0, NULL } |
| 72 | }; |
| 73 | |
Pau Espin Pedrol | 13866f0 | 2021-11-12 13:42:03 +0100 | [diff] [blame] | 74 | DEFUN(cfg_pcu_gsmtap_remote_host, |
| 75 | cfg_pcu_gsmtap_remote_host_cmd, |
| 76 | "gsmtap-remote-host [HOSTNAME]", |
| 77 | "Enable GSMTAP Um logging (see also 'gsmtap-category')\n" |
| 78 | "Remote IP address or hostname ('localhost' if omitted)\n") |
| 79 | { |
| 80 | osmo_talloc_replace_string(the_pcu, &the_pcu->gsmtap_remote_host, |
| 81 | argc > 0 ? argv[0] : "localhost"); |
| 82 | |
| 83 | if (vty->type != VTY_FILE) |
| 84 | vty_out(vty, "%% This command requires restart%s", VTY_NEWLINE); |
| 85 | |
| 86 | return CMD_SUCCESS; |
| 87 | } |
| 88 | |
| 89 | DEFUN(cfg_pcu_no_gsmtap_remote_host, |
| 90 | cfg_pcu_no_gsmtap_remote_host_cmd, |
| 91 | "no gsmtap-remote-host", |
| 92 | NO_STR "Disable GSMTAP Um logging\n") |
| 93 | { |
| 94 | if (the_pcu->gsmtap_remote_host) |
| 95 | TALLOC_FREE(the_pcu->gsmtap_remote_host); |
| 96 | |
| 97 | if (vty->type != VTY_FILE) |
| 98 | vty_out(vty, "%% This command requires restart%s", VTY_NEWLINE); |
| 99 | |
| 100 | return CMD_SUCCESS; |
| 101 | } |
| 102 | |
| 103 | DEFUN(cfg_pcu_gsmtap_sapi_all, pcucfg_pcu_gsmtap_categ_all_cmd, |
| 104 | "gsmtap-category (enable-all|disable-all)", |
| 105 | "Enable/disable sending of UL/DL messages over GSMTAP\n" |
| 106 | "Enable all kinds of messages (all categories)\n" |
| 107 | "Disable all kinds of messages (all categories)\n") |
| 108 | { |
| 109 | |
| 110 | if (strcmp(argv[0], "enable-all") == 0) |
| 111 | the_pcu->gsmtap_categ_mask = UINT32_MAX; |
| 112 | else |
| 113 | the_pcu->gsmtap_categ_mask = 0x00; |
| 114 | |
| 115 | return CMD_SUCCESS; |
| 116 | } |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 117 | |
| 118 | DEFUN(cfg_pcu_gsmtap_categ, cfg_pcu_gsmtap_categ_cmd, "HIDDEN", "HIDDEN") |
| 119 | { |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 120 | int categ; |
| 121 | |
| 122 | categ = get_string_value(pcu_gsmtap_categ_names, argv[0]); |
| 123 | if (categ < 0) |
| 124 | return CMD_WARNING; |
| 125 | |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 126 | the_pcu->gsmtap_categ_mask |= (1 << categ); |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 127 | |
| 128 | return CMD_SUCCESS; |
| 129 | } |
| 130 | |
| 131 | DEFUN(cfg_pcu_no_gsmtap_categ, cfg_pcu_no_gsmtap_categ_cmd, "HIDDEN", "HIDDEN") |
| 132 | { |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 133 | int categ; |
| 134 | |
| 135 | categ = get_string_value(pcu_gsmtap_categ_names, argv[0]); |
| 136 | if (categ < 0) |
| 137 | return CMD_WARNING; |
| 138 | |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 139 | the_pcu->gsmtap_categ_mask &= ~(1 << categ); |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 140 | |
| 141 | return CMD_SUCCESS; |
| 142 | } |
| 143 | |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 144 | static struct cmd_node pcu_node = { |
| 145 | (enum node_type) PCU_NODE, |
Jacob Erlbeck | cc12f02 | 2015-04-09 15:45:24 +0200 | [diff] [blame] | 146 | "%s(config-pcu)# ", |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 147 | 1, |
| 148 | }; |
| 149 | |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 150 | static int config_write_pcu(struct vty *vty) |
| 151 | { |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 152 | unsigned int i; |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 153 | |
| 154 | vty_out(vty, "pcu%s", VTY_NEWLINE); |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 155 | vty_out(vty, " flow-control-interval %d%s", the_pcu->vty.fc_interval, |
Andreas Eversberg | cd8a83a | 2012-09-23 06:41:21 +0200 | [diff] [blame] | 156 | VTY_NEWLINE); |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 157 | if (the_pcu->vty.fc_bvc_bucket_size) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 158 | vty_out(vty, " flow-control force-bvc-bucket-size %d%s", |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 159 | the_pcu->vty.fc_bvc_bucket_size, VTY_NEWLINE); |
| 160 | if (the_pcu->vty.fc_bvc_leak_rate) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 161 | vty_out(vty, " flow-control force-bvc-leak-rate %d%s", |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 162 | the_pcu->vty.fc_bvc_leak_rate, VTY_NEWLINE); |
| 163 | if (the_pcu->vty.fc_ms_bucket_size) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 164 | vty_out(vty, " flow-control force-ms-bucket-size %d%s", |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 165 | the_pcu->vty.fc_ms_bucket_size, VTY_NEWLINE); |
| 166 | if (the_pcu->vty.fc_ms_leak_rate) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 167 | vty_out(vty, " flow-control force-ms-leak-rate %d%s", |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 168 | the_pcu->vty.fc_ms_leak_rate, VTY_NEWLINE); |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 169 | if (the_pcu->vty.force_initial_cs) { |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 170 | if (the_pcu->vty.initial_cs_ul == the_pcu->vty.initial_cs_dl) |
| 171 | vty_out(vty, " cs %d%s", the_pcu->vty.initial_cs_dl, |
Andreas Eversberg | 499ff41 | 2012-10-03 14:21:36 +0200 | [diff] [blame] | 172 | VTY_NEWLINE); |
| 173 | else |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 174 | vty_out(vty, " cs %d %d%s", the_pcu->vty.initial_cs_dl, |
| 175 | the_pcu->vty.initial_cs_ul, VTY_NEWLINE); |
Holger Hans Peter Freyther | c421e8a | 2014-07-02 14:55:17 +0200 | [diff] [blame] | 176 | } |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 177 | if (the_pcu->vty.max_cs_dl && the_pcu->vty.max_cs_ul) { |
| 178 | if (the_pcu->vty.max_cs_ul == the_pcu->vty.max_cs_dl) |
| 179 | vty_out(vty, " cs max %d%s", the_pcu->vty.max_cs_dl, |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 180 | VTY_NEWLINE); |
| 181 | else |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 182 | vty_out(vty, " cs max %d %d%s", the_pcu->vty.max_cs_dl, |
| 183 | the_pcu->vty.max_cs_ul, VTY_NEWLINE); |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 184 | } |
Pau Espin Pedrol | e8dcf64 | 2021-01-14 13:17:01 +0100 | [diff] [blame] | 185 | if (the_pcu->vty.cs_adj_enabled) |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 186 | vty_out(vty, " cs threshold %d %d%s", |
Pau Espin Pedrol | e8dcf64 | 2021-01-14 13:17:01 +0100 | [diff] [blame] | 187 | the_pcu->vty.cs_adj_lower_limit, the_pcu->vty.cs_adj_upper_limit, |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 188 | VTY_NEWLINE); |
| 189 | else |
| 190 | vty_out(vty, " no cs threshold%s", VTY_NEWLINE); |
| 191 | |
Pau Espin Pedrol | ad79b85 | 2021-01-14 13:20:55 +0100 | [diff] [blame] | 192 | if (the_pcu->vty.cs_downgrade_threshold) |
Jacob Erlbeck | 70b96aa | 2015-06-12 10:52:34 +0200 | [diff] [blame] | 193 | vty_out(vty, " cs downgrade-threshold %d%s", |
Pau Espin Pedrol | ad79b85 | 2021-01-14 13:20:55 +0100 | [diff] [blame] | 194 | the_pcu->vty.cs_downgrade_threshold, VTY_NEWLINE); |
Jacob Erlbeck | 70b96aa | 2015-06-12 10:52:34 +0200 | [diff] [blame] | 195 | else |
| 196 | vty_out(vty, " no cs downgrade-threshold%s", VTY_NEWLINE); |
| 197 | |
Jacob Erlbeck | 94cde13 | 2015-06-09 09:44:36 +0200 | [diff] [blame] | 198 | vty_out(vty, " cs link-quality-ranges cs1 %d cs2 %d %d cs3 %d %d cs4 %d%s", |
Pau Espin Pedrol | 54b159a | 2021-01-14 13:30:04 +0100 | [diff] [blame] | 199 | the_pcu->vty.cs_lqual_ranges[0].high, |
| 200 | the_pcu->vty.cs_lqual_ranges[1].low, |
| 201 | the_pcu->vty.cs_lqual_ranges[1].high, |
| 202 | the_pcu->vty.cs_lqual_ranges[2].low, |
| 203 | the_pcu->vty.cs_lqual_ranges[2].high, |
| 204 | the_pcu->vty.cs_lqual_ranges[3].low, |
Jacob Erlbeck | 94cde13 | 2015-06-09 09:44:36 +0200 | [diff] [blame] | 205 | VTY_NEWLINE); |
| 206 | |
Minh-Quang Nguyen | 1f18909 | 2017-08-16 09:50:06 -0400 | [diff] [blame] | 207 | vty_out(vty, " mcs link-quality-ranges mcs1 %d mcs2 %d %d mcs3 %d %d mcs4 %d %d mcs5 %d %d mcs6 %d %d mcs7 %d %d mcs8 %d %d mcs9 %d%s", |
Pau Espin Pedrol | 54b159a | 2021-01-14 13:30:04 +0100 | [diff] [blame] | 208 | the_pcu->vty.mcs_lqual_ranges[0].high, |
| 209 | the_pcu->vty.mcs_lqual_ranges[1].low, |
| 210 | the_pcu->vty.mcs_lqual_ranges[1].high, |
| 211 | the_pcu->vty.mcs_lqual_ranges[2].low, |
| 212 | the_pcu->vty.mcs_lqual_ranges[2].high, |
| 213 | the_pcu->vty.mcs_lqual_ranges[3].low, |
| 214 | the_pcu->vty.mcs_lqual_ranges[3].high, |
| 215 | the_pcu->vty.mcs_lqual_ranges[4].low, |
| 216 | the_pcu->vty.mcs_lqual_ranges[4].high, |
| 217 | the_pcu->vty.mcs_lqual_ranges[5].low, |
| 218 | the_pcu->vty.mcs_lqual_ranges[5].high, |
| 219 | the_pcu->vty.mcs_lqual_ranges[6].low, |
| 220 | the_pcu->vty.mcs_lqual_ranges[6].high, |
| 221 | the_pcu->vty.mcs_lqual_ranges[7].low, |
| 222 | the_pcu->vty.mcs_lqual_ranges[7].high, |
| 223 | the_pcu->vty.mcs_lqual_ranges[8].low, |
Minh-Quang Nguyen | 1f18909 | 2017-08-16 09:50:06 -0400 | [diff] [blame] | 224 | VTY_NEWLINE); |
| 225 | |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 226 | if (the_pcu->vty.force_initial_mcs) { |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 227 | if (the_pcu->vty.initial_mcs_ul == the_pcu->vty.initial_mcs_dl) |
| 228 | vty_out(vty, " mcs %d%s", the_pcu->vty.initial_mcs_dl, |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 229 | VTY_NEWLINE); |
| 230 | else |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 231 | vty_out(vty, " mcs %d %d%s", the_pcu->vty.initial_mcs_dl, |
| 232 | the_pcu->vty.initial_mcs_ul, VTY_NEWLINE); |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 233 | } |
Minh-Quang Nguyen | 1f18909 | 2017-08-16 09:50:06 -0400 | [diff] [blame] | 234 | |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 235 | if (the_pcu->vty.max_mcs_dl && the_pcu->vty.max_mcs_ul) { |
| 236 | if (the_pcu->vty.max_mcs_ul == the_pcu->vty.max_mcs_dl) |
| 237 | vty_out(vty, " mcs max %d%s", the_pcu->vty.max_mcs_dl, |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 238 | VTY_NEWLINE); |
| 239 | else |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 240 | vty_out(vty, " mcs max %d %d%s", the_pcu->vty.max_mcs_dl, |
| 241 | the_pcu->vty.max_mcs_ul, VTY_NEWLINE); |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 242 | } |
| 243 | |
Pau Espin Pedrol | 519d071 | 2021-01-14 14:30:03 +0100 | [diff] [blame] | 244 | vty_out(vty, " window-size %d %d%s", the_pcu->vty.ws_base, the_pcu->vty.ws_pdch, |
Jacob Erlbeck | 36df774 | 2016-01-19 15:53:30 +0100 | [diff] [blame] | 245 | VTY_NEWLINE); |
| 246 | |
Pau Espin Pedrol | 97296b2 | 2021-01-14 13:08:02 +0100 | [diff] [blame] | 247 | if (the_pcu->vty.dl_arq_type == EGPRS_ARQ2) |
| 248 | vty_out(vty, " egprs dl arq-type arq2%s", VTY_NEWLINE); |
Aravind Sirsikar | 50b0970 | 2016-08-22 17:21:10 +0530 | [diff] [blame] | 249 | |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 250 | if (the_pcu->vty.force_llc_lifetime == 0xffff) |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 251 | vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 252 | else if (the_pcu->vty.force_llc_lifetime) |
| 253 | vty_out(vty, " queue lifetime %d%s", the_pcu->vty.force_llc_lifetime, |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 254 | VTY_NEWLINE); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 255 | if (the_pcu->vty.llc_discard_csec) |
| 256 | vty_out(vty, " queue hysteresis %d%s", the_pcu->vty.llc_discard_csec, |
Jacob Erlbeck | 0c1c877 | 2015-03-20 12:02:42 +0100 | [diff] [blame] | 257 | VTY_NEWLINE); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 258 | if (the_pcu->vty.llc_idle_ack_csec) |
| 259 | vty_out(vty, " queue idle-ack-delay %d%s", the_pcu->vty.llc_idle_ack_csec, |
Jacob Erlbeck | d0261b7 | 2015-04-02 13:58:09 +0200 | [diff] [blame] | 260 | VTY_NEWLINE); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 261 | if (the_pcu->vty.llc_codel_interval_msec == LLC_CODEL_USE_DEFAULT) |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 262 | vty_out(vty, " queue codel%s", VTY_NEWLINE); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 263 | else if (the_pcu->vty.llc_codel_interval_msec == LLC_CODEL_DISABLE) |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 264 | vty_out(vty, " no queue codel%s", VTY_NEWLINE); |
| 265 | else |
| 266 | vty_out(vty, " queue codel interval %d%s", |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 267 | the_pcu->vty.llc_codel_interval_msec/10, VTY_NEWLINE); |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 268 | |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 269 | if (the_pcu->alloc_algorithm == alloc_algorithm_a) |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 270 | vty_out(vty, " alloc-algorithm a%s", VTY_NEWLINE); |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 271 | if (the_pcu->alloc_algorithm == alloc_algorithm_b) |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 272 | vty_out(vty, " alloc-algorithm b%s", VTY_NEWLINE); |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 273 | if (the_pcu->alloc_algorithm == alloc_algorithm_dynamic) |
Jacob Erlbeck | 400ec02 | 2015-07-14 13:31:48 +0200 | [diff] [blame] | 274 | vty_out(vty, " alloc-algorithm dynamic%s", VTY_NEWLINE); |
Pau Espin Pedrol | 03de898 | 2021-01-14 12:48:50 +0100 | [diff] [blame] | 275 | if (the_pcu->vty.force_two_phase) |
Andreas Eversberg | 07e97cf | 2012-08-07 16:00:56 +0200 | [diff] [blame] | 276 | vty_out(vty, " two-phase-access%s", VTY_NEWLINE); |
Pau Espin Pedrol | fe8de45 | 2021-02-09 18:47:34 +0100 | [diff] [blame] | 277 | if (the_pcu->vty.force_alpha != (uint8_t)-1) |
| 278 | vty_out(vty, " alpha %u%s", the_pcu->vty.force_alpha, VTY_NEWLINE); |
Pau Espin Pedrol | a281495 | 2021-01-14 12:53:53 +0100 | [diff] [blame] | 279 | vty_out(vty, " gamma %d%s", the_pcu->vty.gamma * 2, VTY_NEWLINE); |
Pau Espin Pedrol | 05f9f59 | 2021-01-14 12:56:58 +0100 | [diff] [blame] | 280 | if (!the_pcu->vty.dl_tbf_preemptive_retransmission) |
Oliver Smith | 45fdc44 | 2019-09-05 15:12:20 +0200 | [diff] [blame] | 281 | vty_out(vty, " no dl-tbf-preemptive-retransmission%s", VTY_NEWLINE); |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 282 | if (strcmp(the_pcu->pcu_sock_path, PCU_SOCK_DEFAULT)) |
| 283 | vty_out(vty, " pcu-socket %s%s", the_pcu->pcu_sock_path, VTY_NEWLINE); |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 284 | |
Pau Espin Pedrol | 13866f0 | 2021-11-12 13:42:03 +0100 | [diff] [blame] | 285 | if (the_pcu->gsmtap_remote_host) |
| 286 | vty_out(vty, " gsmtap-remote-host %s%s", the_pcu->gsmtap_remote_host, VTY_NEWLINE); |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 287 | for (i = 0; i < 32; i++) { |
Pau Espin Pedrol | 13866f0 | 2021-11-12 13:42:03 +0100 | [diff] [blame] | 288 | if (the_pcu->gsmtap_categ_mask & ((uint32_t)1 << i)) { |
| 289 | const char *category_buf; |
| 290 | if (!(category_buf = get_value_string_or_null(pcu_gsmtap_categ_names, i))) |
| 291 | continue; |
| 292 | vty_out(vty, " gsmtap-category %s%s", category_buf, VTY_NEWLINE); |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 293 | } |
| 294 | } |
| 295 | |
Alexander Couzens | f7ec525 | 2021-01-25 20:28:38 +0100 | [diff] [blame] | 296 | if (the_pcu->vty.ns_dialect == GPRS_NS2_DIALECT_SNS) |
Harald Welte | 57d3515 | 2018-07-05 03:11:17 +0200 | [diff] [blame] | 297 | vty_out(vty, " gb-dialect ip-sns%s", VTY_NEWLINE); |
| 298 | else |
| 299 | vty_out(vty, " gb-dialect classic%s", VTY_NEWLINE); |
| 300 | |
Harald Welte | d9367e3 | 2021-04-29 22:02:47 +0200 | [diff] [blame] | 301 | if (the_pcu->vty.ns_ip_dscp != -1) |
| 302 | vty_out(vty, " gb ip-dscp %d%s", the_pcu->vty.ns_ip_dscp, VTY_NEWLINE); |
| 303 | if (the_pcu->vty.ns_priority != -1) |
| 304 | vty_out(vty, " gb socket-priority %d%s", the_pcu->vty.ns_priority, VTY_NEWLINE); |
| 305 | |
Pau Espin Pedrol | 66e8a49 | 2021-02-17 20:24:59 +0100 | [diff] [blame] | 306 | if (the_pcu->vty.neigh_ctrl_addr) { |
| 307 | vty_out(vty, " neighbor resolution %s %u%s", |
| 308 | the_pcu->vty.neigh_ctrl_addr, the_pcu->vty.neigh_ctrl_port, VTY_NEWLINE); |
| 309 | } |
| 310 | |
Pau Espin Pedrol | 924aaad | 2021-01-14 12:01:42 +0100 | [diff] [blame] | 311 | osmo_tdef_vty_write(vty, the_pcu->T_defs, " timer "); |
Pau Espin Pedrol | 1879442 | 2019-09-26 18:25:35 +0200 | [diff] [blame] | 312 | |
Max | c9ce6f9 | 2018-01-30 17:53:02 +0100 | [diff] [blame] | 313 | return CMD_SUCCESS; |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | /* per-BTS configuration */ |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 317 | DEFUN_ATTR(cfg_pcu, |
| 318 | cfg_pcu_cmd, |
| 319 | "pcu", |
| 320 | "BTS specific configure", |
| 321 | CMD_ATTR_IMMEDIATE) |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 322 | { |
| 323 | vty->node = PCU_NODE; |
| 324 | |
| 325 | return CMD_SUCCESS; |
| 326 | } |
| 327 | |
Jacob Erlbeck | 953c789 | 2015-09-28 18:12:57 +0200 | [diff] [blame] | 328 | #define EGPRS_STR "EGPRS configuration\n" |
| 329 | |
Pau Espin Pedrol | 270c9ea | 2020-10-30 17:15:32 +0100 | [diff] [blame] | 330 | DEFUN_DEPRECATED(cfg_pcu_egprs, |
| 331 | cfg_pcu_egprs_cmd, |
| 332 | "egprs only", |
| 333 | EGPRS_STR "Use EGPRS and disable plain GPRS\n") |
Jacob Erlbeck | 953c789 | 2015-09-28 18:12:57 +0200 | [diff] [blame] | 334 | { |
Pau Espin Pedrol | 270c9ea | 2020-10-30 17:15:32 +0100 | [diff] [blame] | 335 | vty_out (vty, "'egprs only' is deprecated, egprs support is controled from BTS/BSC config, this is now a no-op%s", VTY_NEWLINE); |
Jacob Erlbeck | 953c789 | 2015-09-28 18:12:57 +0200 | [diff] [blame] | 336 | return CMD_SUCCESS; |
| 337 | } |
| 338 | |
Pau Espin Pedrol | 270c9ea | 2020-10-30 17:15:32 +0100 | [diff] [blame] | 339 | DEFUN_DEPRECATED(cfg_pcu_no_egprs, |
| 340 | cfg_pcu_no_egprs_cmd, |
| 341 | "no egprs", |
| 342 | NO_STR EGPRS_STR) |
Jacob Erlbeck | 953c789 | 2015-09-28 18:12:57 +0200 | [diff] [blame] | 343 | { |
Pau Espin Pedrol | 270c9ea | 2020-10-30 17:15:32 +0100 | [diff] [blame] | 344 | vty_out (vty, "'no egprs only' is deprecated, egprs support is controled from BTS/BSC config, this is now a no-op%s", VTY_NEWLINE); |
Jacob Erlbeck | 953c789 | 2015-09-28 18:12:57 +0200 | [diff] [blame] | 345 | return CMD_SUCCESS; |
| 346 | } |
| 347 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 348 | DEFUN_ATTR(cfg_pcu_fc_interval, |
| 349 | cfg_pcu_fc_interval_cmd, |
| 350 | "flow-control-interval <1-10>", |
| 351 | "Interval between sending subsequent Flow Control PDUs\n" |
| 352 | "Interval time in seconds\n", |
| 353 | CMD_ATTR_IMMEDIATE) |
Andreas Eversberg | cd8a83a | 2012-09-23 06:41:21 +0200 | [diff] [blame] | 354 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 355 | the_pcu->vty.fc_interval = atoi(argv[0]); |
Andreas Eversberg | cd8a83a | 2012-09-23 06:41:21 +0200 | [diff] [blame] | 356 | return CMD_SUCCESS; |
| 357 | } |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 358 | #define FC_STR "BSSGP Flow Control configuration\n" |
| 359 | #define FC_BMAX_STR(who) "Force a fixed value for the " who " bucket size\n" |
| 360 | #define FC_LR_STR(who) "Force a fixed value for the " who " leak rate\n" |
| 361 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 362 | DEFUN_ATTR(cfg_pcu_fc_bvc_bucket_size, |
| 363 | cfg_pcu_fc_bvc_bucket_size_cmd, |
| 364 | "flow-control force-bvc-bucket-size <1-6553500>", |
| 365 | FC_STR FC_BMAX_STR("BVC") "Bucket size in octets\n", |
| 366 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 367 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 368 | the_pcu->vty.fc_bvc_bucket_size = atoi(argv[0]); |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 369 | return CMD_SUCCESS; |
| 370 | } |
| 371 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 372 | DEFUN_ATTR(cfg_pcu_no_fc_bvc_bucket_size, |
| 373 | cfg_pcu_no_fc_bvc_bucket_size_cmd, |
| 374 | "no flow-control force-bvc-bucket-size", |
| 375 | NO_STR FC_STR FC_BMAX_STR("BVC"), |
| 376 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 377 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 378 | the_pcu->vty.fc_bvc_bucket_size = 0; |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 379 | return CMD_SUCCESS; |
| 380 | } |
| 381 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 382 | DEFUN_ATTR(cfg_pcu_fc_bvc_leak_rate, |
| 383 | cfg_pcu_fc_bvc_leak_rate_cmd, |
| 384 | "flow-control force-bvc-leak-rate <1-6553500>", |
| 385 | FC_STR FC_LR_STR("BVC") "Leak rate in bit/s\n", |
| 386 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 387 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 388 | the_pcu->vty.fc_bvc_leak_rate = atoi(argv[0]); |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 389 | |
| 390 | return CMD_SUCCESS; |
| 391 | } |
| 392 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 393 | DEFUN_ATTR(cfg_pcu_no_fc_bvc_leak_rate, |
| 394 | cfg_pcu_no_fc_bvc_leak_rate_cmd, |
| 395 | "no flow-control force-bvc-leak-rate", |
| 396 | NO_STR FC_STR FC_LR_STR("BVC"), |
| 397 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 398 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 399 | the_pcu->vty.fc_bvc_leak_rate = 0; |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 400 | return CMD_SUCCESS; |
| 401 | } |
| 402 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 403 | DEFUN_ATTR(cfg_pcu_fc_ms_bucket_size, |
| 404 | cfg_pcu_fc_ms_bucket_size_cmd, |
| 405 | "flow-control force-ms-bucket-size <1-6553500>", |
| 406 | FC_STR FC_BMAX_STR("default MS") "Bucket size in octets\n", |
| 407 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 408 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 409 | the_pcu->vty.fc_ms_bucket_size = atoi(argv[0]); |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 410 | return CMD_SUCCESS; |
| 411 | } |
| 412 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 413 | DEFUN_ATTR(cfg_pcu_no_fc_ms_bucket_size, |
| 414 | cfg_pcu_no_fc_ms_bucket_size_cmd, |
| 415 | "no flow-control force-ms-bucket-size", |
| 416 | NO_STR FC_STR FC_BMAX_STR("default MS"), |
| 417 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 418 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 419 | the_pcu->vty.fc_ms_bucket_size = 0; |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 420 | return CMD_SUCCESS; |
| 421 | } |
| 422 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 423 | DEFUN_ATTR(cfg_pcu_fc_ms_leak_rate, |
| 424 | cfg_pcu_fc_ms_leak_rate_cmd, |
| 425 | "flow-control force-ms-leak-rate <1-6553500>", |
| 426 | FC_STR FC_LR_STR("default MS") "Leak rate in bit/s\n", |
| 427 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 428 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 429 | the_pcu->vty.fc_ms_leak_rate = atoi(argv[0]); |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 430 | return CMD_SUCCESS; |
| 431 | } |
| 432 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 433 | DEFUN_ATTR(cfg_pcu_no_fc_ms_leak_rate, |
| 434 | cfg_pcu_no_fc_ms_leak_rate_cmd, |
| 435 | "no flow-control force-ms-leak-rate", |
| 436 | NO_STR FC_STR FC_LR_STR("default MS"), |
| 437 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 438 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 439 | the_pcu->vty.fc_ms_leak_rate = 0; |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 440 | return CMD_SUCCESS; |
| 441 | } |
Andreas Eversberg | cd8a83a | 2012-09-23 06:41:21 +0200 | [diff] [blame] | 442 | |
Jacob Erlbeck | 0288cdb | 2015-05-06 10:47:30 +0200 | [diff] [blame] | 443 | #define FC_BTIME_STR "Set target downlink maximum queueing time (only affects the advertised bucket size)\n" |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 444 | DEFUN_ATTR(cfg_pcu_fc_bucket_time, |
| 445 | cfg_pcu_fc_bucket_time_cmd, |
| 446 | "flow-control bucket-time <1-65534>", |
| 447 | FC_STR FC_BTIME_STR "Time in centi-seconds\n", |
| 448 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 0288cdb | 2015-05-06 10:47:30 +0200 | [diff] [blame] | 449 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 450 | the_pcu->vty.fc_bucket_time = atoi(argv[0]); |
Jacob Erlbeck | 0288cdb | 2015-05-06 10:47:30 +0200 | [diff] [blame] | 451 | return CMD_SUCCESS; |
| 452 | } |
| 453 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 454 | DEFUN_ATTR(cfg_pcu_no_fc_bucket_time, |
| 455 | cfg_pcu_no_fc_bucket_time_cmd, |
| 456 | "no flow-control bucket-time", |
| 457 | NO_STR FC_STR FC_BTIME_STR, |
| 458 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 0288cdb | 2015-05-06 10:47:30 +0200 | [diff] [blame] | 459 | { |
Pau Espin Pedrol | e891222 | 2021-01-14 14:03:17 +0100 | [diff] [blame] | 460 | the_pcu->vty.fc_bucket_time = 0; |
Jacob Erlbeck | 0288cdb | 2015-05-06 10:47:30 +0200 | [diff] [blame] | 461 | return CMD_SUCCESS; |
| 462 | } |
| 463 | |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 464 | #define CS_STR "Coding Scheme configuration\n" |
Jacob Erlbeck | 0288cdb | 2015-05-06 10:47:30 +0200 | [diff] [blame] | 465 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 466 | DEFUN_ATTR(cfg_pcu_cs, |
| 467 | cfg_pcu_cs_cmd, |
| 468 | "cs <1-4> [<1-4>]", |
| 469 | CS_STR |
| 470 | "Initial CS value to be used (overrides BTS config)\n" |
| 471 | "Use a different initial CS value for the uplink", |
| 472 | CMD_ATTR_IMMEDIATE) |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 473 | { |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 474 | uint8_t cs_dl, cs_ul; |
| 475 | cs_dl = atoi(argv[0]); |
Andreas Eversberg | 499ff41 | 2012-10-03 14:21:36 +0200 | [diff] [blame] | 476 | if (argc > 1) |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 477 | cs_ul = atoi(argv[1]); |
Andreas Eversberg | 499ff41 | 2012-10-03 14:21:36 +0200 | [diff] [blame] | 478 | else |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 479 | cs_ul = cs_dl; |
| 480 | the_pcu->vty.force_initial_cs = true; |
| 481 | gprs_pcu_set_initial_cs(the_pcu, cs_dl, cs_ul); |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 482 | return CMD_SUCCESS; |
| 483 | } |
| 484 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 485 | DEFUN_ATTR(cfg_pcu_no_cs, |
| 486 | cfg_pcu_no_cs_cmd, |
| 487 | "no cs", |
| 488 | NO_STR CS_STR, |
| 489 | CMD_ATTR_IMMEDIATE) |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 490 | { |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 491 | the_pcu->vty.force_initial_cs = false; |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 492 | gprs_pcu_set_initial_cs(the_pcu, 0, 0); |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 493 | return CMD_SUCCESS; |
| 494 | } |
| 495 | |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 496 | #define CS_MAX_STR "Set maximum values for adaptive CS selection (overrides BTS config)\n" |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 497 | DEFUN_ATTR(cfg_pcu_cs_max, |
| 498 | cfg_pcu_cs_max_cmd, |
| 499 | "cs max <1-4> [<1-4>]", |
| 500 | CS_STR |
| 501 | CS_MAX_STR |
| 502 | "Maximum CS value to be used\n" |
| 503 | "Use a different maximum CS value for the uplink", |
| 504 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 505 | { |
Pau Espin Pedrol | 343ec9b | 2020-10-30 18:35:54 +0100 | [diff] [blame] | 506 | uint8_t cs_dl = atoi(argv[0]); |
| 507 | uint8_t cs_ul; |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 508 | |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 509 | if (argc > 1) |
Pau Espin Pedrol | 343ec9b | 2020-10-30 18:35:54 +0100 | [diff] [blame] | 510 | cs_ul = atoi(argv[1]); |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 511 | else |
Pau Espin Pedrol | 343ec9b | 2020-10-30 18:35:54 +0100 | [diff] [blame] | 512 | cs_ul = cs_dl; |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 513 | |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 514 | gprs_pcu_set_max_cs(the_pcu, cs_dl, cs_ul); |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 515 | return CMD_SUCCESS; |
| 516 | } |
| 517 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 518 | DEFUN_ATTR(cfg_pcu_no_cs_max, |
| 519 | cfg_pcu_no_cs_max_cmd, |
| 520 | "no cs max", |
| 521 | NO_STR CS_STR CS_MAX_STR, |
| 522 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 523 | { |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 524 | gprs_pcu_set_max_cs(the_pcu, 0, 0); |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 525 | return CMD_SUCCESS; |
| 526 | } |
| 527 | |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 528 | #define MCS_STR "Modulation and Coding Scheme configuration (EGPRS)\n" |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 529 | DEFUN_ATTR(cfg_pcu_mcs, |
| 530 | cfg_pcu_mcs_cmd, |
| 531 | "mcs <1-9> [<1-9>]", |
| 532 | MCS_STR |
| 533 | "Initial MCS value to be used (default 1)\n" |
| 534 | "Use a different initial MCS value for the uplink", |
| 535 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 536 | { |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 537 | uint8_t mcs_dl, mcs_ul; |
| 538 | mcs_dl = atoi(argv[0]); |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 539 | if (argc > 1) |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 540 | mcs_ul = atoi(argv[1]); |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 541 | else |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 542 | mcs_ul = mcs_dl; |
| 543 | the_pcu->vty.force_initial_mcs = true; |
| 544 | gprs_pcu_set_initial_mcs(the_pcu, mcs_dl, mcs_ul); |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 545 | return CMD_SUCCESS; |
| 546 | } |
| 547 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 548 | DEFUN_ATTR(cfg_pcu_no_mcs, |
| 549 | cfg_pcu_no_mcs_cmd, |
| 550 | "no mcs", |
| 551 | NO_STR MCS_STR, |
| 552 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 553 | { |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 554 | the_pcu->vty.force_initial_mcs = false; |
Pau Espin Pedrol | 793583e | 2021-01-14 16:20:57 +0100 | [diff] [blame] | 555 | gprs_pcu_set_initial_mcs(the_pcu, 0, 0); |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 556 | return CMD_SUCCESS; |
| 557 | } |
| 558 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 559 | DEFUN_ATTR(cfg_pcu_mcs_max, |
| 560 | cfg_pcu_mcs_max_cmd, |
| 561 | "mcs max <1-9> [<1-9>]", |
| 562 | MCS_STR |
| 563 | CS_MAX_STR |
| 564 | "Maximum MCS value to be used\n" |
| 565 | "Use a different maximum MCS value for the uplink", |
| 566 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 567 | { |
Pau Espin Pedrol | 343ec9b | 2020-10-30 18:35:54 +0100 | [diff] [blame] | 568 | uint8_t mcs_dl = atoi(argv[0]); |
| 569 | uint8_t mcs_ul; |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 570 | |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 571 | if (argc > 1) |
Pau Espin Pedrol | 343ec9b | 2020-10-30 18:35:54 +0100 | [diff] [blame] | 572 | mcs_ul = atoi(argv[1]); |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 573 | else |
Pau Espin Pedrol | 343ec9b | 2020-10-30 18:35:54 +0100 | [diff] [blame] | 574 | mcs_ul = mcs_dl; |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 575 | |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 576 | gprs_pcu_set_max_mcs(the_pcu, mcs_dl, mcs_ul); |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 577 | return CMD_SUCCESS; |
| 578 | } |
| 579 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 580 | DEFUN_ATTR(cfg_pcu_no_mcs_max, |
| 581 | cfg_pcu_no_mcs_max_cmd, |
| 582 | "no mcs max", |
| 583 | NO_STR MCS_STR CS_MAX_STR, |
| 584 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 585 | { |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 586 | gprs_pcu_set_max_mcs(the_pcu, 0, 0); |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 587 | return CMD_SUCCESS; |
| 588 | } |
| 589 | |
Aravind Sirsikar | 50b0970 | 2016-08-22 17:21:10 +0530 | [diff] [blame] | 590 | #define DL_STR "downlink specific configuration\n" |
| 591 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 592 | DEFUN_ATTR(cfg_pcu_dl_arq_type, |
| 593 | cfg_pcu_dl_arq_cmd, |
| 594 | "egprs dl arq-type (spb|arq2)", |
| 595 | EGPRS_STR DL_STR "ARQ options\n" |
| 596 | "enable SPB(ARQ1) support\n" |
| 597 | "enable ARQ2 support", |
| 598 | CMD_ATTR_IMMEDIATE) |
Aravind Sirsikar | 50b0970 | 2016-08-22 17:21:10 +0530 | [diff] [blame] | 599 | { |
Aravind Sirsikar | 50b0970 | 2016-08-22 17:21:10 +0530 | [diff] [blame] | 600 | if (!strcmp(argv[0], "arq2")) |
Pau Espin Pedrol | 97296b2 | 2021-01-14 13:08:02 +0100 | [diff] [blame] | 601 | the_pcu->vty.dl_arq_type = EGPRS_ARQ2; |
Aravind Sirsikar | 50b0970 | 2016-08-22 17:21:10 +0530 | [diff] [blame] | 602 | else |
Pau Espin Pedrol | 97296b2 | 2021-01-14 13:08:02 +0100 | [diff] [blame] | 603 | the_pcu->vty.dl_arq_type = EGPRS_ARQ1; |
Aravind Sirsikar | 50b0970 | 2016-08-22 17:21:10 +0530 | [diff] [blame] | 604 | |
| 605 | return CMD_SUCCESS; |
| 606 | } |
| 607 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 608 | DEFUN_USRATTR(cfg_pcu_window_size, |
| 609 | cfg_pcu_window_size_cmd, |
| 610 | X(PCU_VTY_ATTR_NEW_TBF), |
| 611 | "window-size <0-1024> [<0-256>]", |
| 612 | "Window size configuration (b + N_PDCH * f)\n" |
| 613 | "Base value (b)\n" |
| 614 | "Factor for number of PDCH (f)") |
Jacob Erlbeck | 36df774 | 2016-01-19 15:53:30 +0100 | [diff] [blame] | 615 | { |
Jacob Erlbeck | 36df774 | 2016-01-19 15:53:30 +0100 | [diff] [blame] | 616 | uint16_t b = atoi(argv[0]); |
| 617 | |
Pau Espin Pedrol | 519d071 | 2021-01-14 14:30:03 +0100 | [diff] [blame] | 618 | the_pcu->vty.ws_base = b; |
Jacob Erlbeck | 36df774 | 2016-01-19 15:53:30 +0100 | [diff] [blame] | 619 | if (argc > 1) { |
| 620 | uint16_t f = atoi(argv[1]); |
Pau Espin Pedrol | 519d071 | 2021-01-14 14:30:03 +0100 | [diff] [blame] | 621 | the_pcu->vty.ws_pdch = f; |
Jacob Erlbeck | 36df774 | 2016-01-19 15:53:30 +0100 | [diff] [blame] | 622 | } |
| 623 | |
| 624 | return CMD_SUCCESS; |
| 625 | } |
| 626 | |
| 627 | |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 628 | #define QUEUE_STR "Packet queue options\n" |
| 629 | #define LIFETIME_STR "Set lifetime limit of LLC frame in centi-seconds " \ |
| 630 | "(overrides the value given by SGSN)\n" |
| 631 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 632 | DEFUN_USRATTR(cfg_pcu_queue_lifetime, |
| 633 | cfg_pcu_queue_lifetime_cmd, |
| 634 | X(PCU_VTY_ATTR_NEW_TBF), |
| 635 | "queue lifetime <1-65534>", |
| 636 | QUEUE_STR LIFETIME_STR "Lifetime in centi-seconds") |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 637 | { |
Jacob Erlbeck | 2acfbeb | 2015-04-30 17:55:16 +0200 | [diff] [blame] | 638 | uint16_t csec = atoi(argv[0]); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 639 | the_pcu->vty.force_llc_lifetime = csec; |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 640 | return CMD_SUCCESS; |
| 641 | } |
| 642 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 643 | DEFUN_USRATTR(cfg_pcu_queue_lifetime_inf, |
| 644 | cfg_pcu_queue_lifetime_inf_cmd, |
| 645 | X(PCU_VTY_ATTR_NEW_TBF), |
| 646 | "queue lifetime infinite", |
| 647 | QUEUE_STR LIFETIME_STR "Infinite lifetime") |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 648 | { |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 649 | the_pcu->vty.force_llc_lifetime = 0xffff; |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 650 | return CMD_SUCCESS; |
| 651 | } |
| 652 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 653 | DEFUN_USRATTR(cfg_pcu_no_queue_lifetime, |
| 654 | cfg_pcu_no_queue_lifetime_cmd, |
| 655 | X(PCU_VTY_ATTR_NEW_TBF), |
| 656 | "no queue lifetime", |
| 657 | NO_STR QUEUE_STR "Disable lifetime limit of LLC frame (use value given " |
| 658 | "by SGSN)\n") |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 659 | { |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 660 | the_pcu->vty.force_llc_lifetime = 0; |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 661 | return CMD_SUCCESS; |
| 662 | } |
| 663 | |
Jacob Erlbeck | 0c1c877 | 2015-03-20 12:02:42 +0100 | [diff] [blame] | 664 | #define QUEUE_HYSTERESIS_STR "Set lifetime hysteresis of LLC frame in centi-seconds " \ |
| 665 | "(continue discarding until lifetime-hysteresis is reached)\n" |
| 666 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 667 | DEFUN_USRATTR(cfg_pcu_queue_hysteresis, |
| 668 | cfg_pcu_queue_hysteresis_cmd, |
| 669 | X(PCU_VTY_ATTR_NEW_TBF), |
| 670 | "queue hysteresis <1-65535>", |
| 671 | QUEUE_STR QUEUE_HYSTERESIS_STR "Hysteresis in centi-seconds") |
Jacob Erlbeck | 0c1c877 | 2015-03-20 12:02:42 +0100 | [diff] [blame] | 672 | { |
Jacob Erlbeck | 2acfbeb | 2015-04-30 17:55:16 +0200 | [diff] [blame] | 673 | uint16_t csec = atoi(argv[0]); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 674 | the_pcu->vty.llc_discard_csec = csec; |
Jacob Erlbeck | 0c1c877 | 2015-03-20 12:02:42 +0100 | [diff] [blame] | 675 | return CMD_SUCCESS; |
| 676 | } |
| 677 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 678 | DEFUN_USRATTR(cfg_pcu_no_queue_hysteresis, |
| 679 | cfg_pcu_no_queue_hysteresis_cmd, |
| 680 | X(PCU_VTY_ATTR_NEW_TBF), |
| 681 | "no queue hysteresis", |
| 682 | NO_STR QUEUE_STR QUEUE_HYSTERESIS_STR) |
Jacob Erlbeck | 0c1c877 | 2015-03-20 12:02:42 +0100 | [diff] [blame] | 683 | { |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 684 | the_pcu->vty.llc_discard_csec = 0; |
Jacob Erlbeck | 0c1c877 | 2015-03-20 12:02:42 +0100 | [diff] [blame] | 685 | return CMD_SUCCESS; |
| 686 | } |
| 687 | |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 688 | #define QUEUE_CODEL_STR "Set CoDel queue management\n" |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 689 | DEFUN_USRATTR(cfg_pcu_queue_codel, |
| 690 | cfg_pcu_queue_codel_cmd, |
| 691 | X(PCU_VTY_ATTR_NEW_SUBSCR), |
| 692 | "queue codel", |
| 693 | QUEUE_STR QUEUE_CODEL_STR) |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 694 | { |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 695 | the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT; |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 696 | return CMD_SUCCESS; |
| 697 | } |
| 698 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 699 | DEFUN_USRATTR(cfg_pcu_queue_codel_interval, |
| 700 | cfg_pcu_queue_codel_interval_cmd, |
| 701 | X(PCU_VTY_ATTR_NEW_SUBSCR), |
| 702 | "queue codel interval <1-1000>", |
| 703 | QUEUE_STR QUEUE_CODEL_STR "Specify interval\n" "Interval in centi-seconds") |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 704 | { |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 705 | uint16_t csec = atoi(argv[0]); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 706 | the_pcu->vty.llc_codel_interval_msec = 10*csec; |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 707 | return CMD_SUCCESS; |
| 708 | } |
| 709 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 710 | DEFUN_USRATTR(cfg_pcu_no_queue_codel, |
| 711 | cfg_pcu_no_queue_codel_cmd, |
| 712 | X(PCU_VTY_ATTR_NEW_SUBSCR), |
| 713 | "no queue codel", |
| 714 | NO_STR QUEUE_STR QUEUE_CODEL_STR) |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 715 | { |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 716 | the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_DISABLE; |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 717 | return CMD_SUCCESS; |
| 718 | } |
| 719 | |
| 720 | |
Jacob Erlbeck | d0261b7 | 2015-04-02 13:58:09 +0200 | [diff] [blame] | 721 | #define QUEUE_IDLE_ACK_STR "Request an ACK after the last DL LLC frame in centi-seconds\n" |
| 722 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 723 | DEFUN_ATTR(cfg_pcu_queue_idle_ack_delay, |
| 724 | cfg_pcu_queue_idle_ack_delay_cmd, |
| 725 | "queue idle-ack-delay <1-65535>", |
| 726 | QUEUE_STR QUEUE_IDLE_ACK_STR "Idle ACK delay in centi-seconds", |
| 727 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | d0261b7 | 2015-04-02 13:58:09 +0200 | [diff] [blame] | 728 | { |
Jacob Erlbeck | 2acfbeb | 2015-04-30 17:55:16 +0200 | [diff] [blame] | 729 | uint16_t csec = atoi(argv[0]); |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 730 | the_pcu->vty.llc_idle_ack_csec = csec; |
Jacob Erlbeck | d0261b7 | 2015-04-02 13:58:09 +0200 | [diff] [blame] | 731 | return CMD_SUCCESS; |
| 732 | } |
| 733 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 734 | DEFUN_ATTR(cfg_pcu_no_queue_idle_ack_delay, |
| 735 | cfg_pcu_no_queue_idle_ack_delay_cmd, |
| 736 | "no queue idle-ack-delay", |
| 737 | NO_STR QUEUE_STR QUEUE_IDLE_ACK_STR, |
| 738 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | d0261b7 | 2015-04-02 13:58:09 +0200 | [diff] [blame] | 739 | { |
Pau Espin Pedrol | f473ec9 | 2021-01-14 14:45:14 +0100 | [diff] [blame] | 740 | the_pcu->vty.llc_idle_ack_csec = 0; |
Jacob Erlbeck | d0261b7 | 2015-04-02 13:58:09 +0200 | [diff] [blame] | 741 | return CMD_SUCCESS; |
| 742 | } |
| 743 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 744 | DEFUN_ATTR(cfg_pcu_alloc, |
| 745 | cfg_pcu_alloc_cmd, |
| 746 | "alloc-algorithm (a|b|dynamic)", |
| 747 | "Select slot allocation algorithm to use when assigning timeslots on " |
| 748 | "PACCH\n" |
| 749 | "Single slot is assigned only\n" |
| 750 | "Multiple slots are assigned for semi-duplex operation\n" |
| 751 | "Dynamically select the algorithm based on the system state\n", |
| 752 | CMD_ATTR_IMMEDIATE) |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 753 | { |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 754 | switch (argv[0][0]) { |
| 755 | case 'a': |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 756 | the_pcu->alloc_algorithm = alloc_algorithm_a; |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 757 | break; |
| 758 | case 'b': |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 759 | the_pcu->alloc_algorithm = alloc_algorithm_b; |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 760 | break; |
Jacob Erlbeck | 400ec02 | 2015-07-14 13:31:48 +0200 | [diff] [blame] | 761 | default: |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 762 | the_pcu->alloc_algorithm = alloc_algorithm_dynamic; |
Jacob Erlbeck | 400ec02 | 2015-07-14 13:31:48 +0200 | [diff] [blame] | 763 | break; |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 764 | } |
| 765 | |
| 766 | return CMD_SUCCESS; |
| 767 | } |
| 768 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 769 | DEFUN_ATTR(cfg_pcu_two_phase, |
| 770 | cfg_pcu_two_phase_cmd, |
| 771 | "two-phase-access", |
| 772 | "Force two phase access when MS requests single phase access\n", |
| 773 | CMD_ATTR_IMMEDIATE) |
Andreas Eversberg | 07e97cf | 2012-08-07 16:00:56 +0200 | [diff] [blame] | 774 | { |
Pau Espin Pedrol | 03de898 | 2021-01-14 12:48:50 +0100 | [diff] [blame] | 775 | the_pcu->vty.force_two_phase = 1; |
Andreas Eversberg | 07e97cf | 2012-08-07 16:00:56 +0200 | [diff] [blame] | 776 | return CMD_SUCCESS; |
| 777 | } |
| 778 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 779 | DEFUN_ATTR(cfg_pcu_no_two_phase, |
| 780 | cfg_pcu_no_two_phase_cmd, |
| 781 | "no two-phase-access", |
| 782 | NO_STR "Only use two phase access when requested my MS\n", |
| 783 | CMD_ATTR_IMMEDIATE) |
Andreas Eversberg | 07e97cf | 2012-08-07 16:00:56 +0200 | [diff] [blame] | 784 | { |
Pau Espin Pedrol | 03de898 | 2021-01-14 12:48:50 +0100 | [diff] [blame] | 785 | the_pcu->vty.force_two_phase = 0; |
Andreas Eversberg | 07e97cf | 2012-08-07 16:00:56 +0200 | [diff] [blame] | 786 | return CMD_SUCCESS; |
| 787 | } |
| 788 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 789 | DEFUN_ATTR(cfg_pcu_alpha, |
| 790 | cfg_pcu_alpha_cmd, |
Pau Espin Pedrol | fe8de45 | 2021-02-09 18:47:34 +0100 | [diff] [blame] | 791 | "alpha (si13|<0-10>)", |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 792 | "Alpha parameter for MS power control in units of 0.1 (see TS 05.08) " |
| 793 | "NOTE: Be sure to set Alpha value at System information 13 too.\n" |
Pau Espin Pedrol | fe8de45 | 2021-02-09 18:47:34 +0100 | [diff] [blame] | 794 | "Use value received from BSC in System Intormation 13 (default)\n" |
| 795 | "Force Alpha in units of 0.1\n", |
| 796 | CMD_ATTR_IMMEDIATE | CMD_ATTR_DEPRECATED) |
Andreas Eversberg | aafcbbb | 2012-09-27 09:20:45 +0200 | [diff] [blame] | 797 | { |
Pau Espin Pedrol | fe8de45 | 2021-02-09 18:47:34 +0100 | [diff] [blame] | 798 | vty_out(vty, "%% 'alpha <0-10>' is now deprecated: use osmo-bsc's 'gprs power-control alpha <0-10>' instead%s", |
| 799 | VTY_NEWLINE); |
| 800 | if (strcmp(argv[0], "si13") == 0) |
| 801 | the_pcu->vty.force_alpha = (uint8_t) -1; |
| 802 | else |
| 803 | the_pcu->vty.force_alpha = atoi(argv[0]); |
Andreas Eversberg | aafcbbb | 2012-09-27 09:20:45 +0200 | [diff] [blame] | 804 | return CMD_SUCCESS; |
| 805 | } |
| 806 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 807 | DEFUN_ATTR(cfg_pcu_gamma, |
| 808 | cfg_pcu_gamma_cmd, |
| 809 | "gamma <0-62>", |
| 810 | "Gamma parameter for MS power control in units of dB (see TS 05.08)\n" |
| 811 | "Gamma in even unit of dBs\n", |
| 812 | CMD_ATTR_IMMEDIATE) |
Andreas Eversberg | aafcbbb | 2012-09-27 09:20:45 +0200 | [diff] [blame] | 813 | { |
Pau Espin Pedrol | a281495 | 2021-01-14 12:53:53 +0100 | [diff] [blame] | 814 | the_pcu->vty.gamma = atoi(argv[0]) / 2; |
Andreas Eversberg | aafcbbb | 2012-09-27 09:20:45 +0200 | [diff] [blame] | 815 | return CMD_SUCCESS; |
| 816 | } |
| 817 | |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 818 | DEFUN(show_bts_stats, |
| 819 | show_bts_stats_cmd, |
| 820 | "show bts statistics", |
| 821 | SHOW_STR "BTS related functionality\nStatistics\n") |
| 822 | { |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 823 | struct gprs_rlcmac_bts *bts; |
| 824 | llist_for_each_entry(bts, &the_pcu->bts_list, list) { |
| 825 | vty_out(vty, "BTS%" PRIu8 ":%s", bts->nr, VTY_NEWLINE); |
| 826 | vty_out_rate_ctr_group(vty, " ", bts_rate_counters(bts)); |
| 827 | } |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 828 | return CMD_SUCCESS; |
Daniel Willmann | 772415f | 2014-01-15 17:06:51 +0100 | [diff] [blame] | 829 | } |
| 830 | |
Pau Espin Pedrol | a1ac2f0 | 2020-09-22 17:01:31 +0200 | [diff] [blame] | 831 | DEFUN(show_bts_pdch, |
| 832 | show_bts_pdch_cmd, |
| 833 | "show bts pdch", |
| 834 | SHOW_STR "BTS related functionality\nPDCH timeslots\n") |
| 835 | { |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 836 | struct gprs_rlcmac_bts *bts; |
| 837 | llist_for_each_entry(bts, &the_pcu->bts_list, list) { |
| 838 | pcu_vty_show_bts_pdch(vty, bts); |
| 839 | } |
| 840 | return CMD_SUCCESS; |
Pau Espin Pedrol | a1ac2f0 | 2020-09-22 17:01:31 +0200 | [diff] [blame] | 841 | } |
| 842 | |
Jacob Erlbeck | 3bed5d1 | 2015-03-19 11:22:38 +0100 | [diff] [blame] | 843 | #define IDLE_TIME_STR "keep an idle DL TBF alive for the time given\n" |
Pau Espin Pedrol | 2b5c629 | 2019-09-09 13:41:00 +0200 | [diff] [blame] | 844 | DEFUN_DEPRECATED(cfg_pcu_dl_tbf_idle_time, |
Jacob Erlbeck | 3bed5d1 | 2015-03-19 11:22:38 +0100 | [diff] [blame] | 845 | cfg_pcu_dl_tbf_idle_time_cmd, |
| 846 | "dl-tbf-idle-time <1-5000>", |
| 847 | IDLE_TIME_STR "idle time in msec") |
| 848 | { |
Pau Espin Pedrol | 2b5c629 | 2019-09-09 13:41:00 +0200 | [diff] [blame] | 849 | vty_out(vty, "%% 'dl-tbf-idle-time' is now deprecated: use 'timer X2031 <val>' instead%s", VTY_NEWLINE); |
| 850 | |
Pau Espin Pedrol | 924aaad | 2021-01-14 12:01:42 +0100 | [diff] [blame] | 851 | if (osmo_tdef_set(the_pcu->T_defs, -2031, atoi(argv[0]), OSMO_TDEF_MS) < 0) |
Pau Espin Pedrol | 2b5c629 | 2019-09-09 13:41:00 +0200 | [diff] [blame] | 852 | return CMD_WARNING; |
Jacob Erlbeck | 3bed5d1 | 2015-03-19 11:22:38 +0100 | [diff] [blame] | 853 | return CMD_SUCCESS; |
| 854 | } |
| 855 | |
Pau Espin Pedrol | 2b5c629 | 2019-09-09 13:41:00 +0200 | [diff] [blame] | 856 | DEFUN_DEPRECATED(cfg_pcu_no_dl_tbf_idle_time, |
Jacob Erlbeck | 3bed5d1 | 2015-03-19 11:22:38 +0100 | [diff] [blame] | 857 | cfg_pcu_no_dl_tbf_idle_time_cmd, |
| 858 | "no dl-tbf-idle-time", |
| 859 | NO_STR IDLE_TIME_STR) |
| 860 | { |
Pau Espin Pedrol | 2b5c629 | 2019-09-09 13:41:00 +0200 | [diff] [blame] | 861 | vty_out(vty, "%% 'no dl-tbf-idle-time' is now deprecated: use 'timer X2031 0' instead%s", VTY_NEWLINE); |
| 862 | |
Pau Espin Pedrol | 924aaad | 2021-01-14 12:01:42 +0100 | [diff] [blame] | 863 | if (osmo_tdef_set(the_pcu->T_defs, -2031, 0, OSMO_TDEF_MS) < 0) |
Pau Espin Pedrol | 2b5c629 | 2019-09-09 13:41:00 +0200 | [diff] [blame] | 864 | return CMD_WARNING; |
Jacob Erlbeck | 3bed5d1 | 2015-03-19 11:22:38 +0100 | [diff] [blame] | 865 | return CMD_SUCCESS; |
| 866 | } |
| 867 | |
Oliver Smith | 45fdc44 | 2019-09-05 15:12:20 +0200 | [diff] [blame] | 868 | #define RETRANSMISSION_STR "retransmit blocks even before the MS had a chance to receive them (better throughput," \ |
| 869 | " less readable traces)" |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 870 | DEFUN_ATTR(cfg_pcu_dl_tbf_preemptive_retransmission, |
| 871 | cfg_pcu_dl_tbf_preemptive_retransmission_cmd, |
| 872 | "dl-tbf-preemptive-retransmission", |
| 873 | RETRANSMISSION_STR " (enabled by default)", |
| 874 | CMD_ATTR_IMMEDIATE) |
Oliver Smith | 45fdc44 | 2019-09-05 15:12:20 +0200 | [diff] [blame] | 875 | { |
Pau Espin Pedrol | 05f9f59 | 2021-01-14 12:56:58 +0100 | [diff] [blame] | 876 | the_pcu->vty.dl_tbf_preemptive_retransmission = true; |
Oliver Smith | 45fdc44 | 2019-09-05 15:12:20 +0200 | [diff] [blame] | 877 | return CMD_SUCCESS; |
| 878 | } |
| 879 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 880 | DEFUN_ATTR(cfg_pcu_no_dl_tbf_preemptive_retransmission, |
| 881 | cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd, |
| 882 | "no dl-tbf-preemptive-retransmission", |
| 883 | NO_STR RETRANSMISSION_STR, |
| 884 | CMD_ATTR_IMMEDIATE) |
Oliver Smith | 45fdc44 | 2019-09-05 15:12:20 +0200 | [diff] [blame] | 885 | { |
Pau Espin Pedrol | 05f9f59 | 2021-01-14 12:56:58 +0100 | [diff] [blame] | 886 | the_pcu->vty.dl_tbf_preemptive_retransmission = false; |
Oliver Smith | 45fdc44 | 2019-09-05 15:12:20 +0200 | [diff] [blame] | 887 | return CMD_SUCCESS; |
| 888 | } |
| 889 | |
Jacob Erlbeck | a098c19 | 2015-05-28 16:11:19 +0200 | [diff] [blame] | 890 | #define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n" |
Pau Espin Pedrol | 63700ea | 2019-09-09 13:19:06 +0200 | [diff] [blame] | 891 | DEFUN_DEPRECATED(cfg_pcu_ms_idle_time, |
Jacob Erlbeck | a098c19 | 2015-05-28 16:11:19 +0200 | [diff] [blame] | 892 | cfg_pcu_ms_idle_time_cmd, |
| 893 | "ms-idle-time <1-7200>", |
| 894 | MS_IDLE_TIME_STR "idle time in sec") |
| 895 | { |
Pau Espin Pedrol | 63700ea | 2019-09-09 13:19:06 +0200 | [diff] [blame] | 896 | vty_out(vty, "%% 'ms-idle-time' is now deprecated: use 'timer X2030 <val>' instead%s", VTY_NEWLINE); |
Pau Espin Pedrol | 924aaad | 2021-01-14 12:01:42 +0100 | [diff] [blame] | 897 | if (osmo_tdef_set(the_pcu->T_defs, -2030, atoi(argv[0]), OSMO_TDEF_S) < 0) |
Pau Espin Pedrol | 63700ea | 2019-09-09 13:19:06 +0200 | [diff] [blame] | 898 | return CMD_WARNING; |
Jacob Erlbeck | a098c19 | 2015-05-28 16:11:19 +0200 | [diff] [blame] | 899 | return CMD_SUCCESS; |
| 900 | } |
| 901 | |
Pau Espin Pedrol | 63700ea | 2019-09-09 13:19:06 +0200 | [diff] [blame] | 902 | DEFUN_DEPRECATED(cfg_pcu_no_ms_idle_time, |
Jacob Erlbeck | a098c19 | 2015-05-28 16:11:19 +0200 | [diff] [blame] | 903 | cfg_pcu_no_ms_idle_time_cmd, |
| 904 | "no ms-idle-time", |
| 905 | NO_STR MS_IDLE_TIME_STR) |
| 906 | { |
Pau Espin Pedrol | 63700ea | 2019-09-09 13:19:06 +0200 | [diff] [blame] | 907 | vty_out(vty, "%% 'no ms-idle-time' is now deprecated: use 'timer X2030 0' instead%s", VTY_NEWLINE); |
Pau Espin Pedrol | 924aaad | 2021-01-14 12:01:42 +0100 | [diff] [blame] | 908 | if (osmo_tdef_set(the_pcu->T_defs, -2030, 0, OSMO_TDEF_S) < 0) |
Pau Espin Pedrol | 63700ea | 2019-09-09 13:19:06 +0200 | [diff] [blame] | 909 | return CMD_WARNING; |
Jacob Erlbeck | a098c19 | 2015-05-28 16:11:19 +0200 | [diff] [blame] | 910 | return CMD_SUCCESS; |
| 911 | } |
| 912 | |
Pau Espin Pedrol | 1e6eb30 | 2019-11-28 17:00:44 +0100 | [diff] [blame] | 913 | #define CS_ERR_LIMITS_STR "set thresholds for error rate based downlink (M)CS adjustment\n" |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 914 | DEFUN_ATTR(cfg_pcu_cs_err_limits, |
| 915 | cfg_pcu_cs_err_limits_cmd, |
| 916 | "cs threshold <0-100> <0-100>", |
| 917 | CS_STR CS_ERR_LIMITS_STR "lower limit in %\n" "upper limit in %\n", |
| 918 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 919 | { |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 920 | uint8_t lower_limit = atoi(argv[0]); |
| 921 | uint8_t upper_limit = atoi(argv[1]); |
| 922 | |
| 923 | if (lower_limit > upper_limit) { |
| 924 | vty_out(vty, |
| 925 | "The lower limit must be less than or equal to the " |
| 926 | "upper limit.%s", VTY_NEWLINE); |
| 927 | return CMD_WARNING; |
| 928 | } |
| 929 | |
Pau Espin Pedrol | e8dcf64 | 2021-01-14 13:17:01 +0100 | [diff] [blame] | 930 | the_pcu->vty.cs_adj_enabled = true; |
| 931 | the_pcu->vty.cs_adj_upper_limit = upper_limit; |
| 932 | the_pcu->vty.cs_adj_lower_limit = lower_limit; |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 933 | |
| 934 | return CMD_SUCCESS; |
| 935 | } |
| 936 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 937 | DEFUN_ATTR(cfg_pcu_no_cs_err_limits, |
| 938 | cfg_pcu_no_cs_err_limits_cmd, |
| 939 | "no cs threshold", |
| 940 | NO_STR CS_STR CS_ERR_LIMITS_STR, |
| 941 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 942 | { |
Pau Espin Pedrol | e8dcf64 | 2021-01-14 13:17:01 +0100 | [diff] [blame] | 943 | the_pcu->vty.cs_adj_enabled = false; |
| 944 | the_pcu->vty.cs_adj_upper_limit = 100; |
| 945 | the_pcu->vty.cs_adj_lower_limit = 0; |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 946 | |
| 947 | return CMD_SUCCESS; |
| 948 | } |
| 949 | |
Pau Espin Pedrol | 1e6eb30 | 2019-11-28 17:00:44 +0100 | [diff] [blame] | 950 | #define CS_DOWNGRADE_STR "set threshold for data size based downlink (M)CS downgrade\n" |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 951 | DEFUN_ATTR(cfg_pcu_cs_downgrade_thrsh, |
| 952 | cfg_pcu_cs_downgrade_thrsh_cmd, |
| 953 | "cs downgrade-threshold <1-10000>", |
| 954 | CS_STR CS_DOWNGRADE_STR "downgrade if less octets left\n", |
| 955 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 70b96aa | 2015-06-12 10:52:34 +0200 | [diff] [blame] | 956 | { |
Pau Espin Pedrol | ad79b85 | 2021-01-14 13:20:55 +0100 | [diff] [blame] | 957 | the_pcu->vty.cs_downgrade_threshold = atoi(argv[0]); |
Jacob Erlbeck | 70b96aa | 2015-06-12 10:52:34 +0200 | [diff] [blame] | 958 | return CMD_SUCCESS; |
| 959 | } |
| 960 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 961 | DEFUN_ATTR(cfg_pcu_no_cs_downgrade_thrsh, |
| 962 | cfg_pcu_no_cs_downgrade_thrsh_cmd, |
| 963 | "no cs downgrade-threshold", |
| 964 | NO_STR CS_STR CS_DOWNGRADE_STR, |
| 965 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 70b96aa | 2015-06-12 10:52:34 +0200 | [diff] [blame] | 966 | { |
Pau Espin Pedrol | ad79b85 | 2021-01-14 13:20:55 +0100 | [diff] [blame] | 967 | the_pcu->vty.cs_downgrade_threshold = 0; |
Jacob Erlbeck | 70b96aa | 2015-06-12 10:52:34 +0200 | [diff] [blame] | 968 | return CMD_SUCCESS; |
| 969 | } |
| 970 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 971 | DEFUN_ATTR(cfg_pcu_cs_lqual_ranges, |
| 972 | cfg_pcu_cs_lqual_ranges_cmd, |
| 973 | "cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35> cs3 <0-35> <0-35> cs4 <0-35>", |
| 974 | CS_STR "Set link quality ranges for each uplink CS\n" |
| 975 | "Set quality range for CS-1 (high value only)\n" |
| 976 | "CS-1 high (dB)\n" |
| 977 | "Set quality range for CS-2\n" |
| 978 | "CS-2 low (dB)\n" |
| 979 | "CS-2 high (dB)\n" |
| 980 | "Set quality range for CS-3\n" |
| 981 | "CS-3 low (dB)\n" |
| 982 | "CS-3 high (dB)\n" |
| 983 | "Set quality range for CS-4 (low value only)\n" |
| 984 | "CS-4 low (dB)\n", |
| 985 | CMD_ATTR_IMMEDIATE) |
Jacob Erlbeck | 94cde13 | 2015-06-09 09:44:36 +0200 | [diff] [blame] | 986 | { |
Jacob Erlbeck | 94cde13 | 2015-06-09 09:44:36 +0200 | [diff] [blame] | 987 | uint8_t cs1_high = atoi(argv[0]); |
| 988 | uint8_t cs2_low = atoi(argv[1]); |
| 989 | uint8_t cs2_high = atoi(argv[2]); |
| 990 | uint8_t cs3_low = atoi(argv[3]); |
| 991 | uint8_t cs3_high = atoi(argv[4]); |
| 992 | uint8_t cs4_low = atoi(argv[5]); |
| 993 | |
Pau Espin Pedrol | 54b159a | 2021-01-14 13:30:04 +0100 | [diff] [blame] | 994 | the_pcu->vty.cs_lqual_ranges[0].high = cs1_high; |
| 995 | the_pcu->vty.cs_lqual_ranges[1].low = cs2_low; |
| 996 | the_pcu->vty.cs_lqual_ranges[1].high = cs2_high; |
| 997 | the_pcu->vty.cs_lqual_ranges[2].low = cs3_low; |
| 998 | the_pcu->vty.cs_lqual_ranges[2].high = cs3_high; |
| 999 | the_pcu->vty.cs_lqual_ranges[3].low = cs4_low; |
Jacob Erlbeck | 94cde13 | 2015-06-09 09:44:36 +0200 | [diff] [blame] | 1000 | |
| 1001 | return CMD_SUCCESS; |
| 1002 | } |
| 1003 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 1004 | DEFUN_ATTR(cfg_pcu_mcs_lqual_ranges, |
| 1005 | cfg_pcu_mcs_lqual_ranges_cmd, |
| 1006 | "mcs link-quality-ranges mcs1 <0-35> mcs2 <0-35> <0-35> mcs3 <0-35> <0-35> mcs4 <0-35> <0-35> mcs5 <0-35> <0-35> mcs6 <0-35> <0-35> mcs7 <0-35> <0-35> mcs8 <0-35> <0-35> mcs9 <0-35>", |
| 1007 | CS_STR "Set link quality ranges for each uplink MCS\n" |
| 1008 | "Set quality range for MCS-1 (high value only)\n" |
| 1009 | "MCS-1 high (dB)\n" |
| 1010 | "Set quality range for MCS-2\n" |
| 1011 | "MCS-2 high (dB)\n" |
| 1012 | "MCS-2 low (dB)\n" |
| 1013 | "Set quality range for MCS-3\n" |
| 1014 | "MCS-3 high (dB)\n" |
| 1015 | "MCS-3 low (dB)\n" |
| 1016 | "Set quality range for MCS-4\n" |
| 1017 | "MCS-4 high (dB)\n" |
| 1018 | "MCS-4 low (dB)\n" |
| 1019 | "Set quality range for MCS-5\n" |
| 1020 | "MCS-5 high (dB)\n" |
| 1021 | "MCS-5 low (dB)\n" |
| 1022 | "Set quality range for MCS-6\n" |
| 1023 | "MCS-6 low (dB)\n" |
| 1024 | "MCS-6 high (dB)\n" |
| 1025 | "Set quality range for MCS-7\n" |
| 1026 | "MCS-7 low (dB)\n" |
| 1027 | "MCS-7 high (dB)\n" |
| 1028 | "Set quality range for MCS-8\n" |
| 1029 | "MCS-8 low (dB)\n" |
| 1030 | "MCS-8 high (dB)\n" |
| 1031 | "Set quality range for MCS-9 (low value only)\n" |
| 1032 | "MCS-9 low (dB)\n", |
| 1033 | CMD_ATTR_IMMEDIATE) |
Minh-Quang Nguyen | 1f18909 | 2017-08-16 09:50:06 -0400 | [diff] [blame] | 1034 | { |
Pau Espin Pedrol | 54b159a | 2021-01-14 13:30:04 +0100 | [diff] [blame] | 1035 | the_pcu->vty.mcs_lqual_ranges[0].high = atoi(argv[0]); |
| 1036 | the_pcu->vty.mcs_lqual_ranges[1].low = atoi(argv[1]); |
| 1037 | the_pcu->vty.mcs_lqual_ranges[1].high = atoi(argv[2]); |
| 1038 | the_pcu->vty.mcs_lqual_ranges[2].low = atoi(argv[3]); |
| 1039 | the_pcu->vty.mcs_lqual_ranges[2].high = atoi(argv[4]); |
| 1040 | the_pcu->vty.mcs_lqual_ranges[3].low = atoi(argv[5]); |
| 1041 | the_pcu->vty.mcs_lqual_ranges[3].high = atoi(argv[6]); |
| 1042 | the_pcu->vty.mcs_lqual_ranges[4].low = atoi(argv[7]); |
| 1043 | the_pcu->vty.mcs_lqual_ranges[4].high = atoi(argv[8]); |
| 1044 | the_pcu->vty.mcs_lqual_ranges[5].low = atoi(argv[9]); |
| 1045 | the_pcu->vty.mcs_lqual_ranges[5].high = atoi(argv[10]); |
| 1046 | the_pcu->vty.mcs_lqual_ranges[6].low = atoi(argv[11]); |
| 1047 | the_pcu->vty.mcs_lqual_ranges[6].high = atoi(argv[12]); |
| 1048 | the_pcu->vty.mcs_lqual_ranges[7].low = atoi(argv[13]); |
| 1049 | the_pcu->vty.mcs_lqual_ranges[7].high = atoi(argv[14]); |
| 1050 | the_pcu->vty.mcs_lqual_ranges[8].low = atoi(argv[15]); |
Minh-Quang Nguyen | 1f18909 | 2017-08-16 09:50:06 -0400 | [diff] [blame] | 1051 | |
| 1052 | return CMD_SUCCESS; |
| 1053 | } |
| 1054 | |
Pau Espin Pedrol | c4178e5 | 2017-08-08 15:03:50 +0200 | [diff] [blame] | 1055 | DEFUN(cfg_pcu_sock, |
| 1056 | cfg_pcu_sock_cmd, |
| 1057 | "pcu-socket PATH", |
| 1058 | "Configure the osmo-bts PCU socket file/path name\n" |
| 1059 | "Path of the socket to connect to\n") |
| 1060 | { |
Vadim Yanitskiy | fc75cc0 | 2019-11-30 20:13:25 +0700 | [diff] [blame] | 1061 | if (vty->type != VTY_FILE) |
| 1062 | vty_out(vty, "Changing PCU socket path at run-time has no effect%s", VTY_NEWLINE); |
| 1063 | |
Pau Espin Pedrol | ac3fd12 | 2021-01-13 18:54:38 +0100 | [diff] [blame] | 1064 | osmo_talloc_replace_string(tall_pcu_ctx, &the_pcu->pcu_sock_path, argv[0]); |
Pau Espin Pedrol | c4178e5 | 2017-08-08 15:03:50 +0200 | [diff] [blame] | 1065 | |
| 1066 | return CMD_SUCCESS; |
| 1067 | } |
Jacob Erlbeck | 94cde13 | 2015-06-09 09:44:36 +0200 | [diff] [blame] | 1068 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 1069 | DEFUN_USRATTR(cfg_pcu_gb_dialect, |
| 1070 | cfg_pcu_gb_dialect_cmd, |
| 1071 | X(PCU_VTY_ATTR_NS_RESET), |
| 1072 | "gb-dialect (classic|ip-sns)", |
| 1073 | "Select which Gb interface dialect to use\n" |
| 1074 | "Classic Gb interface with NS-{RESET,BLOCK,UNBLOCK} and static configuration\n" |
| 1075 | "Modern Gb interface with IP-SNS (Sub Network Service) and dynamic configuration\n") |
Harald Welte | 57d3515 | 2018-07-05 03:11:17 +0200 | [diff] [blame] | 1076 | { |
Alexander Couzens | 290d903 | 2020-09-16 21:52:02 +0200 | [diff] [blame] | 1077 | if (!strcmp(argv[0], "ip-sns")) { |
Alexander Couzens | f7ec525 | 2021-01-25 20:28:38 +0100 | [diff] [blame] | 1078 | the_pcu->vty.ns_dialect = GPRS_NS2_DIALECT_SNS; |
Alexander Couzens | 290d903 | 2020-09-16 21:52:02 +0200 | [diff] [blame] | 1079 | } else { |
Alexander Couzens | f7ec525 | 2021-01-25 20:28:38 +0100 | [diff] [blame] | 1080 | the_pcu->vty.ns_dialect = GPRS_NS2_DIALECT_IPACCESS; |
Alexander Couzens | 290d903 | 2020-09-16 21:52:02 +0200 | [diff] [blame] | 1081 | } |
Harald Welte | 57d3515 | 2018-07-05 03:11:17 +0200 | [diff] [blame] | 1082 | |
| 1083 | return CMD_SUCCESS; |
| 1084 | } |
| 1085 | |
Harald Welte | d9367e3 | 2021-04-29 22:02:47 +0200 | [diff] [blame] | 1086 | DEFUN_USRATTR(cfg_pcu_gb_ip_dscp, |
| 1087 | cfg_pcu_gb_ip_dscp_cmd, |
| 1088 | X(PCU_VTY_ATTR_NS_RESET), |
| 1089 | "gb ip-dscp <0-63>", |
| 1090 | "Configure Gb interface\n" |
| 1091 | "Set IP DSCP value for outbound packets\n" |
| 1092 | "IP DSCP value to use\n") |
| 1093 | { |
| 1094 | the_pcu->vty.ns_ip_dscp = atoi(argv[0]); |
| 1095 | return CMD_SUCCESS; |
| 1096 | } |
| 1097 | |
| 1098 | DEFUN_USRATTR(cfg_pcu_gb_priority, |
| 1099 | cfg_pcu_gb_priority_cmd, |
| 1100 | X(PCU_VTY_ATTR_NS_RESET), |
| 1101 | "gb socket-priority <0-255>", |
| 1102 | "Configure Gb interface\n" |
| 1103 | "Set socket priority value for outbound packets\n" |
| 1104 | "Socket priority value to use (>6 requires CAP_NET_ADMIN)") |
| 1105 | { |
| 1106 | the_pcu->vty.ns_priority = atoi(argv[0]); |
| 1107 | return CMD_SUCCESS; |
| 1108 | } |
| 1109 | |
Pau Espin Pedrol | c0a250d | 2021-01-21 18:46:13 +0100 | [diff] [blame] | 1110 | DEFUN(cfg_neighbor_resolution, cfg_neighbor_resolution_cmd, |
| 1111 | "neighbor resolution " VTY_IPV46_CMD " [<0-65535>]", |
| 1112 | "Manage local and remote-BSS neighbor cells\n" |
| 1113 | "Connect to Neighbor Resolution Service (CTRL interface) to given ip and port\n" |
| 1114 | "IPv4 address to connect to\n" "IPv6 address to connect to\n" |
| 1115 | "Port to connect to (default 4248)\n") |
| 1116 | { |
Pau Espin Pedrol | 5557c0a | 2021-09-07 14:09:50 +0200 | [diff] [blame] | 1117 | vty_out(vty, "%% Warning: The CTRL interface for Neighbor Address Resolution is now deprecated." |
| 1118 | "Upgrade osmo-bsc and drop the 'neighbor resolution " VTY_IPV46_CMD " [<0-65535>]' VTY " |
| 1119 | "option in order to let osmo-pcu use the new resoluton method using the PCUIF over IPA " |
| 1120 | "multiplex, which will work out of the box without required configuration.%s", VTY_NEWLINE); |
Pau Espin Pedrol | c0a250d | 2021-01-21 18:46:13 +0100 | [diff] [blame] | 1121 | osmo_talloc_replace_string(the_pcu, &the_pcu->vty.neigh_ctrl_addr, argv[0]); |
| 1122 | if (argc > 1) |
| 1123 | the_pcu->vty.neigh_ctrl_port = atoi(argv[1]); |
| 1124 | else |
| 1125 | the_pcu->vty.neigh_ctrl_port = OSMO_CTRL_PORT_BSC_NEIGH; |
| 1126 | return CMD_SUCCESS; |
| 1127 | } |
| 1128 | |
| 1129 | |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1130 | DEFUN(show_bts_timer, show_bts_timer_cmd, |
| 1131 | "show bts-timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL, |
| 1132 | SHOW_STR "Show BTS controlled timers\n" |
| 1133 | OSMO_TDEF_VTY_DOC_T) |
| 1134 | { |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 1135 | struct gprs_rlcmac_bts *bts; |
| 1136 | llist_for_each_entry(bts, &the_pcu->bts_list, list) { |
| 1137 | const char *T_arg = argc > 0 ? argv[0] : NULL; |
| 1138 | vty_out(vty, "BTS%" PRIu8 ":%s", bts->nr, VTY_NEWLINE); |
| 1139 | osmo_tdef_vty_show_cmd(vty, bts->T_defs_bts, T_arg, " "); |
| 1140 | } |
| 1141 | return CMD_SUCCESS; |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1142 | } |
| 1143 | |
| 1144 | DEFUN(show_timer, show_timer_cmd, |
| 1145 | "show timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL, |
| 1146 | SHOW_STR "Show PCU timers\n" |
| 1147 | OSMO_TDEF_VTY_DOC_T) |
| 1148 | { |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1149 | const char *T_arg = argc > 0 ? argv[0] : NULL; |
Pau Espin Pedrol | 924aaad | 2021-01-14 12:01:42 +0100 | [diff] [blame] | 1150 | return osmo_tdef_vty_show_cmd(vty, the_pcu->T_defs, T_arg, NULL); |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1151 | } |
| 1152 | |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 1153 | DEFUN_ATTR(cfg_pcu_timer, cfg_pcu_timer_cmd, |
| 1154 | "timer " OSMO_TDEF_VTY_ARG_SET_OPTIONAL, |
| 1155 | "Configure or show PCU timers\n" |
| 1156 | OSMO_TDEF_VTY_DOC_SET, |
| 1157 | CMD_ATTR_IMMEDIATE) |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1158 | { |
Pau Espin Pedrol | ab7159f | 2021-01-26 17:51:44 +0100 | [diff] [blame] | 1159 | int rc; |
| 1160 | struct osmo_tdef *t; |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1161 | /* If any arguments are missing, redirect to 'show' */ |
| 1162 | if (argc < 2) |
| 1163 | return show_timer(self, vty, argc, argv); |
Pau Espin Pedrol | ab7159f | 2021-01-26 17:51:44 +0100 | [diff] [blame] | 1164 | if ((rc = osmo_tdef_vty_set_cmd(vty, the_pcu->T_defs, argv)) != CMD_SUCCESS) |
| 1165 | return rc; |
| 1166 | t = osmo_tdef_vty_parse_T_arg(vty, the_pcu->T_defs, argv[0]); |
| 1167 | switch (t->T) { |
| 1168 | case PCU_TDEF_NEIGH_CACHE_ALIVE: |
| 1169 | neigh_cache_set_keep_time_interval(the_pcu->neigh_cache, t->val); |
| 1170 | break; |
| 1171 | case PCU_TDEF_SI_CACHE_ALIVE: |
| 1172 | si_cache_set_keep_time_interval(the_pcu->si_cache, t->val); |
| 1173 | break; |
| 1174 | default: |
| 1175 | break; |
| 1176 | } |
| 1177 | return CMD_SUCCESS; |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1178 | } |
| 1179 | |
Daniel Willmann | 772415f | 2014-01-15 17:06:51 +0100 | [diff] [blame] | 1180 | DEFUN(show_tbf, |
| 1181 | show_tbf_cmd, |
Max | 12a0987 | 2018-02-01 16:07:33 +0100 | [diff] [blame] | 1182 | "show tbf (all|ccch|pacch)", |
| 1183 | SHOW_STR "information about TBFs\n" |
| 1184 | "All TBFs\n" |
| 1185 | "TBFs allocated via CCCH\n" |
| 1186 | "TBFs allocated via PACCH\n") |
Daniel Willmann | 772415f | 2014-01-15 17:06:51 +0100 | [diff] [blame] | 1187 | { |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 1188 | struct gprs_rlcmac_bts *bts; |
| 1189 | llist_for_each_entry(bts, &the_pcu->bts_list, list) { |
| 1190 | uint32_t flags = UINT32_MAX; |
Max | 12a0987 | 2018-02-01 16:07:33 +0100 | [diff] [blame] | 1191 | |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 1192 | if (argv[0][0] == 'c') |
| 1193 | flags = (1 << GPRS_RLCMAC_FLAG_CCCH); |
| 1194 | else if (argv[0][0] == 'p') |
| 1195 | flags = (1 << GPRS_RLCMAC_FLAG_PACCH); |
Max | 12a0987 | 2018-02-01 16:07:33 +0100 | [diff] [blame] | 1196 | |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 1197 | pcu_vty_show_tbf_all(vty, bts, flags); |
| 1198 | } |
| 1199 | return CMD_SUCCESS; |
Daniel Willmann | 772415f | 2014-01-15 17:06:51 +0100 | [diff] [blame] | 1200 | } |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 1201 | |
Jacob Erlbeck | f47f68a | 2015-06-04 10:23:24 +0200 | [diff] [blame] | 1202 | DEFUN(show_ms_all, |
| 1203 | show_ms_all_cmd, |
| 1204 | "show ms all", |
| 1205 | SHOW_STR "information about MSs\n" "All TBFs\n") |
| 1206 | { |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 1207 | struct gprs_rlcmac_bts *bts; |
| 1208 | llist_for_each_entry(bts, &the_pcu->bts_list, list) { |
| 1209 | pcu_vty_show_ms_all(vty, bts); |
| 1210 | } |
| 1211 | return CMD_SUCCESS; |
Jacob Erlbeck | f47f68a | 2015-06-04 10:23:24 +0200 | [diff] [blame] | 1212 | } |
| 1213 | |
Jacob Erlbeck | 37e896d | 2015-06-05 16:33:33 +0200 | [diff] [blame] | 1214 | DEFUN(show_ms_tlli, |
| 1215 | show_ms_tlli_cmd, |
| 1216 | "show ms tlli TLLI", |
| 1217 | SHOW_STR "information about MSs\n" "Select MS by TLLI\n" "TLLI as hex\n") |
| 1218 | { |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 1219 | struct gprs_rlcmac_bts *bts; |
| 1220 | llist_for_each_entry(bts, &the_pcu->bts_list, list) { |
| 1221 | char *endp = NULL; |
| 1222 | unsigned long long tlli = strtoll(argv[0], &endp, 16); |
| 1223 | if ((endp != NULL && *endp != 0) || tlli > 0xffffffffULL) { |
| 1224 | vty_out(vty, "Invalid TLLI.%s", VTY_NEWLINE); |
| 1225 | return CMD_WARNING; |
| 1226 | } |
| 1227 | pcu_vty_show_ms_by_tlli(vty, bts, (uint32_t)tlli); |
Jacob Erlbeck | 37e896d | 2015-06-05 16:33:33 +0200 | [diff] [blame] | 1228 | } |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 1229 | return CMD_SUCCESS; |
Jacob Erlbeck | 37e896d | 2015-06-05 16:33:33 +0200 | [diff] [blame] | 1230 | } |
| 1231 | |
| 1232 | DEFUN(show_ms_imsi, |
| 1233 | show_ms_imsi_cmd, |
| 1234 | "show ms imsi IMSI", |
| 1235 | SHOW_STR "information about MSs\n" "Select MS by IMSI\n" "IMSI\n") |
| 1236 | { |
Pau Espin Pedrol | d1049dc | 2021-01-18 17:14:14 +0100 | [diff] [blame] | 1237 | struct gprs_rlcmac_bts *bts; |
| 1238 | llist_for_each_entry(bts, &the_pcu->bts_list, list) { |
| 1239 | pcu_vty_show_ms_by_imsi(vty, bts, argv[0]); |
| 1240 | } |
| 1241 | return CMD_SUCCESS; |
Jacob Erlbeck | 37e896d | 2015-06-05 16:33:33 +0200 | [diff] [blame] | 1242 | } |
| 1243 | |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 1244 | static const char pcu_copyright[] = |
Harald Welte | f94562a | 2022-11-11 18:19:06 +0100 | [diff] [blame] | 1245 | "Copyright (C) 2012-2013 by Ivan Kluchnikov and Andreas Eversberg\r\n" |
| 1246 | "Copyright (C) 2013-2022 by sysmocom - s.f.m.c. GmbH\r\n" |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 1247 | "License GNU GPL version 2 or later\r\n" |
| 1248 | "This is free software: you are free to change and redistribute it.\r\n" |
| 1249 | "There is NO WARRANTY, to the extent permitted by law.\r\n"; |
| 1250 | |
| 1251 | struct vty_app_info pcu_vty_info = { |
Pau Espin Pedrol | d0fc9e8 | 2019-11-29 13:37:45 +0100 | [diff] [blame] | 1252 | .name = "OsmoPCU", |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 1253 | .version = PACKAGE_VERSION, |
| 1254 | .copyright = pcu_copyright, |
Philipp Maier | 9459ebd | 2020-09-29 23:31:33 +0200 | [diff] [blame] | 1255 | .usr_attr_desc = { |
| 1256 | [PCU_VTY_ATTR_NEW_TBF] = \ |
| 1257 | "This command applies when a new TBF is begins", |
| 1258 | [PCU_VTY_ATTR_NEW_SUBSCR] = \ |
| 1259 | "This command applies when a new subscriber attaches", |
| 1260 | [PCU_VTY_ATTR_NS_RESET] = \ |
| 1261 | "This command applies when the NS is reset", |
| 1262 | }, |
| 1263 | .usr_attr_letters = { |
| 1264 | [PCU_VTY_ATTR_NEW_TBF] = 'n', |
| 1265 | [PCU_VTY_ATTR_NEW_SUBSCR] = 's', |
| 1266 | [PCU_VTY_ATTR_NS_RESET] = 'r', |
| 1267 | }, |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 1268 | }; |
| 1269 | |
Pau Espin Pedrol | cd2ac56 | 2019-08-05 14:30:44 +0200 | [diff] [blame] | 1270 | int pcu_vty_init(void) |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 1271 | { |
| 1272 | // install_element_ve(&show_pcu_cmd); |
| 1273 | |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 1274 | cfg_pcu_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names, |
| 1275 | "gsmtap-category (", |
| 1276 | "|",")", VTY_DO_LOWER); |
| 1277 | cfg_pcu_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help, |
| 1278 | "GSMTAP Category\n", |
| 1279 | "\n", "", 0); |
| 1280 | cfg_pcu_no_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names, |
| 1281 | "no gsmtap-category (", |
| 1282 | "|",")", VTY_DO_LOWER); |
| 1283 | cfg_pcu_no_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help, |
| 1284 | NO_STR "GSMTAP Category\n", |
| 1285 | "\n", "", 0); |
| 1286 | |
Pau Espin Pedrol | cd2ac56 | 2019-08-05 14:30:44 +0200 | [diff] [blame] | 1287 | logging_vty_add_cmds(); |
| 1288 | osmo_stats_vty_add_cmds(); |
Vadim Yanitskiy | d83c8ff | 2020-02-06 16:46:17 +0700 | [diff] [blame] | 1289 | osmo_talloc_vty_add_cmds(); |
Vadim Yanitskiy | 830ca26 | 2021-02-05 23:22:37 +0100 | [diff] [blame] | 1290 | osmo_fsm_vty_add_cmds(); |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 1291 | |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 1292 | install_node(&pcu_node, config_write_pcu); |
| 1293 | install_element(CONFIG_NODE, &cfg_pcu_cmd); |
Jacob Erlbeck | 953c789 | 2015-09-28 18:12:57 +0200 | [diff] [blame] | 1294 | install_element(PCU_NODE, &cfg_pcu_egprs_cmd); |
| 1295 | install_element(PCU_NODE, &cfg_pcu_no_egprs_cmd); |
Andreas Eversberg | cd8a83a | 2012-09-23 06:41:21 +0200 | [diff] [blame] | 1296 | install_element(PCU_NODE, &cfg_pcu_no_two_phase_cmd); |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 1297 | install_element(PCU_NODE, &cfg_pcu_cs_cmd); |
| 1298 | install_element(PCU_NODE, &cfg_pcu_no_cs_cmd); |
Jacob Erlbeck | b33e675 | 2015-06-04 19:04:30 +0200 | [diff] [blame] | 1299 | install_element(PCU_NODE, &cfg_pcu_cs_max_cmd); |
| 1300 | install_element(PCU_NODE, &cfg_pcu_no_cs_max_cmd); |
Jacob Erlbeck | 8322d08 | 2015-06-04 15:12:10 +0200 | [diff] [blame] | 1301 | install_element(PCU_NODE, &cfg_pcu_cs_err_limits_cmd); |
| 1302 | install_element(PCU_NODE, &cfg_pcu_no_cs_err_limits_cmd); |
Jacob Erlbeck | 70b96aa | 2015-06-12 10:52:34 +0200 | [diff] [blame] | 1303 | install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd); |
| 1304 | install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd); |
Jacob Erlbeck | 94cde13 | 2015-06-09 09:44:36 +0200 | [diff] [blame] | 1305 | install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd); |
Minh-Quang Nguyen | 1f18909 | 2017-08-16 09:50:06 -0400 | [diff] [blame] | 1306 | install_element(PCU_NODE, &cfg_pcu_mcs_lqual_ranges_cmd); |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 1307 | install_element(PCU_NODE, &cfg_pcu_mcs_cmd); |
Aravind Sirsikar | 50b0970 | 2016-08-22 17:21:10 +0530 | [diff] [blame] | 1308 | install_element(PCU_NODE, &cfg_pcu_dl_arq_cmd); |
Jacob Erlbeck | 4cc46d3 | 2016-02-02 16:02:16 +0100 | [diff] [blame] | 1309 | install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd); |
Jacob Erlbeck | 0d05805 | 2016-01-07 11:48:28 +0100 | [diff] [blame] | 1310 | install_element(PCU_NODE, &cfg_pcu_mcs_max_cmd); |
| 1311 | install_element(PCU_NODE, &cfg_pcu_no_mcs_max_cmd); |
Jacob Erlbeck | 36df774 | 2016-01-19 15:53:30 +0100 | [diff] [blame] | 1312 | install_element(PCU_NODE, &cfg_pcu_window_size_cmd); |
Andreas Eversberg | 24131bf | 2012-07-21 11:09:58 +0200 | [diff] [blame] | 1313 | install_element(PCU_NODE, &cfg_pcu_queue_lifetime_cmd); |
| 1314 | install_element(PCU_NODE, &cfg_pcu_queue_lifetime_inf_cmd); |
| 1315 | install_element(PCU_NODE, &cfg_pcu_no_queue_lifetime_cmd); |
Jacob Erlbeck | 0c1c877 | 2015-03-20 12:02:42 +0100 | [diff] [blame] | 1316 | install_element(PCU_NODE, &cfg_pcu_queue_hysteresis_cmd); |
| 1317 | install_element(PCU_NODE, &cfg_pcu_no_queue_hysteresis_cmd); |
Jacob Erlbeck | d4ad731 | 2015-07-17 16:39:09 +0200 | [diff] [blame] | 1318 | install_element(PCU_NODE, &cfg_pcu_queue_codel_cmd); |
| 1319 | install_element(PCU_NODE, &cfg_pcu_queue_codel_interval_cmd); |
| 1320 | install_element(PCU_NODE, &cfg_pcu_no_queue_codel_cmd); |
Jacob Erlbeck | d0261b7 | 2015-04-02 13:58:09 +0200 | [diff] [blame] | 1321 | install_element(PCU_NODE, &cfg_pcu_queue_idle_ack_delay_cmd); |
| 1322 | install_element(PCU_NODE, &cfg_pcu_no_queue_idle_ack_delay_cmd); |
Andreas Eversberg | a1503fa | 2012-07-22 08:58:09 +0200 | [diff] [blame] | 1323 | install_element(PCU_NODE, &cfg_pcu_alloc_cmd); |
Andreas Eversberg | 07e97cf | 2012-08-07 16:00:56 +0200 | [diff] [blame] | 1324 | install_element(PCU_NODE, &cfg_pcu_two_phase_cmd); |
Andreas Eversberg | cd8a83a | 2012-09-23 06:41:21 +0200 | [diff] [blame] | 1325 | install_element(PCU_NODE, &cfg_pcu_fc_interval_cmd); |
Jacob Erlbeck | 0288cdb | 2015-05-06 10:47:30 +0200 | [diff] [blame] | 1326 | install_element(PCU_NODE, &cfg_pcu_fc_bucket_time_cmd); |
| 1327 | install_element(PCU_NODE, &cfg_pcu_no_fc_bucket_time_cmd); |
Jacob Erlbeck | 87d7341 | 2015-04-21 12:56:48 +0200 | [diff] [blame] | 1328 | install_element(PCU_NODE, &cfg_pcu_fc_bvc_bucket_size_cmd); |
| 1329 | install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_bucket_size_cmd); |
| 1330 | install_element(PCU_NODE, &cfg_pcu_fc_bvc_leak_rate_cmd); |
| 1331 | install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_leak_rate_cmd); |
| 1332 | install_element(PCU_NODE, &cfg_pcu_fc_ms_bucket_size_cmd); |
| 1333 | install_element(PCU_NODE, &cfg_pcu_no_fc_ms_bucket_size_cmd); |
| 1334 | install_element(PCU_NODE, &cfg_pcu_fc_ms_leak_rate_cmd); |
| 1335 | install_element(PCU_NODE, &cfg_pcu_no_fc_ms_leak_rate_cmd); |
Andreas Eversberg | aafcbbb | 2012-09-27 09:20:45 +0200 | [diff] [blame] | 1336 | install_element(PCU_NODE, &cfg_pcu_alpha_cmd); |
| 1337 | install_element(PCU_NODE, &cfg_pcu_gamma_cmd); |
Jacob Erlbeck | 3bed5d1 | 2015-03-19 11:22:38 +0100 | [diff] [blame] | 1338 | install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_cmd); |
| 1339 | install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd); |
Oliver Smith | 45fdc44 | 2019-09-05 15:12:20 +0200 | [diff] [blame] | 1340 | install_element(PCU_NODE, &cfg_pcu_dl_tbf_preemptive_retransmission_cmd); |
| 1341 | install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd); |
Jacob Erlbeck | a098c19 | 2015-05-28 16:11:19 +0200 | [diff] [blame] | 1342 | install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd); |
| 1343 | install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); |
Pau Espin Pedrol | 13866f0 | 2021-11-12 13:42:03 +0100 | [diff] [blame] | 1344 | install_element(PCU_NODE, &cfg_pcu_gsmtap_remote_host_cmd); |
| 1345 | install_element(PCU_NODE, &cfg_pcu_no_gsmtap_remote_host_cmd); |
| 1346 | install_element(PCU_NODE, &pcucfg_pcu_gsmtap_categ_all_cmd); |
Harald Welte | 717cdf5 | 2017-07-21 21:56:23 +0200 | [diff] [blame] | 1347 | install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd); |
| 1348 | install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd); |
Pau Espin Pedrol | c4178e5 | 2017-08-08 15:03:50 +0200 | [diff] [blame] | 1349 | install_element(PCU_NODE, &cfg_pcu_sock_cmd); |
Harald Welte | 57d3515 | 2018-07-05 03:11:17 +0200 | [diff] [blame] | 1350 | install_element(PCU_NODE, &cfg_pcu_gb_dialect_cmd); |
Harald Welte | d9367e3 | 2021-04-29 22:02:47 +0200 | [diff] [blame] | 1351 | install_element(PCU_NODE, &cfg_pcu_gb_ip_dscp_cmd); |
| 1352 | install_element(PCU_NODE, &cfg_pcu_gb_priority_cmd); |
Pau Espin Pedrol | c0a250d | 2021-01-21 18:46:13 +0100 | [diff] [blame] | 1353 | install_element(PCU_NODE, &cfg_neighbor_resolution_cmd); |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1354 | install_element(PCU_NODE, &cfg_pcu_timer_cmd); |
Andreas Eversberg | 8b761a3 | 2012-07-20 21:50:31 +0200 | [diff] [blame] | 1355 | |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 1356 | install_element_ve(&show_bts_stats_cmd); |
Pau Espin Pedrol | a1ac2f0 | 2020-09-22 17:01:31 +0200 | [diff] [blame] | 1357 | install_element_ve(&show_bts_pdch_cmd); |
Daniel Willmann | 772415f | 2014-01-15 17:06:51 +0100 | [diff] [blame] | 1358 | install_element_ve(&show_tbf_cmd); |
Jacob Erlbeck | f47f68a | 2015-06-04 10:23:24 +0200 | [diff] [blame] | 1359 | install_element_ve(&show_ms_all_cmd); |
Jacob Erlbeck | 37e896d | 2015-06-05 16:33:33 +0200 | [diff] [blame] | 1360 | install_element_ve(&show_ms_tlli_cmd); |
| 1361 | install_element_ve(&show_ms_imsi_cmd); |
Pau Espin Pedrol | 28f160e | 2019-09-05 14:48:35 +0200 | [diff] [blame] | 1362 | install_element_ve(&show_bts_timer_cmd); |
| 1363 | install_element_ve(&show_timer_cmd); |
Holger Hans Peter Freyther | f537298 | 2013-10-27 09:02:31 +0100 | [diff] [blame] | 1364 | |
Andreas Eversberg | 1294256 | 2012-07-12 14:31:57 +0200 | [diff] [blame] | 1365 | return 0; |
| 1366 | } |