pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38051?usp=email )
Change subject: Introduce typedef for bts->nr gsm_bts_nr_t ......................................................................
Introduce typedef for bts->nr gsm_bts_nr_t
The size of bts->nr is implicitly or explicitly used or taken into account in several places in the code. Add a new type to make it easier to define its size and range in one place.
This also helps in identifying fields contains an BSC-implementation "bts_nr" vs theip.access Abis OML "bts_nr" sent over the wire, which is always a uint8_t according to spec.
Related: SYS#7062 Change-Id: Ic0db2873fa9795024aba4399da495a0d8f7504b0 --- M include/osmocom/bsc/bts.h M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/abis_nm_vty.c M src/osmo-bsc/abis_om2000_vty.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts.c M src/osmo-bsc/bts_vty.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/neighbor_ident_vty.c M src/osmo-bsc/smscb_vty.c M tests/handover/handover_test.c 11 files changed, 66 insertions(+), 56 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved dexter: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index f2f7217..a8680d8 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -329,7 +329,7 @@ /* See (struct gsm_bts *)->depends_on */ struct bts_depends_on_entry { struct llist_head list; - uint8_t bts_nr; /* See (struct gsm_bts *)->nr */ + gsm_bts_nr_t bts_nr; /* See (struct gsm_bts *)->nr */ };
/* One BTS */ @@ -341,7 +341,7 @@ struct llist_head loc_list;
/* number of this BTS in network */ - uint8_t nr; + gsm_bts_nr_t nr; /* human readable name / description */ char *description; /* Cell Identity */ @@ -836,8 +836,8 @@ }
/* dependency handling */ -int bts_depend_mark(struct gsm_bts *bts, int dep); -void bts_depend_clear(struct gsm_bts *bts, int dep); +int bts_depend_mark(struct gsm_bts *bts, gsm_bts_nr_t dep); +void bts_depend_clear(struct gsm_bts *bts, gsm_bts_nr_t dep); bool bts_depend_check(struct gsm_bts *bts); bool bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6bffcc4..d67ebc1 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -21,6 +21,7 @@ #include <osmocom/core/time_cc.h> #include <osmocom/core/linuxlist.h> #include <osmocom/core/linuxrbtree.h> +#include <osmocom/core/utils.h>
#include <osmocom/crypt/auth.h>
@@ -96,6 +97,13 @@ #define DLCI2RSL_LINK_ID(dlci) \ ((dlci & 0xc0) == 0xc0 ? 0x40 : 0x00) | (dlci & 0x07)
+typedef uint8_t gsm_bts_nr_t; /* See (struct gsm_bts *)->nr */ +/* BTS_NR_MAX = ((2 << ((sizeof(gsm_bts_nr_t) * 8) - 1)) - 1) + * This is needed as a constant so that the value can be stringified properly: */ +#define BTS_NR_MAX 255 +#define BTS_NR_MAX_STR OSMO_STRINGIFY_VAL(BTS_NR_MAX) +#define BTS_NR_VTY_ARG_VAL "<0-" BTS_NR_MAX_STR ">" + /* 3-bit long values */ #define EARFCN_PRIO_INVALID 8 #define EARFCN_MEAS_BW_INVALID 8 @@ -881,7 +889,7 @@
struct gsm_network *gsm_network_init(void *ctx);
-struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num); +struct gsm_bts *gsm_bts_num(const struct gsm_network *net, gsm_bts_nr_t num); struct gsm_bts *gsm_bts_by_cell_id(const struct gsm_network *net, const struct gsm0808_cell_id *cell_id, int match_idx); @@ -975,7 +983,7 @@ struct rate_ctr_group *bsc_ctrs; struct osmo_stat_item_group *bsc_statg;
- unsigned int num_bts; + gsm_bts_nr_t num_bts; struct llist_head bts_list; struct llist_head bts_rejected;
diff --git a/src/osmo-bsc/abis_nm_vty.c b/src/osmo-bsc/abis_nm_vty.c index bbd2d15..d7ddcb9 100644 --- a/src/osmo-bsc/abis_nm_vty.c +++ b/src/osmo-bsc/abis_nm_vty.c @@ -76,7 +76,7 @@
DEFUN(oml_class_inst, oml_class_inst_cmd, - "bts <0-255> oml class " NM_OBJCLASS_VTY + "bts " BTS_NR_VTY_ARG_VAL " oml class " NM_OBJCLASS_VTY " instance <0-255> <0-255> <0-255>", "BTS related commands\n" "BTS Number\n" "Manipulate the OML managed objects\n" @@ -111,7 +111,7 @@ }
DEFUN(oml_classnum_inst, oml_classnum_inst_cmd, - "bts <0-255> oml class <0-255> instance <0-255> <0-255> <0-255>", + "bts " BTS_NR_VTY_ARG_VAL " oml class <0-255> instance <0-255> <0-255> <0-255>", "BTS related commands\n" "BTS Number\n" "Manipulate the OML managed objects\n" "Object Class\n" "Object Class\n" diff --git a/src/osmo-bsc/abis_om2000_vty.c b/src/osmo-bsc/abis_om2000_vty.c index 7604807..efec05e 100644 --- a/src/osmo-bsc/abis_om2000_vty.c +++ b/src/osmo-bsc/abis_om2000_vty.c @@ -79,7 +79,7 @@ #define OM2K_VTY_HELP "Configure OM2K specific parameters\n"
DEFUN(om2k_class_inst, om2k_class_inst_cmd, - "bts <0-255> om2000 class " OM2K_OBJCLASS_VTY + "bts " BTS_NR_VTY_ARG_VAL " om2000 class " OM2K_OBJCLASS_VTY " <0-255> <0-255> <0-255>", "BTS related commands\n" "BTS Number\n" "Manipulate the OM2000 managed objects\n" @@ -120,7 +120,7 @@ }
DEFUN(om2k_classnum_inst, om2k_classnum_inst_cmd, - "bts <0-255> om2000 class <0-255> <0-255> <0-255> <0-255>", + "bts " BTS_NR_VTY_ARG_VAL " om2000 class <0-255> <0-255> <0-255> <0-255>", "BTS related commands\n" "BTS Number\n" "Manipulate the OML managed objects\n" "Object Class\n" "Object Class\n" @@ -748,7 +748,7 @@ }
DEFUN(show_om2k_mo, show_om2k_mo_cmd, - "show bts <0-255> om2k-mo", + "show bts " BTS_NR_VTY_ARG_VAL " om2k-mo", SHOW_STR "Display information about a BTS\n" "BTS number\n" "OM2000 Managed Object information\n") { diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 8690a47..f04c7ec 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -232,7 +232,7 @@
return CMD_SUCCESS; } -DEFUN(show_bts, show_bts_cmd, "show bts [<0-255>]", +DEFUN(show_bts, show_bts_cmd, "show bts [" BTS_NR_VTY_ARG_VAL "]", SHOW_STR "Display information about a BTS\n" "BTS number\n") { @@ -273,7 +273,7 @@ return CMD_SUCCESS; }
-DEFUN(show_bts_fail_rep, show_bts_fail_rep_cmd, "show bts <0-255> fail-rep [reset]", +DEFUN(show_bts_fail_rep, show_bts_fail_rep_cmd, "show bts " BTS_NR_VTY_ARG_VAL " fail-rep [reset]", SHOW_STR "Display information about a BTS\n" "BTS number\n" "OML failure reports\n" "Clear the list of failure reports after showing them\n") @@ -457,7 +457,7 @@
DEFUN(show_trx, show_trx_cmd, - "show trx [<0-255>] [<0-255>]", + "show trx [" BTS_NR_VTY_ARG_VAL "] [<0-255>]", SHOW_STR "Display information about a TRX\n" BTS_TRX_STR) { @@ -500,7 +500,7 @@
DEFUN(show_ts, show_ts_cmd, - "show timeslot [<0-255>] [<0-255>] [<0-7>]", + "show timeslot [" BTS_NR_VTY_ARG_VAL "] [<0-255>] [<0-7>]", SHOW_STR "Display information about a TS\n" BTS_TRX_TS_STR) { @@ -727,7 +727,7 @@
DEFUN(show_lchan, show_lchan_cmd, - "show lchan [<0-255>] [<0-255>] [<0-7>] [<0-7>]", + "show lchan [" BTS_NR_VTY_ARG_VAL "] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" BTS_TRX_TS_LCHAN_STR) { @@ -736,7 +736,7 @@
DEFUN(show_lchan_summary, show_lchan_summary_cmd, - "show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]", + "show lchan summary [" BTS_NR_VTY_ARG_VAL "] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" "Short summary (used lchans)\n" BTS_TRX_TS_LCHAN_STR) @@ -746,7 +746,7 @@
DEFUN(show_lchan_summary_all, show_lchan_summary_all_cmd, - "show lchan summary-all [<0-255>] [<0-255>] [<0-7>] [<0-7>]", + "show lchan summary-all [" BTS_NR_VTY_ARG_VAL "] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" "Short summary (all lchans)\n" BTS_TRX_TS_LCHAN_STR) @@ -912,7 +912,7 @@
DEFUN(handover_subscr_conn, handover_subscr_conn_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> handover <0-255>", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> sub-slot <0-7> handover " BTS_NR_VTY_ARG_VAL, BTS_NR_TRX_TS_SS_STR2 MANUAL_HANDOVER_STR "New " BTS_NR_STR) @@ -922,7 +922,7 @@
DEFUN(assignment_subscr_conn, assignment_subscr_conn_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> assignment", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> sub-slot <0-7> assignment", BTS_NR_TRX_TS_SS_STR2 MANUAL_ASSIGNMENT_STR) { @@ -1089,7 +1089,7 @@
DEFUN(show_paging, show_paging_cmd, - "show paging [<0-255>]", + "show paging [" BTS_NR_VTY_ARG_VAL "]", SHOW_STR "Display information about paging requests of a BTS\n" BTS_NR_STR) { @@ -1120,7 +1120,7 @@
DEFUN(show_paging_group, show_paging_group_cmd, - "show paging-group <0-255> IMSI", + "show paging-group " BTS_NR_VTY_ARG_VAL " IMSI", SHOW_STR "Display the paging group\n" BTS_NR_STR "IMSI\n") { @@ -1313,7 +1313,7 @@ }
DEFUN(restart_bts, restart_bts_cmd, - "restart-bts <0-65535>", + "restart-bts " BTS_NR_VTY_ARG_VAL, "Restart ip.access nanoBTS through OML\n" BTS_NR_STR) { @@ -1352,7 +1352,7 @@
DEFUN(bts_resend_sysinfo, bts_resend_sysinfo_cmd, - "bts <0-255> resend-system-information", + "bts " BTS_NR_VTY_ARG_VAL " resend-system-information", "BTS Specific Commands\n" BTS_NR_STR "Re-generate + re-send BCCH SYSTEM INFORMATION\n") { @@ -1386,7 +1386,7 @@
DEFUN(bts_resend_power_ctrl_params, bts_resend_power_ctrl_params_cmd, - "bts <0-255> resend-power-control-defaults", + "bts " BTS_NR_VTY_ARG_VAL " resend-power-control-defaults", "BTS Specific Commands\n" BTS_NR_STR "Re-generate + re-send default MS/BS Power control parameters\n") { @@ -1425,7 +1425,7 @@
DEFUN(bts_c0_power_red, bts_c0_power_red_cmd, - "bts <0-255> c0-power-reduction <0-6>", + "bts " BTS_NR_VTY_ARG_VAL " c0-power-reduction <0-6>", "BTS Specific Commands\n" BTS_NR_STR "BCCH carrier power reduction operation\n" "Power reduction value (in dB, even numbers only)\n") @@ -1469,7 +1469,7 @@ /* this command is now hidden, as it's a low-level debug hack, and people should * instead use osmo-cbc these days */ DEFUN_HIDDEN(smscb_cmd, smscb_cmd_cmd, - "bts <0-255> smscb-command (normal|schedule|default) <1-4> HEXSTRING", + "bts " BTS_NR_VTY_ARG_VAL " smscb-command (normal|schedule|default) <1-4> HEXSTRING", "BTS related commands\n" BTS_NR_STR "SMS Cell Broadcast\n" "Normal (one-shot) SMSCB Message; sent once over Abis+Um\n" @@ -1539,7 +1539,7 @@ }
DEFUN(pdch_act, pdch_act_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> pdch (activate|deactivate)", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> pdch (activate|deactivate)", BTS_NR_TRX_TS_STR2 "Packet Data Channel\n" "Activate Dynamic PDCH/TCH (-> PDCH mode)\n" @@ -1796,7 +1796,7 @@ * manually in a given mode/codec. This is useful for receiver * performance testing (FER/RBER/...) */ DEFUN(lchan_act, lchan_act_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> (sub-slot|vamos-sub-slot) <0-7> (activate|activate-vamos) (hr|fr|efr|amr|sig) [<0-7>]", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> (sub-slot|vamos-sub-slot) <0-7> (activate|activate-vamos) (hr|fr|efr|amr|sig) [<0-7>]", BTS_NR_TRX_TS_STR2 "Primary sub-slot\n" "VAMOS secondary shadow subslot, range <0-1>, only valid for TCH type timeslots\n" SS_NR_STR @@ -1808,7 +1808,7 @@ }
DEFUN(lchan_deact, lchan_deact_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> (sub-slot|vamos-sub-slot) <0-7> deactivate", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> (sub-slot|vamos-sub-slot) <0-7> deactivate", BTS_NR_TRX_TS_STR2 "Primary sub-slot\n" "VAMOS secondary shadow subslot, range <0-1>, only valid for TCH type timeslots\n" SS_NR_STR @@ -1855,7 +1855,7 @@ /* Similar to lchan_act, but activates all lchans on the specified BTS at once, * this is intended to perform lab tests / measurements. */ DEFUN_HIDDEN(lchan_act_all_bts, lchan_act_all_bts_cmd, - "bts <0-255> (activate-all-lchan|deactivate-all-lchan)", + "bts " BTS_NR_VTY_ARG_VAL " (activate-all-lchan|deactivate-all-lchan)", "BTS Specific Commands\n" BTS_NR_STR ACTIVATE_ALL_LCHANS_STR DEACTIVATE_ALL_LCHANS_STR) @@ -1895,7 +1895,7 @@ /* Similar to lchan_act, but activates all lchans on the specified BTS at once, * this is intended to perform lab tests / measurements. */ DEFUN_HIDDEN(lchan_act_all_trx, lchan_act_all_trx_cmd, - "bts <0-255> trx <0-255> (activate-all-lchan|deactivate-all-lchan)", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> (activate-all-lchan|deactivate-all-lchan)", "BTS for manual command\n" BTS_NR_STR "TRX for manual command\n" TRX_NR_STR ACTIVATE_ALL_LCHANS_STR @@ -1937,7 +1937,7 @@ }
DEFUN(lchan_set_mspower, lchan_set_mspower_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> ms-power <0-40> [verify]\n", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> sub-slot <0-7> ms-power <0-40> [verify]\n", BTS_NR_TRX_TS_SS_STR2 "Manually force MS Uplink Power Level in dBm on the lchan (for testing)\n" "Set transmit power of the MS in dBm\n" @@ -1988,7 +1988,7 @@ }
DEFUN(vamos_modify_lchan, vamos_modify_lchan_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> modify (vamos|non-vamos) " TSC_ARGS_OPT, + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> sub-slot <0-7> modify (vamos|non-vamos) " TSC_ARGS_OPT, BTS_NR_TRX_TS_SS_STR2 "Manually send Channel Mode Modify (for debugging)\n" "Enable VAMOS channel mode\n" "Disable VAMOS channel mode\n" @@ -2026,7 +2026,7 @@ /* Debug command to send lchans from state LCHAN_ST_UNUSED to state * LCHAN_ST_BORKEN and vice versa. */ DEFUN_HIDDEN(lchan_set_borken, lchan_set_borken_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> (borken|unused)", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> sub-slot <0-7> (borken|unused)", BTS_NR_TRX_TS_SS_STR2 "send lchan to state LCHAN_ST_BORKEN (for debugging)\n" "send lchan to state LCHAN_ST_UNUSED (for debugging)\n") @@ -2071,7 +2071,7 @@ }
DEFUN(lchan_mdcx, lchan_mdcx_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> mdcx A.B.C.D <0-65535>", + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> sub-slot <0-7> mdcx A.B.C.D <0-65535>", BTS_NR_TRX_TS_SS_STR2 "Modify RTP Connection\n" "MGW IP Address\n" "MGW UDP Port\n") { @@ -2109,7 +2109,7 @@ }
DEFUN(lchan_reassign, lchan_reassign_cmd, - "bts <0-255> trx <0-255> timeslot <0-7> (sub-slot|vamos-sub-slot) <0-7> " + "bts " BTS_NR_VTY_ARG_VAL " trx <0-255> timeslot <0-7> (sub-slot|vamos-sub-slot) <0-7> " "reassign-to trx <0-255> timeslot <0-7> (sub-slot|vamos-sub-slot) <0-7> " TSC_ARGS_OPT, BTS_NR_TRX_TS_STR2 @@ -3219,7 +3219,7 @@
DEFUN(bts_unblock_setup_ramping, bts_unblock_setup_ramping_cmd, - "bts <0-255> unblock-setup-ramping", + "bts " BTS_NR_VTY_ARG_VAL " unblock-setup-ramping", "BTS Specific Commands\n" BTS_NR_STR "Unblock and allow to configure a BTS if kept back by BTS ramping\n") { @@ -3325,7 +3325,7 @@
DEFUN(gen_position_trap, gen_position_trap_cmd, - "generate-location-state-trap <0-255>", + "generate-location-state-trap " BTS_NR_VTY_ARG_VAL, "Generate location state report\n" "BTS to report\n") { diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c index 28d4c65..260e24e 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -870,7 +870,7 @@ } }
-int bts_depend_mark(struct gsm_bts *bts, int dep) +int bts_depend_mark(struct gsm_bts *bts, gsm_bts_nr_t dep) { struct bts_depends_on_entry *entry; entry = talloc_zero(bts, struct bts_depends_on_entry); @@ -883,7 +883,7 @@ return 0; }
-static struct bts_depends_on_entry *bts_depend_find_entry(const struct gsm_bts *bts, int dep) +static struct bts_depends_on_entry *bts_depend_find_entry(const struct gsm_bts *bts, gsm_bts_nr_t dep) { struct bts_depends_on_entry *entry; llist_for_each_entry(entry, &bts->trx_list, list) { @@ -893,7 +893,7 @@ return NULL; }
-void bts_depend_clear(struct gsm_bts *bts, int dep) +void bts_depend_clear(struct gsm_bts *bts, gsm_bts_nr_t dep) { struct bts_depends_on_entry *entry; entry = bts_depend_find_entry(bts, dep); diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 3c0c2ef..81c4022 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -106,7 +106,7 @@ /* per-BTS configuration */ DEFUN_ATTR(cfg_bts, cfg_bts_cmd, - "bts <0-255>", + "bts " BTS_NR_VTY_ARG_VAL, "Select a BTS to configure\n" BTS_NR_STR, CMD_ATTR_IMMEDIATE) @@ -2605,7 +2605,7 @@ }
DEFUN_ATTR(cfg_bts_depends_on, cfg_bts_depends_on_cmd, - "depends-on-bts <0-255>", + "depends-on-bts " BTS_NR_VTY_ARG_VAL, "This BTS can only be started if another one is up\n" BTS_NR_STR, CMD_ATTR_IMMEDIATE) { @@ -2639,7 +2639,7 @@ }
DEFUN_ATTR(cfg_bts_no_depends_on, cfg_bts_no_depends_on_cmd, - "no depends-on-bts <0-255>", + "no depends-on-bts " BTS_NR_VTY_ARG_VAL, NO_STR "This BTS can only be started if another one is up\n" BTS_NR_STR, CMD_ATTR_IMMEDIATE) { diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index b11607e..814cd56 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -49,6 +49,8 @@
void *tall_bsc_ctx = NULL;
+osmo_static_assert(BTS_NR_MAX == ((2 << ((sizeof(gsm_bts_nr_t) * 8) - 1)) - 1), _gsm_bts_nr_t_size); + void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, uint8_t e1_ts, uint8_t e1_ts_ss) { @@ -250,7 +252,7 @@ return get_value_string(chreq_names, c); }
-struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num) +struct gsm_bts *gsm_bts_num(const struct gsm_network *net, gsm_bts_nr_t num) { struct gsm_bts *bts;
diff --git a/src/osmo-bsc/neighbor_ident_vty.c b/src/osmo-bsc/neighbor_ident_vty.c index 44b9057..5cdab11 100644 --- a/src/osmo-bsc/neighbor_ident_vty.c +++ b/src/osmo-bsc/neighbor_ident_vty.c @@ -57,7 +57,7 @@ #define CGI_PS_ARGC 5 #define CGI_PS_DOC "Neighbor cell by cgi (Packet Switched, with RAC)\n" "MCC\n" "MNC\n" "LAC\n" "RAC\n" "CI\n"
-#define LOCAL_BTS_PARAMS "bts <0-255>" +#define LOCAL_BTS_PARAMS "bts " BTS_NR_VTY_ARG_VAL #define LOCAL_BTS_DOC "Neighbor cell by local BTS number\n" "BTS number\n"
static int neighbor_ident_vty_parse_lac(struct vty *vty, struct gsm0808_cell_id *cell_id, const char **argv) @@ -579,7 +579,7 @@ }
DEFUN(show_bts_neighbor, show_bts_neighbor_cmd, - "show bts <0-255> neighbor " CELL_AB_VTY_PARAMS, + "show bts " BTS_NR_VTY_ARG_VAL " neighbor " CELL_AB_VTY_PARAMS, SHOW_STR "Display information about a BTS\n" "BTS number\n" "Query which cell would be the target for this neighbor ARFCN+BSIC\n" CELL_AB_VTY_DOC) diff --git a/src/osmo-bsc/smscb_vty.c b/src/osmo-bsc/smscb_vty.c index b13d2db..c43866e 100644 --- a/src/osmo-bsc/smscb_vty.c +++ b/src/osmo-bsc/smscb_vty.c @@ -391,7 +391,7 @@ }
DEFUN(bts_show_cbs, bts_show_cbs_cmd, - "show bts <0-255> smscb [(basic|extended)]", + "show bts " BTS_NR_VTY_ARG_VAL " smscb [(basic|extended)]", SHOW_STR "Display information about a BTS\n" "BTS number\n" "SMS Cell Broadcast State\n" "Show only information related to CBCH BASIC\n" diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 174e9e1..e4c7873 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -847,7 +847,7 @@ return trx; }
-#define LCHAN_ARGS "lchan <0-255> <0-255> <0-7> <0-7>" +#define LCHAN_ARGS "lchan " BTS_NR_VTY_ARG_VAL " <0-255> <0-7> <0-7>" #define LCHAN_ARGS_DOC "identify an lchan\nBTS nr\nTRX nr\nTimeslot nr\nSubslot nr\n"
static struct gsm_lchan *parse_lchan_args(const char **argv) @@ -858,7 +858,7 @@ return &ts->lchan[atoi(argv[3])]; }
-#define LCHAN_WILDCARD_ARGS "lchan (<0-255>|*) (<0-255>|*) (<0-7>|*) (<0-7>|*)" +#define LCHAN_WILDCARD_ARGS "lchan (" BTS_NR_VTY_ARG_VAL "|*) (<0-255>|*) (<0-7>|*) (<0-7>|*)" #define LCHAN_WILDCARD_ARGS_DOC "identify an lchan\nBTS nr\nall BTS\nTRX nr\nall BTS\nTimeslot nr\nall TS\nSubslot nr\nall subslots\n"
static void parse_lchan_wildcard_args(const char **argv, void (*cb)(struct gsm_lchan*, void*), void *cb_data) @@ -1104,7 +1104,7 @@ }
DEFUN(res_ind, res_ind_cmd, - "res-ind trx <0-255> <0-255> levels .LEVELS", + "res-ind trx " BTS_NR_VTY_ARG_VAL " <0-255> levels .LEVELS", "Send Resource Indication for a specific TRX, indicating interference levels per lchan\n" "Indicate a BTS and TRX\n" "BTS nr\n" "TRX nr\n" "Indicate interference levels: each level is an index to bts->interf_meas_params.bounds_dbm[]," @@ -1398,7 +1398,7 @@ }
DEFUN(expect_ts_use, expect_ts_use_cmd, - "expect-ts-use trx <0-255> <0-255> states" TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE, + "expect-ts-use trx " BTS_NR_VTY_ARG_VAL " <0-255> states" TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE, "Expect timeslots of a BTS' TRX to be in a specific state\n" "Indicate a BTS and TRX\n" "BTS nr\n" "TRX nr\n" "List of 8 expected TS states\n" @@ -1435,7 +1435,7 @@ }
DEFUN(set_arfcn, set_arfcn_cmd, - "set-arfcn trx <0-255> <0-255> <0-1023>", + "set-arfcn trx " BTS_NR_VTY_ARG_VAL " <0-255> <0-1023>", "Set the ARFCN for a BTS' TRX\n" "Indicate a BTS and TRX\n" "BTS nr\n" "TRX nr\n" "Absolute Radio Frequency Channel Number\n") @@ -1467,7 +1467,7 @@ }
DEFUN(set_band, set_band_cmd, - "set-band bts <0-255> BAND", + "set-band bts " BTS_NR_VTY_ARG_VAL " BAND", "Set the frequency band for a BTS\n" "Indicate a BTS\n" "BTS nr\n" "Frequency band\n") @@ -1488,7 +1488,7 @@ }
DEFUN(set_ts_use, set_ts_use_cmd, - "set-ts-use trx <0-255> <0-255> states" TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE, + "set-ts-use trx " BTS_NR_VTY_ARG_VAL " <0-255> states" TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE TS_USE, "Put timeslots of a BTS' TRX into a specific state\n" "Indicate a BTS and TRX\n" "BTS nr\n" "TRX nr\n" "List of 8 TS states to apply\n"