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