From 5c7b7090271fb5b88e68066bb681ce6cda88dc9f Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sun, 1 Nov 2020 05:44:23 +0700 Subject: vty: call bts_model_vty_init() from bts_vty_init() Similar to bts_vty_init(), BTS specific bts_model_vty_init() requires a pointer to 'struct gsm_bts'. Not only it's used as a parent talloc context, but also stored locally, so then it can be used by some VTY commands. Let's expose the global 'struct gsm_bts' from main, and pass the application's talloc context like was done in [1]. This finally makes the BTS model specific options appear in the automatically generated VTY reference (--vty-ref-xml). [1] Ic356a950da85de02c82e9882a5fbadaaa6929680 Change-Id: Iee7fee6747dd1e7c0af36f9b27326f651ae37aaf Related: SYS#4937, OS#3036 --- include/osmo-bts/bts_model.h | 2 +- include/osmo-bts/vty.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h index 568ff007..ef93fdad 100644 --- a/include/osmo-bts/bts_model.h +++ b/include/osmo-bts/bts_model.h @@ -34,7 +34,7 @@ int bts_model_trx_deact_rf(struct gsm_bts_trx *trx); /* Implementation should call bts_model_trx_close_cb when done */ void bts_model_trx_close(struct gsm_bts_trx *trx); -int bts_model_vty_init(struct gsm_bts *bts); +int bts_model_vty_init(void *ctx); void bts_model_config_write_bts(struct vty *vty, const struct gsm_bts *bts); void bts_model_config_write_trx(struct vty *vty, const struct gsm_bts_trx *trx); diff --git a/include/osmo-bts/vty.h b/include/osmo-bts/vty.h index c9840d11..c815c85a 100644 --- a/include/osmo-bts/vty.h +++ b/include/osmo-bts/vty.h @@ -27,6 +27,7 @@ int bts_vty_init(void *ctx); struct gsm_network *gsmnet_from_vty(struct vty *v); extern struct vty_app_info bts_vty_info; +extern struct gsm_bts *g_bts; enum bts_vty_cmd_attr { BTS_VTY_ATTR_NEW_LCHAN, -- cgit v1.2.3