vty: add attributes to VTY commands indicating when they apply

Change-Id: I63978ce3ea87593c9a41e503ed3b761c64e1e80f
Related: SYS#4937, OS#1601
This commit is contained in:
Philipp Maier 2020-09-29 23:31:33 +02:00 committed by laforge
parent 290d9030e9
commit 9459ebde32
2 changed files with 327 additions and 260 deletions

View File

@ -21,6 +21,8 @@
#include "tbf.h"
#include "pcu_vty_functions.h"
#define X(x) (1 << x)
extern void *tall_pcu_ctx;
static const struct value_string pcu_gsmtap_categ_names[] = {
@ -258,10 +260,11 @@ static int config_write_pcu(struct vty *vty)
}
/* per-BTS configuration */
DEFUN(cfg_pcu,
DEFUN_ATTR(cfg_pcu,
cfg_pcu_cmd,
"pcu",
"BTS specific configure")
"BTS specific configure",
CMD_ATTR_IMMEDIATE)
{
vty->node = PCU_NODE;
@ -270,8 +273,9 @@ DEFUN(cfg_pcu,
#define EGPRS_STR "EGPRS configuration\n"
DEFUN(cfg_pcu_egprs,
DEFUN_USRATTR(cfg_pcu_egprs,
cfg_pcu_egprs_cmd,
X(PCU_VTY_ATTR_NEW_TBF),
"egprs only",
EGPRS_STR "Use EGPRS and disable plain GPRS\n")
{
@ -282,8 +286,9 @@ DEFUN(cfg_pcu_egprs,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_egprs,
DEFUN_USRATTR(cfg_pcu_no_egprs,
cfg_pcu_no_egprs_cmd,
X(PCU_VTY_ATTR_NEW_TBF),
"no egprs",
NO_STR EGPRS_STR)
{
@ -294,11 +299,12 @@ DEFUN(cfg_pcu_no_egprs,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_fc_interval,
DEFUN_ATTR(cfg_pcu_fc_interval,
cfg_pcu_fc_interval_cmd,
"flow-control-interval <1-10>",
"Interval between sending subsequent Flow Control PDUs\n"
"Interval time in seconds\n")
"Interval time in seconds\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -310,10 +316,11 @@ DEFUN(cfg_pcu_fc_interval,
#define FC_BMAX_STR(who) "Force a fixed value for the " who " bucket size\n"
#define FC_LR_STR(who) "Force a fixed value for the " who " leak rate\n"
DEFUN(cfg_pcu_fc_bvc_bucket_size,
DEFUN_ATTR(cfg_pcu_fc_bvc_bucket_size,
cfg_pcu_fc_bvc_bucket_size_cmd,
"flow-control force-bvc-bucket-size <1-6553500>",
FC_STR FC_BMAX_STR("BVC") "Bucket size in octets\n")
FC_STR FC_BMAX_STR("BVC") "Bucket size in octets\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -322,10 +329,11 @@ DEFUN(cfg_pcu_fc_bvc_bucket_size,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_fc_bvc_bucket_size,
DEFUN_ATTR(cfg_pcu_no_fc_bvc_bucket_size,
cfg_pcu_no_fc_bvc_bucket_size_cmd,
"no flow-control force-bvc-bucket-size",
NO_STR FC_STR FC_BMAX_STR("BVC"))
NO_STR FC_STR FC_BMAX_STR("BVC"),
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -334,10 +342,11 @@ DEFUN(cfg_pcu_no_fc_bvc_bucket_size,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_fc_bvc_leak_rate,
DEFUN_ATTR(cfg_pcu_fc_bvc_leak_rate,
cfg_pcu_fc_bvc_leak_rate_cmd,
"flow-control force-bvc-leak-rate <1-6553500>",
FC_STR FC_LR_STR("BVC") "Leak rate in bit/s\n")
FC_STR FC_LR_STR("BVC") "Leak rate in bit/s\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -346,10 +355,11 @@ DEFUN(cfg_pcu_fc_bvc_leak_rate,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_fc_bvc_leak_rate,
DEFUN_ATTR(cfg_pcu_no_fc_bvc_leak_rate,
cfg_pcu_no_fc_bvc_leak_rate_cmd,
"no flow-control force-bvc-leak-rate",
NO_STR FC_STR FC_LR_STR("BVC"))
NO_STR FC_STR FC_LR_STR("BVC"),
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -358,10 +368,11 @@ DEFUN(cfg_pcu_no_fc_bvc_leak_rate,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_fc_ms_bucket_size,
DEFUN_ATTR(cfg_pcu_fc_ms_bucket_size,
cfg_pcu_fc_ms_bucket_size_cmd,
"flow-control force-ms-bucket-size <1-6553500>",
FC_STR FC_BMAX_STR("default MS") "Bucket size in octets\n")
FC_STR FC_BMAX_STR("default MS") "Bucket size in octets\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -370,10 +381,11 @@ DEFUN(cfg_pcu_fc_ms_bucket_size,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_fc_ms_bucket_size,
DEFUN_ATTR(cfg_pcu_no_fc_ms_bucket_size,
cfg_pcu_no_fc_ms_bucket_size_cmd,
"no flow-control force-ms-bucket-size",
NO_STR FC_STR FC_BMAX_STR("default MS"))
NO_STR FC_STR FC_BMAX_STR("default MS"),
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -382,10 +394,11 @@ DEFUN(cfg_pcu_no_fc_ms_bucket_size,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_fc_ms_leak_rate,
DEFUN_ATTR(cfg_pcu_fc_ms_leak_rate,
cfg_pcu_fc_ms_leak_rate_cmd,
"flow-control force-ms-leak-rate <1-6553500>",
FC_STR FC_LR_STR("default MS") "Leak rate in bit/s\n")
FC_STR FC_LR_STR("default MS") "Leak rate in bit/s\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -394,10 +407,11 @@ DEFUN(cfg_pcu_fc_ms_leak_rate,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_fc_ms_leak_rate,
DEFUN_ATTR(cfg_pcu_no_fc_ms_leak_rate,
cfg_pcu_no_fc_ms_leak_rate_cmd,
"no flow-control force-ms-leak-rate",
NO_STR FC_STR FC_LR_STR("default MS"))
NO_STR FC_STR FC_LR_STR("default MS"),
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -407,10 +421,11 @@ DEFUN(cfg_pcu_no_fc_ms_leak_rate,
}
#define FC_BTIME_STR "Set target downlink maximum queueing time (only affects the advertised bucket size)\n"
DEFUN(cfg_pcu_fc_bucket_time,
DEFUN_ATTR(cfg_pcu_fc_bucket_time,
cfg_pcu_fc_bucket_time_cmd,
"flow-control bucket-time <1-65534>",
FC_STR FC_BTIME_STR "Time in centi-seconds\n")
FC_STR FC_BTIME_STR "Time in centi-seconds\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -419,10 +434,11 @@ DEFUN(cfg_pcu_fc_bucket_time,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_fc_bucket_time,
DEFUN_ATTR(cfg_pcu_no_fc_bucket_time,
cfg_pcu_no_fc_bucket_time_cmd,
"no flow-control bucket-time",
NO_STR FC_STR FC_BTIME_STR)
NO_STR FC_STR FC_BTIME_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -433,12 +449,13 @@ DEFUN(cfg_pcu_no_fc_bucket_time,
#define CS_STR "Coding Scheme configuration\n"
DEFUN(cfg_pcu_cs,
DEFUN_ATTR(cfg_pcu_cs,
cfg_pcu_cs_cmd,
"cs <1-4> [<1-4>]",
CS_STR
"Initial CS value to be used (overrides BTS config)\n"
"Use a different initial CS value for the uplink")
"Use a different initial CS value for the uplink",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
uint8_t cs = atoi(argv[0]);
@ -453,10 +470,11 @@ DEFUN(cfg_pcu_cs,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_cs,
DEFUN_ATTR(cfg_pcu_no_cs,
cfg_pcu_no_cs_cmd,
"no cs",
NO_STR CS_STR)
NO_STR CS_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -466,13 +484,14 @@ DEFUN(cfg_pcu_no_cs,
}
#define CS_MAX_STR "Set maximum values for adaptive CS selection (overrides BTS config)\n"
DEFUN(cfg_pcu_cs_max,
DEFUN_ATTR(cfg_pcu_cs_max,
cfg_pcu_cs_max_cmd,
"cs max <1-4> [<1-4>]",
CS_STR
CS_MAX_STR
"Maximum CS value to be used\n"
"Use a different maximum CS value for the uplink")
"Use a different maximum CS value for the uplink",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
uint8_t cs = atoi(argv[0]);
@ -486,10 +505,11 @@ DEFUN(cfg_pcu_cs_max,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_cs_max,
DEFUN_ATTR(cfg_pcu_no_cs_max,
cfg_pcu_no_cs_max_cmd,
"no cs max",
NO_STR CS_STR CS_MAX_STR)
NO_STR CS_STR CS_MAX_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -500,13 +520,13 @@ DEFUN(cfg_pcu_no_cs_max,
}
#define MCS_STR "Modulation and Coding Scheme configuration (EGPRS)\n"
DEFUN(cfg_pcu_mcs,
DEFUN_ATTR(cfg_pcu_mcs,
cfg_pcu_mcs_cmd,
"mcs <1-9> [<1-9>]",
MCS_STR
"Initial MCS value to be used (default 1)\n"
"Use a different initial MCS value for the uplink")
"Use a different initial MCS value for the uplink",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
uint8_t cs = atoi(argv[0]);
@ -520,10 +540,11 @@ DEFUN(cfg_pcu_mcs,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_mcs,
DEFUN_ATTR(cfg_pcu_no_mcs,
cfg_pcu_no_mcs_cmd,
"no mcs",
NO_STR MCS_STR)
NO_STR MCS_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -533,13 +554,14 @@ DEFUN(cfg_pcu_no_mcs,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_mcs_max,
DEFUN_ATTR(cfg_pcu_mcs_max,
cfg_pcu_mcs_max_cmd,
"mcs max <1-9> [<1-9>]",
MCS_STR
CS_MAX_STR
"Maximum MCS value to be used\n"
"Use a different maximum MCS value for the uplink")
"Use a different maximum MCS value for the uplink",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
uint8_t mcs = atoi(argv[0]);
@ -553,10 +575,11 @@ DEFUN(cfg_pcu_mcs_max,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_mcs_max,
DEFUN_ATTR(cfg_pcu_no_mcs_max,
cfg_pcu_no_mcs_max_cmd,
"no mcs max",
NO_STR MCS_STR CS_MAX_STR)
NO_STR MCS_STR CS_MAX_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -568,12 +591,13 @@ DEFUN(cfg_pcu_no_mcs_max,
#define DL_STR "downlink specific configuration\n"
DEFUN(cfg_pcu_dl_arq_type,
DEFUN_ATTR(cfg_pcu_dl_arq_type,
cfg_pcu_dl_arq_cmd,
"egprs dl arq-type (spb|arq2)",
EGPRS_STR DL_STR "ARQ options\n"
"enable SPB(ARQ1) support\n"
"enable ARQ2 support")
"enable ARQ2 support",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -585,8 +609,9 @@ DEFUN(cfg_pcu_dl_arq_type,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_window_size,
DEFUN_USRATTR(cfg_pcu_window_size,
cfg_pcu_window_size_cmd,
X(PCU_VTY_ATTR_NEW_TBF),
"window-size <0-1024> [<0-256>]",
"Window size configuration (b + N_PDCH * f)\n"
"Base value (b)\n"
@ -609,8 +634,9 @@ DEFUN(cfg_pcu_window_size,
#define LIFETIME_STR "Set lifetime limit of LLC frame in centi-seconds " \
"(overrides the value given by SGSN)\n"
DEFUN(cfg_pcu_queue_lifetime,
DEFUN_USRATTR(cfg_pcu_queue_lifetime,
cfg_pcu_queue_lifetime_cmd,
X(PCU_VTY_ATTR_NEW_TBF),
"queue lifetime <1-65534>",
QUEUE_STR LIFETIME_STR "Lifetime in centi-seconds")
{
@ -622,8 +648,9 @@ DEFUN(cfg_pcu_queue_lifetime,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_queue_lifetime_inf,
DEFUN_USRATTR(cfg_pcu_queue_lifetime_inf,
cfg_pcu_queue_lifetime_inf_cmd,
X(PCU_VTY_ATTR_NEW_TBF),
"queue lifetime infinite",
QUEUE_STR LIFETIME_STR "Infinite lifetime")
{
@ -634,8 +661,9 @@ DEFUN(cfg_pcu_queue_lifetime_inf,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_queue_lifetime,
DEFUN_USRATTR(cfg_pcu_no_queue_lifetime,
cfg_pcu_no_queue_lifetime_cmd,
X(PCU_VTY_ATTR_NEW_TBF),
"no queue lifetime",
NO_STR QUEUE_STR "Disable lifetime limit of LLC frame (use value given "
"by SGSN)\n")
@ -650,8 +678,9 @@ DEFUN(cfg_pcu_no_queue_lifetime,
#define QUEUE_HYSTERESIS_STR "Set lifetime hysteresis of LLC frame in centi-seconds " \
"(continue discarding until lifetime-hysteresis is reached)\n"
DEFUN(cfg_pcu_queue_hysteresis,
DEFUN_USRATTR(cfg_pcu_queue_hysteresis,
cfg_pcu_queue_hysteresis_cmd,
X(PCU_VTY_ATTR_NEW_TBF),
"queue hysteresis <1-65535>",
QUEUE_STR QUEUE_HYSTERESIS_STR "Hysteresis in centi-seconds")
{
@ -663,8 +692,9 @@ DEFUN(cfg_pcu_queue_hysteresis,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_queue_hysteresis,
DEFUN_USRATTR(cfg_pcu_no_queue_hysteresis,
cfg_pcu_no_queue_hysteresis_cmd,
X(PCU_VTY_ATTR_NEW_TBF),
"no queue hysteresis",
NO_STR QUEUE_STR QUEUE_HYSTERESIS_STR)
{
@ -676,9 +706,9 @@ DEFUN(cfg_pcu_no_queue_hysteresis,
}
#define QUEUE_CODEL_STR "Set CoDel queue management\n"
DEFUN(cfg_pcu_queue_codel,
DEFUN_USRATTR(cfg_pcu_queue_codel,
cfg_pcu_queue_codel_cmd,
X(PCU_VTY_ATTR_NEW_SUBSCR),
"queue codel",
QUEUE_STR QUEUE_CODEL_STR)
{
@ -689,8 +719,9 @@ DEFUN(cfg_pcu_queue_codel,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_queue_codel_interval,
DEFUN_USRATTR(cfg_pcu_queue_codel_interval,
cfg_pcu_queue_codel_interval_cmd,
X(PCU_VTY_ATTR_NEW_SUBSCR),
"queue codel interval <1-1000>",
QUEUE_STR QUEUE_CODEL_STR "Specify interval\n" "Interval in centi-seconds")
{
@ -702,8 +733,9 @@ DEFUN(cfg_pcu_queue_codel_interval,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_queue_codel,
DEFUN_USRATTR(cfg_pcu_no_queue_codel,
cfg_pcu_no_queue_codel_cmd,
X(PCU_VTY_ATTR_NEW_SUBSCR),
"no queue codel",
NO_STR QUEUE_STR QUEUE_CODEL_STR)
{
@ -717,10 +749,11 @@ DEFUN(cfg_pcu_no_queue_codel,
#define QUEUE_IDLE_ACK_STR "Request an ACK after the last DL LLC frame in centi-seconds\n"
DEFUN(cfg_pcu_queue_idle_ack_delay,
DEFUN_ATTR(cfg_pcu_queue_idle_ack_delay,
cfg_pcu_queue_idle_ack_delay_cmd,
"queue idle-ack-delay <1-65535>",
QUEUE_STR QUEUE_IDLE_ACK_STR "Idle ACK delay in centi-seconds")
QUEUE_STR QUEUE_IDLE_ACK_STR "Idle ACK delay in centi-seconds",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
uint16_t csec = atoi(argv[0]);
@ -730,10 +763,11 @@ DEFUN(cfg_pcu_queue_idle_ack_delay,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_queue_idle_ack_delay,
DEFUN_ATTR(cfg_pcu_no_queue_idle_ack_delay,
cfg_pcu_no_queue_idle_ack_delay_cmd,
"no queue idle-ack-delay",
NO_STR QUEUE_STR QUEUE_IDLE_ACK_STR)
NO_STR QUEUE_STR QUEUE_IDLE_ACK_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -742,15 +776,15 @@ DEFUN(cfg_pcu_no_queue_idle_ack_delay,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_alloc,
DEFUN_ATTR(cfg_pcu_alloc,
cfg_pcu_alloc_cmd,
"alloc-algorithm (a|b|dynamic)",
"Select slot allocation algorithm to use when assigning timeslots on "
"PACCH\n"
"Single slot is assigned only\n"
"Multiple slots are assigned for semi-duplex operation\n"
"Dynamically select the algorithm based on the system state\n")
"Dynamically select the algorithm based on the system state\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -769,10 +803,11 @@ DEFUN(cfg_pcu_alloc,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_two_phase,
DEFUN_ATTR(cfg_pcu_two_phase,
cfg_pcu_two_phase_cmd,
"two-phase-access",
"Force two phase access when MS requests single phase access\n")
"Force two phase access when MS requests single phase access\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -781,10 +816,11 @@ DEFUN(cfg_pcu_two_phase,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_two_phase,
DEFUN_ATTR(cfg_pcu_no_two_phase,
cfg_pcu_no_two_phase_cmd,
"no two-phase-access",
NO_STR "Only use two phase access when requested my MS\n")
NO_STR "Only use two phase access when requested my MS\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -793,12 +829,13 @@ DEFUN(cfg_pcu_no_two_phase,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_alpha,
DEFUN_ATTR(cfg_pcu_alpha,
cfg_pcu_alpha_cmd,
"alpha <0-10>",
"Alpha parameter for MS power control in units of 0.1 (see TS 05.08) "
"NOTE: Be sure to set Alpha value at System information 13 too.\n"
"Alpha in units of 0.1\n")
"Alpha in units of 0.1\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -807,11 +844,12 @@ DEFUN(cfg_pcu_alpha,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_gamma,
DEFUN_ATTR(cfg_pcu_gamma,
cfg_pcu_gamma_cmd,
"gamma <0-62>",
"Gamma parameter for MS power control in units of dB (see TS 05.08)\n"
"Gamma in even unit of dBs\n")
"Gamma in even unit of dBs\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -868,10 +906,11 @@ DEFUN_DEPRECATED(cfg_pcu_no_dl_tbf_idle_time,
#define RETRANSMISSION_STR "retransmit blocks even before the MS had a chance to receive them (better throughput," \
" less readable traces)"
DEFUN(cfg_pcu_dl_tbf_preemptive_retransmission,
DEFUN_ATTR(cfg_pcu_dl_tbf_preemptive_retransmission,
cfg_pcu_dl_tbf_preemptive_retransmission_cmd,
"dl-tbf-preemptive-retransmission",
RETRANSMISSION_STR " (enabled by default)")
RETRANSMISSION_STR " (enabled by default)",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -880,10 +919,11 @@ DEFUN(cfg_pcu_dl_tbf_preemptive_retransmission,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_dl_tbf_preemptive_retransmission,
DEFUN_ATTR(cfg_pcu_no_dl_tbf_preemptive_retransmission,
cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd,
"no dl-tbf-preemptive-retransmission",
NO_STR RETRANSMISSION_STR)
NO_STR RETRANSMISSION_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -922,10 +962,11 @@ DEFUN_DEPRECATED(cfg_pcu_no_ms_idle_time,
}
#define CS_ERR_LIMITS_STR "set thresholds for error rate based downlink (M)CS adjustment\n"
DEFUN(cfg_pcu_cs_err_limits,
DEFUN_ATTR(cfg_pcu_cs_err_limits,
cfg_pcu_cs_err_limits_cmd,
"cs threshold <0-100> <0-100>",
CS_STR CS_ERR_LIMITS_STR "lower limit in %\n" "upper limit in %\n")
CS_STR CS_ERR_LIMITS_STR "lower limit in %\n" "upper limit in %\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -946,10 +987,11 @@ DEFUN(cfg_pcu_cs_err_limits,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_cs_err_limits,
DEFUN_ATTR(cfg_pcu_no_cs_err_limits,
cfg_pcu_no_cs_err_limits_cmd,
"no cs threshold",
NO_STR CS_STR CS_ERR_LIMITS_STR)
NO_STR CS_STR CS_ERR_LIMITS_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -961,10 +1003,11 @@ DEFUN(cfg_pcu_no_cs_err_limits,
}
#define CS_DOWNGRADE_STR "set threshold for data size based downlink (M)CS downgrade\n"
DEFUN(cfg_pcu_cs_downgrade_thrsh,
DEFUN_ATTR(cfg_pcu_cs_downgrade_thrsh,
cfg_pcu_cs_downgrade_thrsh_cmd,
"cs downgrade-threshold <1-10000>",
CS_STR CS_DOWNGRADE_STR "downgrade if less octets left\n")
CS_STR CS_DOWNGRADE_STR "downgrade if less octets left\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -973,10 +1016,11 @@ DEFUN(cfg_pcu_cs_downgrade_thrsh,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_no_cs_downgrade_thrsh,
DEFUN_ATTR(cfg_pcu_no_cs_downgrade_thrsh,
cfg_pcu_no_cs_downgrade_thrsh_cmd,
"no cs downgrade-threshold",
NO_STR CS_STR CS_DOWNGRADE_STR)
NO_STR CS_STR CS_DOWNGRADE_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -985,8 +1029,7 @@ DEFUN(cfg_pcu_no_cs_downgrade_thrsh,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_cs_lqual_ranges,
DEFUN_ATTR(cfg_pcu_cs_lqual_ranges,
cfg_pcu_cs_lqual_ranges_cmd,
"cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35> cs3 <0-35> <0-35> cs4 <0-35>",
CS_STR "Set link quality ranges for each uplink CS\n"
@ -999,7 +1042,8 @@ DEFUN(cfg_pcu_cs_lqual_ranges,
"CS-3 low (dB)\n"
"CS-3 high (dB)\n"
"Set quality range for CS-4 (low value only)\n"
"CS-4 low (dB)\n")
"CS-4 low (dB)\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -1020,7 +1064,7 @@ DEFUN(cfg_pcu_cs_lqual_ranges,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_mcs_lqual_ranges,
DEFUN_ATTR(cfg_pcu_mcs_lqual_ranges,
cfg_pcu_mcs_lqual_ranges_cmd,
"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>",
CS_STR "Set link quality ranges for each uplink MCS\n"
@ -1048,7 +1092,8 @@ DEFUN(cfg_pcu_mcs_lqual_ranges,
"MCS-8 low (dB)\n"
"MCS-8 high (dB)\n"
"Set quality range for MCS-9 (low value only)\n"
"MCS-9 low (dB)\n")
"MCS-9 low (dB)\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
@ -1088,8 +1133,9 @@ DEFUN(cfg_pcu_sock,
return CMD_SUCCESS;
}
DEFUN(cfg_pcu_gb_dialect,
DEFUN_USRATTR(cfg_pcu_gb_dialect,
cfg_pcu_gb_dialect_cmd,
X(PCU_VTY_ATTR_NS_RESET),
"gb-dialect (classic|ip-sns)",
"Select which Gb interface dialect to use\n"
"Classic Gb interface with NS-{RESET,BLOCK,UNBLOCK} and static configuration\n"
@ -1128,10 +1174,11 @@ DEFUN(show_timer, show_timer_cmd,
return osmo_tdef_vty_show_cmd(vty, bts->T_defs_pcu, T_arg, NULL);
}
DEFUN(cfg_pcu_timer, cfg_pcu_timer_cmd,
DEFUN_ATTR(cfg_pcu_timer, cfg_pcu_timer_cmd,
"timer " OSMO_TDEF_VTY_ARG_SET_OPTIONAL,
"Configure or show PCU timers\n"
OSMO_TDEF_VTY_DOC_SET)
OSMO_TDEF_VTY_DOC_SET,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
/* If any arguments are missing, redirect to 'show' */
@ -1203,6 +1250,19 @@ struct vty_app_info pcu_vty_info = {
.name = "OsmoPCU",
.version = PACKAGE_VERSION,
.copyright = pcu_copyright,
.usr_attr_desc = {
[PCU_VTY_ATTR_NEW_TBF] = \
"This command applies when a new TBF is begins",
[PCU_VTY_ATTR_NEW_SUBSCR] = \
"This command applies when a new subscriber attaches",
[PCU_VTY_ATTR_NS_RESET] = \
"This command applies when the NS is reset",
},
.usr_attr_letters = {
[PCU_VTY_ATTR_NEW_TBF] = 'n',
[PCU_VTY_ATTR_NEW_SUBSCR] = 's',
[PCU_VTY_ATTR_NS_RESET] = 'r',
},
};
int pcu_vty_init(void)

View File

@ -16,5 +16,12 @@ int pcu_vty_init();
extern struct vty_app_info pcu_vty_info;
enum bsc_vty_cmd_attr {
PCU_VTY_ATTR_NEW_TBF = 0,
PCU_VTY_ATTR_NEW_SUBSCR,
PCU_VTY_ATTR_NS_RESET,
/* NOTE: up to 32 entries */
};
#endif /* _PCU_VTY_H */