Change in osmo-bts[master]: main: register VTY commands before handle_options()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Thu Oct 29 02:38:52 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/20954 )


Change subject: main: register VTY commands before handle_options()
......................................................................

main: register VTY commands before handle_options()

Otherwise only those commands that are registered by libosmocore
appear in the generated XML VTY reference - change the order.

bts_vty_init() accepts an argument that is used as a talloc
context for vty_cmd_string_from_valstr() - pass tall_bts_ctx.

Change-Id: Ic356a950da85de02c82e9882a5fbadaaa6929680
Related: SYS#4937, OS#3036
---
M include/osmo-bts/vty.h
M src/common/main.c
M src/common/vty.c
3 files changed, 13 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/20954/1

diff --git a/include/osmo-bts/vty.h b/include/osmo-bts/vty.h
index b6e3f0d..c9840d1 100644
--- a/include/osmo-bts/vty.h
+++ b/include/osmo-bts/vty.h
@@ -22,7 +22,7 @@
 int bts_vty_go_parent(struct vty *vty);
 int bts_vty_is_config_node(struct vty *vty, int node);
 
-int bts_vty_init(struct gsm_bts *bts);
+int bts_vty_init(void *ctx);
 
 struct gsm_network *gsmnet_from_vty(struct vty *v);
 
diff --git a/src/common/main.c b/src/common/main.c
index ad14374..c18fe4c 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -275,6 +275,9 @@
 	osmo_cpu_sched_vty_init(tall_bts_ctx);
 	rate_ctr_init(tall_bts_ctx);
 
+	e1inp_vty_init();
+	bts_vty_init(tall_bts_ctx);
+
 	handle_options(argc, argv);
 
 	bts = gsm_bts_alloc(tall_bts_ctx, 0);
@@ -283,9 +286,6 @@
 		exit(1);
 	}
 
-	e1inp_vty_init();
-	bts_vty_init(bts);
-
 	/* enable realtime priority for us */
 	if (rt_prio != -1) {
 		struct sched_param param;
diff --git a/src/common/vty.c b/src/common/vty.c
index d20b143..957678a 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -1815,33 +1815,33 @@
 	return CMD_SUCCESS;
 }
 
-int bts_vty_init(struct gsm_bts *bts)
+int bts_vty_init(void *ctx)
 {
-	cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names,
+	cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(ctx, gsmtap_sapi_names,
 						"gsmtap-sapi (",
 						"|",")", VTY_DO_LOWER);
-	cfg_trx_gsmtap_sapi_cmd.doc = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names,
+	cfg_trx_gsmtap_sapi_cmd.doc = vty_cmd_string_from_valstr(ctx, gsmtap_sapi_names,
 						"Enable sending of UL/DL messages over GSMTAP\n",
 						"\n", "", 0);
 
-	cfg_trx_no_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names,
+	cfg_trx_no_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(ctx, gsmtap_sapi_names,
 						"no gsmtap-sapi (",
 						"|",")", VTY_DO_LOWER);
-	cfg_trx_no_gsmtap_sapi_cmd.doc = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names,
+	cfg_trx_no_gsmtap_sapi_cmd.doc = vty_cmd_string_from_valstr(ctx, gsmtap_sapi_names,
 						NO_STR "Disable sending of UL/DL messages over GSMTAP\n",
 						"\n", "", 0);
 
-	logging_fltr_l1_sapi_cmd.string = vty_cmd_string_from_valstr(bts, l1sap_common_sapi_names,
+	logging_fltr_l1_sapi_cmd.string = vty_cmd_string_from_valstr(ctx, l1sap_common_sapi_names,
 						"logging filter l1-sapi (",
 						"|", ")", VTY_DO_LOWER);
-	logging_fltr_l1_sapi_cmd.doc = vty_cmd_string_from_valstr(bts, l1sap_common_sapi_names,
+	logging_fltr_l1_sapi_cmd.doc = vty_cmd_string_from_valstr(ctx, l1sap_common_sapi_names,
 						LOGGING_STR FILTER_STR "L1 SAPI\n",
 						"\n", "", 0);
 
-	no_logging_fltr_l1_sapi_cmd.string = vty_cmd_string_from_valstr(bts, l1sap_common_sapi_names,
+	no_logging_fltr_l1_sapi_cmd.string = vty_cmd_string_from_valstr(ctx, l1sap_common_sapi_names,
 						"no logging filter l1-sapi (",
 						"|", ")", VTY_DO_LOWER);
-	no_logging_fltr_l1_sapi_cmd.doc = vty_cmd_string_from_valstr(bts, l1sap_common_sapi_names,
+	no_logging_fltr_l1_sapi_cmd.doc = vty_cmd_string_from_valstr(ctx, l1sap_common_sapi_names,
 						NO_STR LOGGING_STR FILTER_STR "L1 SAPI\n",
 						"\n", "", 0);
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/20954
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ic356a950da85de02c82e9882a5fbadaaa6929680
Gerrit-Change-Number: 20954
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201029/ef69009b/attachment.htm>


More information about the gerrit-log mailing list