blob: 84c04568f38af0461b5a91ee4b65a0205f7e103a [file] [log] [blame]
Andreas Eversberg12942562012-07-12 14:31:57 +02001/* OsmoBTS VTY interface */
2
Andreas Eversberg12942562012-07-12 14:31:57 +02003
Andreas Eversberg8b761a32012-07-20 21:50:31 +02004#include <stdint.h>
Holger Hans Peter Freyther2c98f1d2014-07-02 14:56:36 +02005#include <stdlib.h>
Neels Hofmeyrd34646a2017-02-08 17:07:40 +01006#include <string.h>
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01007#include <inttypes.h>
8
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02009#include <osmocom/core/tdef.h>
Vadim Yanitskiy657a4c02019-11-30 20:15:22 +070010#include <osmocom/core/utils.h>
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +020011#include <osmocom/vty/tdef_vty.h>
Andreas Eversberg12942562012-07-12 14:31:57 +020012#include <osmocom/vty/logging.h>
Jacob Erlbeck42aba812015-11-10 15:32:00 +010013#include <osmocom/vty/stats.h>
Jacob Erlbeckc0c580c2015-04-30 15:59:01 +020014#include <osmocom/vty/misc.h>
Andreas Eversberg8b761a32012-07-20 21:50:31 +020015#include <osmocom/core/linuxlist.h>
Holger Hans Peter Freythere8915b92014-07-02 14:57:47 +020016#include <osmocom/core/rate_ctr.h>
Pau Espin Pedrolc0a250d2021-01-21 18:46:13 +010017#include <osmocom/ctrl/ports.h>
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +020018#include <osmocom/pcu/pcuif_proto.h>
Alexander Couzens290d9032020-09-16 21:52:02 +020019#include <osmocom/gprs/gprs_ns2.h>
Andreas Eversberg12942562012-07-12 14:31:57 +020020#include "pcu_vty.h"
Andreas Eversberg8b761a32012-07-20 21:50:31 +020021#include "gprs_rlcmac.h"
Max6dc90b82018-02-19 17:17:28 +010022#include <pdch.h>
Holger Hans Peter Freyther67ed34e2013-10-17 17:01:54 +020023#include "bts.h"
Jacob Erlbeckc0c580c2015-04-30 15:59:01 +020024#include "tbf.h"
Jacob Erlbeck62e96a32015-06-04 09:42:14 +020025#include "pcu_vty_functions.h"
Pau Espin Pedrolff7c5812022-12-14 18:49:06 +010026#include "alloc_algo.h"
Jacob Erlbeck62e96a32015-06-04 09:42:14 +020027
Philipp Maier9459ebd2020-09-29 23:31:33 +020028#define X(x) (1 << x)
29
Harald Welte717cdf52017-07-21 21:56:23 +020030extern void *tall_pcu_ctx;
31
32static 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 Weltebc219d52017-07-29 13:42:27 +020038 { PCU_GSMTAP_C_DL_PTCCH, "dl-ptcch" },
Pau Espin Pedrol58543702019-09-30 19:07:16 +020039 { PCU_GSMTAP_C_DL_AGCH, "dl-agch" },
40 { PCU_GSMTAP_C_DL_PCH, "dl-pch" },
Harald Welte717cdf52017-07-21 21:56:23 +020041
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 Pedrol1ec211f2019-09-30 18:33:14 +020047 { PCU_GSMTAP_C_UL_RACH, "ul-rach" },
Vadim Yanitskiy07b64872020-06-11 00:26:15 +070048 { PCU_GSMTAP_C_UL_PTCCH, "ul-ptcch" },
Harald Welte717cdf52017-07-21 21:56:23 +020049
50 { 0, NULL }
51};
52
53static 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 Weltebc219d52017-07-29 13:42:27 +020059 { PCU_GSMTAP_C_DL_PTCCH, "Downlink PTCCH Blocks" },
Pau Espin Pedrol58543702019-09-30 19:07:16 +020060 { PCU_GSMTAP_C_DL_AGCH, "Downlink AGCH Blocks" },
61 { PCU_GSMTAP_C_DL_PCH, "Downlink PCH Blocks" },
Harald Welte717cdf52017-07-21 21:56:23 +020062
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 Pedrol1ec211f2019-09-30 18:33:14 +020068 { PCU_GSMTAP_C_UL_RACH, "Uplink RACH Bursts" },
Vadim Yanitskiy07b64872020-06-11 00:26:15 +070069 { PCU_GSMTAP_C_UL_PTCCH, "Uplink PTCCH Bursts" },
Harald Welte717cdf52017-07-21 21:56:23 +020070
71 { 0, NULL }
72};
73
Pau Espin Pedrol13866f02021-11-12 13:42:03 +010074DEFUN(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
89DEFUN(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
103DEFUN(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 Welte717cdf52017-07-21 21:56:23 +0200117
118DEFUN(cfg_pcu_gsmtap_categ, cfg_pcu_gsmtap_categ_cmd, "HIDDEN", "HIDDEN")
119{
Harald Welte717cdf52017-07-21 21:56:23 +0200120 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 Pedrolac3fd122021-01-13 18:54:38 +0100126 the_pcu->gsmtap_categ_mask |= (1 << categ);
Harald Welte717cdf52017-07-21 21:56:23 +0200127
128 return CMD_SUCCESS;
129}
130
131DEFUN(cfg_pcu_no_gsmtap_categ, cfg_pcu_no_gsmtap_categ_cmd, "HIDDEN", "HIDDEN")
132{
Harald Welte717cdf52017-07-21 21:56:23 +0200133 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 Pedrolac3fd122021-01-13 18:54:38 +0100139 the_pcu->gsmtap_categ_mask &= ~(1 << categ);
Harald Welte717cdf52017-07-21 21:56:23 +0200140
141 return CMD_SUCCESS;
142}
143
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200144static struct cmd_node pcu_node = {
145 (enum node_type) PCU_NODE,
Jacob Erlbeckcc12f022015-04-09 15:45:24 +0200146 "%s(config-pcu)# ",
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200147 1,
148};
149
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200150static int config_write_pcu(struct vty *vty)
151{
Harald Welte717cdf52017-07-21 21:56:23 +0200152 unsigned int i;
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200153
154 vty_out(vty, "pcu%s", VTY_NEWLINE);
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100155 vty_out(vty, " flow-control-interval %d%s", the_pcu->vty.fc_interval,
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200156 VTY_NEWLINE);
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100157 if (the_pcu->vty.fc_bvc_bucket_size)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200158 vty_out(vty, " flow-control force-bvc-bucket-size %d%s",
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100159 the_pcu->vty.fc_bvc_bucket_size, VTY_NEWLINE);
160 if (the_pcu->vty.fc_bvc_leak_rate)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200161 vty_out(vty, " flow-control force-bvc-leak-rate %d%s",
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100162 the_pcu->vty.fc_bvc_leak_rate, VTY_NEWLINE);
163 if (the_pcu->vty.fc_ms_bucket_size)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200164 vty_out(vty, " flow-control force-ms-bucket-size %d%s",
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100165 the_pcu->vty.fc_ms_bucket_size, VTY_NEWLINE);
166 if (the_pcu->vty.fc_ms_leak_rate)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200167 vty_out(vty, " flow-control force-ms-leak-rate %d%s",
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100168 the_pcu->vty.fc_ms_leak_rate, VTY_NEWLINE);
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100169 if (the_pcu->vty.force_initial_cs) {
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100170 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 Eversberg499ff412012-10-03 14:21:36 +0200172 VTY_NEWLINE);
173 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100174 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 Freytherc421e8a2014-07-02 14:55:17 +0200176 }
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100177 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 Erlbeckb33e6752015-06-04 19:04:30 +0200180 VTY_NEWLINE);
181 else
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100182 vty_out(vty, " cs max %d %d%s", the_pcu->vty.max_cs_dl,
183 the_pcu->vty.max_cs_ul, VTY_NEWLINE);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200184 }
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100185 if (the_pcu->vty.cs_adj_enabled)
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200186 vty_out(vty, " cs threshold %d %d%s",
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100187 the_pcu->vty.cs_adj_lower_limit, the_pcu->vty.cs_adj_upper_limit,
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200188 VTY_NEWLINE);
189 else
190 vty_out(vty, " no cs threshold%s", VTY_NEWLINE);
191
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100192 if (the_pcu->vty.cs_downgrade_threshold)
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200193 vty_out(vty, " cs downgrade-threshold %d%s",
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100194 the_pcu->vty.cs_downgrade_threshold, VTY_NEWLINE);
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200195 else
196 vty_out(vty, " no cs downgrade-threshold%s", VTY_NEWLINE);
197
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200198 vty_out(vty, " cs link-quality-ranges cs1 %d cs2 %d %d cs3 %d %d cs4 %d%s",
Pau Espin Pedrol54b159a2021-01-14 13:30:04 +0100199 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 Erlbeck94cde132015-06-09 09:44:36 +0200205 VTY_NEWLINE);
206
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -0400207 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 Pedrol54b159a2021-01-14 13:30:04 +0100208 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 Nguyen1f189092017-08-16 09:50:06 -0400224 VTY_NEWLINE);
225
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100226 if (the_pcu->vty.force_initial_mcs) {
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100227 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 Erlbeck4cc46d32016-02-02 16:02:16 +0100229 VTY_NEWLINE);
230 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100231 vty_out(vty, " mcs %d %d%s", the_pcu->vty.initial_mcs_dl,
232 the_pcu->vty.initial_mcs_ul, VTY_NEWLINE);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100233 }
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -0400234
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100235 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 Erlbeck0d058052016-01-07 11:48:28 +0100238 VTY_NEWLINE);
239 else
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100240 vty_out(vty, " mcs max %d %d%s", the_pcu->vty.max_mcs_dl,
241 the_pcu->vty.max_mcs_ul, VTY_NEWLINE);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100242 }
243
Pau Espin Pedrol519d0712021-01-14 14:30:03 +0100244 vty_out(vty, " window-size %d %d%s", the_pcu->vty.ws_base, the_pcu->vty.ws_pdch,
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100245 VTY_NEWLINE);
246
Pau Espin Pedrol97296b22021-01-14 13:08:02 +0100247 if (the_pcu->vty.dl_arq_type == EGPRS_ARQ2)
248 vty_out(vty, " egprs dl arq-type arq2%s", VTY_NEWLINE);
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530249
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100250 if (the_pcu->vty.force_llc_lifetime == 0xffff)
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200251 vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100252 else if (the_pcu->vty.force_llc_lifetime)
253 vty_out(vty, " queue lifetime %d%s", the_pcu->vty.force_llc_lifetime,
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200254 VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100255 if (the_pcu->vty.llc_discard_csec)
256 vty_out(vty, " queue hysteresis %d%s", the_pcu->vty.llc_discard_csec,
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100257 VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100258 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 Erlbeckd0261b72015-04-02 13:58:09 +0200260 VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100261 if (the_pcu->vty.llc_codel_interval_msec == LLC_CODEL_USE_DEFAULT)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200262 vty_out(vty, " queue codel%s", VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100263 else if (the_pcu->vty.llc_codel_interval_msec == LLC_CODEL_DISABLE)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200264 vty_out(vty, " no queue codel%s", VTY_NEWLINE);
265 else
266 vty_out(vty, " queue codel interval %d%s",
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100267 the_pcu->vty.llc_codel_interval_msec/10, VTY_NEWLINE);
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200268
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100269 if (the_pcu->alloc_algorithm == alloc_algorithm_a)
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200270 vty_out(vty, " alloc-algorithm a%s", VTY_NEWLINE);
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100271 if (the_pcu->alloc_algorithm == alloc_algorithm_b)
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200272 vty_out(vty, " alloc-algorithm b%s", VTY_NEWLINE);
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100273 if (the_pcu->alloc_algorithm == alloc_algorithm_dynamic)
Jacob Erlbeck400ec022015-07-14 13:31:48 +0200274 vty_out(vty, " alloc-algorithm dynamic%s", VTY_NEWLINE);
Pau Espin Pedrol03de8982021-01-14 12:48:50 +0100275 if (the_pcu->vty.force_two_phase)
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200276 vty_out(vty, " two-phase-access%s", VTY_NEWLINE);
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100277 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 Pedrola2814952021-01-14 12:53:53 +0100279 vty_out(vty, " gamma %d%s", the_pcu->vty.gamma * 2, VTY_NEWLINE);
Pau Espin Pedrol05f9f592021-01-14 12:56:58 +0100280 if (!the_pcu->vty.dl_tbf_preemptive_retransmission)
Oliver Smith45fdc442019-09-05 15:12:20 +0200281 vty_out(vty, " no dl-tbf-preemptive-retransmission%s", VTY_NEWLINE);
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100282 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 Eversberga1503fa2012-07-22 08:58:09 +0200284
Pau Espin Pedrol13866f02021-11-12 13:42:03 +0100285 if (the_pcu->gsmtap_remote_host)
286 vty_out(vty, " gsmtap-remote-host %s%s", the_pcu->gsmtap_remote_host, VTY_NEWLINE);
Harald Welte717cdf52017-07-21 21:56:23 +0200287 for (i = 0; i < 32; i++) {
Pau Espin Pedrol13866f02021-11-12 13:42:03 +0100288 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 Welte717cdf52017-07-21 21:56:23 +0200293 }
294 }
295
Alexander Couzensf7ec5252021-01-25 20:28:38 +0100296 if (the_pcu->vty.ns_dialect == GPRS_NS2_DIALECT_SNS)
Harald Welte57d35152018-07-05 03:11:17 +0200297 vty_out(vty, " gb-dialect ip-sns%s", VTY_NEWLINE);
298 else
299 vty_out(vty, " gb-dialect classic%s", VTY_NEWLINE);
300
Harald Welted9367e32021-04-29 22:02:47 +0200301 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 Pedrol924aaad2021-01-14 12:01:42 +0100306 osmo_tdef_vty_write(vty, the_pcu->T_defs, " timer ");
Pau Espin Pedrol18794422019-09-26 18:25:35 +0200307
Maxc9ce6f92018-01-30 17:53:02 +0100308 return CMD_SUCCESS;
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200309}
310
311/* per-BTS configuration */
Philipp Maier9459ebd2020-09-29 23:31:33 +0200312DEFUN_ATTR(cfg_pcu,
313 cfg_pcu_cmd,
314 "pcu",
315 "BTS specific configure",
316 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200317{
318 vty->node = PCU_NODE;
319
320 return CMD_SUCCESS;
321}
322
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200323#define EGPRS_STR "EGPRS configuration\n"
324
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100325DEFUN_DEPRECATED(cfg_pcu_egprs,
326 cfg_pcu_egprs_cmd,
327 "egprs only",
328 EGPRS_STR "Use EGPRS and disable plain GPRS\n")
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200329{
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100330 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 Erlbeck953c7892015-09-28 18:12:57 +0200331 return CMD_SUCCESS;
332}
333
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100334DEFUN_DEPRECATED(cfg_pcu_no_egprs,
335 cfg_pcu_no_egprs_cmd,
336 "no egprs",
337 NO_STR EGPRS_STR)
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200338{
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100339 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 Erlbeck953c7892015-09-28 18:12:57 +0200340 return CMD_SUCCESS;
341}
342
Philipp Maier9459ebd2020-09-29 23:31:33 +0200343DEFUN_ATTR(cfg_pcu_fc_interval,
344 cfg_pcu_fc_interval_cmd,
345 "flow-control-interval <1-10>",
346 "Interval between sending subsequent Flow Control PDUs\n"
347 "Interval time in seconds\n",
348 CMD_ATTR_IMMEDIATE)
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200349{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100350 the_pcu->vty.fc_interval = atoi(argv[0]);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200351 return CMD_SUCCESS;
352}
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200353#define FC_STR "BSSGP Flow Control configuration\n"
354#define FC_BMAX_STR(who) "Force a fixed value for the " who " bucket size\n"
355#define FC_LR_STR(who) "Force a fixed value for the " who " leak rate\n"
356
Philipp Maier9459ebd2020-09-29 23:31:33 +0200357DEFUN_ATTR(cfg_pcu_fc_bvc_bucket_size,
358 cfg_pcu_fc_bvc_bucket_size_cmd,
359 "flow-control force-bvc-bucket-size <1-6553500>",
360 FC_STR FC_BMAX_STR("BVC") "Bucket size in octets\n",
361 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200362{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100363 the_pcu->vty.fc_bvc_bucket_size = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200364 return CMD_SUCCESS;
365}
366
Philipp Maier9459ebd2020-09-29 23:31:33 +0200367DEFUN_ATTR(cfg_pcu_no_fc_bvc_bucket_size,
368 cfg_pcu_no_fc_bvc_bucket_size_cmd,
369 "no flow-control force-bvc-bucket-size",
370 NO_STR FC_STR FC_BMAX_STR("BVC"),
371 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200372{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100373 the_pcu->vty.fc_bvc_bucket_size = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200374 return CMD_SUCCESS;
375}
376
Philipp Maier9459ebd2020-09-29 23:31:33 +0200377DEFUN_ATTR(cfg_pcu_fc_bvc_leak_rate,
378 cfg_pcu_fc_bvc_leak_rate_cmd,
379 "flow-control force-bvc-leak-rate <1-6553500>",
380 FC_STR FC_LR_STR("BVC") "Leak rate in bit/s\n",
381 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200382{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100383 the_pcu->vty.fc_bvc_leak_rate = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200384
385 return CMD_SUCCESS;
386}
387
Philipp Maier9459ebd2020-09-29 23:31:33 +0200388DEFUN_ATTR(cfg_pcu_no_fc_bvc_leak_rate,
389 cfg_pcu_no_fc_bvc_leak_rate_cmd,
390 "no flow-control force-bvc-leak-rate",
391 NO_STR FC_STR FC_LR_STR("BVC"),
392 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200393{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100394 the_pcu->vty.fc_bvc_leak_rate = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200395 return CMD_SUCCESS;
396}
397
Philipp Maier9459ebd2020-09-29 23:31:33 +0200398DEFUN_ATTR(cfg_pcu_fc_ms_bucket_size,
399 cfg_pcu_fc_ms_bucket_size_cmd,
400 "flow-control force-ms-bucket-size <1-6553500>",
401 FC_STR FC_BMAX_STR("default MS") "Bucket size in octets\n",
402 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200403{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100404 the_pcu->vty.fc_ms_bucket_size = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200405 return CMD_SUCCESS;
406}
407
Philipp Maier9459ebd2020-09-29 23:31:33 +0200408DEFUN_ATTR(cfg_pcu_no_fc_ms_bucket_size,
409 cfg_pcu_no_fc_ms_bucket_size_cmd,
410 "no flow-control force-ms-bucket-size",
411 NO_STR FC_STR FC_BMAX_STR("default MS"),
412 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200413{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100414 the_pcu->vty.fc_ms_bucket_size = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200415 return CMD_SUCCESS;
416}
417
Philipp Maier9459ebd2020-09-29 23:31:33 +0200418DEFUN_ATTR(cfg_pcu_fc_ms_leak_rate,
419 cfg_pcu_fc_ms_leak_rate_cmd,
420 "flow-control force-ms-leak-rate <1-6553500>",
421 FC_STR FC_LR_STR("default MS") "Leak rate in bit/s\n",
422 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200423{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100424 the_pcu->vty.fc_ms_leak_rate = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200425 return CMD_SUCCESS;
426}
427
Philipp Maier9459ebd2020-09-29 23:31:33 +0200428DEFUN_ATTR(cfg_pcu_no_fc_ms_leak_rate,
429 cfg_pcu_no_fc_ms_leak_rate_cmd,
430 "no flow-control force-ms-leak-rate",
431 NO_STR FC_STR FC_LR_STR("default MS"),
432 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200433{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100434 the_pcu->vty.fc_ms_leak_rate = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200435 return CMD_SUCCESS;
436}
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200437
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200438#define FC_BTIME_STR "Set target downlink maximum queueing time (only affects the advertised bucket size)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200439DEFUN_ATTR(cfg_pcu_fc_bucket_time,
440 cfg_pcu_fc_bucket_time_cmd,
441 "flow-control bucket-time <1-65534>",
442 FC_STR FC_BTIME_STR "Time in centi-seconds\n",
443 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200444{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100445 the_pcu->vty.fc_bucket_time = atoi(argv[0]);
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200446 return CMD_SUCCESS;
447}
448
Philipp Maier9459ebd2020-09-29 23:31:33 +0200449DEFUN_ATTR(cfg_pcu_no_fc_bucket_time,
450 cfg_pcu_no_fc_bucket_time_cmd,
451 "no flow-control bucket-time",
452 NO_STR FC_STR FC_BTIME_STR,
453 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200454{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100455 the_pcu->vty.fc_bucket_time = 0;
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200456 return CMD_SUCCESS;
457}
458
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200459#define CS_STR "Coding Scheme configuration\n"
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200460
Philipp Maier9459ebd2020-09-29 23:31:33 +0200461DEFUN_ATTR(cfg_pcu_cs,
462 cfg_pcu_cs_cmd,
463 "cs <1-4> [<1-4>]",
464 CS_STR
465 "Initial CS value to be used (overrides BTS config)\n"
466 "Use a different initial CS value for the uplink",
467 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200468{
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100469 uint8_t cs_dl, cs_ul;
470 cs_dl = atoi(argv[0]);
Andreas Eversberg499ff412012-10-03 14:21:36 +0200471 if (argc > 1)
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100472 cs_ul = atoi(argv[1]);
Andreas Eversberg499ff412012-10-03 14:21:36 +0200473 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100474 cs_ul = cs_dl;
475 the_pcu->vty.force_initial_cs = true;
476 gprs_pcu_set_initial_cs(the_pcu, cs_dl, cs_ul);
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200477 return CMD_SUCCESS;
478}
479
Philipp Maier9459ebd2020-09-29 23:31:33 +0200480DEFUN_ATTR(cfg_pcu_no_cs,
481 cfg_pcu_no_cs_cmd,
482 "no cs",
483 NO_STR CS_STR,
484 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200485{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100486 the_pcu->vty.force_initial_cs = false;
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100487 gprs_pcu_set_initial_cs(the_pcu, 0, 0);
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200488 return CMD_SUCCESS;
489}
490
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100491#define CS_MAX_STR "Set maximum values for adaptive CS selection (overrides BTS config)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200492DEFUN_ATTR(cfg_pcu_cs_max,
493 cfg_pcu_cs_max_cmd,
494 "cs max <1-4> [<1-4>]",
495 CS_STR
496 CS_MAX_STR
497 "Maximum CS value to be used\n"
498 "Use a different maximum CS value for the uplink",
499 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200500{
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100501 uint8_t cs_dl = atoi(argv[0]);
502 uint8_t cs_ul;
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200503
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200504 if (argc > 1)
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100505 cs_ul = atoi(argv[1]);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200506 else
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100507 cs_ul = cs_dl;
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200508
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100509 gprs_pcu_set_max_cs(the_pcu, cs_dl, cs_ul);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200510 return CMD_SUCCESS;
511}
512
Philipp Maier9459ebd2020-09-29 23:31:33 +0200513DEFUN_ATTR(cfg_pcu_no_cs_max,
514 cfg_pcu_no_cs_max_cmd,
515 "no cs max",
516 NO_STR CS_STR CS_MAX_STR,
517 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200518{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100519 gprs_pcu_set_max_cs(the_pcu, 0, 0);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200520 return CMD_SUCCESS;
521}
522
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100523#define MCS_STR "Modulation and Coding Scheme configuration (EGPRS)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200524DEFUN_ATTR(cfg_pcu_mcs,
525 cfg_pcu_mcs_cmd,
526 "mcs <1-9> [<1-9>]",
527 MCS_STR
528 "Initial MCS value to be used (default 1)\n"
529 "Use a different initial MCS value for the uplink",
530 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100531{
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100532 uint8_t mcs_dl, mcs_ul;
533 mcs_dl = atoi(argv[0]);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100534 if (argc > 1)
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100535 mcs_ul = atoi(argv[1]);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100536 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100537 mcs_ul = mcs_dl;
538 the_pcu->vty.force_initial_mcs = true;
539 gprs_pcu_set_initial_mcs(the_pcu, mcs_dl, mcs_ul);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100540 return CMD_SUCCESS;
541}
542
Philipp Maier9459ebd2020-09-29 23:31:33 +0200543DEFUN_ATTR(cfg_pcu_no_mcs,
544 cfg_pcu_no_mcs_cmd,
545 "no mcs",
546 NO_STR MCS_STR,
547 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100548{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100549 the_pcu->vty.force_initial_mcs = false;
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100550 gprs_pcu_set_initial_mcs(the_pcu, 0, 0);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100551 return CMD_SUCCESS;
552}
553
Philipp Maier9459ebd2020-09-29 23:31:33 +0200554DEFUN_ATTR(cfg_pcu_mcs_max,
555 cfg_pcu_mcs_max_cmd,
556 "mcs max <1-9> [<1-9>]",
557 MCS_STR
558 CS_MAX_STR
559 "Maximum MCS value to be used\n"
560 "Use a different maximum MCS value for the uplink",
561 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100562{
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100563 uint8_t mcs_dl = atoi(argv[0]);
564 uint8_t mcs_ul;
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100565
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100566 if (argc > 1)
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100567 mcs_ul = atoi(argv[1]);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100568 else
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100569 mcs_ul = mcs_dl;
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100570
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100571 gprs_pcu_set_max_mcs(the_pcu, mcs_dl, mcs_ul);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100572 return CMD_SUCCESS;
573}
574
Philipp Maier9459ebd2020-09-29 23:31:33 +0200575DEFUN_ATTR(cfg_pcu_no_mcs_max,
576 cfg_pcu_no_mcs_max_cmd,
577 "no mcs max",
578 NO_STR MCS_STR CS_MAX_STR,
579 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100580{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100581 gprs_pcu_set_max_mcs(the_pcu, 0, 0);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100582 return CMD_SUCCESS;
583}
584
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530585#define DL_STR "downlink specific configuration\n"
586
Philipp Maier9459ebd2020-09-29 23:31:33 +0200587DEFUN_ATTR(cfg_pcu_dl_arq_type,
588 cfg_pcu_dl_arq_cmd,
589 "egprs dl arq-type (spb|arq2)",
590 EGPRS_STR DL_STR "ARQ options\n"
591 "enable SPB(ARQ1) support\n"
592 "enable ARQ2 support",
593 CMD_ATTR_IMMEDIATE)
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530594{
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530595 if (!strcmp(argv[0], "arq2"))
Pau Espin Pedrol97296b22021-01-14 13:08:02 +0100596 the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530597 else
Pau Espin Pedrol97296b22021-01-14 13:08:02 +0100598 the_pcu->vty.dl_arq_type = EGPRS_ARQ1;
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530599
600 return CMD_SUCCESS;
601}
602
Philipp Maier9459ebd2020-09-29 23:31:33 +0200603DEFUN_USRATTR(cfg_pcu_window_size,
604 cfg_pcu_window_size_cmd,
605 X(PCU_VTY_ATTR_NEW_TBF),
606 "window-size <0-1024> [<0-256>]",
607 "Window size configuration (b + N_PDCH * f)\n"
608 "Base value (b)\n"
609 "Factor for number of PDCH (f)")
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100610{
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100611 uint16_t b = atoi(argv[0]);
612
Pau Espin Pedrol519d0712021-01-14 14:30:03 +0100613 the_pcu->vty.ws_base = b;
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100614 if (argc > 1) {
615 uint16_t f = atoi(argv[1]);
Pau Espin Pedrol519d0712021-01-14 14:30:03 +0100616 the_pcu->vty.ws_pdch = f;
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100617 }
618
619 return CMD_SUCCESS;
620}
621
622
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200623#define QUEUE_STR "Packet queue options\n"
624#define LIFETIME_STR "Set lifetime limit of LLC frame in centi-seconds " \
625 "(overrides the value given by SGSN)\n"
626
Philipp Maier9459ebd2020-09-29 23:31:33 +0200627DEFUN_USRATTR(cfg_pcu_queue_lifetime,
628 cfg_pcu_queue_lifetime_cmd,
629 X(PCU_VTY_ATTR_NEW_TBF),
630 "queue lifetime <1-65534>",
631 QUEUE_STR LIFETIME_STR "Lifetime in centi-seconds")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200632{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200633 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100634 the_pcu->vty.force_llc_lifetime = csec;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200635 return CMD_SUCCESS;
636}
637
Philipp Maier9459ebd2020-09-29 23:31:33 +0200638DEFUN_USRATTR(cfg_pcu_queue_lifetime_inf,
639 cfg_pcu_queue_lifetime_inf_cmd,
640 X(PCU_VTY_ATTR_NEW_TBF),
641 "queue lifetime infinite",
642 QUEUE_STR LIFETIME_STR "Infinite lifetime")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200643{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100644 the_pcu->vty.force_llc_lifetime = 0xffff;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200645 return CMD_SUCCESS;
646}
647
Philipp Maier9459ebd2020-09-29 23:31:33 +0200648DEFUN_USRATTR(cfg_pcu_no_queue_lifetime,
649 cfg_pcu_no_queue_lifetime_cmd,
650 X(PCU_VTY_ATTR_NEW_TBF),
651 "no queue lifetime",
652 NO_STR QUEUE_STR "Disable lifetime limit of LLC frame (use value given "
653 "by SGSN)\n")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200654{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100655 the_pcu->vty.force_llc_lifetime = 0;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200656 return CMD_SUCCESS;
657}
658
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100659#define QUEUE_HYSTERESIS_STR "Set lifetime hysteresis of LLC frame in centi-seconds " \
660 "(continue discarding until lifetime-hysteresis is reached)\n"
661
Philipp Maier9459ebd2020-09-29 23:31:33 +0200662DEFUN_USRATTR(cfg_pcu_queue_hysteresis,
663 cfg_pcu_queue_hysteresis_cmd,
664 X(PCU_VTY_ATTR_NEW_TBF),
665 "queue hysteresis <1-65535>",
666 QUEUE_STR QUEUE_HYSTERESIS_STR "Hysteresis in centi-seconds")
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100667{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200668 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100669 the_pcu->vty.llc_discard_csec = csec;
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100670 return CMD_SUCCESS;
671}
672
Philipp Maier9459ebd2020-09-29 23:31:33 +0200673DEFUN_USRATTR(cfg_pcu_no_queue_hysteresis,
674 cfg_pcu_no_queue_hysteresis_cmd,
675 X(PCU_VTY_ATTR_NEW_TBF),
676 "no queue hysteresis",
677 NO_STR QUEUE_STR QUEUE_HYSTERESIS_STR)
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100678{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100679 the_pcu->vty.llc_discard_csec = 0;
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100680 return CMD_SUCCESS;
681}
682
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200683#define QUEUE_CODEL_STR "Set CoDel queue management\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200684DEFUN_USRATTR(cfg_pcu_queue_codel,
685 cfg_pcu_queue_codel_cmd,
686 X(PCU_VTY_ATTR_NEW_SUBSCR),
687 "queue codel",
688 QUEUE_STR QUEUE_CODEL_STR)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200689{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100690 the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200691 return CMD_SUCCESS;
692}
693
Philipp Maier9459ebd2020-09-29 23:31:33 +0200694DEFUN_USRATTR(cfg_pcu_queue_codel_interval,
695 cfg_pcu_queue_codel_interval_cmd,
696 X(PCU_VTY_ATTR_NEW_SUBSCR),
697 "queue codel interval <1-1000>",
698 QUEUE_STR QUEUE_CODEL_STR "Specify interval\n" "Interval in centi-seconds")
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200699{
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200700 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100701 the_pcu->vty.llc_codel_interval_msec = 10*csec;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200702 return CMD_SUCCESS;
703}
704
Philipp Maier9459ebd2020-09-29 23:31:33 +0200705DEFUN_USRATTR(cfg_pcu_no_queue_codel,
706 cfg_pcu_no_queue_codel_cmd,
707 X(PCU_VTY_ATTR_NEW_SUBSCR),
708 "no queue codel",
709 NO_STR QUEUE_STR QUEUE_CODEL_STR)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200710{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100711 the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_DISABLE;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200712 return CMD_SUCCESS;
713}
714
715
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200716#define QUEUE_IDLE_ACK_STR "Request an ACK after the last DL LLC frame in centi-seconds\n"
717
Philipp Maier9459ebd2020-09-29 23:31:33 +0200718DEFUN_ATTR(cfg_pcu_queue_idle_ack_delay,
719 cfg_pcu_queue_idle_ack_delay_cmd,
720 "queue idle-ack-delay <1-65535>",
721 QUEUE_STR QUEUE_IDLE_ACK_STR "Idle ACK delay in centi-seconds",
722 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200723{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200724 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100725 the_pcu->vty.llc_idle_ack_csec = csec;
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200726 return CMD_SUCCESS;
727}
728
Philipp Maier9459ebd2020-09-29 23:31:33 +0200729DEFUN_ATTR(cfg_pcu_no_queue_idle_ack_delay,
730 cfg_pcu_no_queue_idle_ack_delay_cmd,
731 "no queue idle-ack-delay",
732 NO_STR QUEUE_STR QUEUE_IDLE_ACK_STR,
733 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200734{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100735 the_pcu->vty.llc_idle_ack_csec = 0;
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200736 return CMD_SUCCESS;
737}
738
Philipp Maier9459ebd2020-09-29 23:31:33 +0200739DEFUN_ATTR(cfg_pcu_alloc,
740 cfg_pcu_alloc_cmd,
741 "alloc-algorithm (a|b|dynamic)",
742 "Select slot allocation algorithm to use when assigning timeslots on "
743 "PACCH\n"
744 "Single slot is assigned only\n"
745 "Multiple slots are assigned for semi-duplex operation\n"
746 "Dynamically select the algorithm based on the system state\n",
747 CMD_ATTR_IMMEDIATE)
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200748{
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200749 switch (argv[0][0]) {
750 case 'a':
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100751 the_pcu->alloc_algorithm = alloc_algorithm_a;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200752 break;
753 case 'b':
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100754 the_pcu->alloc_algorithm = alloc_algorithm_b;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200755 break;
Jacob Erlbeck400ec022015-07-14 13:31:48 +0200756 default:
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100757 the_pcu->alloc_algorithm = alloc_algorithm_dynamic;
Jacob Erlbeck400ec022015-07-14 13:31:48 +0200758 break;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200759 }
760
761 return CMD_SUCCESS;
762}
763
Philipp Maier9459ebd2020-09-29 23:31:33 +0200764DEFUN_ATTR(cfg_pcu_two_phase,
765 cfg_pcu_two_phase_cmd,
766 "two-phase-access",
767 "Force two phase access when MS requests single phase access\n",
768 CMD_ATTR_IMMEDIATE)
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200769{
Pau Espin Pedrol03de8982021-01-14 12:48:50 +0100770 the_pcu->vty.force_two_phase = 1;
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200771 return CMD_SUCCESS;
772}
773
Philipp Maier9459ebd2020-09-29 23:31:33 +0200774DEFUN_ATTR(cfg_pcu_no_two_phase,
775 cfg_pcu_no_two_phase_cmd,
776 "no two-phase-access",
777 NO_STR "Only use two phase access when requested my MS\n",
778 CMD_ATTR_IMMEDIATE)
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200779{
Pau Espin Pedrol03de8982021-01-14 12:48:50 +0100780 the_pcu->vty.force_two_phase = 0;
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200781 return CMD_SUCCESS;
782}
783
Philipp Maier9459ebd2020-09-29 23:31:33 +0200784DEFUN_ATTR(cfg_pcu_alpha,
785 cfg_pcu_alpha_cmd,
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100786 "alpha (si13|<0-10>)",
Philipp Maier9459ebd2020-09-29 23:31:33 +0200787 "Alpha parameter for MS power control in units of 0.1 (see TS 05.08) "
788 "NOTE: Be sure to set Alpha value at System information 13 too.\n"
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100789 "Use value received from BSC in System Intormation 13 (default)\n"
790 "Force Alpha in units of 0.1\n",
791 CMD_ATTR_IMMEDIATE | CMD_ATTR_DEPRECATED)
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200792{
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100793 vty_out(vty, "%% 'alpha <0-10>' is now deprecated: use osmo-bsc's 'gprs power-control alpha <0-10>' instead%s",
794 VTY_NEWLINE);
795 if (strcmp(argv[0], "si13") == 0)
796 the_pcu->vty.force_alpha = (uint8_t) -1;
797 else
798 the_pcu->vty.force_alpha = atoi(argv[0]);
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200799 return CMD_SUCCESS;
800}
801
Philipp Maier9459ebd2020-09-29 23:31:33 +0200802DEFUN_ATTR(cfg_pcu_gamma,
803 cfg_pcu_gamma_cmd,
804 "gamma <0-62>",
805 "Gamma parameter for MS power control in units of dB (see TS 05.08)\n"
806 "Gamma in even unit of dBs\n",
807 CMD_ATTR_IMMEDIATE)
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200808{
Pau Espin Pedrola2814952021-01-14 12:53:53 +0100809 the_pcu->vty.gamma = atoi(argv[0]) / 2;
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200810 return CMD_SUCCESS;
811}
812
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +0100813DEFUN(show_bts_stats,
814 show_bts_stats_cmd,
815 "show bts statistics",
816 SHOW_STR "BTS related functionality\nStatistics\n")
817{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +0100818 struct gprs_rlcmac_bts *bts;
819 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
820 vty_out(vty, "BTS%" PRIu8 ":%s", bts->nr, VTY_NEWLINE);
821 vty_out_rate_ctr_group(vty, " ", bts_rate_counters(bts));
822 }
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +0100823 return CMD_SUCCESS;
Daniel Willmann772415f2014-01-15 17:06:51 +0100824}
825
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +0200826DEFUN(show_bts_pdch,
827 show_bts_pdch_cmd,
828 "show bts pdch",
829 SHOW_STR "BTS related functionality\nPDCH timeslots\n")
830{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +0100831 struct gprs_rlcmac_bts *bts;
832 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
833 pcu_vty_show_bts_pdch(vty, bts);
834 }
835 return CMD_SUCCESS;
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +0200836}
837
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100838#define IDLE_TIME_STR "keep an idle DL TBF alive for the time given\n"
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200839DEFUN_DEPRECATED(cfg_pcu_dl_tbf_idle_time,
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100840 cfg_pcu_dl_tbf_idle_time_cmd,
841 "dl-tbf-idle-time <1-5000>",
842 IDLE_TIME_STR "idle time in msec")
843{
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200844 vty_out(vty, "%% 'dl-tbf-idle-time' is now deprecated: use 'timer X2031 <val>' instead%s", VTY_NEWLINE);
845
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100846 if (osmo_tdef_set(the_pcu->T_defs, -2031, atoi(argv[0]), OSMO_TDEF_MS) < 0)
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200847 return CMD_WARNING;
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100848 return CMD_SUCCESS;
849}
850
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200851DEFUN_DEPRECATED(cfg_pcu_no_dl_tbf_idle_time,
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100852 cfg_pcu_no_dl_tbf_idle_time_cmd,
853 "no dl-tbf-idle-time",
854 NO_STR IDLE_TIME_STR)
855{
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200856 vty_out(vty, "%% 'no dl-tbf-idle-time' is now deprecated: use 'timer X2031 0' instead%s", VTY_NEWLINE);
857
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100858 if (osmo_tdef_set(the_pcu->T_defs, -2031, 0, OSMO_TDEF_MS) < 0)
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200859 return CMD_WARNING;
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100860 return CMD_SUCCESS;
861}
862
Oliver Smith45fdc442019-09-05 15:12:20 +0200863#define RETRANSMISSION_STR "retransmit blocks even before the MS had a chance to receive them (better throughput," \
864 " less readable traces)"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200865DEFUN_ATTR(cfg_pcu_dl_tbf_preemptive_retransmission,
866 cfg_pcu_dl_tbf_preemptive_retransmission_cmd,
867 "dl-tbf-preemptive-retransmission",
868 RETRANSMISSION_STR " (enabled by default)",
869 CMD_ATTR_IMMEDIATE)
Oliver Smith45fdc442019-09-05 15:12:20 +0200870{
Pau Espin Pedrol05f9f592021-01-14 12:56:58 +0100871 the_pcu->vty.dl_tbf_preemptive_retransmission = true;
Oliver Smith45fdc442019-09-05 15:12:20 +0200872 return CMD_SUCCESS;
873}
874
Philipp Maier9459ebd2020-09-29 23:31:33 +0200875DEFUN_ATTR(cfg_pcu_no_dl_tbf_preemptive_retransmission,
876 cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd,
877 "no dl-tbf-preemptive-retransmission",
878 NO_STR RETRANSMISSION_STR,
879 CMD_ATTR_IMMEDIATE)
Oliver Smith45fdc442019-09-05 15:12:20 +0200880{
Pau Espin Pedrol05f9f592021-01-14 12:56:58 +0100881 the_pcu->vty.dl_tbf_preemptive_retransmission = false;
Oliver Smith45fdc442019-09-05 15:12:20 +0200882 return CMD_SUCCESS;
883}
884
Jacob Erlbecka098c192015-05-28 16:11:19 +0200885#define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n"
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200886DEFUN_DEPRECATED(cfg_pcu_ms_idle_time,
Jacob Erlbecka098c192015-05-28 16:11:19 +0200887 cfg_pcu_ms_idle_time_cmd,
888 "ms-idle-time <1-7200>",
889 MS_IDLE_TIME_STR "idle time in sec")
890{
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200891 vty_out(vty, "%% 'ms-idle-time' is now deprecated: use 'timer X2030 <val>' instead%s", VTY_NEWLINE);
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100892 if (osmo_tdef_set(the_pcu->T_defs, -2030, atoi(argv[0]), OSMO_TDEF_S) < 0)
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200893 return CMD_WARNING;
Jacob Erlbecka098c192015-05-28 16:11:19 +0200894 return CMD_SUCCESS;
895}
896
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200897DEFUN_DEPRECATED(cfg_pcu_no_ms_idle_time,
Jacob Erlbecka098c192015-05-28 16:11:19 +0200898 cfg_pcu_no_ms_idle_time_cmd,
899 "no ms-idle-time",
900 NO_STR MS_IDLE_TIME_STR)
901{
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200902 vty_out(vty, "%% 'no ms-idle-time' is now deprecated: use 'timer X2030 0' instead%s", VTY_NEWLINE);
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100903 if (osmo_tdef_set(the_pcu->T_defs, -2030, 0, OSMO_TDEF_S) < 0)
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200904 return CMD_WARNING;
Jacob Erlbecka098c192015-05-28 16:11:19 +0200905 return CMD_SUCCESS;
906}
907
Pau Espin Pedrol1e6eb302019-11-28 17:00:44 +0100908#define CS_ERR_LIMITS_STR "set thresholds for error rate based downlink (M)CS adjustment\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200909DEFUN_ATTR(cfg_pcu_cs_err_limits,
910 cfg_pcu_cs_err_limits_cmd,
911 "cs threshold <0-100> <0-100>",
912 CS_STR CS_ERR_LIMITS_STR "lower limit in %\n" "upper limit in %\n",
913 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200914{
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200915 uint8_t lower_limit = atoi(argv[0]);
916 uint8_t upper_limit = atoi(argv[1]);
917
918 if (lower_limit > upper_limit) {
919 vty_out(vty,
920 "The lower limit must be less than or equal to the "
921 "upper limit.%s", VTY_NEWLINE);
922 return CMD_WARNING;
923 }
924
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100925 the_pcu->vty.cs_adj_enabled = true;
926 the_pcu->vty.cs_adj_upper_limit = upper_limit;
927 the_pcu->vty.cs_adj_lower_limit = lower_limit;
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200928
929 return CMD_SUCCESS;
930}
931
Philipp Maier9459ebd2020-09-29 23:31:33 +0200932DEFUN_ATTR(cfg_pcu_no_cs_err_limits,
933 cfg_pcu_no_cs_err_limits_cmd,
934 "no cs threshold",
935 NO_STR CS_STR CS_ERR_LIMITS_STR,
936 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200937{
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100938 the_pcu->vty.cs_adj_enabled = false;
939 the_pcu->vty.cs_adj_upper_limit = 100;
940 the_pcu->vty.cs_adj_lower_limit = 0;
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200941
942 return CMD_SUCCESS;
943}
944
Pau Espin Pedrol1e6eb302019-11-28 17:00:44 +0100945#define CS_DOWNGRADE_STR "set threshold for data size based downlink (M)CS downgrade\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200946DEFUN_ATTR(cfg_pcu_cs_downgrade_thrsh,
947 cfg_pcu_cs_downgrade_thrsh_cmd,
948 "cs downgrade-threshold <1-10000>",
949 CS_STR CS_DOWNGRADE_STR "downgrade if less octets left\n",
950 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200951{
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100952 the_pcu->vty.cs_downgrade_threshold = atoi(argv[0]);
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200953 return CMD_SUCCESS;
954}
955
Philipp Maier9459ebd2020-09-29 23:31:33 +0200956DEFUN_ATTR(cfg_pcu_no_cs_downgrade_thrsh,
957 cfg_pcu_no_cs_downgrade_thrsh_cmd,
958 "no cs downgrade-threshold",
959 NO_STR CS_STR CS_DOWNGRADE_STR,
960 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200961{
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100962 the_pcu->vty.cs_downgrade_threshold = 0;
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200963 return CMD_SUCCESS;
964}
965
Philipp Maier9459ebd2020-09-29 23:31:33 +0200966DEFUN_ATTR(cfg_pcu_cs_lqual_ranges,
967 cfg_pcu_cs_lqual_ranges_cmd,
968 "cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35> cs3 <0-35> <0-35> cs4 <0-35>",
969 CS_STR "Set link quality ranges for each uplink CS\n"
970 "Set quality range for CS-1 (high value only)\n"
971 "CS-1 high (dB)\n"
972 "Set quality range for CS-2\n"
973 "CS-2 low (dB)\n"
974 "CS-2 high (dB)\n"
975 "Set quality range for CS-3\n"
976 "CS-3 low (dB)\n"
977 "CS-3 high (dB)\n"
978 "Set quality range for CS-4 (low value only)\n"
979 "CS-4 low (dB)\n",
980 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200981{
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200982 uint8_t cs1_high = atoi(argv[0]);
983 uint8_t cs2_low = atoi(argv[1]);
984 uint8_t cs2_high = atoi(argv[2]);
985 uint8_t cs3_low = atoi(argv[3]);
986 uint8_t cs3_high = atoi(argv[4]);
987 uint8_t cs4_low = atoi(argv[5]);
988
Pau Espin Pedrol54b159a2021-01-14 13:30:04 +0100989 the_pcu->vty.cs_lqual_ranges[0].high = cs1_high;
990 the_pcu->vty.cs_lqual_ranges[1].low = cs2_low;
991 the_pcu->vty.cs_lqual_ranges[1].high = cs2_high;
992 the_pcu->vty.cs_lqual_ranges[2].low = cs3_low;
993 the_pcu->vty.cs_lqual_ranges[2].high = cs3_high;
994 the_pcu->vty.cs_lqual_ranges[3].low = cs4_low;
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200995
996 return CMD_SUCCESS;
997}
998
Philipp Maier9459ebd2020-09-29 23:31:33 +0200999DEFUN_ATTR(cfg_pcu_mcs_lqual_ranges,
1000 cfg_pcu_mcs_lqual_ranges_cmd,
1001 "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>",
1002 CS_STR "Set link quality ranges for each uplink MCS\n"
1003 "Set quality range for MCS-1 (high value only)\n"
1004 "MCS-1 high (dB)\n"
1005 "Set quality range for MCS-2\n"
1006 "MCS-2 high (dB)\n"
1007 "MCS-2 low (dB)\n"
1008 "Set quality range for MCS-3\n"
1009 "MCS-3 high (dB)\n"
1010 "MCS-3 low (dB)\n"
1011 "Set quality range for MCS-4\n"
1012 "MCS-4 high (dB)\n"
1013 "MCS-4 low (dB)\n"
1014 "Set quality range for MCS-5\n"
1015 "MCS-5 high (dB)\n"
1016 "MCS-5 low (dB)\n"
1017 "Set quality range for MCS-6\n"
1018 "MCS-6 low (dB)\n"
1019 "MCS-6 high (dB)\n"
1020 "Set quality range for MCS-7\n"
1021 "MCS-7 low (dB)\n"
1022 "MCS-7 high (dB)\n"
1023 "Set quality range for MCS-8\n"
1024 "MCS-8 low (dB)\n"
1025 "MCS-8 high (dB)\n"
1026 "Set quality range for MCS-9 (low value only)\n"
1027 "MCS-9 low (dB)\n",
1028 CMD_ATTR_IMMEDIATE)
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001029{
Pau Espin Pedrol54b159a2021-01-14 13:30:04 +01001030 the_pcu->vty.mcs_lqual_ranges[0].high = atoi(argv[0]);
1031 the_pcu->vty.mcs_lqual_ranges[1].low = atoi(argv[1]);
1032 the_pcu->vty.mcs_lqual_ranges[1].high = atoi(argv[2]);
1033 the_pcu->vty.mcs_lqual_ranges[2].low = atoi(argv[3]);
1034 the_pcu->vty.mcs_lqual_ranges[2].high = atoi(argv[4]);
1035 the_pcu->vty.mcs_lqual_ranges[3].low = atoi(argv[5]);
1036 the_pcu->vty.mcs_lqual_ranges[3].high = atoi(argv[6]);
1037 the_pcu->vty.mcs_lqual_ranges[4].low = atoi(argv[7]);
1038 the_pcu->vty.mcs_lqual_ranges[4].high = atoi(argv[8]);
1039 the_pcu->vty.mcs_lqual_ranges[5].low = atoi(argv[9]);
1040 the_pcu->vty.mcs_lqual_ranges[5].high = atoi(argv[10]);
1041 the_pcu->vty.mcs_lqual_ranges[6].low = atoi(argv[11]);
1042 the_pcu->vty.mcs_lqual_ranges[6].high = atoi(argv[12]);
1043 the_pcu->vty.mcs_lqual_ranges[7].low = atoi(argv[13]);
1044 the_pcu->vty.mcs_lqual_ranges[7].high = atoi(argv[14]);
1045 the_pcu->vty.mcs_lqual_ranges[8].low = atoi(argv[15]);
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001046
1047 return CMD_SUCCESS;
1048}
1049
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001050DEFUN(cfg_pcu_sock,
1051 cfg_pcu_sock_cmd,
1052 "pcu-socket PATH",
1053 "Configure the osmo-bts PCU socket file/path name\n"
1054 "Path of the socket to connect to\n")
1055{
Vadim Yanitskiyfc75cc02019-11-30 20:13:25 +07001056 if (vty->type != VTY_FILE)
1057 vty_out(vty, "Changing PCU socket path at run-time has no effect%s", VTY_NEWLINE);
1058
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +01001059 osmo_talloc_replace_string(tall_pcu_ctx, &the_pcu->pcu_sock_path, argv[0]);
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001060
1061 return CMD_SUCCESS;
1062}
Jacob Erlbeck94cde132015-06-09 09:44:36 +02001063
Philipp Maier9459ebd2020-09-29 23:31:33 +02001064DEFUN_USRATTR(cfg_pcu_gb_dialect,
1065 cfg_pcu_gb_dialect_cmd,
1066 X(PCU_VTY_ATTR_NS_RESET),
1067 "gb-dialect (classic|ip-sns)",
1068 "Select which Gb interface dialect to use\n"
1069 "Classic Gb interface with NS-{RESET,BLOCK,UNBLOCK} and static configuration\n"
1070 "Modern Gb interface with IP-SNS (Sub Network Service) and dynamic configuration\n")
Harald Welte57d35152018-07-05 03:11:17 +02001071{
Alexander Couzens290d9032020-09-16 21:52:02 +02001072 if (!strcmp(argv[0], "ip-sns")) {
Alexander Couzensf7ec5252021-01-25 20:28:38 +01001073 the_pcu->vty.ns_dialect = GPRS_NS2_DIALECT_SNS;
Alexander Couzens290d9032020-09-16 21:52:02 +02001074 } else {
Alexander Couzensf7ec5252021-01-25 20:28:38 +01001075 the_pcu->vty.ns_dialect = GPRS_NS2_DIALECT_IPACCESS;
Alexander Couzens290d9032020-09-16 21:52:02 +02001076 }
Harald Welte57d35152018-07-05 03:11:17 +02001077
1078 return CMD_SUCCESS;
1079}
1080
Harald Welted9367e32021-04-29 22:02:47 +02001081DEFUN_USRATTR(cfg_pcu_gb_ip_dscp,
1082 cfg_pcu_gb_ip_dscp_cmd,
1083 X(PCU_VTY_ATTR_NS_RESET),
1084 "gb ip-dscp <0-63>",
1085 "Configure Gb interface\n"
1086 "Set IP DSCP value for outbound packets\n"
1087 "IP DSCP value to use\n")
1088{
1089 the_pcu->vty.ns_ip_dscp = atoi(argv[0]);
1090 return CMD_SUCCESS;
1091}
1092
1093DEFUN_USRATTR(cfg_pcu_gb_priority,
1094 cfg_pcu_gb_priority_cmd,
1095 X(PCU_VTY_ATTR_NS_RESET),
1096 "gb socket-priority <0-255>",
1097 "Configure Gb interface\n"
1098 "Set socket priority value for outbound packets\n"
1099 "Socket priority value to use (>6 requires CAP_NET_ADMIN)")
1100{
1101 the_pcu->vty.ns_priority = atoi(argv[0]);
1102 return CMD_SUCCESS;
1103}
1104
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001105DEFUN(show_bts_timer, show_bts_timer_cmd,
1106 "show bts-timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL,
1107 SHOW_STR "Show BTS controlled timers\n"
1108 OSMO_TDEF_VTY_DOC_T)
1109{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001110 struct gprs_rlcmac_bts *bts;
1111 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1112 const char *T_arg = argc > 0 ? argv[0] : NULL;
1113 vty_out(vty, "BTS%" PRIu8 ":%s", bts->nr, VTY_NEWLINE);
1114 osmo_tdef_vty_show_cmd(vty, bts->T_defs_bts, T_arg, " ");
1115 }
1116 return CMD_SUCCESS;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001117}
1118
1119DEFUN(show_timer, show_timer_cmd,
1120 "show timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL,
1121 SHOW_STR "Show PCU timers\n"
1122 OSMO_TDEF_VTY_DOC_T)
1123{
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001124 const char *T_arg = argc > 0 ? argv[0] : NULL;
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +01001125 return osmo_tdef_vty_show_cmd(vty, the_pcu->T_defs, T_arg, NULL);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001126}
1127
Philipp Maier9459ebd2020-09-29 23:31:33 +02001128DEFUN_ATTR(cfg_pcu_timer, cfg_pcu_timer_cmd,
1129 "timer " OSMO_TDEF_VTY_ARG_SET_OPTIONAL,
1130 "Configure or show PCU timers\n"
1131 OSMO_TDEF_VTY_DOC_SET,
1132 CMD_ATTR_IMMEDIATE)
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001133{
Pau Espin Pedrolab7159f2021-01-26 17:51:44 +01001134 int rc;
1135 struct osmo_tdef *t;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001136 /* If any arguments are missing, redirect to 'show' */
1137 if (argc < 2)
1138 return show_timer(self, vty, argc, argv);
Pau Espin Pedrolab7159f2021-01-26 17:51:44 +01001139 if ((rc = osmo_tdef_vty_set_cmd(vty, the_pcu->T_defs, argv)) != CMD_SUCCESS)
1140 return rc;
1141 t = osmo_tdef_vty_parse_T_arg(vty, the_pcu->T_defs, argv[0]);
1142 switch (t->T) {
1143 case PCU_TDEF_NEIGH_CACHE_ALIVE:
1144 neigh_cache_set_keep_time_interval(the_pcu->neigh_cache, t->val);
1145 break;
1146 case PCU_TDEF_SI_CACHE_ALIVE:
1147 si_cache_set_keep_time_interval(the_pcu->si_cache, t->val);
1148 break;
1149 default:
1150 break;
1151 }
1152 return CMD_SUCCESS;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001153}
1154
Daniel Willmann772415f2014-01-15 17:06:51 +01001155DEFUN(show_tbf,
1156 show_tbf_cmd,
Max12a09872018-02-01 16:07:33 +01001157 "show tbf (all|ccch|pacch)",
1158 SHOW_STR "information about TBFs\n"
1159 "All TBFs\n"
1160 "TBFs allocated via CCCH\n"
1161 "TBFs allocated via PACCH\n")
Daniel Willmann772415f2014-01-15 17:06:51 +01001162{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001163 struct gprs_rlcmac_bts *bts;
1164 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1165 uint32_t flags = UINT32_MAX;
Max12a09872018-02-01 16:07:33 +01001166
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001167 if (argv[0][0] == 'c')
1168 flags = (1 << GPRS_RLCMAC_FLAG_CCCH);
1169 else if (argv[0][0] == 'p')
1170 flags = (1 << GPRS_RLCMAC_FLAG_PACCH);
Max12a09872018-02-01 16:07:33 +01001171
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001172 pcu_vty_show_tbf_all(vty, bts, flags);
1173 }
1174 return CMD_SUCCESS;
Daniel Willmann772415f2014-01-15 17:06:51 +01001175}
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001176
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001177DEFUN(show_ms_all,
1178 show_ms_all_cmd,
1179 "show ms all",
1180 SHOW_STR "information about MSs\n" "All TBFs\n")
1181{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001182 struct gprs_rlcmac_bts *bts;
1183 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1184 pcu_vty_show_ms_all(vty, bts);
1185 }
1186 return CMD_SUCCESS;
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001187}
1188
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001189DEFUN(show_ms_tlli,
1190 show_ms_tlli_cmd,
1191 "show ms tlli TLLI",
1192 SHOW_STR "information about MSs\n" "Select MS by TLLI\n" "TLLI as hex\n")
1193{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001194 struct gprs_rlcmac_bts *bts;
1195 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1196 char *endp = NULL;
1197 unsigned long long tlli = strtoll(argv[0], &endp, 16);
1198 if ((endp != NULL && *endp != 0) || tlli > 0xffffffffULL) {
1199 vty_out(vty, "Invalid TLLI.%s", VTY_NEWLINE);
1200 return CMD_WARNING;
1201 }
1202 pcu_vty_show_ms_by_tlli(vty, bts, (uint32_t)tlli);
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001203 }
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001204 return CMD_SUCCESS;
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001205}
1206
1207DEFUN(show_ms_imsi,
1208 show_ms_imsi_cmd,
1209 "show ms imsi IMSI",
1210 SHOW_STR "information about MSs\n" "Select MS by IMSI\n" "IMSI\n")
1211{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001212 struct gprs_rlcmac_bts *bts;
1213 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1214 pcu_vty_show_ms_by_imsi(vty, bts, argv[0]);
1215 }
1216 return CMD_SUCCESS;
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001217}
1218
Andreas Eversberg12942562012-07-12 14:31:57 +02001219static const char pcu_copyright[] =
Harald Weltef94562a2022-11-11 18:19:06 +01001220 "Copyright (C) 2012-2013 by Ivan Kluchnikov and Andreas Eversberg\r\n"
1221 "Copyright (C) 2013-2022 by sysmocom - s.f.m.c. GmbH\r\n"
Andreas Eversberg12942562012-07-12 14:31:57 +02001222 "License GNU GPL version 2 or later\r\n"
1223 "This is free software: you are free to change and redistribute it.\r\n"
1224 "There is NO WARRANTY, to the extent permitted by law.\r\n";
1225
1226struct vty_app_info pcu_vty_info = {
Pau Espin Pedrold0fc9e82019-11-29 13:37:45 +01001227 .name = "OsmoPCU",
Andreas Eversberg12942562012-07-12 14:31:57 +02001228 .version = PACKAGE_VERSION,
1229 .copyright = pcu_copyright,
Philipp Maier9459ebd2020-09-29 23:31:33 +02001230 .usr_attr_desc = {
1231 [PCU_VTY_ATTR_NEW_TBF] = \
1232 "This command applies when a new TBF is begins",
1233 [PCU_VTY_ATTR_NEW_SUBSCR] = \
1234 "This command applies when a new subscriber attaches",
1235 [PCU_VTY_ATTR_NS_RESET] = \
1236 "This command applies when the NS is reset",
1237 },
1238 .usr_attr_letters = {
1239 [PCU_VTY_ATTR_NEW_TBF] = 'n',
1240 [PCU_VTY_ATTR_NEW_SUBSCR] = 's',
1241 [PCU_VTY_ATTR_NS_RESET] = 'r',
1242 },
Andreas Eversberg12942562012-07-12 14:31:57 +02001243};
1244
Pau Espin Pedrolcd2ac562019-08-05 14:30:44 +02001245int pcu_vty_init(void)
Andreas Eversberg12942562012-07-12 14:31:57 +02001246{
1247// install_element_ve(&show_pcu_cmd);
1248
Harald Welte717cdf52017-07-21 21:56:23 +02001249 cfg_pcu_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names,
1250 "gsmtap-category (",
1251 "|",")", VTY_DO_LOWER);
1252 cfg_pcu_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help,
1253 "GSMTAP Category\n",
1254 "\n", "", 0);
1255 cfg_pcu_no_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names,
1256 "no gsmtap-category (",
1257 "|",")", VTY_DO_LOWER);
1258 cfg_pcu_no_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help,
1259 NO_STR "GSMTAP Category\n",
1260 "\n", "", 0);
1261
Pau Espin Pedrolcd2ac562019-08-05 14:30:44 +02001262 logging_vty_add_cmds();
1263 osmo_stats_vty_add_cmds();
Vadim Yanitskiyd83c8ff2020-02-06 16:46:17 +07001264 osmo_talloc_vty_add_cmds();
Vadim Yanitskiy830ca262021-02-05 23:22:37 +01001265 osmo_fsm_vty_add_cmds();
Andreas Eversberg12942562012-07-12 14:31:57 +02001266
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001267 install_node(&pcu_node, config_write_pcu);
1268 install_element(CONFIG_NODE, &cfg_pcu_cmd);
Jacob Erlbeck953c7892015-09-28 18:12:57 +02001269 install_element(PCU_NODE, &cfg_pcu_egprs_cmd);
1270 install_element(PCU_NODE, &cfg_pcu_no_egprs_cmd);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +02001271 install_element(PCU_NODE, &cfg_pcu_no_two_phase_cmd);
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001272 install_element(PCU_NODE, &cfg_pcu_cs_cmd);
1273 install_element(PCU_NODE, &cfg_pcu_no_cs_cmd);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +02001274 install_element(PCU_NODE, &cfg_pcu_cs_max_cmd);
1275 install_element(PCU_NODE, &cfg_pcu_no_cs_max_cmd);
Jacob Erlbeck8322d082015-06-04 15:12:10 +02001276 install_element(PCU_NODE, &cfg_pcu_cs_err_limits_cmd);
1277 install_element(PCU_NODE, &cfg_pcu_no_cs_err_limits_cmd);
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +02001278 install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd);
1279 install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd);
Jacob Erlbeck94cde132015-06-09 09:44:36 +02001280 install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd);
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001281 install_element(PCU_NODE, &cfg_pcu_mcs_lqual_ranges_cmd);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +01001282 install_element(PCU_NODE, &cfg_pcu_mcs_cmd);
Aravind Sirsikar50b09702016-08-22 17:21:10 +05301283 install_element(PCU_NODE, &cfg_pcu_dl_arq_cmd);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +01001284 install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd);
Jacob Erlbeck0d058052016-01-07 11:48:28 +01001285 install_element(PCU_NODE, &cfg_pcu_mcs_max_cmd);
1286 install_element(PCU_NODE, &cfg_pcu_no_mcs_max_cmd);
Jacob Erlbeck36df7742016-01-19 15:53:30 +01001287 install_element(PCU_NODE, &cfg_pcu_window_size_cmd);
Andreas Eversberg24131bf2012-07-21 11:09:58 +02001288 install_element(PCU_NODE, &cfg_pcu_queue_lifetime_cmd);
1289 install_element(PCU_NODE, &cfg_pcu_queue_lifetime_inf_cmd);
1290 install_element(PCU_NODE, &cfg_pcu_no_queue_lifetime_cmd);
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +01001291 install_element(PCU_NODE, &cfg_pcu_queue_hysteresis_cmd);
1292 install_element(PCU_NODE, &cfg_pcu_no_queue_hysteresis_cmd);
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +02001293 install_element(PCU_NODE, &cfg_pcu_queue_codel_cmd);
1294 install_element(PCU_NODE, &cfg_pcu_queue_codel_interval_cmd);
1295 install_element(PCU_NODE, &cfg_pcu_no_queue_codel_cmd);
Jacob Erlbeckd0261b72015-04-02 13:58:09 +02001296 install_element(PCU_NODE, &cfg_pcu_queue_idle_ack_delay_cmd);
1297 install_element(PCU_NODE, &cfg_pcu_no_queue_idle_ack_delay_cmd);
Andreas Eversberga1503fa2012-07-22 08:58:09 +02001298 install_element(PCU_NODE, &cfg_pcu_alloc_cmd);
Andreas Eversberg07e97cf2012-08-07 16:00:56 +02001299 install_element(PCU_NODE, &cfg_pcu_two_phase_cmd);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +02001300 install_element(PCU_NODE, &cfg_pcu_fc_interval_cmd);
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +02001301 install_element(PCU_NODE, &cfg_pcu_fc_bucket_time_cmd);
1302 install_element(PCU_NODE, &cfg_pcu_no_fc_bucket_time_cmd);
Jacob Erlbeck87d73412015-04-21 12:56:48 +02001303 install_element(PCU_NODE, &cfg_pcu_fc_bvc_bucket_size_cmd);
1304 install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_bucket_size_cmd);
1305 install_element(PCU_NODE, &cfg_pcu_fc_bvc_leak_rate_cmd);
1306 install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_leak_rate_cmd);
1307 install_element(PCU_NODE, &cfg_pcu_fc_ms_bucket_size_cmd);
1308 install_element(PCU_NODE, &cfg_pcu_no_fc_ms_bucket_size_cmd);
1309 install_element(PCU_NODE, &cfg_pcu_fc_ms_leak_rate_cmd);
1310 install_element(PCU_NODE, &cfg_pcu_no_fc_ms_leak_rate_cmd);
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +02001311 install_element(PCU_NODE, &cfg_pcu_alpha_cmd);
1312 install_element(PCU_NODE, &cfg_pcu_gamma_cmd);
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +01001313 install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_cmd);
1314 install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd);
Oliver Smith45fdc442019-09-05 15:12:20 +02001315 install_element(PCU_NODE, &cfg_pcu_dl_tbf_preemptive_retransmission_cmd);
1316 install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd);
Jacob Erlbecka098c192015-05-28 16:11:19 +02001317 install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd);
1318 install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd);
Pau Espin Pedrol13866f02021-11-12 13:42:03 +01001319 install_element(PCU_NODE, &cfg_pcu_gsmtap_remote_host_cmd);
1320 install_element(PCU_NODE, &cfg_pcu_no_gsmtap_remote_host_cmd);
1321 install_element(PCU_NODE, &pcucfg_pcu_gsmtap_categ_all_cmd);
Harald Welte717cdf52017-07-21 21:56:23 +02001322 install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd);
1323 install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd);
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001324 install_element(PCU_NODE, &cfg_pcu_sock_cmd);
Harald Welte57d35152018-07-05 03:11:17 +02001325 install_element(PCU_NODE, &cfg_pcu_gb_dialect_cmd);
Harald Welted9367e32021-04-29 22:02:47 +02001326 install_element(PCU_NODE, &cfg_pcu_gb_ip_dscp_cmd);
1327 install_element(PCU_NODE, &cfg_pcu_gb_priority_cmd);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001328 install_element(PCU_NODE, &cfg_pcu_timer_cmd);
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001329
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001330 install_element_ve(&show_bts_stats_cmd);
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +02001331 install_element_ve(&show_bts_pdch_cmd);
Daniel Willmann772415f2014-01-15 17:06:51 +01001332 install_element_ve(&show_tbf_cmd);
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001333 install_element_ve(&show_ms_all_cmd);
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001334 install_element_ve(&show_ms_tlli_cmd);
1335 install_element_ve(&show_ms_imsi_cmd);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001336 install_element_ve(&show_bts_timer_cmd);
1337 install_element_ve(&show_timer_cmd);
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001338
Andreas Eversberg12942562012-07-12 14:31:57 +02001339 return 0;
1340}