blob: 244a58a0923ddffa2c0bddba21fb05e8eef9a9ca [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"
26
Philipp Maier9459ebd2020-09-29 23:31:33 +020027#define X(x) (1 << x)
28
Harald Welte717cdf52017-07-21 21:56:23 +020029extern void *tall_pcu_ctx;
30
31static const struct value_string pcu_gsmtap_categ_names[] = {
32 { PCU_GSMTAP_C_DL_UNKNOWN, "dl-unknown" },
33 { PCU_GSMTAP_C_DL_DUMMY, "dl-dummy" },
34 { PCU_GSMTAP_C_DL_CTRL, "dl-ctrl" },
35 { PCU_GSMTAP_C_DL_DATA_GPRS, "dl-data-gprs" },
36 { PCU_GSMTAP_C_DL_DATA_EGPRS, "dl-data-egprs" },
Harald Weltebc219d52017-07-29 13:42:27 +020037 { PCU_GSMTAP_C_DL_PTCCH, "dl-ptcch" },
Pau Espin Pedrol58543702019-09-30 19:07:16 +020038 { PCU_GSMTAP_C_DL_AGCH, "dl-agch" },
39 { PCU_GSMTAP_C_DL_PCH, "dl-pch" },
Harald Welte717cdf52017-07-21 21:56:23 +020040
41 { PCU_GSMTAP_C_UL_UNKNOWN, "ul-unknown" },
42 { PCU_GSMTAP_C_UL_DUMMY, "ul-dummy" },
43 { PCU_GSMTAP_C_UL_CTRL, "ul-ctrl" },
44 { PCU_GSMTAP_C_UL_DATA_GPRS, "ul-data-gprs" },
45 { PCU_GSMTAP_C_UL_DATA_EGPRS, "ul-data-egprs" },
Pau Espin Pedrol1ec211f2019-09-30 18:33:14 +020046 { PCU_GSMTAP_C_UL_RACH, "ul-rach" },
Vadim Yanitskiy07b64872020-06-11 00:26:15 +070047 { PCU_GSMTAP_C_UL_PTCCH, "ul-ptcch" },
Harald Welte717cdf52017-07-21 21:56:23 +020048
49 { 0, NULL }
50};
51
52static const struct value_string pcu_gsmtap_categ_help[] = {
53 { PCU_GSMTAP_C_DL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" },
54 { PCU_GSMTAP_C_DL_DUMMY, "Downlink Dummy Blocks" },
55 { PCU_GSMTAP_C_DL_CTRL, "Downlink Control Blocks" },
56 { PCU_GSMTAP_C_DL_DATA_GPRS, "Downlink Data Blocks (GPRS)" },
57 { PCU_GSMTAP_C_DL_DATA_EGPRS, "Downlink Data Blocks (EGPRS)" },
Harald Weltebc219d52017-07-29 13:42:27 +020058 { PCU_GSMTAP_C_DL_PTCCH, "Downlink PTCCH Blocks" },
Pau Espin Pedrol58543702019-09-30 19:07:16 +020059 { PCU_GSMTAP_C_DL_AGCH, "Downlink AGCH Blocks" },
60 { PCU_GSMTAP_C_DL_PCH, "Downlink PCH Blocks" },
Harald Welte717cdf52017-07-21 21:56:23 +020061
62 { PCU_GSMTAP_C_UL_UNKNOWN, "Unknown / Unparseable / Erroneous Downlink Blocks" },
63 { PCU_GSMTAP_C_UL_DUMMY, "Uplink Dummy Blocks" },
64 { PCU_GSMTAP_C_UL_CTRL, "Uplink Control Blocks" },
65 { PCU_GSMTAP_C_UL_DATA_GPRS, "Uplink Data Blocks (GPRS)" },
66 { PCU_GSMTAP_C_UL_DATA_EGPRS, "Uplink Data Blocks (EGPRS)" },
Pau Espin Pedrol1ec211f2019-09-30 18:33:14 +020067 { PCU_GSMTAP_C_UL_RACH, "Uplink RACH Bursts" },
Vadim Yanitskiy07b64872020-06-11 00:26:15 +070068 { PCU_GSMTAP_C_UL_PTCCH, "Uplink PTCCH Bursts" },
Harald Welte717cdf52017-07-21 21:56:23 +020069
70 { 0, NULL }
71};
72
Pau Espin Pedrol13866f02021-11-12 13:42:03 +010073DEFUN(cfg_pcu_gsmtap_remote_host,
74 cfg_pcu_gsmtap_remote_host_cmd,
75 "gsmtap-remote-host [HOSTNAME]",
76 "Enable GSMTAP Um logging (see also 'gsmtap-category')\n"
77 "Remote IP address or hostname ('localhost' if omitted)\n")
78{
79 osmo_talloc_replace_string(the_pcu, &the_pcu->gsmtap_remote_host,
80 argc > 0 ? argv[0] : "localhost");
81
82 if (vty->type != VTY_FILE)
83 vty_out(vty, "%% This command requires restart%s", VTY_NEWLINE);
84
85 return CMD_SUCCESS;
86}
87
88DEFUN(cfg_pcu_no_gsmtap_remote_host,
89 cfg_pcu_no_gsmtap_remote_host_cmd,
90 "no gsmtap-remote-host",
91 NO_STR "Disable GSMTAP Um logging\n")
92{
93 if (the_pcu->gsmtap_remote_host)
94 TALLOC_FREE(the_pcu->gsmtap_remote_host);
95
96 if (vty->type != VTY_FILE)
97 vty_out(vty, "%% This command requires restart%s", VTY_NEWLINE);
98
99 return CMD_SUCCESS;
100}
101
102DEFUN(cfg_pcu_gsmtap_sapi_all, pcucfg_pcu_gsmtap_categ_all_cmd,
103 "gsmtap-category (enable-all|disable-all)",
104 "Enable/disable sending of UL/DL messages over GSMTAP\n"
105 "Enable all kinds of messages (all categories)\n"
106 "Disable all kinds of messages (all categories)\n")
107{
108
109 if (strcmp(argv[0], "enable-all") == 0)
110 the_pcu->gsmtap_categ_mask = UINT32_MAX;
111 else
112 the_pcu->gsmtap_categ_mask = 0x00;
113
114 return CMD_SUCCESS;
115}
Harald Welte717cdf52017-07-21 21:56:23 +0200116
117DEFUN(cfg_pcu_gsmtap_categ, cfg_pcu_gsmtap_categ_cmd, "HIDDEN", "HIDDEN")
118{
Harald Welte717cdf52017-07-21 21:56:23 +0200119 int categ;
120
121 categ = get_string_value(pcu_gsmtap_categ_names, argv[0]);
122 if (categ < 0)
123 return CMD_WARNING;
124
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100125 the_pcu->gsmtap_categ_mask |= (1 << categ);
Harald Welte717cdf52017-07-21 21:56:23 +0200126
127 return CMD_SUCCESS;
128}
129
130DEFUN(cfg_pcu_no_gsmtap_categ, cfg_pcu_no_gsmtap_categ_cmd, "HIDDEN", "HIDDEN")
131{
Harald Welte717cdf52017-07-21 21:56:23 +0200132 int categ;
133
134 categ = get_string_value(pcu_gsmtap_categ_names, argv[0]);
135 if (categ < 0)
136 return CMD_WARNING;
137
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100138 the_pcu->gsmtap_categ_mask &= ~(1 << categ);
Harald Welte717cdf52017-07-21 21:56:23 +0200139
140 return CMD_SUCCESS;
141}
142
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200143static struct cmd_node pcu_node = {
144 (enum node_type) PCU_NODE,
Jacob Erlbeckcc12f022015-04-09 15:45:24 +0200145 "%s(config-pcu)# ",
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200146 1,
147};
148
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200149static int config_write_pcu(struct vty *vty)
150{
Harald Welte717cdf52017-07-21 21:56:23 +0200151 unsigned int i;
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200152
153 vty_out(vty, "pcu%s", VTY_NEWLINE);
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100154 vty_out(vty, " flow-control-interval %d%s", the_pcu->vty.fc_interval,
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200155 VTY_NEWLINE);
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100156 if (the_pcu->vty.fc_bvc_bucket_size)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200157 vty_out(vty, " flow-control force-bvc-bucket-size %d%s",
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100158 the_pcu->vty.fc_bvc_bucket_size, VTY_NEWLINE);
159 if (the_pcu->vty.fc_bvc_leak_rate)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200160 vty_out(vty, " flow-control force-bvc-leak-rate %d%s",
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100161 the_pcu->vty.fc_bvc_leak_rate, VTY_NEWLINE);
162 if (the_pcu->vty.fc_ms_bucket_size)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200163 vty_out(vty, " flow-control force-ms-bucket-size %d%s",
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100164 the_pcu->vty.fc_ms_bucket_size, VTY_NEWLINE);
165 if (the_pcu->vty.fc_ms_leak_rate)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200166 vty_out(vty, " flow-control force-ms-leak-rate %d%s",
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100167 the_pcu->vty.fc_ms_leak_rate, VTY_NEWLINE);
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100168 if (the_pcu->vty.force_initial_cs) {
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100169 if (the_pcu->vty.initial_cs_ul == the_pcu->vty.initial_cs_dl)
170 vty_out(vty, " cs %d%s", the_pcu->vty.initial_cs_dl,
Andreas Eversberg499ff412012-10-03 14:21:36 +0200171 VTY_NEWLINE);
172 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100173 vty_out(vty, " cs %d %d%s", the_pcu->vty.initial_cs_dl,
174 the_pcu->vty.initial_cs_ul, VTY_NEWLINE);
Holger Hans Peter Freytherc421e8a2014-07-02 14:55:17 +0200175 }
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100176 if (the_pcu->vty.max_cs_dl && the_pcu->vty.max_cs_ul) {
177 if (the_pcu->vty.max_cs_ul == the_pcu->vty.max_cs_dl)
178 vty_out(vty, " cs max %d%s", the_pcu->vty.max_cs_dl,
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200179 VTY_NEWLINE);
180 else
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100181 vty_out(vty, " cs max %d %d%s", the_pcu->vty.max_cs_dl,
182 the_pcu->vty.max_cs_ul, VTY_NEWLINE);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200183 }
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100184 if (the_pcu->vty.cs_adj_enabled)
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200185 vty_out(vty, " cs threshold %d %d%s",
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100186 the_pcu->vty.cs_adj_lower_limit, the_pcu->vty.cs_adj_upper_limit,
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200187 VTY_NEWLINE);
188 else
189 vty_out(vty, " no cs threshold%s", VTY_NEWLINE);
190
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100191 if (the_pcu->vty.cs_downgrade_threshold)
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200192 vty_out(vty, " cs downgrade-threshold %d%s",
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100193 the_pcu->vty.cs_downgrade_threshold, VTY_NEWLINE);
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200194 else
195 vty_out(vty, " no cs downgrade-threshold%s", VTY_NEWLINE);
196
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200197 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 +0100198 the_pcu->vty.cs_lqual_ranges[0].high,
199 the_pcu->vty.cs_lqual_ranges[1].low,
200 the_pcu->vty.cs_lqual_ranges[1].high,
201 the_pcu->vty.cs_lqual_ranges[2].low,
202 the_pcu->vty.cs_lqual_ranges[2].high,
203 the_pcu->vty.cs_lqual_ranges[3].low,
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200204 VTY_NEWLINE);
205
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -0400206 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 +0100207 the_pcu->vty.mcs_lqual_ranges[0].high,
208 the_pcu->vty.mcs_lqual_ranges[1].low,
209 the_pcu->vty.mcs_lqual_ranges[1].high,
210 the_pcu->vty.mcs_lqual_ranges[2].low,
211 the_pcu->vty.mcs_lqual_ranges[2].high,
212 the_pcu->vty.mcs_lqual_ranges[3].low,
213 the_pcu->vty.mcs_lqual_ranges[3].high,
214 the_pcu->vty.mcs_lqual_ranges[4].low,
215 the_pcu->vty.mcs_lqual_ranges[4].high,
216 the_pcu->vty.mcs_lqual_ranges[5].low,
217 the_pcu->vty.mcs_lqual_ranges[5].high,
218 the_pcu->vty.mcs_lqual_ranges[6].low,
219 the_pcu->vty.mcs_lqual_ranges[6].high,
220 the_pcu->vty.mcs_lqual_ranges[7].low,
221 the_pcu->vty.mcs_lqual_ranges[7].high,
222 the_pcu->vty.mcs_lqual_ranges[8].low,
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -0400223 VTY_NEWLINE);
224
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100225 if (the_pcu->vty.force_initial_mcs) {
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100226 if (the_pcu->vty.initial_mcs_ul == the_pcu->vty.initial_mcs_dl)
227 vty_out(vty, " mcs %d%s", the_pcu->vty.initial_mcs_dl,
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100228 VTY_NEWLINE);
229 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100230 vty_out(vty, " mcs %d %d%s", the_pcu->vty.initial_mcs_dl,
231 the_pcu->vty.initial_mcs_ul, VTY_NEWLINE);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100232 }
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -0400233
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100234 if (the_pcu->vty.max_mcs_dl && the_pcu->vty.max_mcs_ul) {
235 if (the_pcu->vty.max_mcs_ul == the_pcu->vty.max_mcs_dl)
236 vty_out(vty, " mcs max %d%s", the_pcu->vty.max_mcs_dl,
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100237 VTY_NEWLINE);
238 else
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100239 vty_out(vty, " mcs max %d %d%s", the_pcu->vty.max_mcs_dl,
240 the_pcu->vty.max_mcs_ul, VTY_NEWLINE);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100241 }
242
Pau Espin Pedrol519d0712021-01-14 14:30:03 +0100243 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 +0100244 VTY_NEWLINE);
245
Pau Espin Pedrol97296b22021-01-14 13:08:02 +0100246 if (the_pcu->vty.dl_arq_type == EGPRS_ARQ2)
247 vty_out(vty, " egprs dl arq-type arq2%s", VTY_NEWLINE);
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530248
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100249 if (the_pcu->vty.force_llc_lifetime == 0xffff)
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200250 vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100251 else if (the_pcu->vty.force_llc_lifetime)
252 vty_out(vty, " queue lifetime %d%s", the_pcu->vty.force_llc_lifetime,
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200253 VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100254 if (the_pcu->vty.llc_discard_csec)
255 vty_out(vty, " queue hysteresis %d%s", the_pcu->vty.llc_discard_csec,
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100256 VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100257 if (the_pcu->vty.llc_idle_ack_csec)
258 vty_out(vty, " queue idle-ack-delay %d%s", the_pcu->vty.llc_idle_ack_csec,
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200259 VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100260 if (the_pcu->vty.llc_codel_interval_msec == LLC_CODEL_USE_DEFAULT)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200261 vty_out(vty, " queue codel%s", VTY_NEWLINE);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100262 else if (the_pcu->vty.llc_codel_interval_msec == LLC_CODEL_DISABLE)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200263 vty_out(vty, " no queue codel%s", VTY_NEWLINE);
264 else
265 vty_out(vty, " queue codel interval %d%s",
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100266 the_pcu->vty.llc_codel_interval_msec/10, VTY_NEWLINE);
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200267
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100268 if (the_pcu->alloc_algorithm == alloc_algorithm_a)
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200269 vty_out(vty, " alloc-algorithm a%s", VTY_NEWLINE);
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100270 if (the_pcu->alloc_algorithm == alloc_algorithm_b)
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200271 vty_out(vty, " alloc-algorithm b%s", VTY_NEWLINE);
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100272 if (the_pcu->alloc_algorithm == alloc_algorithm_dynamic)
Jacob Erlbeck400ec022015-07-14 13:31:48 +0200273 vty_out(vty, " alloc-algorithm dynamic%s", VTY_NEWLINE);
Pau Espin Pedrol03de8982021-01-14 12:48:50 +0100274 if (the_pcu->vty.force_two_phase)
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200275 vty_out(vty, " two-phase-access%s", VTY_NEWLINE);
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100276 if (the_pcu->vty.force_alpha != (uint8_t)-1)
277 vty_out(vty, " alpha %u%s", the_pcu->vty.force_alpha, VTY_NEWLINE);
Pau Espin Pedrola2814952021-01-14 12:53:53 +0100278 vty_out(vty, " gamma %d%s", the_pcu->vty.gamma * 2, VTY_NEWLINE);
Pau Espin Pedrol05f9f592021-01-14 12:56:58 +0100279 if (!the_pcu->vty.dl_tbf_preemptive_retransmission)
Oliver Smith45fdc442019-09-05 15:12:20 +0200280 vty_out(vty, " no dl-tbf-preemptive-retransmission%s", VTY_NEWLINE);
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100281 if (strcmp(the_pcu->pcu_sock_path, PCU_SOCK_DEFAULT))
282 vty_out(vty, " pcu-socket %s%s", the_pcu->pcu_sock_path, VTY_NEWLINE);
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200283
Pau Espin Pedrol13866f02021-11-12 13:42:03 +0100284 if (the_pcu->gsmtap_remote_host)
285 vty_out(vty, " gsmtap-remote-host %s%s", the_pcu->gsmtap_remote_host, VTY_NEWLINE);
Harald Welte717cdf52017-07-21 21:56:23 +0200286 for (i = 0; i < 32; i++) {
Pau Espin Pedrol13866f02021-11-12 13:42:03 +0100287 if (the_pcu->gsmtap_categ_mask & ((uint32_t)1 << i)) {
288 const char *category_buf;
289 if (!(category_buf = get_value_string_or_null(pcu_gsmtap_categ_names, i)))
290 continue;
291 vty_out(vty, " gsmtap-category %s%s", category_buf, VTY_NEWLINE);
Harald Welte717cdf52017-07-21 21:56:23 +0200292 }
293 }
294
Alexander Couzensf7ec5252021-01-25 20:28:38 +0100295 if (the_pcu->vty.ns_dialect == GPRS_NS2_DIALECT_SNS)
Harald Welte57d35152018-07-05 03:11:17 +0200296 vty_out(vty, " gb-dialect ip-sns%s", VTY_NEWLINE);
297 else
298 vty_out(vty, " gb-dialect classic%s", VTY_NEWLINE);
299
Harald Welted9367e32021-04-29 22:02:47 +0200300 if (the_pcu->vty.ns_ip_dscp != -1)
301 vty_out(vty, " gb ip-dscp %d%s", the_pcu->vty.ns_ip_dscp, VTY_NEWLINE);
302 if (the_pcu->vty.ns_priority != -1)
303 vty_out(vty, " gb socket-priority %d%s", the_pcu->vty.ns_priority, VTY_NEWLINE);
304
Pau Espin Pedrol66e8a492021-02-17 20:24:59 +0100305 if (the_pcu->vty.neigh_ctrl_addr) {
306 vty_out(vty, " neighbor resolution %s %u%s",
307 the_pcu->vty.neigh_ctrl_addr, the_pcu->vty.neigh_ctrl_port, VTY_NEWLINE);
308 }
309
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100310 osmo_tdef_vty_write(vty, the_pcu->T_defs, " timer ");
Pau Espin Pedrol18794422019-09-26 18:25:35 +0200311
Maxc9ce6f92018-01-30 17:53:02 +0100312 return CMD_SUCCESS;
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200313}
314
315/* per-BTS configuration */
Philipp Maier9459ebd2020-09-29 23:31:33 +0200316DEFUN_ATTR(cfg_pcu,
317 cfg_pcu_cmd,
318 "pcu",
319 "BTS specific configure",
320 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200321{
322 vty->node = PCU_NODE;
323
324 return CMD_SUCCESS;
325}
326
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200327#define EGPRS_STR "EGPRS configuration\n"
328
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100329DEFUN_DEPRECATED(cfg_pcu_egprs,
330 cfg_pcu_egprs_cmd,
331 "egprs only",
332 EGPRS_STR "Use EGPRS and disable plain GPRS\n")
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200333{
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100334 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 +0200335 return CMD_SUCCESS;
336}
337
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100338DEFUN_DEPRECATED(cfg_pcu_no_egprs,
339 cfg_pcu_no_egprs_cmd,
340 "no egprs",
341 NO_STR EGPRS_STR)
Jacob Erlbeck953c7892015-09-28 18:12:57 +0200342{
Pau Espin Pedrol270c9ea2020-10-30 17:15:32 +0100343 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 +0200344 return CMD_SUCCESS;
345}
346
Philipp Maier9459ebd2020-09-29 23:31:33 +0200347DEFUN_ATTR(cfg_pcu_fc_interval,
348 cfg_pcu_fc_interval_cmd,
349 "flow-control-interval <1-10>",
350 "Interval between sending subsequent Flow Control PDUs\n"
351 "Interval time in seconds\n",
352 CMD_ATTR_IMMEDIATE)
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200353{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100354 the_pcu->vty.fc_interval = atoi(argv[0]);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200355 return CMD_SUCCESS;
356}
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200357#define FC_STR "BSSGP Flow Control configuration\n"
358#define FC_BMAX_STR(who) "Force a fixed value for the " who " bucket size\n"
359#define FC_LR_STR(who) "Force a fixed value for the " who " leak rate\n"
360
Philipp Maier9459ebd2020-09-29 23:31:33 +0200361DEFUN_ATTR(cfg_pcu_fc_bvc_bucket_size,
362 cfg_pcu_fc_bvc_bucket_size_cmd,
363 "flow-control force-bvc-bucket-size <1-6553500>",
364 FC_STR FC_BMAX_STR("BVC") "Bucket size in octets\n",
365 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200366{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100367 the_pcu->vty.fc_bvc_bucket_size = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200368 return CMD_SUCCESS;
369}
370
Philipp Maier9459ebd2020-09-29 23:31:33 +0200371DEFUN_ATTR(cfg_pcu_no_fc_bvc_bucket_size,
372 cfg_pcu_no_fc_bvc_bucket_size_cmd,
373 "no flow-control force-bvc-bucket-size",
374 NO_STR FC_STR FC_BMAX_STR("BVC"),
375 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200376{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100377 the_pcu->vty.fc_bvc_bucket_size = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200378 return CMD_SUCCESS;
379}
380
Philipp Maier9459ebd2020-09-29 23:31:33 +0200381DEFUN_ATTR(cfg_pcu_fc_bvc_leak_rate,
382 cfg_pcu_fc_bvc_leak_rate_cmd,
383 "flow-control force-bvc-leak-rate <1-6553500>",
384 FC_STR FC_LR_STR("BVC") "Leak rate in bit/s\n",
385 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200386{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100387 the_pcu->vty.fc_bvc_leak_rate = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200388
389 return CMD_SUCCESS;
390}
391
Philipp Maier9459ebd2020-09-29 23:31:33 +0200392DEFUN_ATTR(cfg_pcu_no_fc_bvc_leak_rate,
393 cfg_pcu_no_fc_bvc_leak_rate_cmd,
394 "no flow-control force-bvc-leak-rate",
395 NO_STR FC_STR FC_LR_STR("BVC"),
396 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200397{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100398 the_pcu->vty.fc_bvc_leak_rate = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200399 return CMD_SUCCESS;
400}
401
Philipp Maier9459ebd2020-09-29 23:31:33 +0200402DEFUN_ATTR(cfg_pcu_fc_ms_bucket_size,
403 cfg_pcu_fc_ms_bucket_size_cmd,
404 "flow-control force-ms-bucket-size <1-6553500>",
405 FC_STR FC_BMAX_STR("default MS") "Bucket size in octets\n",
406 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200407{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100408 the_pcu->vty.fc_ms_bucket_size = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200409 return CMD_SUCCESS;
410}
411
Philipp Maier9459ebd2020-09-29 23:31:33 +0200412DEFUN_ATTR(cfg_pcu_no_fc_ms_bucket_size,
413 cfg_pcu_no_fc_ms_bucket_size_cmd,
414 "no flow-control force-ms-bucket-size",
415 NO_STR FC_STR FC_BMAX_STR("default MS"),
416 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200417{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100418 the_pcu->vty.fc_ms_bucket_size = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200419 return CMD_SUCCESS;
420}
421
Philipp Maier9459ebd2020-09-29 23:31:33 +0200422DEFUN_ATTR(cfg_pcu_fc_ms_leak_rate,
423 cfg_pcu_fc_ms_leak_rate_cmd,
424 "flow-control force-ms-leak-rate <1-6553500>",
425 FC_STR FC_LR_STR("default MS") "Leak rate in bit/s\n",
426 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200427{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100428 the_pcu->vty.fc_ms_leak_rate = atoi(argv[0]);
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200429 return CMD_SUCCESS;
430}
431
Philipp Maier9459ebd2020-09-29 23:31:33 +0200432DEFUN_ATTR(cfg_pcu_no_fc_ms_leak_rate,
433 cfg_pcu_no_fc_ms_leak_rate_cmd,
434 "no flow-control force-ms-leak-rate",
435 NO_STR FC_STR FC_LR_STR("default MS"),
436 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200437{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100438 the_pcu->vty.fc_ms_leak_rate = 0;
Jacob Erlbeck87d73412015-04-21 12:56:48 +0200439 return CMD_SUCCESS;
440}
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +0200441
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200442#define FC_BTIME_STR "Set target downlink maximum queueing time (only affects the advertised bucket size)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200443DEFUN_ATTR(cfg_pcu_fc_bucket_time,
444 cfg_pcu_fc_bucket_time_cmd,
445 "flow-control bucket-time <1-65534>",
446 FC_STR FC_BTIME_STR "Time in centi-seconds\n",
447 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200448{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100449 the_pcu->vty.fc_bucket_time = atoi(argv[0]);
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200450 return CMD_SUCCESS;
451}
452
Philipp Maier9459ebd2020-09-29 23:31:33 +0200453DEFUN_ATTR(cfg_pcu_no_fc_bucket_time,
454 cfg_pcu_no_fc_bucket_time_cmd,
455 "no flow-control bucket-time",
456 NO_STR FC_STR FC_BTIME_STR,
457 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200458{
Pau Espin Pedrole8912222021-01-14 14:03:17 +0100459 the_pcu->vty.fc_bucket_time = 0;
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200460 return CMD_SUCCESS;
461}
462
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200463#define CS_STR "Coding Scheme configuration\n"
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +0200464
Philipp Maier9459ebd2020-09-29 23:31:33 +0200465DEFUN_ATTR(cfg_pcu_cs,
466 cfg_pcu_cs_cmd,
467 "cs <1-4> [<1-4>]",
468 CS_STR
469 "Initial CS value to be used (overrides BTS config)\n"
470 "Use a different initial CS value for the uplink",
471 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200472{
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100473 uint8_t cs_dl, cs_ul;
474 cs_dl = atoi(argv[0]);
Andreas Eversberg499ff412012-10-03 14:21:36 +0200475 if (argc > 1)
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100476 cs_ul = atoi(argv[1]);
Andreas Eversberg499ff412012-10-03 14:21:36 +0200477 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100478 cs_ul = cs_dl;
479 the_pcu->vty.force_initial_cs = true;
480 gprs_pcu_set_initial_cs(the_pcu, cs_dl, cs_ul);
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200481 return CMD_SUCCESS;
482}
483
Philipp Maier9459ebd2020-09-29 23:31:33 +0200484DEFUN_ATTR(cfg_pcu_no_cs,
485 cfg_pcu_no_cs_cmd,
486 "no cs",
487 NO_STR CS_STR,
488 CMD_ATTR_IMMEDIATE)
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200489{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100490 the_pcu->vty.force_initial_cs = false;
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100491 gprs_pcu_set_initial_cs(the_pcu, 0, 0);
Andreas Eversberg8b761a32012-07-20 21:50:31 +0200492 return CMD_SUCCESS;
493}
494
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100495#define CS_MAX_STR "Set maximum values for adaptive CS selection (overrides BTS config)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200496DEFUN_ATTR(cfg_pcu_cs_max,
497 cfg_pcu_cs_max_cmd,
498 "cs max <1-4> [<1-4>]",
499 CS_STR
500 CS_MAX_STR
501 "Maximum CS value to be used\n"
502 "Use a different maximum CS value for the uplink",
503 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200504{
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100505 uint8_t cs_dl = atoi(argv[0]);
506 uint8_t cs_ul;
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200507
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200508 if (argc > 1)
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100509 cs_ul = atoi(argv[1]);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200510 else
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100511 cs_ul = cs_dl;
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200512
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100513 gprs_pcu_set_max_cs(the_pcu, cs_dl, cs_ul);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200514 return CMD_SUCCESS;
515}
516
Philipp Maier9459ebd2020-09-29 23:31:33 +0200517DEFUN_ATTR(cfg_pcu_no_cs_max,
518 cfg_pcu_no_cs_max_cmd,
519 "no cs max",
520 NO_STR CS_STR CS_MAX_STR,
521 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200522{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100523 gprs_pcu_set_max_cs(the_pcu, 0, 0);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +0200524 return CMD_SUCCESS;
525}
526
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100527#define MCS_STR "Modulation and Coding Scheme configuration (EGPRS)\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200528DEFUN_ATTR(cfg_pcu_mcs,
529 cfg_pcu_mcs_cmd,
530 "mcs <1-9> [<1-9>]",
531 MCS_STR
532 "Initial MCS value to be used (default 1)\n"
533 "Use a different initial MCS value for the uplink",
534 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100535{
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100536 uint8_t mcs_dl, mcs_ul;
537 mcs_dl = atoi(argv[0]);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100538 if (argc > 1)
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100539 mcs_ul = atoi(argv[1]);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100540 else
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100541 mcs_ul = mcs_dl;
542 the_pcu->vty.force_initial_mcs = true;
543 gprs_pcu_set_initial_mcs(the_pcu, mcs_dl, mcs_ul);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100544 return CMD_SUCCESS;
545}
546
Philipp Maier9459ebd2020-09-29 23:31:33 +0200547DEFUN_ATTR(cfg_pcu_no_mcs,
548 cfg_pcu_no_mcs_cmd,
549 "no mcs",
550 NO_STR MCS_STR,
551 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100552{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100553 the_pcu->vty.force_initial_mcs = false;
Pau Espin Pedrol793583e2021-01-14 16:20:57 +0100554 gprs_pcu_set_initial_mcs(the_pcu, 0, 0);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +0100555 return CMD_SUCCESS;
556}
557
Philipp Maier9459ebd2020-09-29 23:31:33 +0200558DEFUN_ATTR(cfg_pcu_mcs_max,
559 cfg_pcu_mcs_max_cmd,
560 "mcs max <1-9> [<1-9>]",
561 MCS_STR
562 CS_MAX_STR
563 "Maximum MCS value to be used\n"
564 "Use a different maximum MCS value for the uplink",
565 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100566{
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100567 uint8_t mcs_dl = atoi(argv[0]);
568 uint8_t mcs_ul;
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100569
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100570 if (argc > 1)
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100571 mcs_ul = atoi(argv[1]);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100572 else
Pau Espin Pedrol343ec9b2020-10-30 18:35:54 +0100573 mcs_ul = mcs_dl;
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100574
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100575 gprs_pcu_set_max_mcs(the_pcu, mcs_dl, mcs_ul);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100576 return CMD_SUCCESS;
577}
578
Philipp Maier9459ebd2020-09-29 23:31:33 +0200579DEFUN_ATTR(cfg_pcu_no_mcs_max,
580 cfg_pcu_no_mcs_max_cmd,
581 "no mcs max",
582 NO_STR MCS_STR CS_MAX_STR,
583 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100584{
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100585 gprs_pcu_set_max_mcs(the_pcu, 0, 0);
Jacob Erlbeck0d058052016-01-07 11:48:28 +0100586 return CMD_SUCCESS;
587}
588
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530589#define DL_STR "downlink specific configuration\n"
590
Philipp Maier9459ebd2020-09-29 23:31:33 +0200591DEFUN_ATTR(cfg_pcu_dl_arq_type,
592 cfg_pcu_dl_arq_cmd,
593 "egprs dl arq-type (spb|arq2)",
594 EGPRS_STR DL_STR "ARQ options\n"
595 "enable SPB(ARQ1) support\n"
596 "enable ARQ2 support",
597 CMD_ATTR_IMMEDIATE)
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530598{
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530599 if (!strcmp(argv[0], "arq2"))
Pau Espin Pedrol97296b22021-01-14 13:08:02 +0100600 the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530601 else
Pau Espin Pedrol97296b22021-01-14 13:08:02 +0100602 the_pcu->vty.dl_arq_type = EGPRS_ARQ1;
Aravind Sirsikar50b09702016-08-22 17:21:10 +0530603
604 return CMD_SUCCESS;
605}
606
Philipp Maier9459ebd2020-09-29 23:31:33 +0200607DEFUN_USRATTR(cfg_pcu_window_size,
608 cfg_pcu_window_size_cmd,
609 X(PCU_VTY_ATTR_NEW_TBF),
610 "window-size <0-1024> [<0-256>]",
611 "Window size configuration (b + N_PDCH * f)\n"
612 "Base value (b)\n"
613 "Factor for number of PDCH (f)")
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100614{
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100615 uint16_t b = atoi(argv[0]);
616
Pau Espin Pedrol519d0712021-01-14 14:30:03 +0100617 the_pcu->vty.ws_base = b;
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100618 if (argc > 1) {
619 uint16_t f = atoi(argv[1]);
Pau Espin Pedrol519d0712021-01-14 14:30:03 +0100620 the_pcu->vty.ws_pdch = f;
Jacob Erlbeck36df7742016-01-19 15:53:30 +0100621 }
622
623 return CMD_SUCCESS;
624}
625
626
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200627#define QUEUE_STR "Packet queue options\n"
628#define LIFETIME_STR "Set lifetime limit of LLC frame in centi-seconds " \
629 "(overrides the value given by SGSN)\n"
630
Philipp Maier9459ebd2020-09-29 23:31:33 +0200631DEFUN_USRATTR(cfg_pcu_queue_lifetime,
632 cfg_pcu_queue_lifetime_cmd,
633 X(PCU_VTY_ATTR_NEW_TBF),
634 "queue lifetime <1-65534>",
635 QUEUE_STR LIFETIME_STR "Lifetime in centi-seconds")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200636{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200637 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100638 the_pcu->vty.force_llc_lifetime = csec;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200639 return CMD_SUCCESS;
640}
641
Philipp Maier9459ebd2020-09-29 23:31:33 +0200642DEFUN_USRATTR(cfg_pcu_queue_lifetime_inf,
643 cfg_pcu_queue_lifetime_inf_cmd,
644 X(PCU_VTY_ATTR_NEW_TBF),
645 "queue lifetime infinite",
646 QUEUE_STR LIFETIME_STR "Infinite lifetime")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200647{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100648 the_pcu->vty.force_llc_lifetime = 0xffff;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200649 return CMD_SUCCESS;
650}
651
Philipp Maier9459ebd2020-09-29 23:31:33 +0200652DEFUN_USRATTR(cfg_pcu_no_queue_lifetime,
653 cfg_pcu_no_queue_lifetime_cmd,
654 X(PCU_VTY_ATTR_NEW_TBF),
655 "no queue lifetime",
656 NO_STR QUEUE_STR "Disable lifetime limit of LLC frame (use value given "
657 "by SGSN)\n")
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200658{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100659 the_pcu->vty.force_llc_lifetime = 0;
Andreas Eversberg24131bf2012-07-21 11:09:58 +0200660 return CMD_SUCCESS;
661}
662
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100663#define QUEUE_HYSTERESIS_STR "Set lifetime hysteresis of LLC frame in centi-seconds " \
664 "(continue discarding until lifetime-hysteresis is reached)\n"
665
Philipp Maier9459ebd2020-09-29 23:31:33 +0200666DEFUN_USRATTR(cfg_pcu_queue_hysteresis,
667 cfg_pcu_queue_hysteresis_cmd,
668 X(PCU_VTY_ATTR_NEW_TBF),
669 "queue hysteresis <1-65535>",
670 QUEUE_STR QUEUE_HYSTERESIS_STR "Hysteresis in centi-seconds")
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100671{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200672 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100673 the_pcu->vty.llc_discard_csec = csec;
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100674 return CMD_SUCCESS;
675}
676
Philipp Maier9459ebd2020-09-29 23:31:33 +0200677DEFUN_USRATTR(cfg_pcu_no_queue_hysteresis,
678 cfg_pcu_no_queue_hysteresis_cmd,
679 X(PCU_VTY_ATTR_NEW_TBF),
680 "no queue hysteresis",
681 NO_STR QUEUE_STR QUEUE_HYSTERESIS_STR)
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100682{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100683 the_pcu->vty.llc_discard_csec = 0;
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +0100684 return CMD_SUCCESS;
685}
686
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200687#define QUEUE_CODEL_STR "Set CoDel queue management\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200688DEFUN_USRATTR(cfg_pcu_queue_codel,
689 cfg_pcu_queue_codel_cmd,
690 X(PCU_VTY_ATTR_NEW_SUBSCR),
691 "queue codel",
692 QUEUE_STR QUEUE_CODEL_STR)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200693{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100694 the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200695 return CMD_SUCCESS;
696}
697
Philipp Maier9459ebd2020-09-29 23:31:33 +0200698DEFUN_USRATTR(cfg_pcu_queue_codel_interval,
699 cfg_pcu_queue_codel_interval_cmd,
700 X(PCU_VTY_ATTR_NEW_SUBSCR),
701 "queue codel interval <1-1000>",
702 QUEUE_STR QUEUE_CODEL_STR "Specify interval\n" "Interval in centi-seconds")
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200703{
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200704 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100705 the_pcu->vty.llc_codel_interval_msec = 10*csec;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200706 return CMD_SUCCESS;
707}
708
Philipp Maier9459ebd2020-09-29 23:31:33 +0200709DEFUN_USRATTR(cfg_pcu_no_queue_codel,
710 cfg_pcu_no_queue_codel_cmd,
711 X(PCU_VTY_ATTR_NEW_SUBSCR),
712 "no queue codel",
713 NO_STR QUEUE_STR QUEUE_CODEL_STR)
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200714{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100715 the_pcu->vty.llc_codel_interval_msec = LLC_CODEL_DISABLE;
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +0200716 return CMD_SUCCESS;
717}
718
719
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200720#define QUEUE_IDLE_ACK_STR "Request an ACK after the last DL LLC frame in centi-seconds\n"
721
Philipp Maier9459ebd2020-09-29 23:31:33 +0200722DEFUN_ATTR(cfg_pcu_queue_idle_ack_delay,
723 cfg_pcu_queue_idle_ack_delay_cmd,
724 "queue idle-ack-delay <1-65535>",
725 QUEUE_STR QUEUE_IDLE_ACK_STR "Idle ACK delay in centi-seconds",
726 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200727{
Jacob Erlbeck2acfbeb2015-04-30 17:55:16 +0200728 uint16_t csec = atoi(argv[0]);
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100729 the_pcu->vty.llc_idle_ack_csec = csec;
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200730 return CMD_SUCCESS;
731}
732
Philipp Maier9459ebd2020-09-29 23:31:33 +0200733DEFUN_ATTR(cfg_pcu_no_queue_idle_ack_delay,
734 cfg_pcu_no_queue_idle_ack_delay_cmd,
735 "no queue idle-ack-delay",
736 NO_STR QUEUE_STR QUEUE_IDLE_ACK_STR,
737 CMD_ATTR_IMMEDIATE)
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200738{
Pau Espin Pedrolf473ec92021-01-14 14:45:14 +0100739 the_pcu->vty.llc_idle_ack_csec = 0;
Jacob Erlbeckd0261b72015-04-02 13:58:09 +0200740 return CMD_SUCCESS;
741}
742
Philipp Maier9459ebd2020-09-29 23:31:33 +0200743DEFUN_ATTR(cfg_pcu_alloc,
744 cfg_pcu_alloc_cmd,
745 "alloc-algorithm (a|b|dynamic)",
746 "Select slot allocation algorithm to use when assigning timeslots on "
747 "PACCH\n"
748 "Single slot is assigned only\n"
749 "Multiple slots are assigned for semi-duplex operation\n"
750 "Dynamically select the algorithm based on the system state\n",
751 CMD_ATTR_IMMEDIATE)
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200752{
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200753 switch (argv[0][0]) {
754 case 'a':
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100755 the_pcu->alloc_algorithm = alloc_algorithm_a;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200756 break;
757 case 'b':
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100758 the_pcu->alloc_algorithm = alloc_algorithm_b;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200759 break;
Jacob Erlbeck400ec022015-07-14 13:31:48 +0200760 default:
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +0100761 the_pcu->alloc_algorithm = alloc_algorithm_dynamic;
Jacob Erlbeck400ec022015-07-14 13:31:48 +0200762 break;
Andreas Eversberga1503fa2012-07-22 08:58:09 +0200763 }
764
765 return CMD_SUCCESS;
766}
767
Philipp Maier9459ebd2020-09-29 23:31:33 +0200768DEFUN_ATTR(cfg_pcu_two_phase,
769 cfg_pcu_two_phase_cmd,
770 "two-phase-access",
771 "Force two phase access when MS requests single phase access\n",
772 CMD_ATTR_IMMEDIATE)
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200773{
Pau Espin Pedrol03de8982021-01-14 12:48:50 +0100774 the_pcu->vty.force_two_phase = 1;
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200775 return CMD_SUCCESS;
776}
777
Philipp Maier9459ebd2020-09-29 23:31:33 +0200778DEFUN_ATTR(cfg_pcu_no_two_phase,
779 cfg_pcu_no_two_phase_cmd,
780 "no two-phase-access",
781 NO_STR "Only use two phase access when requested my MS\n",
782 CMD_ATTR_IMMEDIATE)
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200783{
Pau Espin Pedrol03de8982021-01-14 12:48:50 +0100784 the_pcu->vty.force_two_phase = 0;
Andreas Eversberg07e97cf2012-08-07 16:00:56 +0200785 return CMD_SUCCESS;
786}
787
Philipp Maier9459ebd2020-09-29 23:31:33 +0200788DEFUN_ATTR(cfg_pcu_alpha,
789 cfg_pcu_alpha_cmd,
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100790 "alpha (si13|<0-10>)",
Philipp Maier9459ebd2020-09-29 23:31:33 +0200791 "Alpha parameter for MS power control in units of 0.1 (see TS 05.08) "
792 "NOTE: Be sure to set Alpha value at System information 13 too.\n"
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100793 "Use value received from BSC in System Intormation 13 (default)\n"
794 "Force Alpha in units of 0.1\n",
795 CMD_ATTR_IMMEDIATE | CMD_ATTR_DEPRECATED)
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200796{
Pau Espin Pedrolfe8de452021-02-09 18:47:34 +0100797 vty_out(vty, "%% 'alpha <0-10>' is now deprecated: use osmo-bsc's 'gprs power-control alpha <0-10>' instead%s",
798 VTY_NEWLINE);
799 if (strcmp(argv[0], "si13") == 0)
800 the_pcu->vty.force_alpha = (uint8_t) -1;
801 else
802 the_pcu->vty.force_alpha = atoi(argv[0]);
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200803 return CMD_SUCCESS;
804}
805
Philipp Maier9459ebd2020-09-29 23:31:33 +0200806DEFUN_ATTR(cfg_pcu_gamma,
807 cfg_pcu_gamma_cmd,
808 "gamma <0-62>",
809 "Gamma parameter for MS power control in units of dB (see TS 05.08)\n"
810 "Gamma in even unit of dBs\n",
811 CMD_ATTR_IMMEDIATE)
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200812{
Pau Espin Pedrola2814952021-01-14 12:53:53 +0100813 the_pcu->vty.gamma = atoi(argv[0]) / 2;
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +0200814 return CMD_SUCCESS;
815}
816
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +0100817DEFUN(show_bts_stats,
818 show_bts_stats_cmd,
819 "show bts statistics",
820 SHOW_STR "BTS related functionality\nStatistics\n")
821{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +0100822 struct gprs_rlcmac_bts *bts;
823 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
824 vty_out(vty, "BTS%" PRIu8 ":%s", bts->nr, VTY_NEWLINE);
825 vty_out_rate_ctr_group(vty, " ", bts_rate_counters(bts));
826 }
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +0100827 return CMD_SUCCESS;
Daniel Willmann772415f2014-01-15 17:06:51 +0100828}
829
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +0200830DEFUN(show_bts_pdch,
831 show_bts_pdch_cmd,
832 "show bts pdch",
833 SHOW_STR "BTS related functionality\nPDCH timeslots\n")
834{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +0100835 struct gprs_rlcmac_bts *bts;
836 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
837 pcu_vty_show_bts_pdch(vty, bts);
838 }
839 return CMD_SUCCESS;
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +0200840}
841
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100842#define IDLE_TIME_STR "keep an idle DL TBF alive for the time given\n"
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200843DEFUN_DEPRECATED(cfg_pcu_dl_tbf_idle_time,
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100844 cfg_pcu_dl_tbf_idle_time_cmd,
845 "dl-tbf-idle-time <1-5000>",
846 IDLE_TIME_STR "idle time in msec")
847{
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200848 vty_out(vty, "%% 'dl-tbf-idle-time' is now deprecated: use 'timer X2031 <val>' instead%s", VTY_NEWLINE);
849
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100850 if (osmo_tdef_set(the_pcu->T_defs, -2031, atoi(argv[0]), OSMO_TDEF_MS) < 0)
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200851 return CMD_WARNING;
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100852 return CMD_SUCCESS;
853}
854
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200855DEFUN_DEPRECATED(cfg_pcu_no_dl_tbf_idle_time,
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100856 cfg_pcu_no_dl_tbf_idle_time_cmd,
857 "no dl-tbf-idle-time",
858 NO_STR IDLE_TIME_STR)
859{
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200860 vty_out(vty, "%% 'no dl-tbf-idle-time' is now deprecated: use 'timer X2031 0' instead%s", VTY_NEWLINE);
861
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +0100862 if (osmo_tdef_set(the_pcu->T_defs, -2031, 0, OSMO_TDEF_MS) < 0)
Pau Espin Pedrol2b5c6292019-09-09 13:41:00 +0200863 return CMD_WARNING;
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +0100864 return CMD_SUCCESS;
865}
866
Oliver Smith45fdc442019-09-05 15:12:20 +0200867#define RETRANSMISSION_STR "retransmit blocks even before the MS had a chance to receive them (better throughput," \
868 " less readable traces)"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200869DEFUN_ATTR(cfg_pcu_dl_tbf_preemptive_retransmission,
870 cfg_pcu_dl_tbf_preemptive_retransmission_cmd,
871 "dl-tbf-preemptive-retransmission",
872 RETRANSMISSION_STR " (enabled by default)",
873 CMD_ATTR_IMMEDIATE)
Oliver Smith45fdc442019-09-05 15:12:20 +0200874{
Pau Espin Pedrol05f9f592021-01-14 12:56:58 +0100875 the_pcu->vty.dl_tbf_preemptive_retransmission = true;
Oliver Smith45fdc442019-09-05 15:12:20 +0200876 return CMD_SUCCESS;
877}
878
Philipp Maier9459ebd2020-09-29 23:31:33 +0200879DEFUN_ATTR(cfg_pcu_no_dl_tbf_preemptive_retransmission,
880 cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd,
881 "no dl-tbf-preemptive-retransmission",
882 NO_STR RETRANSMISSION_STR,
883 CMD_ATTR_IMMEDIATE)
Oliver Smith45fdc442019-09-05 15:12:20 +0200884{
Pau Espin Pedrol05f9f592021-01-14 12:56:58 +0100885 the_pcu->vty.dl_tbf_preemptive_retransmission = false;
Oliver Smith45fdc442019-09-05 15:12:20 +0200886 return CMD_SUCCESS;
887}
888
Jacob Erlbecka098c192015-05-28 16:11:19 +0200889#define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n"
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200890DEFUN_DEPRECATED(cfg_pcu_ms_idle_time,
Jacob Erlbecka098c192015-05-28 16:11:19 +0200891 cfg_pcu_ms_idle_time_cmd,
892 "ms-idle-time <1-7200>",
893 MS_IDLE_TIME_STR "idle time in sec")
894{
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200895 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 +0100896 if (osmo_tdef_set(the_pcu->T_defs, -2030, atoi(argv[0]), OSMO_TDEF_S) < 0)
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200897 return CMD_WARNING;
Jacob Erlbecka098c192015-05-28 16:11:19 +0200898 return CMD_SUCCESS;
899}
900
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200901DEFUN_DEPRECATED(cfg_pcu_no_ms_idle_time,
Jacob Erlbecka098c192015-05-28 16:11:19 +0200902 cfg_pcu_no_ms_idle_time_cmd,
903 "no ms-idle-time",
904 NO_STR MS_IDLE_TIME_STR)
905{
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200906 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 +0100907 if (osmo_tdef_set(the_pcu->T_defs, -2030, 0, OSMO_TDEF_S) < 0)
Pau Espin Pedrol63700ea2019-09-09 13:19:06 +0200908 return CMD_WARNING;
Jacob Erlbecka098c192015-05-28 16:11:19 +0200909 return CMD_SUCCESS;
910}
911
Pau Espin Pedrol1e6eb302019-11-28 17:00:44 +0100912#define CS_ERR_LIMITS_STR "set thresholds for error rate based downlink (M)CS adjustment\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200913DEFUN_ATTR(cfg_pcu_cs_err_limits,
914 cfg_pcu_cs_err_limits_cmd,
915 "cs threshold <0-100> <0-100>",
916 CS_STR CS_ERR_LIMITS_STR "lower limit in %\n" "upper limit in %\n",
917 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200918{
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200919 uint8_t lower_limit = atoi(argv[0]);
920 uint8_t upper_limit = atoi(argv[1]);
921
922 if (lower_limit > upper_limit) {
923 vty_out(vty,
924 "The lower limit must be less than or equal to the "
925 "upper limit.%s", VTY_NEWLINE);
926 return CMD_WARNING;
927 }
928
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100929 the_pcu->vty.cs_adj_enabled = true;
930 the_pcu->vty.cs_adj_upper_limit = upper_limit;
931 the_pcu->vty.cs_adj_lower_limit = lower_limit;
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200932
933 return CMD_SUCCESS;
934}
935
Philipp Maier9459ebd2020-09-29 23:31:33 +0200936DEFUN_ATTR(cfg_pcu_no_cs_err_limits,
937 cfg_pcu_no_cs_err_limits_cmd,
938 "no cs threshold",
939 NO_STR CS_STR CS_ERR_LIMITS_STR,
940 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200941{
Pau Espin Pedrole8dcf642021-01-14 13:17:01 +0100942 the_pcu->vty.cs_adj_enabled = false;
943 the_pcu->vty.cs_adj_upper_limit = 100;
944 the_pcu->vty.cs_adj_lower_limit = 0;
Jacob Erlbeck8322d082015-06-04 15:12:10 +0200945
946 return CMD_SUCCESS;
947}
948
Pau Espin Pedrol1e6eb302019-11-28 17:00:44 +0100949#define CS_DOWNGRADE_STR "set threshold for data size based downlink (M)CS downgrade\n"
Philipp Maier9459ebd2020-09-29 23:31:33 +0200950DEFUN_ATTR(cfg_pcu_cs_downgrade_thrsh,
951 cfg_pcu_cs_downgrade_thrsh_cmd,
952 "cs downgrade-threshold <1-10000>",
953 CS_STR CS_DOWNGRADE_STR "downgrade if less octets left\n",
954 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200955{
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100956 the_pcu->vty.cs_downgrade_threshold = atoi(argv[0]);
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200957 return CMD_SUCCESS;
958}
959
Philipp Maier9459ebd2020-09-29 23:31:33 +0200960DEFUN_ATTR(cfg_pcu_no_cs_downgrade_thrsh,
961 cfg_pcu_no_cs_downgrade_thrsh_cmd,
962 "no cs downgrade-threshold",
963 NO_STR CS_STR CS_DOWNGRADE_STR,
964 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200965{
Pau Espin Pedrolad79b852021-01-14 13:20:55 +0100966 the_pcu->vty.cs_downgrade_threshold = 0;
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +0200967 return CMD_SUCCESS;
968}
969
Philipp Maier9459ebd2020-09-29 23:31:33 +0200970DEFUN_ATTR(cfg_pcu_cs_lqual_ranges,
971 cfg_pcu_cs_lqual_ranges_cmd,
972 "cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35> cs3 <0-35> <0-35> cs4 <0-35>",
973 CS_STR "Set link quality ranges for each uplink CS\n"
974 "Set quality range for CS-1 (high value only)\n"
975 "CS-1 high (dB)\n"
976 "Set quality range for CS-2\n"
977 "CS-2 low (dB)\n"
978 "CS-2 high (dB)\n"
979 "Set quality range for CS-3\n"
980 "CS-3 low (dB)\n"
981 "CS-3 high (dB)\n"
982 "Set quality range for CS-4 (low value only)\n"
983 "CS-4 low (dB)\n",
984 CMD_ATTR_IMMEDIATE)
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200985{
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200986 uint8_t cs1_high = atoi(argv[0]);
987 uint8_t cs2_low = atoi(argv[1]);
988 uint8_t cs2_high = atoi(argv[2]);
989 uint8_t cs3_low = atoi(argv[3]);
990 uint8_t cs3_high = atoi(argv[4]);
991 uint8_t cs4_low = atoi(argv[5]);
992
Pau Espin Pedrol54b159a2021-01-14 13:30:04 +0100993 the_pcu->vty.cs_lqual_ranges[0].high = cs1_high;
994 the_pcu->vty.cs_lqual_ranges[1].low = cs2_low;
995 the_pcu->vty.cs_lqual_ranges[1].high = cs2_high;
996 the_pcu->vty.cs_lqual_ranges[2].low = cs3_low;
997 the_pcu->vty.cs_lqual_ranges[2].high = cs3_high;
998 the_pcu->vty.cs_lqual_ranges[3].low = cs4_low;
Jacob Erlbeck94cde132015-06-09 09:44:36 +0200999
1000 return CMD_SUCCESS;
1001}
1002
Philipp Maier9459ebd2020-09-29 23:31:33 +02001003DEFUN_ATTR(cfg_pcu_mcs_lqual_ranges,
1004 cfg_pcu_mcs_lqual_ranges_cmd,
1005 "mcs link-quality-ranges mcs1 <0-35> mcs2 <0-35> <0-35> mcs3 <0-35> <0-35> mcs4 <0-35> <0-35> mcs5 <0-35> <0-35> mcs6 <0-35> <0-35> mcs7 <0-35> <0-35> mcs8 <0-35> <0-35> mcs9 <0-35>",
1006 CS_STR "Set link quality ranges for each uplink MCS\n"
1007 "Set quality range for MCS-1 (high value only)\n"
1008 "MCS-1 high (dB)\n"
1009 "Set quality range for MCS-2\n"
1010 "MCS-2 high (dB)\n"
1011 "MCS-2 low (dB)\n"
1012 "Set quality range for MCS-3\n"
1013 "MCS-3 high (dB)\n"
1014 "MCS-3 low (dB)\n"
1015 "Set quality range for MCS-4\n"
1016 "MCS-4 high (dB)\n"
1017 "MCS-4 low (dB)\n"
1018 "Set quality range for MCS-5\n"
1019 "MCS-5 high (dB)\n"
1020 "MCS-5 low (dB)\n"
1021 "Set quality range for MCS-6\n"
1022 "MCS-6 low (dB)\n"
1023 "MCS-6 high (dB)\n"
1024 "Set quality range for MCS-7\n"
1025 "MCS-7 low (dB)\n"
1026 "MCS-7 high (dB)\n"
1027 "Set quality range for MCS-8\n"
1028 "MCS-8 low (dB)\n"
1029 "MCS-8 high (dB)\n"
1030 "Set quality range for MCS-9 (low value only)\n"
1031 "MCS-9 low (dB)\n",
1032 CMD_ATTR_IMMEDIATE)
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001033{
Pau Espin Pedrol54b159a2021-01-14 13:30:04 +01001034 the_pcu->vty.mcs_lqual_ranges[0].high = atoi(argv[0]);
1035 the_pcu->vty.mcs_lqual_ranges[1].low = atoi(argv[1]);
1036 the_pcu->vty.mcs_lqual_ranges[1].high = atoi(argv[2]);
1037 the_pcu->vty.mcs_lqual_ranges[2].low = atoi(argv[3]);
1038 the_pcu->vty.mcs_lqual_ranges[2].high = atoi(argv[4]);
1039 the_pcu->vty.mcs_lqual_ranges[3].low = atoi(argv[5]);
1040 the_pcu->vty.mcs_lqual_ranges[3].high = atoi(argv[6]);
1041 the_pcu->vty.mcs_lqual_ranges[4].low = atoi(argv[7]);
1042 the_pcu->vty.mcs_lqual_ranges[4].high = atoi(argv[8]);
1043 the_pcu->vty.mcs_lqual_ranges[5].low = atoi(argv[9]);
1044 the_pcu->vty.mcs_lqual_ranges[5].high = atoi(argv[10]);
1045 the_pcu->vty.mcs_lqual_ranges[6].low = atoi(argv[11]);
1046 the_pcu->vty.mcs_lqual_ranges[6].high = atoi(argv[12]);
1047 the_pcu->vty.mcs_lqual_ranges[7].low = atoi(argv[13]);
1048 the_pcu->vty.mcs_lqual_ranges[7].high = atoi(argv[14]);
1049 the_pcu->vty.mcs_lqual_ranges[8].low = atoi(argv[15]);
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001050
1051 return CMD_SUCCESS;
1052}
1053
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001054DEFUN(cfg_pcu_sock,
1055 cfg_pcu_sock_cmd,
1056 "pcu-socket PATH",
1057 "Configure the osmo-bts PCU socket file/path name\n"
1058 "Path of the socket to connect to\n")
1059{
Vadim Yanitskiyfc75cc02019-11-30 20:13:25 +07001060 if (vty->type != VTY_FILE)
1061 vty_out(vty, "Changing PCU socket path at run-time has no effect%s", VTY_NEWLINE);
1062
Pau Espin Pedrolac3fd122021-01-13 18:54:38 +01001063 osmo_talloc_replace_string(tall_pcu_ctx, &the_pcu->pcu_sock_path, argv[0]);
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001064
1065 return CMD_SUCCESS;
1066}
Jacob Erlbeck94cde132015-06-09 09:44:36 +02001067
Philipp Maier9459ebd2020-09-29 23:31:33 +02001068DEFUN_USRATTR(cfg_pcu_gb_dialect,
1069 cfg_pcu_gb_dialect_cmd,
1070 X(PCU_VTY_ATTR_NS_RESET),
1071 "gb-dialect (classic|ip-sns)",
1072 "Select which Gb interface dialect to use\n"
1073 "Classic Gb interface with NS-{RESET,BLOCK,UNBLOCK} and static configuration\n"
1074 "Modern Gb interface with IP-SNS (Sub Network Service) and dynamic configuration\n")
Harald Welte57d35152018-07-05 03:11:17 +02001075{
Alexander Couzens290d9032020-09-16 21:52:02 +02001076 if (!strcmp(argv[0], "ip-sns")) {
Alexander Couzensf7ec5252021-01-25 20:28:38 +01001077 the_pcu->vty.ns_dialect = GPRS_NS2_DIALECT_SNS;
Alexander Couzens290d9032020-09-16 21:52:02 +02001078 } else {
Alexander Couzensf7ec5252021-01-25 20:28:38 +01001079 the_pcu->vty.ns_dialect = GPRS_NS2_DIALECT_IPACCESS;
Alexander Couzens290d9032020-09-16 21:52:02 +02001080 }
Harald Welte57d35152018-07-05 03:11:17 +02001081
1082 return CMD_SUCCESS;
1083}
1084
Harald Welted9367e32021-04-29 22:02:47 +02001085DEFUN_USRATTR(cfg_pcu_gb_ip_dscp,
1086 cfg_pcu_gb_ip_dscp_cmd,
1087 X(PCU_VTY_ATTR_NS_RESET),
1088 "gb ip-dscp <0-63>",
1089 "Configure Gb interface\n"
1090 "Set IP DSCP value for outbound packets\n"
1091 "IP DSCP value to use\n")
1092{
1093 the_pcu->vty.ns_ip_dscp = atoi(argv[0]);
1094 return CMD_SUCCESS;
1095}
1096
1097DEFUN_USRATTR(cfg_pcu_gb_priority,
1098 cfg_pcu_gb_priority_cmd,
1099 X(PCU_VTY_ATTR_NS_RESET),
1100 "gb socket-priority <0-255>",
1101 "Configure Gb interface\n"
1102 "Set socket priority value for outbound packets\n"
1103 "Socket priority value to use (>6 requires CAP_NET_ADMIN)")
1104{
1105 the_pcu->vty.ns_priority = atoi(argv[0]);
1106 return CMD_SUCCESS;
1107}
1108
Pau Espin Pedrolc0a250d2021-01-21 18:46:13 +01001109DEFUN(cfg_neighbor_resolution, cfg_neighbor_resolution_cmd,
1110 "neighbor resolution " VTY_IPV46_CMD " [<0-65535>]",
1111 "Manage local and remote-BSS neighbor cells\n"
1112 "Connect to Neighbor Resolution Service (CTRL interface) to given ip and port\n"
1113 "IPv4 address to connect to\n" "IPv6 address to connect to\n"
1114 "Port to connect to (default 4248)\n")
1115{
Pau Espin Pedrol5557c0a2021-09-07 14:09:50 +02001116 vty_out(vty, "%% Warning: The CTRL interface for Neighbor Address Resolution is now deprecated."
1117 "Upgrade osmo-bsc and drop the 'neighbor resolution " VTY_IPV46_CMD " [<0-65535>]' VTY "
1118 "option in order to let osmo-pcu use the new resoluton method using the PCUIF over IPA "
1119 "multiplex, which will work out of the box without required configuration.%s", VTY_NEWLINE);
Pau Espin Pedrolc0a250d2021-01-21 18:46:13 +01001120 osmo_talloc_replace_string(the_pcu, &the_pcu->vty.neigh_ctrl_addr, argv[0]);
1121 if (argc > 1)
1122 the_pcu->vty.neigh_ctrl_port = atoi(argv[1]);
1123 else
1124 the_pcu->vty.neigh_ctrl_port = OSMO_CTRL_PORT_BSC_NEIGH;
1125 return CMD_SUCCESS;
1126}
1127
1128
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001129DEFUN(show_bts_timer, show_bts_timer_cmd,
1130 "show bts-timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL,
1131 SHOW_STR "Show BTS controlled timers\n"
1132 OSMO_TDEF_VTY_DOC_T)
1133{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001134 struct gprs_rlcmac_bts *bts;
1135 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1136 const char *T_arg = argc > 0 ? argv[0] : NULL;
1137 vty_out(vty, "BTS%" PRIu8 ":%s", bts->nr, VTY_NEWLINE);
1138 osmo_tdef_vty_show_cmd(vty, bts->T_defs_bts, T_arg, " ");
1139 }
1140 return CMD_SUCCESS;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001141}
1142
1143DEFUN(show_timer, show_timer_cmd,
1144 "show timer " OSMO_TDEF_VTY_ARG_T_OPTIONAL,
1145 SHOW_STR "Show PCU timers\n"
1146 OSMO_TDEF_VTY_DOC_T)
1147{
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001148 const char *T_arg = argc > 0 ? argv[0] : NULL;
Pau Espin Pedrol924aaad2021-01-14 12:01:42 +01001149 return osmo_tdef_vty_show_cmd(vty, the_pcu->T_defs, T_arg, NULL);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001150}
1151
Philipp Maier9459ebd2020-09-29 23:31:33 +02001152DEFUN_ATTR(cfg_pcu_timer, cfg_pcu_timer_cmd,
1153 "timer " OSMO_TDEF_VTY_ARG_SET_OPTIONAL,
1154 "Configure or show PCU timers\n"
1155 OSMO_TDEF_VTY_DOC_SET,
1156 CMD_ATTR_IMMEDIATE)
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001157{
Pau Espin Pedrolab7159f2021-01-26 17:51:44 +01001158 int rc;
1159 struct osmo_tdef *t;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001160 /* If any arguments are missing, redirect to 'show' */
1161 if (argc < 2)
1162 return show_timer(self, vty, argc, argv);
Pau Espin Pedrolab7159f2021-01-26 17:51:44 +01001163 if ((rc = osmo_tdef_vty_set_cmd(vty, the_pcu->T_defs, argv)) != CMD_SUCCESS)
1164 return rc;
1165 t = osmo_tdef_vty_parse_T_arg(vty, the_pcu->T_defs, argv[0]);
1166 switch (t->T) {
1167 case PCU_TDEF_NEIGH_CACHE_ALIVE:
1168 neigh_cache_set_keep_time_interval(the_pcu->neigh_cache, t->val);
1169 break;
1170 case PCU_TDEF_SI_CACHE_ALIVE:
1171 si_cache_set_keep_time_interval(the_pcu->si_cache, t->val);
1172 break;
1173 default:
1174 break;
1175 }
1176 return CMD_SUCCESS;
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001177}
1178
Daniel Willmann772415f2014-01-15 17:06:51 +01001179DEFUN(show_tbf,
1180 show_tbf_cmd,
Max12a09872018-02-01 16:07:33 +01001181 "show tbf (all|ccch|pacch)",
1182 SHOW_STR "information about TBFs\n"
1183 "All TBFs\n"
1184 "TBFs allocated via CCCH\n"
1185 "TBFs allocated via PACCH\n")
Daniel Willmann772415f2014-01-15 17:06:51 +01001186{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001187 struct gprs_rlcmac_bts *bts;
1188 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1189 uint32_t flags = UINT32_MAX;
Max12a09872018-02-01 16:07:33 +01001190
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001191 if (argv[0][0] == 'c')
1192 flags = (1 << GPRS_RLCMAC_FLAG_CCCH);
1193 else if (argv[0][0] == 'p')
1194 flags = (1 << GPRS_RLCMAC_FLAG_PACCH);
Max12a09872018-02-01 16:07:33 +01001195
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001196 pcu_vty_show_tbf_all(vty, bts, flags);
1197 }
1198 return CMD_SUCCESS;
Daniel Willmann772415f2014-01-15 17:06:51 +01001199}
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001200
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001201DEFUN(show_ms_all,
1202 show_ms_all_cmd,
1203 "show ms all",
1204 SHOW_STR "information about MSs\n" "All TBFs\n")
1205{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001206 struct gprs_rlcmac_bts *bts;
1207 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1208 pcu_vty_show_ms_all(vty, bts);
1209 }
1210 return CMD_SUCCESS;
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001211}
1212
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001213DEFUN(show_ms_tlli,
1214 show_ms_tlli_cmd,
1215 "show ms tlli TLLI",
1216 SHOW_STR "information about MSs\n" "Select MS by TLLI\n" "TLLI as hex\n")
1217{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001218 struct gprs_rlcmac_bts *bts;
1219 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1220 char *endp = NULL;
1221 unsigned long long tlli = strtoll(argv[0], &endp, 16);
1222 if ((endp != NULL && *endp != 0) || tlli > 0xffffffffULL) {
1223 vty_out(vty, "Invalid TLLI.%s", VTY_NEWLINE);
1224 return CMD_WARNING;
1225 }
1226 pcu_vty_show_ms_by_tlli(vty, bts, (uint32_t)tlli);
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001227 }
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001228 return CMD_SUCCESS;
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001229}
1230
1231DEFUN(show_ms_imsi,
1232 show_ms_imsi_cmd,
1233 "show ms imsi IMSI",
1234 SHOW_STR "information about MSs\n" "Select MS by IMSI\n" "IMSI\n")
1235{
Pau Espin Pedrold1049dc2021-01-18 17:14:14 +01001236 struct gprs_rlcmac_bts *bts;
1237 llist_for_each_entry(bts, &the_pcu->bts_list, list) {
1238 pcu_vty_show_ms_by_imsi(vty, bts, argv[0]);
1239 }
1240 return CMD_SUCCESS;
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001241}
1242
Andreas Eversberg12942562012-07-12 14:31:57 +02001243static const char pcu_copyright[] =
Harald Weltef94562a2022-11-11 18:19:06 +01001244 "Copyright (C) 2012-2013 by Ivan Kluchnikov and Andreas Eversberg\r\n"
1245 "Copyright (C) 2013-2022 by sysmocom - s.f.m.c. GmbH\r\n"
Andreas Eversberg12942562012-07-12 14:31:57 +02001246 "License GNU GPL version 2 or later\r\n"
1247 "This is free software: you are free to change and redistribute it.\r\n"
1248 "There is NO WARRANTY, to the extent permitted by law.\r\n";
1249
1250struct vty_app_info pcu_vty_info = {
Pau Espin Pedrold0fc9e82019-11-29 13:37:45 +01001251 .name = "OsmoPCU",
Andreas Eversberg12942562012-07-12 14:31:57 +02001252 .version = PACKAGE_VERSION,
1253 .copyright = pcu_copyright,
Philipp Maier9459ebd2020-09-29 23:31:33 +02001254 .usr_attr_desc = {
1255 [PCU_VTY_ATTR_NEW_TBF] = \
1256 "This command applies when a new TBF is begins",
1257 [PCU_VTY_ATTR_NEW_SUBSCR] = \
1258 "This command applies when a new subscriber attaches",
1259 [PCU_VTY_ATTR_NS_RESET] = \
1260 "This command applies when the NS is reset",
1261 },
1262 .usr_attr_letters = {
1263 [PCU_VTY_ATTR_NEW_TBF] = 'n',
1264 [PCU_VTY_ATTR_NEW_SUBSCR] = 's',
1265 [PCU_VTY_ATTR_NS_RESET] = 'r',
1266 },
Andreas Eversberg12942562012-07-12 14:31:57 +02001267};
1268
Pau Espin Pedrolcd2ac562019-08-05 14:30:44 +02001269int pcu_vty_init(void)
Andreas Eversberg12942562012-07-12 14:31:57 +02001270{
1271// install_element_ve(&show_pcu_cmd);
1272
Harald Welte717cdf52017-07-21 21:56:23 +02001273 cfg_pcu_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names,
1274 "gsmtap-category (",
1275 "|",")", VTY_DO_LOWER);
1276 cfg_pcu_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help,
1277 "GSMTAP Category\n",
1278 "\n", "", 0);
1279 cfg_pcu_no_gsmtap_categ_cmd.string = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_names,
1280 "no gsmtap-category (",
1281 "|",")", VTY_DO_LOWER);
1282 cfg_pcu_no_gsmtap_categ_cmd.doc = vty_cmd_string_from_valstr(tall_pcu_ctx, pcu_gsmtap_categ_help,
1283 NO_STR "GSMTAP Category\n",
1284 "\n", "", 0);
1285
Pau Espin Pedrolcd2ac562019-08-05 14:30:44 +02001286 logging_vty_add_cmds();
1287 osmo_stats_vty_add_cmds();
Vadim Yanitskiyd83c8ff2020-02-06 16:46:17 +07001288 osmo_talloc_vty_add_cmds();
Vadim Yanitskiy830ca262021-02-05 23:22:37 +01001289 osmo_fsm_vty_add_cmds();
Andreas Eversberg12942562012-07-12 14:31:57 +02001290
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001291 install_node(&pcu_node, config_write_pcu);
1292 install_element(CONFIG_NODE, &cfg_pcu_cmd);
Jacob Erlbeck953c7892015-09-28 18:12:57 +02001293 install_element(PCU_NODE, &cfg_pcu_egprs_cmd);
1294 install_element(PCU_NODE, &cfg_pcu_no_egprs_cmd);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +02001295 install_element(PCU_NODE, &cfg_pcu_no_two_phase_cmd);
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001296 install_element(PCU_NODE, &cfg_pcu_cs_cmd);
1297 install_element(PCU_NODE, &cfg_pcu_no_cs_cmd);
Jacob Erlbeckb33e6752015-06-04 19:04:30 +02001298 install_element(PCU_NODE, &cfg_pcu_cs_max_cmd);
1299 install_element(PCU_NODE, &cfg_pcu_no_cs_max_cmd);
Jacob Erlbeck8322d082015-06-04 15:12:10 +02001300 install_element(PCU_NODE, &cfg_pcu_cs_err_limits_cmd);
1301 install_element(PCU_NODE, &cfg_pcu_no_cs_err_limits_cmd);
Jacob Erlbeck70b96aa2015-06-12 10:52:34 +02001302 install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd);
1303 install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd);
Jacob Erlbeck94cde132015-06-09 09:44:36 +02001304 install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd);
Minh-Quang Nguyen1f189092017-08-16 09:50:06 -04001305 install_element(PCU_NODE, &cfg_pcu_mcs_lqual_ranges_cmd);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +01001306 install_element(PCU_NODE, &cfg_pcu_mcs_cmd);
Aravind Sirsikar50b09702016-08-22 17:21:10 +05301307 install_element(PCU_NODE, &cfg_pcu_dl_arq_cmd);
Jacob Erlbeck4cc46d32016-02-02 16:02:16 +01001308 install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd);
Jacob Erlbeck0d058052016-01-07 11:48:28 +01001309 install_element(PCU_NODE, &cfg_pcu_mcs_max_cmd);
1310 install_element(PCU_NODE, &cfg_pcu_no_mcs_max_cmd);
Jacob Erlbeck36df7742016-01-19 15:53:30 +01001311 install_element(PCU_NODE, &cfg_pcu_window_size_cmd);
Andreas Eversberg24131bf2012-07-21 11:09:58 +02001312 install_element(PCU_NODE, &cfg_pcu_queue_lifetime_cmd);
1313 install_element(PCU_NODE, &cfg_pcu_queue_lifetime_inf_cmd);
1314 install_element(PCU_NODE, &cfg_pcu_no_queue_lifetime_cmd);
Jacob Erlbeck0c1c8772015-03-20 12:02:42 +01001315 install_element(PCU_NODE, &cfg_pcu_queue_hysteresis_cmd);
1316 install_element(PCU_NODE, &cfg_pcu_no_queue_hysteresis_cmd);
Jacob Erlbeckd4ad7312015-07-17 16:39:09 +02001317 install_element(PCU_NODE, &cfg_pcu_queue_codel_cmd);
1318 install_element(PCU_NODE, &cfg_pcu_queue_codel_interval_cmd);
1319 install_element(PCU_NODE, &cfg_pcu_no_queue_codel_cmd);
Jacob Erlbeckd0261b72015-04-02 13:58:09 +02001320 install_element(PCU_NODE, &cfg_pcu_queue_idle_ack_delay_cmd);
1321 install_element(PCU_NODE, &cfg_pcu_no_queue_idle_ack_delay_cmd);
Andreas Eversberga1503fa2012-07-22 08:58:09 +02001322 install_element(PCU_NODE, &cfg_pcu_alloc_cmd);
Andreas Eversberg07e97cf2012-08-07 16:00:56 +02001323 install_element(PCU_NODE, &cfg_pcu_two_phase_cmd);
Andreas Eversbergcd8a83a2012-09-23 06:41:21 +02001324 install_element(PCU_NODE, &cfg_pcu_fc_interval_cmd);
Jacob Erlbeck0288cdb2015-05-06 10:47:30 +02001325 install_element(PCU_NODE, &cfg_pcu_fc_bucket_time_cmd);
1326 install_element(PCU_NODE, &cfg_pcu_no_fc_bucket_time_cmd);
Jacob Erlbeck87d73412015-04-21 12:56:48 +02001327 install_element(PCU_NODE, &cfg_pcu_fc_bvc_bucket_size_cmd);
1328 install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_bucket_size_cmd);
1329 install_element(PCU_NODE, &cfg_pcu_fc_bvc_leak_rate_cmd);
1330 install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_leak_rate_cmd);
1331 install_element(PCU_NODE, &cfg_pcu_fc_ms_bucket_size_cmd);
1332 install_element(PCU_NODE, &cfg_pcu_no_fc_ms_bucket_size_cmd);
1333 install_element(PCU_NODE, &cfg_pcu_fc_ms_leak_rate_cmd);
1334 install_element(PCU_NODE, &cfg_pcu_no_fc_ms_leak_rate_cmd);
Andreas Eversbergaafcbbb2012-09-27 09:20:45 +02001335 install_element(PCU_NODE, &cfg_pcu_alpha_cmd);
1336 install_element(PCU_NODE, &cfg_pcu_gamma_cmd);
Jacob Erlbeck3bed5d12015-03-19 11:22:38 +01001337 install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_cmd);
1338 install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd);
Oliver Smith45fdc442019-09-05 15:12:20 +02001339 install_element(PCU_NODE, &cfg_pcu_dl_tbf_preemptive_retransmission_cmd);
1340 install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd);
Jacob Erlbecka098c192015-05-28 16:11:19 +02001341 install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd);
1342 install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd);
Pau Espin Pedrol13866f02021-11-12 13:42:03 +01001343 install_element(PCU_NODE, &cfg_pcu_gsmtap_remote_host_cmd);
1344 install_element(PCU_NODE, &cfg_pcu_no_gsmtap_remote_host_cmd);
1345 install_element(PCU_NODE, &pcucfg_pcu_gsmtap_categ_all_cmd);
Harald Welte717cdf52017-07-21 21:56:23 +02001346 install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd);
1347 install_element(PCU_NODE, &cfg_pcu_no_gsmtap_categ_cmd);
Pau Espin Pedrolc4178e52017-08-08 15:03:50 +02001348 install_element(PCU_NODE, &cfg_pcu_sock_cmd);
Harald Welte57d35152018-07-05 03:11:17 +02001349 install_element(PCU_NODE, &cfg_pcu_gb_dialect_cmd);
Harald Welted9367e32021-04-29 22:02:47 +02001350 install_element(PCU_NODE, &cfg_pcu_gb_ip_dscp_cmd);
1351 install_element(PCU_NODE, &cfg_pcu_gb_priority_cmd);
Pau Espin Pedrolc0a250d2021-01-21 18:46:13 +01001352 install_element(PCU_NODE, &cfg_neighbor_resolution_cmd);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001353 install_element(PCU_NODE, &cfg_pcu_timer_cmd);
Andreas Eversberg8b761a32012-07-20 21:50:31 +02001354
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001355 install_element_ve(&show_bts_stats_cmd);
Pau Espin Pedrola1ac2f02020-09-22 17:01:31 +02001356 install_element_ve(&show_bts_pdch_cmd);
Daniel Willmann772415f2014-01-15 17:06:51 +01001357 install_element_ve(&show_tbf_cmd);
Jacob Erlbeckf47f68a2015-06-04 10:23:24 +02001358 install_element_ve(&show_ms_all_cmd);
Jacob Erlbeck37e896d2015-06-05 16:33:33 +02001359 install_element_ve(&show_ms_tlli_cmd);
1360 install_element_ve(&show_ms_imsi_cmd);
Pau Espin Pedrol28f160e2019-09-05 14:48:35 +02001361 install_element_ve(&show_bts_timer_cmd);
1362 install_element_ve(&show_timer_cmd);
Holger Hans Peter Freytherf5372982013-10-27 09:02:31 +01001363
Andreas Eversberg12942562012-07-12 14:31:57 +02001364 return 0;
1365}