summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/common/vty.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-03-13 06:01:08 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-03-13 06:16:48 +0700
commit9feb5057da41611033a5881409c4fef2628d98a9 (patch)
tree11c4833a33cf9abbbdb5c4bea715739e7d574c86 /src/host/layer23/src/common/vty.c
parentc43d4183f514bbbe200048f07d75a5cad79bae55 (diff)
layer23: refactor the application API concept
With this set of changes we have a cleaner l23 app architecture: * struct vty_app_info: all l23 applications must define this struct; * struct vty_app_info: *cfg_supported() becomes a mask of L23_OPT_*; * struct vty_app_info: explicitly set L23_OPT_* in all l23 apps; * drop l23_app_info(), there can be only one vty_app_info per an app; It's no more needed to obtain the vty_app_info by calling a function and checking the returned value against NULL everywhere. This kind of information is rather static (not dynamically composed) and needs not to be encapsulated into functions. Change-Id: I89004cd5308927305f79b102f7b695709148df6d
Diffstat (limited to 'src/host/layer23/src/common/vty.c')
-rw-r--r--src/host/layer23/src/common/vty.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/host/layer23/src/common/vty.c b/src/host/layer23/src/common/vty.c
index 59876671..fd639185 100644
--- a/src/host/layer23/src/common/vty.c
+++ b/src/host/layer23/src/common/vty.c
@@ -559,18 +559,12 @@ static void l23_vty_init_gsmtap(void)
int l23_vty_init(int (*config_write_ms_node_cb)(struct vty *), osmo_signal_cbfn *l23_vty_signal_cb)
{
- struct l23_app_info *app;
- unsigned int app_supp_opt = 0x00;
int rc = 0;
- app = l23_app_info();
- if (app && app->cfg_supported != NULL)
- app_supp_opt = app->cfg_supported();
-
- if (app_supp_opt & L23_OPT_TAP)
+ if (l23_app_info.opt_supported & L23_OPT_TAP)
l23_vty_init_gsmtap();
- if (app_supp_opt & L23_OPT_VTY)
+ if (l23_app_info.opt_supported & L23_OPT_VTY)
osmo_stats_vty_add_cmds();
install_node(&ms_node, config_write_ms_node_cb);