Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6500

to look at the new patch set (#4).

HO: vty: rename ho decision 1 vty to 'handover1' with 'handover' alias

Handover decision 2 arguments are now configured by 'handover2 foo'. To match
that scheme, rename the previously 'handover foo' args for handover decision 1
to 'handover1 foo'.

For backwards compatibility, still provide aliases of the original VTY
commands. Writing back the config will result in 'handover1' though.

Change-Id: I7305ae7c04cc70082cd80d42b2ba32ffa399f51a
---
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M include/osmocom/bsc/handover_cfg.h
M src/libbsc/handover_cfg.c
M src/libbsc/handover_vty.c
M tests/handover_cfg.vty
6 files changed, 127 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/6500/4

diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 59732af..2d759ca 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -11,12 +11,12 @@
  paging any use tch 0
  handover 0
  handover algorithm 1
- handover window rxlev averaging 10
- handover window rxqual averaging 1
- handover window rxlev neighbor averaging 10
- handover power budget interval 6
- handover power budget hysteresis 3
- handover maximum distance 9999
+ handover1 window rxlev averaging 10
+ handover1 window rxqual averaging 1
+ handover1 window rxlev neighbor averaging 10
+ handover1 power budget interval 6
+ handover1 power budget hysteresis 3
+ handover1 maximum distance 9999
  dyn_ts_allow_tch_f 0
  periodic location update 30
  bts 0
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index aa2c99f..b0087a7 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -10,12 +10,12 @@
  paging any use tch 0
  handover 0
  handover algorithm 1
- handover window rxlev averaging 10
- handover window rxqual averaging 1
- handover window rxlev neighbor averaging 10
- handover power budget interval 6
- handover power budget hysteresis 3
- handover maximum distance 9999
+ handover1 window rxlev averaging 10
+ handover1 window rxqual averaging 1
+ handover1 window rxlev neighbor averaging 10
+ handover1 power budget interval 6
+ handover1 power budget hysteresis 3
+ handover1 maximum distance 9999
  dyn_ts_allow_tch_f 0
  periodic location update 30
  bts 0
diff --git a/include/osmocom/bsc/handover_cfg.h 
b/include/osmocom/bsc/handover_cfg.h
index 024bc97..2321fcf 100644
--- a/include/osmocom/bsc/handover_cfg.h
+++ b/include/osmocom/bsc/handover_cfg.h
@@ -64,6 +64,7 @@
  * TYPE: a type name like int.
  * NAME: a variable name suitable for a struct member.
  * DEFAULT_VAL: default value, as passed to the VTY, e.g. '0' or 'foo', 
without quotes.
+ * VTY_CMD_PREFIX: "handover1 ", "handover2 ", ... or just "" for the common 
general items.
  * VTY_CMD: a command string for VTY without any arguments.
  * VTY_CMD_ARG: VTY value range like '<0-23>' or 'foo|bar', will become 
'(VTY_CMD_ARG|default)'.
  * VTY_ARG_EVAL: function name for parsing the VTY arg[0], e.g. 'atoi'.
@@ -74,14 +75,14 @@
 #define HO_GENERAL_CFG_ALL_MEMBERS \
        \
        HO_CFG_ONE_MEMBER(bool, ho_active, 0, \
-               "handover", "0|1", a2bool, "%d", bool2i, \
+               "", "handover", "0|1", a2bool, "%d", bool2i, \
                "Handover general config\n" \
                "Disable in-call handover\n" \
                "Enable in-call handover\n" \
                "Enable/disable handover: ") \
        \
        HO_CFG_ONE_MEMBER(int, algorithm, 1, \
-               "handover algorithm", "1|2", atoi, "%d", as_is, \
+               "", "handover algorithm", "1|2", atoi, "%d", as_is, \
                "Handover general config\n" \
                "Choose algorithm for handover decision\n" \
                "Algorithm 1: trigger handover based on comparing current cell 
and neighbor RxLev and RxQual," \
@@ -93,21 +94,21 @@
 #define HODEC1_CFG_ALL_MEMBERS \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec1_rxlev_avg_win, 10, \
-               "handover window rxlev averaging", "<1-10>", atoi, "%u", as_is, 
\
+               "handover1 ", "window rxlev averaging", "<1-10>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER1 \
                HO_CFG_STR_WIN_RXLEV \
                "How many RxLev measurements are used for averaging\n" \
                "RxLev averaging: " HO_CFG_STR_AVG_COUNT) \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec1_rxqual_avg_win, 1, \
-               "handover window rxqual averaging", "<1-10>", atoi, "%u", 
as_is, \
+               "handover1 ", "window rxqual averaging", "<1-10>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER1 \
                HO_CFG_STR_WIN_RXQUAL \
                "How many RxQual measurements are used for averaging\n" \
                "RxQual averaging: " HO_CFG_STR_AVG_COUNT) \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec1_rxlev_neigh_avg_win, 10, \
-               "handover window rxlev neighbor averaging", "<1-10>", atoi, 
"%u", as_is, \
+               "handover1 ", "window rxlev neighbor averaging", "<1-10>", 
atoi, "%u", as_is, \
                HO_CFG_STR_HANDOVER1 \
                HO_CFG_STR_WIN_RXLEV \
                "How many Neighbor RxLev measurements are used for averaging\n" 
\
@@ -115,21 +116,21 @@
                "Neighbor RxLev averaging: " HO_CFG_STR_AVG_COUNT) \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec1_pwr_interval, 6, \
-               "handover power budget interval", "<1-99>", atoi, "%u", as_is, \
+               "handover1 ", "power budget interval", "<1-99>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER1 \
                HO_CFG_STR_POWER_BUDGET \
                "How often to check for a better cell (SACCH frames)\n" \
                "Check for stronger neighbor every N number of SACCH frames\n") 
\
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec1_pwr_hysteresis, 3, \
-               "handover power budget hysteresis", "<0-999>", atoi, "%u", 
as_is, \
+               "handover1 ", "power budget hysteresis", "<0-999>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER1 \
                HO_CFG_STR_POWER_BUDGET \
                "How many dBm stronger must a neighbor be to become a HO 
candidate\n" \
                "Neighbor's strength difference in dBm\n") \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec1_max_distance, 9999, \
-               "handover maximum distance" , "<0-9999>", atoi, "%u", as_is, \
+               "handover1 ", "maximum distance" , "<0-9999>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER1 \
                "Maximum Timing-Advance value (i.e. MS distance) before 
triggering HO\n" \
                "Maximum Timing-Advance value (i.e. MS distance) before 
triggering HO\n" \
@@ -139,21 +140,21 @@
 #define HODEC2_CFG_ALL_MEMBERS \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec2_rxlev_avg_win, 10, \
-               "handover2 window rxlev averaging", "<1-10>", atoi, "%u", 
as_is, \
+               "handover2 ", "window rxlev averaging", "<1-10>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_WIN_RXLEV \
                "How many RxLev measurements are used for averaging\n" \
                "RxLev averaging: " HO_CFG_STR_AVG_COUNT) \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec2_rxqual_avg_win, 1, \
-               "handover2 window rxqual averaging", "<1-10>", atoi, "%u", 
as_is, \
+               "handover2 ", "window rxqual averaging", "<1-10>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_WIN_RXQUAL \
                "How many RxQual measurements are used for averaging\n" \
                "RxQual averaging: " HO_CFG_STR_AVG_COUNT) \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec2_rxlev_neigh_avg_win, 10, \
-               "handover2 window rxlev neighbor averaging", "<1-10>", atoi, 
"%u", as_is, \
+               "handover2 ", "window rxlev neighbor averaging", "<1-10>", 
atoi, "%u", as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_WIN_RXLEV \
                "How many Neighbor RxLev measurements are used for averaging\n" 
\
@@ -161,111 +162,111 @@
                "Neighbor RxLev averaging: " HO_CFG_STR_AVG_COUNT) \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec2_pwr_interval, 6, \
-               "handover2 power budget interval", "<1-99>", atoi, "%u", as_is, 
\
+               "handover2 ", "power budget interval", "<1-99>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_POWER_BUDGET \
                "How often to check for a better cell (SACCH frames)\n" \
                "Check for stronger neighbor every N number of SACCH frames\n") 
\
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec2_pwr_hysteresis, 3, \
-               "handover2 power budget hysteresis", "<0-999>", atoi, "%u", 
as_is, \
+               "handover2 ", "power budget hysteresis", "<0-999>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_POWER_BUDGET \
                "How many dBm stronger must a neighbor be to become a HO 
candidate\n" \
                "Neighbor's strength difference in dBm\n") \
        \
        HO_CFG_ONE_MEMBER(unsigned int, hodec2_max_distance, 9999, \
-               "handover2 maximum distance" , "<0-9999>", atoi, "%u", as_is, \
+               "handover2 ", "maximum distance" , "<0-9999>", atoi, "%u", 
as_is, \
                HO_CFG_STR_HANDOVER2 \
                "Maximum Timing-Advance value (i.e. MS distance) before 
triggering HO\n" \
                "Maximum Timing-Advance value (i.e. MS distance) before 
triggering HO\n" \
                "Maximum Timing-Advance value (i.e. MS distance) before 
triggering HO\n") \
        \
        HO_CFG_ONE_MEMBER(bool, hodec2_as_active, 0, \
-               "handover2 assignment", "0|1", a2bool, "%d", bool2i, \
+               "handover2 ", "assignment", "0|1", a2bool, "%d", bool2i, \
                HO_CFG_STR_HANDOVER2 \
                "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \
                "Disable in-call assignment\n" \
                "Enable in-call assignment\n") \
        \
        HO_CFG_ONE_MEMBER(bool, hodec2_full_tdma, subset, \
-               "handover2 tdma-measurement", "full|subset", a2tdma, "%s", 
tdma2a, \
+               "handover2 ", "tdma-measurement", "full|subset", a2tdma, "%s", 
tdma2a, \
                HO_CFG_STR_HANDOVER2 \
                "Define measurement set of TDMA frames" HO_CFG_STR_2 \
                "Full set of 102/104 TDMA frames\n" \
                "Sub set of 4 TDMA frames (SACCH)\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_min_rxlev, -100, \
-               "handover2 min rxlev", "<-110--50>", atoi, "%d", as_is, \
+               "handover2 ", "min rxlev", "<-110--50>", atoi, "%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_MIN \
                "How weak may RxLev of an MS become before triggering HO\n" \
                "minimum RxLev (dBm)\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_min_rxqual, 5, \
-               "handover2 min rxqual", "<0-7>", atoi, "%d", as_is, \
+               "handover2 ", "min rxqual", "<0-7>", atoi, "%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_MIN \
                "How bad may RxQual of an MS become before triggering HO\n" \
                "minimum RxQual (dBm)\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_afs_bias_rxlev, 0, \
-               "handover2 afs-bias rxlev", "<0-20>", atoi, "%d", as_is, \
+               "handover2 ", "afs-bias rxlev", "<0-20>", atoi, "%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_AFS_BIAS \
                "RxLev improvement bias for AFS over other codecs\n" \
                "Virtual RxLev improvement (dBm)\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_afs_bias_rxqual, 0, \
-               "handover2 afs-bias rxqual", "<0-7>", atoi, "%d", as_is, \
+               "handover2 ", "afs-bias rxqual", "<0-7>", atoi, "%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_AFS_BIAS \
                "RxQual improvement bias for AFS over other codecs\n" \
                "Virtual RxQual improvement (dBm)\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_tchf_min_slots, 0, \
-               "handover2 min-free-slots tch/f", "<0-9999>", atoi, "%d", 
as_is, \
+               "handover2 ", "min-free-slots tch/f", "<0-9999>", atoi, "%d", 
as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_MIN_TCH \
                "Minimum free TCH/F timeslots before cell is considered 
congested\n" \
                "Number of TCH/F slots\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_tchh_min_slots, 0, \
-               "handover2 min-free-slots tch/h", "<0-9999>", atoi, "%d", 
as_is, \
+               "handover2 ", "min-free-slots tch/h", "<0-9999>", atoi, "%d", 
as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_MIN_TCH \
                "Minimum free TCH/H timeslots before cell is considered 
congested\n" \
                "Number of TCH/H slots\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_ho_max, 9999, \
-               "handover2 max-handovers", "<1-9999>", atoi, "%d", as_is, \
+               "handover2 ", "max-handovers", "<1-9999>", atoi, "%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                "Maximum number of concurrent handovers allowed per cell" 
HO_CFG_STR_2 \
                "Number\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_penalty_max_dist, 300, \
-               "handover2 penalty-time max-distance", "<0-99999>", atoi, "%d", 
as_is, \
+               "handover2 ", "penalty-time max-distance", "<0-99999>", atoi, 
"%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_PENALTY_TIME \
                "Time to suspend handovers after leaving this cell due to 
exceeding max distance\n" \
                "Seconds\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_penalty_failed_ho, 60, \
-               "handover2 penalty-time failed-ho", "<0-99999>", atoi, "%d", 
as_is, \
+               "handover2 ", "penalty-time failed-ho", "<0-99999>", atoi, 
"%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_PENALTY_TIME \
                "Time to suspend handovers after handover failure to this 
cell\n" \
                "Seconds\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_penalty_failed_as, 60, \
-               "handover2 penalty-time failed-assignment", "<0-99999>", atoi, 
"%d", as_is, \
+               "handover2 ", "penalty-time failed-assignment", "<0-99999>", 
atoi, "%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                HO_CFG_STR_PENALTY_TIME \
                "Time to suspend handovers after assignment failure in this 
cell\n" \
                "Seconds\n") \
        \
        HO_CFG_ONE_MEMBER(int, hodec2_retries, 0, \
-               "handover2 retries", "<0-9>", atoi, "%d", as_is, \
+               "handover2 ", "retries", "<0-9>", atoi, "%d", as_is, \
                HO_CFG_STR_HANDOVER2 \
                "Immediately retry on handover/assignment failure" HO_CFG_STR_2 
\
                "Number of retries\n") \
@@ -278,7 +279,7 @@
 
 /* Declare public API for handover cfg parameters... */
 
-#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, 
VTY5, VTY6) \
+#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY0, VTY1, VTY2, VTY3, 
VTY4, VTY5, VTY6) \
        TYPE ho_get_##NAME(struct handover_cfg *ho); \
        void ho_set_##NAME(struct handover_cfg *ho, TYPE val); \
        bool ho_isset_##NAME(struct handover_cfg *ho); \
diff --git a/src/libbsc/handover_cfg.c b/src/libbsc/handover_cfg.c
index 8c208f6..5b02e76 100644
--- a/src/libbsc/handover_cfg.c
+++ b/src/libbsc/handover_cfg.c
@@ -30,7 +30,7 @@
 struct handover_cfg {
        struct handover_cfg *higher_level_cfg;
 
-#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, 
VTY5, VTY6) \
+#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY0, VTY1, VTY2, VTY3, 
VTY4, VTY5, VTY6) \
        TYPE NAME; \
        bool has_##NAME;
 
@@ -46,7 +46,7 @@
        return ho;
 }
 
-#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY_ARG_EVAL, 
VTY4, VTY5, VTY6) \
+#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY0, VTY1, VTY2, 
VTY_ARG_EVAL, VTY4, VTY5, VTY6) \
 TYPE ho_get_##NAME(struct handover_cfg *ho) \
 { \
        if (ho->has_##NAME) \
diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c
index 9ec9bc7..4bd8e5f 100644
--- a/src/libbsc/handover_vty.c
+++ b/src/libbsc/handover_vty.c
@@ -40,11 +40,11 @@
 
 
 #define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \
-                         VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \
+                         VTY_CMD_PREFIX, VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \
                          VTY_WRITE_FMT, VTY_WRITE_CONV, \
                          VTY_DOC) \
 DEFUN(cfg_ho_##NAME, cfg_ho_##NAME##_cmd, \
-      VTY_CMD " (" VTY_CMD_ARG "|default)", \
+      VTY_CMD_PREFIX VTY_CMD " (" VTY_CMD_ARG "|default)", \
       VTY_DOC \
       "Use default (" #DEFAULT_VAL "), remove explicit setting on this 
node\n") \
 { \
@@ -57,7 +57,7 @@
                        msg = "setting removed, now is"; \
                } else \
                        msg = "already was unset, still is"; \
-               vty_out(vty, "%% '" VTY_CMD "' %s " VTY_WRITE_FMT "%s%s", \
+               vty_out(vty, "%% '" VTY_CMD_PREFIX VTY_CMD "' %s " 
VTY_WRITE_FMT "%s%s", \
                        msg, VTY_WRITE_CONV( ho_get_##NAME(ho) ), \
                        ho_isset_on_parent_##NAME(ho)? " (set on higher level 
node)" : "", \
                        VTY_NEWLINE); \
@@ -70,6 +70,19 @@
 HO_CFG_ALL_MEMBERS
 #undef HO_CFG_ONE_MEMBER
 
+
+/* Aliases of 'handover' for 'handover1' for backwards compat */
+#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \
+                         VTY_CMD_PREFIX, VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \
+                         VTY_WRITE_FMT, VTY_WRITE_CONV, \
+                         VTY_DOC) \
+ALIAS(cfg_ho_##NAME, cfg_ho_##NAME##_cmd_alias, \
+      "handover " VTY_CMD " (" VTY_CMD_ARG "|default)", \
+      VTY_DOC \
+      "Use default (" #DEFAULT_VAL "), remove explicit setting on this 
node\n");
+
+HODEC1_CFG_ALL_MEMBERS
+#undef HO_CFG_ONE_MEMBER
 
 static inline const int a2congestion_check_interval(const char *arg)
 {
@@ -109,11 +122,11 @@
 static void ho_vty_write(struct vty *vty, const char *indent, struct 
handover_cfg *ho)
 {
 #define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \
-                         VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \
+                         VTY_CMD_PREFIX, VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \
                          VTY_WRITE_FMT, VTY_WRITE_CONV, \
                          VTY_DOC) \
        if (ho_isset_##NAME(ho)) \
-               vty_out(vty, "%s" VTY_CMD " " VTY_WRITE_FMT "%s", indent, \
+               vty_out(vty, "%s" VTY_CMD_PREFIX VTY_CMD " " VTY_WRITE_FMT 
"%s", indent, \
                        VTY_WRITE_CONV( ho_get_##NAME(ho) ), VTY_NEWLINE);
 
        HO_CFG_ALL_MEMBERS
@@ -130,18 +143,25 @@
        ho_vty_write(vty, " ", net->ho);
 
        if (net->hodec2.congestion_check_interval_s != 
HO_CFG_CONGESTION_CHECK_DEFAULT)
-               vty_out(vty, " handover congestion-check %s%s",
+               vty_out(vty, " handover2 congestion-check %s%s",
                        
congestion_check_interval2a(net->hodec2.congestion_check_interval_s),
                        VTY_NEWLINE);
 }
 
 static void ho_vty_init_cmds(int parent_node)
 {
-#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, 
VTY5, VTY6) \
+#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY0, VTY1, VTY2, VTY3, 
VTY4, VTY5, VTY6) \
        install_element(parent_node, &cfg_ho_##NAME##_cmd);
 
        HO_CFG_ALL_MEMBERS
 #undef HO_CFG_ONE_MEMBER
+
+       /* Aliases of 'handover' for 'handover1' for backwards compat */
+#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY0, VTY1, VTY2, VTY3, 
VTY4, VTY5, VTY6) \
+       install_element(parent_node, &cfg_ho_##NAME##_cmd_alias);
+
+HODEC1_CFG_ALL_MEMBERS
+#undef HO_CFG_ONE_MEMBER
 }
 
 void ho_vty_init()
diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty
index e2e4b28..a9d3f52 100644
--- a/tests/handover_cfg.vty
+++ b/tests/handover_cfg.vty
@@ -38,7 +38,7 @@
 ...
 
 OsmoBSC(config-net-bts)# ### Add arbitrary handover config item for bts 1:
-OsmoBSC(config-net-bts)# handover power budget interval 23
+OsmoBSC(config-net-bts)# handover1 power budget interval 23
 OsmoBSC(config-net-bts)# exit
 OsmoBSC(config-net)# ### HO is 'on' globally, bts 0 disables it, bts 1 tweaks 
a param:
 OsmoBSC(config-net)# show running-config
@@ -53,7 +53,7 @@
 ... !handover
  bts 1
 ... !handover
-  handover power budget interval 23
+  handover1 power budget interval 23
 ... !handover
 
 OsmoBSC(config-net)# ### Set global default to 'off', now bts 1 also uses the 
global default of 'off':
@@ -74,7 +74,7 @@
 ... !handover
  bts 1
 ... !handover
-  handover power budget interval 23
+  handover1 power budget interval 23
 ... !handover
 
 OsmoBSC(config-net)# ### Remove the global setting, i.e. use the factory 
default net level, with same effect:
@@ -96,7 +96,7 @@
 ... !handover
  bts 1
 ... !handover
-  handover power budget interval 23
+  handover1 power budget interval 23
 ... !handover
 
 OsmoBSC(config-net)# ### Re-enable net-level handover, but bts 0 remains 
disabled explicitly
@@ -117,7 +117,7 @@
 ... !handover
  bts 1
 ... !handover
-  handover power budget interval 23
+  handover1 power budget interval 23
 ... !handover
 
 OsmoBSC(config-net)# ### Remove explicit setting of bts 0 to also use the 
global setting:
@@ -140,7 +140,7 @@
 ... !handover
  bts 1
 ... !handover
-  handover power budget interval 23
+  handover1 power budget interval 23
 ... !handover
 
 OsmoBSC(config-net-bts)# ### Verify that 'min rxlev' value range stops at -50
@@ -165,12 +165,12 @@
 ...
   handover (0|1|default)
   handover algorithm (1|2|default)
-  handover window rxlev averaging (<1-10>|default)
-  handover window rxqual averaging (<1-10>|default)
-  handover window rxlev neighbor averaging (<1-10>|default)
-  handover power budget interval (<1-99>|default)
-  handover power budget hysteresis (<0-999>|default)
-  handover maximum distance (<0-9999>|default)
+  handover1 window rxlev averaging (<1-10>|default)
+  handover1 window rxqual averaging (<1-10>|default)
+  handover1 window rxlev neighbor averaging (<1-10>|default)
+  handover1 power budget interval (<1-99>|default)
+  handover1 power budget hysteresis (<0-999>|default)
+  handover1 maximum distance (<0-9999>|default)
   handover2 window rxlev averaging (<1-10>|default)
   handover2 window rxqual averaging (<1-10>|default)
   handover2 window rxlev neighbor averaging (<1-10>|default)
@@ -190,11 +190,15 @@
   handover2 penalty-time failed-ho (<0-99999>|default)
   handover2 penalty-time failed-assignment (<0-99999>|default)
   handover2 retries (<0-9>|default)
+... !handover2
   handover2 congestion-check (disabled|<1-999>|now)
 ...
 
 OsmoBSC(config-net)# handover?
   handover  Handover general config
+
+OsmoBSC(config-net)# handover1?
+  handover1  Handover options for handover decision algorithm 1
 
 OsmoBSC(config-net)# handover2?
   handover2  Handover options for handover decision algorithm 2
@@ -204,9 +208,12 @@
   1          Enable in-call handover
   default    Enable/disable handover: Use default (0), remove explicit setting 
on this node
   algorithm  Choose algorithm for handover decision
-  window     Measurement averaging settings
-  power      Neighbor cell power triggering
-  maximum    Maximum Timing-Advance value (i.e. MS distance) before triggering 
HO
+...
+
+OsmoBSC(config-net)# handover1 ?
+  window   Measurement averaging settings
+  power    Neighbor cell power triggering
+  maximum  Maximum Timing-Advance value (i.e. MS distance) before triggering HO
 
 OsmoBSC(config-net)# handover2 ?
   window            Measurement averaging settings
@@ -227,51 +234,51 @@
   2        Algorithm 2: trigger handover on RxLev/RxQual, and also to balance 
the load across several cells. Consider available codecs. Prevent repeated 
handover by penalty timers.
   default  Use default (1), remove explicit setting on this node
 
-OsmoBSC(config-net)# handover window ?
+OsmoBSC(config-net)# handover1 window ?
   rxlev   Received-Level averaging
   rxqual  Received-Quality averaging
 
-OsmoBSC(config-net)# handover window rxlev ?
+OsmoBSC(config-net)# handover1 window rxlev ?
   averaging  How many RxLev measurements are used for averaging
   neighbor   How many Neighbor RxLev measurements are used for averaging
 
-OsmoBSC(config-net)# handover window rxlev averaging ?
+OsmoBSC(config-net)# handover1 window rxlev averaging ?
   <1-10>   RxLev averaging: Number of values to average over
   default  Use default (10), remove explicit setting on this node
 
-OsmoBSC(config-net)# handover window rxlev neighbor ?
+OsmoBSC(config-net)# handover1 window rxlev neighbor ?
   averaging  How many Neighbor RxLev measurements are used for averaging
 
-OsmoBSC(config-net)# handover window rxlev neighbor averaging ?
+OsmoBSC(config-net)# handover1 window rxlev neighbor averaging ?
   <1-10>   Neighbor RxLev averaging: Number of values to average over
   default  Use default (10), remove explicit setting on this node
 
-OsmoBSC(config-net)# handover window rxqual ?
+OsmoBSC(config-net)# handover1 window rxqual ?
   averaging  How many RxQual measurements are used for averaging
 
-OsmoBSC(config-net)# handover window rxqual averaging ?
+OsmoBSC(config-net)# handover1 window rxqual averaging ?
   <1-10>   RxQual averaging: Number of values to average over
   default  Use default (1), remove explicit setting on this node
 
-OsmoBSC(config-net)# handover power ?
+OsmoBSC(config-net)# handover1 power ?
   budget  Neighbor cell power triggering
 
-OsmoBSC(config-net)# handover power budget ?
+OsmoBSC(config-net)# handover1 power budget ?
   interval    How often to check for a better cell (SACCH frames)
   hysteresis  How many dBm stronger must a neighbor be to become a HO candidate
 
-OsmoBSC(config-net)# handover power budget interval ?
+OsmoBSC(config-net)# handover1 power budget interval ?
   <1-99>   Check for stronger neighbor every N number of SACCH frames
   default  Use default (6), remove explicit setting on this node
 
-OsmoBSC(config-net)# handover power budget hysteresis ?
+OsmoBSC(config-net)# handover1 power budget hysteresis ?
   <0-999>  Neighbor's strength difference in dBm
   default  Use default (3), remove explicit setting on this node
 
-OsmoBSC(config-net)# handover maximum ?
+OsmoBSC(config-net)# handover1 maximum ?
   distance  Maximum Timing-Advance value (i.e. MS distance) before triggering 
HO
 
-OsmoBSC(config-net)# handover maximum distance ?
+OsmoBSC(config-net)# handover1 maximum distance ?
   <0-9999>  Maximum Timing-Advance value (i.e. MS distance) before triggering 
HO
   default   Use default (9999), remove explicit setting on this node
 
@@ -409,6 +416,9 @@
 OsmoBSC(config-net-bts)# handover?
   handover  Handover general config
 
+OsmoBSC(config-net-bts)# handover1?
+  handover1  Handover options for handover decision algorithm 1
+
 OsmoBSC(config-net-bts)# handover2?
   handover2  Handover options for handover decision algorithm 2
 
@@ -417,9 +427,12 @@
   1          Enable in-call handover
   default    Enable/disable handover: Use default (0), remove explicit setting 
on this node
   algorithm  Choose algorithm for handover decision
-  window     Measurement averaging settings
-  power      Neighbor cell power triggering
-  maximum    Maximum Timing-Advance value (i.e. MS distance) before triggering 
HO
+...
+
+OsmoBSC(config-net-bts)# handover1 ?
+  window   Measurement averaging settings
+  power    Neighbor cell power triggering
+  maximum  Maximum Timing-Advance value (i.e. MS distance) before triggering HO
 
 OsmoBSC(config-net-bts)# handover2 ?
   window            Measurement averaging settings
@@ -439,51 +452,51 @@
   2        Algorithm 2: trigger handover on RxLev/RxQual, and also to balance 
the load across several cells. Consider available codecs. Prevent repeated 
handover by penalty timers.
   default  Use default (1), remove explicit setting on this node
 
-OsmoBSC(config-net-bts)# handover window ?
+OsmoBSC(config-net-bts)# handover1 window ?
   rxlev   Received-Level averaging
   rxqual  Received-Quality averaging
 
-OsmoBSC(config-net-bts)# handover window rxlev ?
+OsmoBSC(config-net-bts)# handover1 window rxlev ?
   averaging  How many RxLev measurements are used for averaging
   neighbor   How many Neighbor RxLev measurements are used for averaging
 
-OsmoBSC(config-net-bts)# handover window rxlev averaging ?
+OsmoBSC(config-net-bts)# handover1 window rxlev averaging ?
   <1-10>   RxLev averaging: Number of values to average over
   default  Use default (10), remove explicit setting on this node
 
-OsmoBSC(config-net-bts)# handover window rxlev neighbor ?
+OsmoBSC(config-net-bts)# handover1 window rxlev neighbor ?
   averaging  How many Neighbor RxLev measurements are used for averaging
 
-OsmoBSC(config-net-bts)# handover window rxlev neighbor averaging ?
+OsmoBSC(config-net-bts)# handover1 window rxlev neighbor averaging ?
   <1-10>   Neighbor RxLev averaging: Number of values to average over
   default  Use default (10), remove explicit setting on this node
 
-OsmoBSC(config-net-bts)# handover window rxqual ?
+OsmoBSC(config-net-bts)# handover1 window rxqual ?
   averaging  How many RxQual measurements are used for averaging
 
-OsmoBSC(config-net-bts)# handover window rxqual averaging ?
+OsmoBSC(config-net-bts)# handover1 window rxqual averaging ?
   <1-10>   RxQual averaging: Number of values to average over
   default  Use default (1), remove explicit setting on this node
 
-OsmoBSC(config-net-bts)# handover power ?
+OsmoBSC(config-net-bts)# handover1 power ?
   budget  Neighbor cell power triggering
 
-OsmoBSC(config-net-bts)# handover power budget ?
+OsmoBSC(config-net-bts)# handover1 power budget ?
   interval    How often to check for a better cell (SACCH frames)
   hysteresis  How many dBm stronger must a neighbor be to become a HO candidate
 
-OsmoBSC(config-net-bts)# handover power budget interval ?
+OsmoBSC(config-net-bts)# handover1 power budget interval ?
   <1-99>   Check for stronger neighbor every N number of SACCH frames
   default  Use default (6), remove explicit setting on this node
 
-OsmoBSC(config-net-bts)# handover power budget hysteresis ?
+OsmoBSC(config-net-bts)# handover1 power budget hysteresis ?
   <0-999>  Neighbor's strength difference in dBm
   default  Use default (3), remove explicit setting on this node
 
-OsmoBSC(config-net-bts)# handover maximum ?
+OsmoBSC(config-net-bts)# handover1 maximum ?
   distance  Maximum Timing-Advance value (i.e. MS distance) before triggering 
HO
 
-OsmoBSC(config-net-bts)# handover maximum distance ?
+OsmoBSC(config-net-bts)# handover1 maximum distance ?
   <0-9999>  Maximum Timing-Advance value (i.e. MS distance) before triggering 
HO
   default   Use default (9999), remove explicit setting on this node
 

-- 
To view, visit https://gerrit.osmocom.org/6500
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7305ae7c04cc70082cd80d42b2ba32ffa399f51a
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to