blob: 54e0df6cb921ce13a76160f4fa0fb79913a1ecba [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 Pedrol66e8a492021-02-17 20:24:59 +0100306 if (the_pcu->vty.neigh_ctrl_addr) {
307 vty_out(vty, " neighbor resolution %s %u%s",
308 the_pcu->vty.neigh_ctrl_addr, the_pcu->vty.neigh_ctrl_port, VTY_NEWLINE);
309 }
310
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100311 osmo_tdef_vty_write(vty, the_pcu->T_defs, " timer ");
Pau Espin Pedrol18794422019-09-26 18:25:35 +0200312
Maxc9ce6f92018-01-30 17:53:02 +0100313 return CMD_SUCCESS;
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200314}
315
316/* per-BTS configuration */
Philipp Maier9459ebd2020-09-29 23:31:33 +0200317DEFUN_ATTR(cfg_pcu,
318 cfg_pcu_cmd,
319 "pcu",
320 "BTS specific configure",
321 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200322{
323 vty->node = PCU_NODE;
324
325 return CMD_SUCCESS;
326}
327
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200328#define EGPRS_STR "EGPRS configuration\n"
329
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100330DEFUN_DEPRECATED(cfg_pcu_egprs,
331 cfg_pcu_egprs_cmd,
332 "egprs only",
333 EGPRS_STR "Use EGPRS and disable plain GPRS\n")
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200334{
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100335 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 +0200336 return CMD_SUCCESS;
337}
338
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100339DEFUN_DEPRECATED(cfg_pcu_no_egprs,
340 cfg_pcu_no_egprs_cmd,
341 "no egprs",
342 NO_STR EGPRS_STR)
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200343{
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100344 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 +0200345 return CMD_SUCCESS;
346}
347
Philipp Maier9459ebd2020-09-29 23:31:33 +0200348DEFUN_ATTR(cfg_pcu_fc_interval,
349 cfg_pcu_fc_interval_cmd,
350 "flow-control-interval <1-10>",
351 "Interval between sending subsequent Flow Control PDUs\n"
352 "Interval time in seconds\n",
353 CMD_ATTR_IMMEDIATE)
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200354{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100355 the_pcu->vty.fc_interval = atoi(argv[0]);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200356 return CMD_SUCCESS;
357}
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200358#define FC_STR "BSSGP Flow Control configuration\n"
359#define FC_BMAX_STR(who) "Force a fixed value for the " who " bucket size\n"
360#define FC_LR_STR(who) "Force a fixed value for the " who " leak rate\n"
361
Philipp Maier9459ebd2020-09-29 23:31:33 +0200362DEFUN_ATTR(cfg_pcu_fc_bvc_bucket_size,
363 cfg_pcu_fc_bvc_bucket_size_cmd,
364 "flow-control force-bvc-bucket-size <1-6553500>",
365 FC_STR FC_BMAX_STR("BVC") "Bucket size in octets\n",
366 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200367{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100368 the_pcu->vty.fc_bvc_bucket_size = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200369 return CMD_SUCCESS;
370}
371
Philipp Maier9459ebd2020-09-29 23:31:33 +0200372DEFUN_ATTR(cfg_pcu_no_fc_bvc_bucket_size,
373 cfg_pcu_no_fc_bvc_bucket_size_cmd,
374 "no flow-control force-bvc-bucket-size",
375 NO_STR FC_STR FC_BMAX_STR("BVC"),
376 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200377{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100378 the_pcu->vty.fc_bvc_bucket_size = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200379 return CMD_SUCCESS;
380}
381
Philipp Maier9459ebd2020-09-29 23:31:33 +0200382DEFUN_ATTR(cfg_pcu_fc_bvc_leak_rate,
383 cfg_pcu_fc_bvc_leak_rate_cmd,
384 "flow-control force-bvc-leak-rate <1-6553500>",
385 FC_STR FC_LR_STR("BVC") "Leak rate in bit/s\n",
386 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200387{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100388 the_pcu->vty.fc_bvc_leak_rate = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200389
390 return CMD_SUCCESS;
391}
392
Philipp Maier9459ebd2020-09-29 23:31:33 +0200393DEFUN_ATTR(cfg_pcu_no_fc_bvc_leak_rate,
394 cfg_pcu_no_fc_bvc_leak_rate_cmd,
395 "no flow-control force-bvc-leak-rate",
396 NO_STR FC_STR FC_LR_STR("BVC"),
397 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200398{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100399 the_pcu->vty.fc_bvc_leak_rate = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200400 return CMD_SUCCESS;
401}
402
Philipp Maier9459ebd2020-09-29 23:31:33 +0200403DEFUN_ATTR(cfg_pcu_fc_ms_bucket_size,
404 cfg_pcu_fc_ms_bucket_size_cmd,
405 "flow-control force-ms-bucket-size <1-6553500>",
406 FC_STR FC_BMAX_STR("default MS") "Bucket size in octets\n",
407 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200408{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100409 the_pcu->vty.fc_ms_bucket_size = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200410 return CMD_SUCCESS;
411}
412
Philipp Maier9459ebd2020-09-29 23:31:33 +0200413DEFUN_ATTR(cfg_pcu_no_fc_ms_bucket_size,
414 cfg_pcu_no_fc_ms_bucket_size_cmd,
415 "no flow-control force-ms-bucket-size",
416 NO_STR FC_STR FC_BMAX_STR("default MS"),
417 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200418{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100419 the_pcu->vty.fc_ms_bucket_size = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200420 return CMD_SUCCESS;
421}
422
Philipp Maier9459ebd2020-09-29 23:31:33 +0200423DEFUN_ATTR(cfg_pcu_fc_ms_leak_rate,
424 cfg_pcu_fc_ms_leak_rate_cmd,
425 "flow-control force-ms-leak-rate <1-6553500>",
426 FC_STR FC_LR_STR("default MS") "Leak rate in bit/s\n",
427 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200428{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100429 the_pcu->vty.fc_ms_leak_rate = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200430 return CMD_SUCCESS;
431}
432
Philipp Maier9459ebd2020-09-29 23:31:33 +0200433DEFUN_ATTR(cfg_pcu_no_fc_ms_leak_rate,
434 cfg_pcu_no_fc_ms_leak_rate_cmd,
435 "no flow-control force-ms-leak-rate",
436 NO_STR FC_STR FC_LR_STR("default MS"),
437 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200438{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100439 the_pcu->vty.fc_ms_leak_rate = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200440 return CMD_SUCCESS;
441}
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200442
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200443#define FC_BTIME_STR "Set target downlink maximum queueing time (only affects the advertised bucket size)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200444DEFUN_ATTR(cfg_pcu_fc_bucket_time,
445 cfg_pcu_fc_bucket_time_cmd,
446 "flow-control bucket-time <1-65534>",
447 FC_STR FC_BTIME_STR "Time in centi-seconds\n",
448 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200449{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100450 the_pcu->vty.fc_bucket_time = atoi(argv[0]);
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200451 return CMD_SUCCESS;
452}
453
Philipp Maier9459ebd2020-09-29 23:31:33 +0200454DEFUN_ATTR(cfg_pcu_no_fc_bucket_time,
455 cfg_pcu_no_fc_bucket_time_cmd,
456 "no flow-control bucket-time",
457 NO_STR FC_STR FC_BTIME_STR,
458 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200459{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100460 the_pcu->vty.fc_bucket_time = 0;
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200461 return CMD_SUCCESS;
462}
463
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200464#define CS_STR "Coding Scheme configuration\n"
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200465
Philipp Maier9459ebd2020-09-29 23:31:33 +0200466DEFUN_ATTR(cfg_pcu_cs,
467 cfg_pcu_cs_cmd,
468 "cs <1-4> [<1-4>]",
469 CS_STR
470 "Initial CS value to be used (overrides BTS config)\n"
471 "Use a different initial CS value for the uplink",
472 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200473{
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100474 uint8_t cs_dl, cs_ul;
475 cs_dl = atoi(argv[0]);
Andreas Eversberg499ff412012-10-03 14:21:36 +0200476 if (argc > 1)
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100477 cs_ul = atoi(argv[1]);
Andreas Eversberg499ff412012-10-03 14:21:36 +0200478 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100479 cs_ul = cs_dl;
480 the_pcu->vty.force_initial_cs = true;
481 gprs_pcu_set_initial_cs(the_pcu, cs_dl, cs_ul);
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200482 return CMD_SUCCESS;
483}
484
Philipp Maier9459ebd2020-09-29 23:31:33 +0200485DEFUN_ATTR(cfg_pcu_no_cs,
486 cfg_pcu_no_cs_cmd,
487 "no cs",
488 NO_STR CS_STR,
489 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200490{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100491 the_pcu->vty.force_initial_cs = false;
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100492 gprs_pcu_set_initial_cs(the_pcu, 0, 0);
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200493 return CMD_SUCCESS;
494}
495
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100496#define CS_MAX_STR "Set maximum values for adaptive CS selection (overrides BTS config)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200497DEFUN_ATTR(cfg_pcu_cs_max,
498 cfg_pcu_cs_max_cmd,
499 "cs max <1-4> [<1-4>]",
500 CS_STR
501 CS_MAX_STR
502 "Maximum CS value to be used\n"
503 "Use a different maximum CS value for the uplink",
504 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200505{
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100506 uint8_t cs_dl = atoi(argv[0]);
507 uint8_t cs_ul;
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200508
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200509 if (argc > 1)
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100510 cs_ul = atoi(argv[1]);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200511 else
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100512 cs_ul = cs_dl;
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200513
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100514 gprs_pcu_set_max_cs(the_pcu, cs_dl, cs_ul);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200515 return CMD_SUCCESS;
516}
517
Philipp Maier9459ebd2020-09-29 23:31:33 +0200518DEFUN_ATTR(cfg_pcu_no_cs_max,
519 cfg_pcu_no_cs_max_cmd,
520 "no cs max",
521 NO_STR CS_STR CS_MAX_STR,
522 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200523{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100524 gprs_pcu_set_max_cs(the_pcu, 0, 0);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200525 return CMD_SUCCESS;
526}
527
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100528#define MCS_STR "Modulation and Coding Scheme configuration (EGPRS)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200529DEFUN_ATTR(cfg_pcu_mcs,
530 cfg_pcu_mcs_cmd,
531 "mcs <1-9> [<1-9>]",
532 MCS_STR
533 "Initial MCS value to be used (default 1)\n"
534 "Use a different initial MCS value for the uplink",
535 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100536{
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100537 uint8_t mcs_dl, mcs_ul;
538 mcs_dl = atoi(argv[0]);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100539 if (argc > 1)
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100540 mcs_ul = atoi(argv[1]);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100541 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100542 mcs_ul = mcs_dl;
543 the_pcu->vty.force_initial_mcs = true;
544 gprs_pcu_set_initial_mcs(the_pcu, mcs_dl, mcs_ul);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100545 return CMD_SUCCESS;
546}
547
Philipp Maier9459ebd2020-09-29 23:31:33 +0200548DEFUN_ATTR(cfg_pcu_no_mcs,
549 cfg_pcu_no_mcs_cmd,
550 "no mcs",
551 NO_STR MCS_STR,
552 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100553{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100554 the_pcu->vty.force_initial_mcs = false;
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100555 gprs_pcu_set_initial_mcs(the_pcu, 0, 0);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100556 return CMD_SUCCESS;
557}
558
Philipp Maier9459ebd2020-09-29 23:31:33 +0200559DEFUN_ATTR(cfg_pcu_mcs_max,
560 cfg_pcu_mcs_max_cmd,
561 "mcs max <1-9> [<1-9>]",
562 MCS_STR
563 CS_MAX_STR
564 "Maximum MCS value to be used\n"
565 "Use a different maximum MCS value for the uplink",
566 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100567{
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100568 uint8_t mcs_dl = atoi(argv[0]);
569 uint8_t mcs_ul;
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100570
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100571 if (argc > 1)
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100572 mcs_ul = atoi(argv[1]);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100573 else
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100574 mcs_ul = mcs_dl;
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100575
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100576 gprs_pcu_set_max_mcs(the_pcu, mcs_dl, mcs_ul);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100577 return CMD_SUCCESS;
578}
579
Philipp Maier9459ebd2020-09-29 23:31:33 +0200580DEFUN_ATTR(cfg_pcu_no_mcs_max,
581 cfg_pcu_no_mcs_max_cmd,
582 "no mcs max",
583 NO_STR MCS_STR CS_MAX_STR,
584 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100585{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100586 gprs_pcu_set_max_mcs(the_pcu, 0, 0);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100587 return CMD_SUCCESS;
588}
589
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530590#define DL_STR "downlink specific configuration\n"
591
Philipp Maier9459ebd2020-09-29 23:31:33 +0200592DEFUN_ATTR(cfg_pcu_dl_arq_type,
593 cfg_pcu_dl_arq_cmd,
594 "egprs dl arq-type (spb|arq2)",
595 EGPRS_STR DL_STR "ARQ options\n"
596 "enable SPB(ARQ1) support\n"
597 "enable ARQ2 support",
598 CMD_ATTR_IMMEDIATE)
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530599{
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530600 if (!strcmp(argv[0], "arq2"))
Pau Espin Pedrol97296b22021-01-14 13:08:02 +0100601 the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530602 else
Pau Espin Pedrol97296b22021-01-14 13:08:02 +0100603 the_pcu->vty.dl_arq_type = EGPRS_ARQ1;
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530604
605 return CMD_SUCCESS;
606}
607
Philipp Maier9459ebd2020-09-29 23:31:33 +0200608DEFUN_USRATTR(cfg_pcu_window_size,
609 cfg_pcu_window_size_cmd,
610 X(PCU_VTY_ATTR_NEW_TBF),
611 "window-size <0-1024> [<0-256>]",
612 "Window size configuration (b + N_PDCH * f)\n"
613 "Base value (b)\n"
614 "Factor for number of PDCH (f)")
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100615{
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100616 uint16_t b = atoi(argv[0]);
617
Pau Espin Pedrol519d0712021-01-14 14:30:03 +0100618 the_pcu->vty.ws_base = b;
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100619 if (argc > 1) {
620 uint16_t f = atoi(argv[1]);
Pau Espin Pedrol519d0712021-01-14 14:30:03 +0100621 the_pcu->vty.ws_pdch = f;
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100622 }
623
624 return CMD_SUCCESS;
625}
626
627
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200628#define QUEUE_STR "Packet queue options\n"
629#define LIFETIME_STR "Set lifetime limit of LLC frame in centi-seconds " \
630 "(overrides the value given by SGSN)\n"
631
Philipp Maier9459ebd2020-09-29 23:31:33 +0200632DEFUN_USRATTR(cfg_pcu_queue_lifetime,
633 cfg_pcu_queue_lifetime_cmd,
634 X(PCU_VTY_ATTR_NEW_TBF),
635 "queue lifetime <1-65534>",
636 QUEUE_STR LIFETIME_STR "Lifetime in centi-seconds")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200637{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200638 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100639 the_pcu->vty.force_llc_lifetime = csec;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200640 return CMD_SUCCESS;
641}
642
Philipp Maier9459ebd2020-09-29 23:31:33 +0200643DEFUN_USRATTR(cfg_pcu_queue_lifetime_inf,
644 cfg_pcu_queue_lifetime_inf_cmd,
645 X(PCU_VTY_ATTR_NEW_TBF),
646 "queue lifetime infinite",
647 QUEUE_STR LIFETIME_STR "Infinite lifetime")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200648{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100649 the_pcu->vty.force_llc_lifetime = 0xffff;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200650 return CMD_SUCCESS;
651}
652
Philipp Maier9459ebd2020-09-29 23:31:33 +0200653DEFUN_USRATTR(cfg_pcu_no_queue_lifetime,
654 cfg_pcu_no_queue_lifetime_cmd,
655 X(PCU_VTY_ATTR_NEW_TBF),
656 "no queue lifetime",
657 NO_STR QUEUE_STR "Disable lifetime limit of LLC frame (use value given "
658 "by SGSN)\n")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200659{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100660 the_pcu->vty.force_llc_lifetime = 0;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200661 return CMD_SUCCESS;
662}
663
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100664#define QUEUE_HYSTERESIS_STR "Set lifetime hysteresis of LLC frame in centi-seconds " \
665 "(continue discarding until lifetime-hysteresis is reached)\n"
666
Philipp Maier9459ebd2020-09-29 23:31:33 +0200667DEFUN_USRATTR(cfg_pcu_queue_hysteresis,
668 cfg_pcu_queue_hysteresis_cmd,
669 X(PCU_VTY_ATTR_NEW_TBF),
670 "queue hysteresis <1-65535>",
671 QUEUE_STR QUEUE_HYSTERESIS_STR "Hysteresis in centi-seconds")
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100672{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200673 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100674 the_pcu->vty.llc_discard_csec = csec;
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100675 return CMD_SUCCESS;
676}
677
Philipp Maier9459ebd2020-09-29 23:31:33 +0200678DEFUN_USRATTR(cfg_pcu_no_queue_hysteresis,
679 cfg_pcu_no_queue_hysteresis_cmd,
680 X(PCU_VTY_ATTR_NEW_TBF),
681 "no queue hysteresis",
682 NO_STR QUEUE_STR QUEUE_HYSTERESIS_STR)
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100683{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100684 the_pcu->vty.llc_discard_csec = 0;
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100685 return CMD_SUCCESS;
686}
687
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200688#define QUEUE_CODEL_STR "Set CoDel queue management\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200689DEFUN_USRATTR(cfg_pcu_queue_codel,
690 cfg_pcu_queue_codel_cmd,
691 X(PCU_VTY_ATTR_NEW_SUBSCR),
692 "queue codel",
693 QUEUE_STR QUEUE_CODEL_STR)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200694{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100695 the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200696 return CMD_SUCCESS;
697}
698
Philipp Maier9459ebd2020-09-29 23:31:33 +0200699DEFUN_USRATTR(cfg_pcu_queue_codel_interval,
700 cfg_pcu_queue_codel_interval_cmd,
701 X(PCU_VTY_ATTR_NEW_SUBSCR),
702 "queue codel interval <1-1000>",
703 QUEUE_STR QUEUE_CODEL_STR "Specify interval\n" "Interval in centi-seconds")
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200704{
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200705 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100706 the_pcu->vty.llc_codel_interval_msec = 10*csec;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200707 return CMD_SUCCESS;
708}
709
Philipp Maier9459ebd2020-09-29 23:31:33 +0200710DEFUN_USRATTR(cfg_pcu_no_queue_codel,
711 cfg_pcu_no_queue_codel_cmd,
712 X(PCU_VTY_ATTR_NEW_SUBSCR),
713 "no queue codel",
714 NO_STR QUEUE_STR QUEUE_CODEL_STR)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200715{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100716 the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_DISABLE;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200717 return CMD_SUCCESS;
718}
719
720
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200721#define QUEUE_IDLE_ACK_STR "Request an ACK after the last DL LLC frame in centi-seconds\n"
722
Philipp Maier9459ebd2020-09-29 23:31:33 +0200723DEFUN_ATTR(cfg_pcu_queue_idle_ack_delay,
724 cfg_pcu_queue_idle_ack_delay_cmd,
725 "queue idle-ack-delay <1-65535>",
726 QUEUE_STR QUEUE_IDLE_ACK_STR "Idle ACK delay in centi-seconds",
727 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200728{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200729 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100730 the_pcu->vty.llc_idle_ack_csec = csec;
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200731 return CMD_SUCCESS;
732}
733
Philipp Maier9459ebd2020-09-29 23:31:33 +0200734DEFUN_ATTR(cfg_pcu_no_queue_idle_ack_delay,
735 cfg_pcu_no_queue_idle_ack_delay_cmd,
736 "no queue idle-ack-delay",
737 NO_STR QUEUE_STR QUEUE_IDLE_ACK_STR,
738 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200739{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100740 the_pcu->vty.llc_idle_ack_csec = 0;
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200741 return CMD_SUCCESS;
742}
743
Philipp Maier9459ebd2020-09-29 23:31:33 +0200744DEFUN_ATTR(cfg_pcu_alloc,
745 cfg_pcu_alloc_cmd,
746 "alloc-algorithm (a|b|dynamic)",
747 "Select slot allocation algorithm to use when assigning timeslots on "
748 "PACCH\n"
749 "Single slot is assigned only\n"
750 "Multiple slots are assigned for semi-duplex operation\n"
751 "Dynamically select the algorithm based on the system state\n",
752 CMD_ATTR_IMMEDIATE)
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200753{
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200754 switch (argv[0][0]) {
755 case 'a':
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100756 the_pcu->alloc_algorithm = alloc_algorithm_a;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200757 break;
758 case 'b':
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100759 the_pcu->alloc_algorithm = alloc_algorithm_b;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200760 break;
Jacob Erlbeck400ec022015-07-14 13:31:48 +0200761 default:
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100762 the_pcu->alloc_algorithm = alloc_algorithm_dynamic;
Jacob Erlbeck400ec022015-07-14 13:31:48 +0200763 break;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200764 }
765
766 return CMD_SUCCESS;
767}
768
Philipp Maier9459ebd2020-09-29 23:31:33 +0200769DEFUN_ATTR(cfg_pcu_two_phase,
770 cfg_pcu_two_phase_cmd,
771 "two-phase-access",
772 "Force two phase access when MS requests single phase access\n",
773 CMD_ATTR_IMMEDIATE)
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200774{
Pau Espin Pedrol03de8982021-01-14 12:48:50 +0100775 the_pcu->vty.force_two_phase = 1;
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200776 return CMD_SUCCESS;
777}
778
Philipp Maier9459ebd2020-09-29 23:31:33 +0200779DEFUN_ATTR(cfg_pcu_no_two_phase,
780 cfg_pcu_no_two_phase_cmd,
781 "no two-phase-access",
782 NO_STR "Only use two phase access when requested my MS\n",
783 CMD_ATTR_IMMEDIATE)
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200784{
Pau Espin Pedrol03de8982021-01-14 12:48:50 +0100785 the_pcu->vty.force_two_phase = 0;
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200786 return CMD_SUCCESS;
787}
788
Philipp Maier9459ebd2020-09-29 23:31:33 +0200789DEFUN_ATTR(cfg_pcu_alpha,
790 cfg_pcu_alpha_cmd,
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100791 "alpha (si13|<0-10>)",
Philipp Maier9459ebd2020-09-29 23:31:33 +0200792 "Alpha parameter for MS power control in units of 0.1 (see TS 05.08) "
793 "NOTE: Be sure to set Alpha value at System information 13 too.\n"
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100794 "Use value received from BSC in System Intormation 13 (default)\n"
795 "Force Alpha in units of 0.1\n",
796 CMD_ATTR_IMMEDIATE | CMD_ATTR_DEPRECATED)
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200797{
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100798 vty_out(vty, "%% 'alpha <0-10>' is now deprecated: use osmo-bsc's 'gprs power-control alpha <0-10>' instead%s",
799 VTY_NEWLINE);
800 if (strcmp(argv[0], "si13") == 0)
801 the_pcu->vty.force_alpha = (uint8_t) -1;
802 else
803 the_pcu->vty.force_alpha = atoi(argv[0]);
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200804 return CMD_SUCCESS;
805}
806
Philipp Maier9459ebd2020-09-29 23:31:33 +0200807DEFUN_ATTR(cfg_pcu_gamma,
808 cfg_pcu_gamma_cmd,
809 "gamma <0-62>",
810 "Gamma parameter for MS power control in units of dB (see TS 05.08)\n"
811 "Gamma in even unit of dBs\n",
812 CMD_ATTR_IMMEDIATE)
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200813{
Pau Espin Pedrola2814952021-01-14 12:53:53 +0100814 the_pcu->vty.gamma = atoi(argv[0]) / 2;
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200815 return CMD_SUCCESS;
816}
817
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +0100818DEFUN(show_bts_stats,
819 show_bts_stats_cmd,
820 "show bts statistics",
821 SHOW_STR "BTS related functionality\nStatistics\n")
822{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +0100823 struct gprs_rlcmac_bts *bts;
824 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
825 vty_out(vty, "BTS%" PRIu8 ":%s", bts->nr, VTY_NEWLINE);
826 vty_out_rate_ctr_group(vty, " ", bts_rate_counters(bts));
827 }
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +0100828 return CMD_SUCCESS;
Daniel Willmann772415f2014-01-15 17:06:51 +0100829}
830
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +0200831DEFUN(show_bts_pdch,
832 show_bts_pdch_cmd,
833 "show bts pdch",
834 SHOW_STR "BTS related functionality\nPDCH timeslots\n")
835{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +0100836 struct gprs_rlcmac_bts *bts;
837 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
838 pcu_vty_show_bts_pdch(vty, bts);
839 }
840 return CMD_SUCCESS;
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +0200841}
842
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100843#define IDLE_TIME_STR "keep an idle DL TBF alive for the time given\n"
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200844DEFUN_DEPRECATED(cfg_pcu_dl_tbf_idle_time,
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100845 cfg_pcu_dl_tbf_idle_time_cmd,
846 "dl-tbf-idle-time <1-5000>",
847 IDLE_TIME_STR "idle time in msec")
848{
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200849 vty_out(vty, "%% 'dl-tbf-idle-time' is now deprecated: use 'timer X2031 <val>' instead%s", VTY_NEWLINE);
850
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100851 if (osmo_tdef_set(the_pcu->T_defs, -2031, atoi(argv[0]), OSMO_TDEF_MS) < 0)
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200852 return CMD_WARNING;
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100853 return CMD_SUCCESS;
854}
855
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200856DEFUN_DEPRECATED(cfg_pcu_no_dl_tbf_idle_time,
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100857 cfg_pcu_no_dl_tbf_idle_time_cmd,
858 "no dl-tbf-idle-time",
859 NO_STR IDLE_TIME_STR)
860{
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200861 vty_out(vty, "%% 'no dl-tbf-idle-time' is now deprecated: use 'timer X2031 0' instead%s", VTY_NEWLINE);
862
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100863 if (osmo_tdef_set(the_pcu->T_defs, -2031, 0, OSMO_TDEF_MS) < 0)
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200864 return CMD_WARNING;
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100865 return CMD_SUCCESS;
866}
867
Oliver Smith45fdc442019-09-05 15:12:20 +0200868#define RETRANSMISSION_STR "retransmit blocks even before the MS had a chance to receive them (better throughput," \
869 " less readable traces)"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200870DEFUN_ATTR(cfg_pcu_dl_tbf_preemptive_retransmission,
871 cfg_pcu_dl_tbf_preemptive_retransmission_cmd,
872 "dl-tbf-preemptive-retransmission",
873 RETRANSMISSION_STR " (enabled by default)",
874 CMD_ATTR_IMMEDIATE)
Oliver Smith45fdc442019-09-05 15:12:20 +0200875{
Pau Espin Pedrol05f9f592021-01-14 12:56:58 +0100876 the_pcu->vty.dl_tbf_preemptive_retransmission = true;
Oliver Smith45fdc442019-09-05 15:12:20 +0200877 return CMD_SUCCESS;
878}
879
Philipp Maier9459ebd2020-09-29 23:31:33 +0200880DEFUN_ATTR(cfg_pcu_no_dl_tbf_preemptive_retransmission,
881 cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd,
882 "no dl-tbf-preemptive-retransmission",
883 NO_STR RETRANSMISSION_STR,
884 CMD_ATTR_IMMEDIATE)
Oliver Smith45fdc442019-09-05 15:12:20 +0200885{
Pau Espin Pedrol05f9f592021-01-14 12:56:58 +0100886 the_pcu->vty.dl_tbf_preemptive_retransmission = false;
Oliver Smith45fdc442019-09-05 15:12:20 +0200887 return CMD_SUCCESS;
888}
889
Jacob Erlbecka098c192015-05-28 16:11:19 +0200890#define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n"
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200891DEFUN_DEPRECATED(cfg_pcu_ms_idle_time,
Jacob Erlbecka098c192015-05-28 16:11:19 +0200892 cfg_pcu_ms_idle_time_cmd,
893 "ms-idle-time <1-7200>",
894 MS_IDLE_TIME_STR "idle time in sec")
895{
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200896 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 +0100897 if (osmo_tdef_set(the_pcu->T_defs, -2030, atoi(argv[0]), OSMO_TDEF_S) < 0)
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200898 return CMD_WARNING;
Jacob Erlbecka098c192015-05-28 16:11:19 +0200899 return CMD_SUCCESS;
900}
901
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200902DEFUN_DEPRECATED(cfg_pcu_no_ms_idle_time,
Jacob Erlbecka098c192015-05-28 16:11:19 +0200903 cfg_pcu_no_ms_idle_time_cmd,
904 "no ms-idle-time",
905 NO_STR MS_IDLE_TIME_STR)
906{
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200907 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 +0100908 if (osmo_tdef_set(the_pcu->T_defs, -2030, 0, OSMO_TDEF_S) < 0)
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200909 return CMD_WARNING;
Jacob Erlbecka098c192015-05-28 16:11:19 +0200910 return CMD_SUCCESS;
911}
912
Pau Espin Pedrol1e6eb302019-11-28 17:00:44 +0100913#define CS_ERR_LIMITS_STR "set thresholds for error rate based downlink (M)CS adjustment\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200914DEFUN_ATTR(cfg_pcu_cs_err_limits,
915 cfg_pcu_cs_err_limits_cmd,
916 "cs threshold <0-100> <0-100>",
917 CS_STR CS_ERR_LIMITS_STR "lower limit in %\n" "upper limit in %\n",
918 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200919{
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200920 uint8_t lower_limit = atoi(argv[0]);
921 uint8_t upper_limit = atoi(argv[1]);
922
923 if (lower_limit > upper_limit) {
924 vty_out(vty,
925 "The lower limit must be less than or equal to the "
926 "upper limit.%s", VTY_NEWLINE);
927 return CMD_WARNING;
928 }
929
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100930 the_pcu->vty.cs_adj_enabled = true;
931 the_pcu->vty.cs_adj_upper_limit = upper_limit;
932 the_pcu->vty.cs_adj_lower_limit = lower_limit;
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200933
934 return CMD_SUCCESS;
935}
936
Philipp Maier9459ebd2020-09-29 23:31:33 +0200937DEFUN_ATTR(cfg_pcu_no_cs_err_limits,
938 cfg_pcu_no_cs_err_limits_cmd,
939 "no cs threshold",
940 NO_STR CS_STR CS_ERR_LIMITS_STR,
941 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200942{
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100943 the_pcu->vty.cs_adj_enabled = false;
944 the_pcu->vty.cs_adj_upper_limit = 100;
945 the_pcu->vty.cs_adj_lower_limit = 0;
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200946
947 return CMD_SUCCESS;
948}
949
Pau Espin Pedrol1e6eb302019-11-28 17:00:44 +0100950#define CS_DOWNGRADE_STR "set threshold for data size based downlink (M)CS downgrade\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200951DEFUN_ATTR(cfg_pcu_cs_downgrade_thrsh,
952 cfg_pcu_cs_downgrade_thrsh_cmd,
953 "cs downgrade-threshold <1-10000>",
954 CS_STR CS_DOWNGRADE_STR "downgrade if less octets left\n",
955 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200956{
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100957 the_pcu->vty.cs_downgrade_threshold = atoi(argv[0]);
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200958 return CMD_SUCCESS;
959}
960
Philipp Maier9459ebd2020-09-29 23:31:33 +0200961DEFUN_ATTR(cfg_pcu_no_cs_downgrade_thrsh,
962 cfg_pcu_no_cs_downgrade_thrsh_cmd,
963 "no cs downgrade-threshold",
964 NO_STR CS_STR CS_DOWNGRADE_STR,
965 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200966{
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100967 the_pcu->vty.cs_downgrade_threshold = 0;
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200968 return CMD_SUCCESS;
969}
970
Philipp Maier9459ebd2020-09-29 23:31:33 +0200971DEFUN_ATTR(cfg_pcu_cs_lqual_ranges,
972 cfg_pcu_cs_lqual_ranges_cmd,
973 "cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35> cs3 <0-35> <0-35> cs4 <0-35>",
974 CS_STR "Set link quality ranges for each uplink CS\n"
975 "Set quality range for CS-1 (high value only)\n"
976 "CS-1 high (dB)\n"
977 "Set quality range for CS-2\n"
978 "CS-2 low (dB)\n"
979 "CS-2 high (dB)\n"
980 "Set quality range for CS-3\n"
981 "CS-3 low (dB)\n"
982 "CS-3 high (dB)\n"
983 "Set quality range for CS-4 (low value only)\n"
984 "CS-4 low (dB)\n",
985 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200986{
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200987 uint8_t cs1_high = atoi(argv[0]);
988 uint8_t cs2_low = atoi(argv[1]);
989 uint8_t cs2_high = atoi(argv[2]);
990 uint8_t cs3_low = atoi(argv[3]);
991 uint8_t cs3_high = atoi(argv[4]);
992 uint8_t cs4_low = atoi(argv[5]);
993
Pau Espin Pedrol54b159a2021-01-14 13:30:04 +0100994 the_pcu->vty.cs_lqual_ranges[0].high = cs1_high;
995 the_pcu->vty.cs_lqual_ranges[1].low = cs2_low;
996 the_pcu->vty.cs_lqual_ranges[1].high = cs2_high;
997 the_pcu->vty.cs_lqual_ranges[2].low = cs3_low;
998 the_pcu->vty.cs_lqual_ranges[2].high = cs3_high;
999 the_pcu->vty.cs_lqual_ranges[3].low = cs4_low;
Jacob Erlbeck94cde132015-06-09 09:44:36 +02001000
1001 return CMD_SUCCESS;
1002}
1003
Philipp Maier9459ebd2020-09-29 23:31:33 +02001004DEFUN_ATTR(cfg_pcu_mcs_lqual_ranges,
1005 cfg_pcu_mcs_lqual_ranges_cmd,
1006 "mcs link-quality-ranges mcs1 <0-35> mcs2 <0-35> <0-35> mcs3 <0-35> <0-35> mcs4 <0-35> <0-35> mcs5 <0-35> <0-35> mcs6 <0-35> <0-35> mcs7 <0-35> <0-35> mcs8 <0-35> <0-35> mcs9 <0-35>",
1007 CS_STR "Set link quality ranges for each uplink MCS\n"
1008 "Set quality range for MCS-1 (high value only)\n"
1009 "MCS-1 high (dB)\n"
1010 "Set quality range for MCS-2\n"
1011 "MCS-2 high (dB)\n"
1012 "MCS-2 low (dB)\n"
1013 "Set quality range for MCS-3\n"
1014 "MCS-3 high (dB)\n"
1015 "MCS-3 low (dB)\n"
1016 "Set quality range for MCS-4\n"
1017 "MCS-4 high (dB)\n"
1018 "MCS-4 low (dB)\n"
1019 "Set quality range for MCS-5\n"
1020 "MCS-5 high (dB)\n"
1021 "MCS-5 low (dB)\n"
1022 "Set quality range for MCS-6\n"
1023 "MCS-6 low (dB)\n"
1024 "MCS-6 high (dB)\n"
1025 "Set quality range for MCS-7\n"
1026 "MCS-7 low (dB)\n"
1027 "MCS-7 high (dB)\n"
1028 "Set quality range for MCS-8\n"
1029 "MCS-8 low (dB)\n"
1030 "MCS-8 high (dB)\n"
1031 "Set quality range for MCS-9 (low value only)\n"
1032 "MCS-9 low (dB)\n",
1033 CMD_ATTR_IMMEDIATE)
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001034{
Pau Espin Pedrol54b159a2021-01-14 13:30:04 +01001035 the_pcu->vty.mcs_lqual_ranges[0].high = atoi(argv[0]);
1036 the_pcu->vty.mcs_lqual_ranges[1].low = atoi(argv[1]);
1037 the_pcu->vty.mcs_lqual_ranges[1].high = atoi(argv[2]);
1038 the_pcu->vty.mcs_lqual_ranges[2].low = atoi(argv[3]);
1039 the_pcu->vty.mcs_lqual_ranges[2].high = atoi(argv[4]);
1040 the_pcu->vty.mcs_lqual_ranges[3].low = atoi(argv[5]);
1041 the_pcu->vty.mcs_lqual_ranges[3].high = atoi(argv[6]);
1042 the_pcu->vty.mcs_lqual_ranges[4].low = atoi(argv[7]);
1043 the_pcu->vty.mcs_lqual_ranges[4].high = atoi(argv[8]);
1044 the_pcu->vty.mcs_lqual_ranges[5].low = atoi(argv[9]);
1045 the_pcu->vty.mcs_lqual_ranges[5].high = atoi(argv[10]);
1046 the_pcu->vty.mcs_lqual_ranges[6].low = atoi(argv[11]);
1047 the_pcu->vty.mcs_lqual_ranges[6].high = atoi(argv[12]);
1048 the_pcu->vty.mcs_lqual_ranges[7].low = atoi(argv[13]);
1049 the_pcu->vty.mcs_lqual_ranges[7].high = atoi(argv[14]);
1050 the_pcu->vty.mcs_lqual_ranges[8].low = atoi(argv[15]);
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001051
1052 return CMD_SUCCESS;
1053}
1054
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001055DEFUN(cfg_pcu_sock,
1056 cfg_pcu_sock_cmd,
1057 "pcu-socket PATH",
1058 "Configure the osmo-bts PCU socket file/path name\n"
1059 "Path of the socket to connect to\n")
1060{
Vadim Yanitskiyfc75cc02019-11-30 20:13:25 +07001061 if (vty->type != VTY_FILE)
1062 vty_out(vty, "Changing PCU socket path at run-time has no effect%s", VTY_NEWLINE);
1063
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +01001064 osmo_talloc_replace_string(tall_pcu_ctx, &the_pcu->pcu_sock_path, argv[0]);
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001065
1066 return CMD_SUCCESS;
1067}
Jacob Erlbeck94cde132015-06-09 09:44:36 +02001068
Philipp Maier9459ebd2020-09-29 23:31:33 +02001069DEFUN_USRATTR(cfg_pcu_gb_dialect,
1070 cfg_pcu_gb_dialect_cmd,
1071 X(PCU_VTY_ATTR_NS_RESET),
1072 "gb-dialect (classic|ip-sns)",
1073 "Select which Gb interface dialect to use\n"
1074 "Classic Gb interface with NS-{RESET,BLOCK,UNBLOCK} and static configuration\n"
1075 "Modern Gb interface with IP-SNS (Sub Network Service) and dynamic configuration\n")
Harald Welte57d35152018-07-05 03:11:17 +02001076{
Alexander Couzens290d9032020-09-16 21:52:02 +02001077 if (!strcmp(argv[0], "ip-sns")) {
Alexander Couzensf7ec5252021-01-25 20:28:38 +01001078 the_pcu->vty.ns_dialect = GPRS_NS2_DIALECT_SNS;
Alexander Couzens290d9032020-09-16 21:52:02 +02001079 } else {
Alexander Couzensf7ec5252021-01-25 20:28:38 +01001080 the_pcu->vty.ns_dialect = GPRS_NS2_DIALECT_IPACCESS;
Alexander Couzens290d9032020-09-16 21:52:02 +02001081 }
Harald Welte57d35152018-07-05 03:11:17 +02001082
1083 return CMD_SUCCESS;
1084}
1085
Harald Welted9367e32021-04-29 22:02:47 +02001086DEFUN_USRATTR(cfg_pcu_gb_ip_dscp,
1087 cfg_pcu_gb_ip_dscp_cmd,
1088 X(PCU_VTY_ATTR_NS_RESET),
1089 "gb ip-dscp <0-63>",
1090 "Configure Gb interface\n"
1091 "Set IP DSCP value for outbound packets\n"
1092 "IP DSCP value to use\n")
1093{
1094 the_pcu->vty.ns_ip_dscp = atoi(argv[0]);
1095 return CMD_SUCCESS;
1096}
1097
1098DEFUN_USRATTR(cfg_pcu_gb_priority,
1099 cfg_pcu_gb_priority_cmd,
1100 X(PCU_VTY_ATTR_NS_RESET),
1101 "gb socket-priority <0-255>",
1102 "Configure Gb interface\n"
1103 "Set socket priority value for outbound packets\n"
1104 "Socket priority value to use (>6 requires CAP_NET_ADMIN)")
1105{
1106 the_pcu->vty.ns_priority = atoi(argv[0]);
1107 return CMD_SUCCESS;
1108}
1109
Pau Espin Pedrolc0a250d2021-01-21 18:46:13 +01001110DEFUN(cfg_neighbor_resolution, cfg_neighbor_resolution_cmd,
1111 "neighbor resolution " VTY_IPV46_CMD " [<0-65535>]",
1112 "Manage local and remote-BSS neighbor cells\n"
1113 "Connect to Neighbor Resolution Service (CTRL interface) to given ip and port\n"
1114 "IPv4 address to connect to\n" "IPv6 address to connect to\n"
1115 "Port to connect to (default 4248)\n")
1116{
Pau Espin Pedrol5557c0a2021-09-07 14:09:50 +02001117 vty_out(vty, "%% Warning: The CTRL interface for Neighbor Address Resolution is now deprecated."
1118 "Upgrade osmo-bsc and drop the 'neighbor resolution " VTY_IPV46_CMD " [<0-65535>]' VTY "
1119 "option in order to let osmo-pcu use the new resoluton method using the PCUIF over IPA "
1120 "multiplex, which will work out of the box without required configuration.%s", VTY_NEWLINE);
Pau Espin Pedrolc0a250d2021-01-21 18:46:13 +01001121 osmo_talloc_replace_string(the_pcu, &the_pcu->vty.neigh_ctrl_addr, argv[0]);
1122 if (argc > 1)
1123 the_pcu->vty.neigh_ctrl_port = atoi(argv[1]);
1124 else
1125 the_pcu->vty.neigh_ctrl_port = OSMO_CTRL_PORT_BSC_NEIGH;
1126 return CMD_SUCCESS;
1127}
1128
1129
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001130DEFUN(show_bts_timer, show_bts_timer_cmd,
1131 "show bts-timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL,
1132 SHOW_STR "Show BTS controlled timers\n"
1133 OSMO_TDEF_VTY_DOC_T)
1134{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001135 struct gprs_rlcmac_bts *bts;
1136 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1137 const char *T_arg = argc > 0 ? argv[0] : NULL;
1138 vty_out(vty, "BTS%" PRIu8 ":%s", bts->nr, VTY_NEWLINE);
1139 osmo_tdef_vty_show_cmd(vty, bts->T_defs_bts, T_arg, " ");
1140 }
1141 return CMD_SUCCESS;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001142}
1143
1144DEFUN(show_timer, show_timer_cmd,
1145 "show timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL,
1146 SHOW_STR "Show PCU timers\n"
1147 OSMO_TDEF_VTY_DOC_T)
1148{
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001149 const char *T_arg = argc > 0 ? argv[0] : NULL;
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +01001150 return osmo_tdef_vty_show_cmd(vty, the_pcu->T_defs, T_arg, NULL);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001151}
1152
Philipp Maier9459ebd2020-09-29 23:31:33 +02001153DEFUN_ATTR(cfg_pcu_timer, cfg_pcu_timer_cmd,
1154 "timer " OSMO_TDEF_VTY_ARG_SET_OPTIONAL,
1155 "Configure or show PCU timers\n"
1156 OSMO_TDEF_VTY_DOC_SET,
1157 CMD_ATTR_IMMEDIATE)
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001158{
Pau Espin Pedrolab7159f2021-01-26 17:51:44 +01001159 int rc;
1160 struct osmo_tdef *t;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001161 /* If any arguments are missing, redirect to 'show' */
1162 if (argc < 2)
1163 return show_timer(self, vty, argc, argv);
Pau Espin Pedrolab7159f2021-01-26 17:51:44 +01001164 if ((rc = osmo_tdef_vty_set_cmd(vty, the_pcu->T_defs, argv)) != CMD_SUCCESS)
1165 return rc;
1166 t = osmo_tdef_vty_parse_T_arg(vty, the_pcu->T_defs, argv[0]);
1167 switch (t->T) {
1168 case PCU_TDEF_NEIGH_CACHE_ALIVE:
1169 neigh_cache_set_keep_time_interval(the_pcu->neigh_cache, t->val);
1170 break;
1171 case PCU_TDEF_SI_CACHE_ALIVE:
1172 si_cache_set_keep_time_interval(the_pcu->si_cache, t->val);
1173 break;
1174 default:
1175 break;
1176 }
1177 return CMD_SUCCESS;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001178}
1179
Daniel Willmann772415f2014-01-15 17:06:51 +01001180DEFUN(show_tbf,
1181 show_tbf_cmd,
Max12a09872018-02-01 16:07:33 +01001182 "show tbf (all|ccch|pacch)",
1183 SHOW_STR "information about TBFs\n"
1184 "All TBFs\n"
1185 "TBFs allocated via CCCH\n"
1186 "TBFs allocated via PACCH\n")
Daniel Willmann772415f2014-01-15 17:06:51 +01001187{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001188 struct gprs_rlcmac_bts *bts;
1189 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1190 uint32_t flags = UINT32_MAX;
Max12a09872018-02-01 16:07:33 +01001191
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001192 if (argv[0][0] == 'c')
1193 flags = (1 << GPRS_RLCMAC_FLAG_CCCH);
1194 else if (argv[0][0] == 'p')
1195 flags = (1 << GPRS_RLCMAC_FLAG_PACCH);
Max12a09872018-02-01 16:07:33 +01001196
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001197 pcu_vty_show_tbf_all(vty, bts, flags);
1198 }
1199 return CMD_SUCCESS;
Daniel Willmann772415f2014-01-15 17:06:51 +01001200}
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001201
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001202DEFUN(show_ms_all,
1203 show_ms_all_cmd,
1204 "show ms all",
1205 SHOW_STR "information about MSs\n" "All TBFs\n")
1206{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001207 struct gprs_rlcmac_bts *bts;
1208 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1209 pcu_vty_show_ms_all(vty, bts);
1210 }
1211 return CMD_SUCCESS;
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001212}
1213
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001214DEFUN(show_ms_tlli,
1215 show_ms_tlli_cmd,
1216 "show ms tlli TLLI",
1217 SHOW_STR "information about MSs\n" "Select MS by TLLI\n" "TLLI as hex\n")
1218{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001219 struct gprs_rlcmac_bts *bts;
1220 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1221 char *endp = NULL;
1222 unsigned long long tlli = strtoll(argv[0], &endp, 16);
1223 if ((endp != NULL && *endp != 0) || tlli > 0xffffffffULL) {
1224 vty_out(vty, "Invalid TLLI.%s", VTY_NEWLINE);
1225 return CMD_WARNING;
1226 }
1227 pcu_vty_show_ms_by_tlli(vty, bts, (uint32_t)tlli);
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001228 }
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001229 return CMD_SUCCESS;
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001230}
1231
1232DEFUN(show_ms_imsi,
1233 show_ms_imsi_cmd,
1234 "show ms imsi IMSI",
1235 SHOW_STR "information about MSs\n" "Select MS by IMSI\n" "IMSI\n")
1236{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001237 struct gprs_rlcmac_bts *bts;
1238 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1239 pcu_vty_show_ms_by_imsi(vty, bts, argv[0]);
1240 }
1241 return CMD_SUCCESS;
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001242}
1243
Andreas Eversberg12942562012-07-12 14:31:57 +02001244static const char pcu_copyright[] =
Harald Weltef94562a2022-11-11 18:19:06 +01001245 "Copyright (C) 2012-2013 by Ivan Kluchnikov and Andreas Eversberg\r\n"
1246 "Copyright (C) 2013-2022 by sysmocom - s.f.m.c. GmbH\r\n"
Andreas Eversberg12942562012-07-12 14:31:57 +02001247 "License GNU GPL version 2 or later\r\n"
1248 "This is free software: you are free to change and redistribute it.\r\n"
1249 "There is NO WARRANTY, to the extent permitted by law.\r\n";
1250
1251struct vty_app_info pcu_vty_info = {
Pau Espin Pedrold0fc9e82019-11-29 13:37:45 +01001252 .name = "OsmoPCU",
Andreas Eversberg12942562012-07-12 14:31:57 +02001253 .version = PACKAGE_VERSION,
1254 .copyright = pcu_copyright,
Philipp Maier9459ebd2020-09-29 23:31:33 +02001255 .usr_attr_desc = {
1256 [PCU_VTY_ATTR_NEW_TBF] = \
1257 "This command applies when a new TBF is begins",
1258 [PCU_VTY_ATTR_NEW_SUBSCR] = \
1259 "This command applies when a new subscriber attaches",
1260 [PCU_VTY_ATTR_NS_RESET] = \
1261 "This command applies when the NS is reset",
1262 },
1263 .usr_attr_letters = {
1264 [PCU_VTY_ATTR_NEW_TBF] = 'n',
1265 [PCU_VTY_ATTR_NEW_SUBSCR] = 's',
1266 [PCU_VTY_ATTR_NS_RESET] = 'r',
1267 },
Andreas Eversberg12942562012-07-12 14:31:57 +02001268};
1269
Pau Espin Pedrolcd2ac562019-08-05 14:30:44 +02001270int pcu_vty_init(void)
Andreas Eversberg12942562012-07-12 14:31:57 +02001271{
1272// install_element_ve(&show_pcu_cmd);
1273
Harald Welte717cdf52017-07-21 21:56:23 +02001274 cfg_pcu_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names,
1275 "gsmtap-category (",
1276 "|",")", VTY_DO_LOWER);
1277 cfg_pcu_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help,
1278 "GSMTAP Category\n",
1279 "\n", "", 0);
1280 cfg_pcu_no_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names,
1281 "no gsmtap-category (",
1282 "|",")", VTY_DO_LOWER);
1283 cfg_pcu_no_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help,
1284 NO_STR "GSMTAP Category\n",
1285 "\n", "", 0);
1286
Pau Espin Pedrolcd2ac562019-08-05 14:30:44 +02001287 logging_vty_add_cmds();
1288 osmo_stats_vty_add_cmds();
Vadim Yanitskiyd83c8ff2020-02-06 16:46:17 +07001289 osmo_talloc_vty_add_cmds();
Vadim Yanitskiy830ca262021-02-05 23:22:37 +01001290 osmo_fsm_vty_add_cmds();
Andreas Eversberg12942562012-07-12 14:31:57 +02001291
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001292 install_node(&pcu_node, config_write_pcu);
1293 install_element(CONFIG_NODE, &cfg_pcu_cmd);
Jacob Erlbeck953c7892015-09-28 18:12:57 +02001294 install_element(PCU_NODE, &cfg_pcu_egprs_cmd);
1295 install_element(PCU_NODE, &cfg_pcu_no_egprs_cmd);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +02001296 install_element(PCU_NODE, &cfg_pcu_no_two_phase_cmd);
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001297 install_element(PCU_NODE, &cfg_pcu_cs_cmd);
1298 install_element(PCU_NODE, &cfg_pcu_no_cs_cmd);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +02001299 install_element(PCU_NODE, &cfg_pcu_cs_max_cmd);
1300 install_element(PCU_NODE, &cfg_pcu_no_cs_max_cmd);
Jacob Erlbeck8322d082015-06-04 15:12:10 +02001301 install_element(PCU_NODE, &cfg_pcu_cs_err_limits_cmd);
1302 install_element(PCU_NODE, &cfg_pcu_no_cs_err_limits_cmd);
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +02001303 install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd);
1304 install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd);
Jacob Erlbeck94cde132015-06-09 09:44:36 +02001305 install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd);
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001306 install_element(PCU_NODE, &cfg_pcu_mcs_lqual_ranges_cmd);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +01001307 install_element(PCU_NODE, &cfg_pcu_mcs_cmd);
Aravind Sirsikar50b09702016-08-22 17:21:10 +05301308 install_element(PCU_NODE, &cfg_pcu_dl_arq_cmd);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +01001309 install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd);
Jacob Erlbeck0d058052016-01-07 11:48:28 +01001310 install_element(PCU_NODE, &cfg_pcu_mcs_max_cmd);
1311 install_element(PCU_NODE, &cfg_pcu_no_mcs_max_cmd);
Jacob Erlbeck36df7742016-01-19 15:53:30 +01001312 install_element(PCU_NODE, &cfg_pcu_window_size_cmd);
Andreas Eversberg24131bf2012-07-21 11:09:58 +02001313 install_element(PCU_NODE, &cfg_pcu_queue_lifetime_cmd);
1314 install_element(PCU_NODE, &cfg_pcu_queue_lifetime_inf_cmd);
1315 install_element(PCU_NODE, &cfg_pcu_no_queue_lifetime_cmd);
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +01001316 install_element(PCU_NODE, &cfg_pcu_queue_hysteresis_cmd);
1317 install_element(PCU_NODE, &cfg_pcu_no_queue_hysteresis_cmd);
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +02001318 install_element(PCU_NODE, &cfg_pcu_queue_codel_cmd);
1319 install_element(PCU_NODE, &cfg_pcu_queue_codel_interval_cmd);
1320 install_element(PCU_NODE, &cfg_pcu_no_queue_codel_cmd);
Jacob Erlbeckd0261b72015-04-02 13:58:09 +02001321 install_element(PCU_NODE, &cfg_pcu_queue_idle_ack_delay_cmd);
1322 install_element(PCU_NODE, &cfg_pcu_no_queue_idle_ack_delay_cmd);
Andreas Eversberga1503fa2012-07-22 08:58:09 +02001323 install_element(PCU_NODE, &cfg_pcu_alloc_cmd);
Andreas Eversberg07e97cf2012-08-07 16:00:56 +02001324 install_element(PCU_NODE, &cfg_pcu_two_phase_cmd);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +02001325 install_element(PCU_NODE, &cfg_pcu_fc_interval_cmd);
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +02001326 install_element(PCU_NODE, &cfg_pcu_fc_bucket_time_cmd);
1327 install_element(PCU_NODE, &cfg_pcu_no_fc_bucket_time_cmd);
Jacob Erlbeck87d73412015-04-21 12:56:48 +02001328 install_element(PCU_NODE, &cfg_pcu_fc_bvc_bucket_size_cmd);
1329 install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_bucket_size_cmd);
1330 install_element(PCU_NODE, &cfg_pcu_fc_bvc_leak_rate_cmd);
1331 install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_leak_rate_cmd);
1332 install_element(PCU_NODE, &cfg_pcu_fc_ms_bucket_size_cmd);
1333 install_element(PCU_NODE, &cfg_pcu_no_fc_ms_bucket_size_cmd);
1334 install_element(PCU_NODE, &cfg_pcu_fc_ms_leak_rate_cmd);
1335 install_element(PCU_NODE, &cfg_pcu_no_fc_ms_leak_rate_cmd);
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +02001336 install_element(PCU_NODE, &cfg_pcu_alpha_cmd);
1337 install_element(PCU_NODE, &cfg_pcu_gamma_cmd);
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +01001338 install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_cmd);
1339 install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd);
Oliver Smith45fdc442019-09-05 15:12:20 +02001340 install_element(PCU_NODE, &cfg_pcu_dl_tbf_preemptive_retransmission_cmd);
1341 install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd);
Jacob Erlbecka098c192015-05-28 16:11:19 +02001342 install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd);
1343 install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd);
Pau Espin Pedrol13866f02021-11-12 13:42:03 +01001344 install_element(PCU_NODE, &cfg_pcu_gsmtap_remote_host_cmd);
1345 install_element(PCU_NODE, &cfg_pcu_no_gsmtap_remote_host_cmd);
1346 install_element(PCU_NODE, &pcucfg_pcu_gsmtap_categ_all_cmd);
Harald Welte717cdf52017-07-21 21:56:23 +02001347 install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd);
1348 install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd);
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001349 install_element(PCU_NODE, &cfg_pcu_sock_cmd);
Harald Welte57d35152018-07-05 03:11:17 +02001350 install_element(PCU_NODE, &cfg_pcu_gb_dialect_cmd);
Harald Welted9367e32021-04-29 22:02:47 +02001351 install_element(PCU_NODE, &cfg_pcu_gb_ip_dscp_cmd);
1352 install_element(PCU_NODE, &cfg_pcu_gb_priority_cmd);
Pau Espin Pedrolc0a250d2021-01-21 18:46:13 +01001353 install_element(PCU_NODE, &cfg_neighbor_resolution_cmd);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001354 install_element(PCU_NODE, &cfg_pcu_timer_cmd);
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001355
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001356 install_element_ve(&show_bts_stats_cmd);
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +02001357 install_element_ve(&show_bts_pdch_cmd);
Daniel Willmann772415f2014-01-15 17:06:51 +01001358 install_element_ve(&show_tbf_cmd);
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001359 install_element_ve(&show_ms_all_cmd);
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001360 install_element_ve(&show_ms_tlli_cmd);
1361 install_element_ve(&show_ms_imsi_cmd);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001362 install_element_ve(&show_bts_timer_cmd);
1363 install_element_ve(&show_timer_cmd);
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001364
Andreas Eversberg12942562012-07-12 14:31:57 +02001365 return 0;
1366}