diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-01-12 17:18:14 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-01-16 13:34:28 +0100 |
commit | adb67e5106e398f29e5f9b1a2972dde35966c0fb (patch) | |
tree | 130ae0d51e68b58d8a0bf7466ee47c8700042db4 /src/host/layer23/include/osmocom/bb/common | |
parent | b54dbfcde9b7c760bdb0fb41b25e35cad969d199 (diff) |
layer23: Initial VTY framework to share VTY code between apps
A small layer23 framework is added which allows apps to easily share/reuse
VTY commands while giving some flexiblity to add new per-app
specific configs/cmds, since not all commands may be relevant for all
apps.
Some of the mobile app code is moved to common, and sample infra is
added to modem app.
Future commits will most probably keep moving more stuff mobile->common
and then reusing those in modem app, as found needed.
Change-Id: Iabfb3129199488d790b89884bc1e424f2aca696f
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/common')
-rw-r--r-- | src/host/layer23/include/osmocom/bb/common/Makefile.am | 1 | ||||
-rw-r--r-- | src/host/layer23/include/osmocom/bb/common/vty.h | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/Makefile.am b/src/host/layer23/include/osmocom/bb/common/Makefile.am index 8663d9cd..c756b8e4 100644 --- a/src/host/layer23/include/osmocom/bb/common/Makefile.am +++ b/src/host/layer23/include/osmocom/bb/common/Makefile.am @@ -13,4 +13,5 @@ noinst_HEADERS = \ sap_fsm.h \ sap_interface.h \ sim.h \ + vty.h \ $(NULL) diff --git a/src/host/layer23/include/osmocom/bb/common/vty.h b/src/host/layer23/include/osmocom/bb/common/vty.h new file mode 100644 index 00000000..dd5e7f2f --- /dev/null +++ b/src/host/layer23/include/osmocom/bb/common/vty.h @@ -0,0 +1,25 @@ +#pragma once + +#include <osmocom/bb/common/osmocom_data.h> +#include <osmocom/vty/vty.h> +#include <osmocom/vty/buffer.h> +#include <osmocom/vty/command.h> + +struct osmocom_ms; + +enum l23_vty_node { + MS_NODE = _LAST_OSMOVTY_NODE + 1, + _LAST_L23VTY_NODE, +}; + +int l23_vty_init(int (*config_write_ms_node_cb)(struct vty *)); + +struct osmocom_ms *l23_vty_get_ms(const char *name, struct vty *vty); +void l23_ms_dump(struct osmocom_ms *ms, struct vty *vty); +void l23_vty_config_write_ms_node(struct vty *vty, const struct osmocom_ms *ms, const char *prefix); +void l23_vty_config_write_ms_node_contents(struct vty *vty, const struct osmocom_ms *ms, const char *prefix); + +extern struct llist_head ms_list; + +extern struct cmd_element l23_show_ms_cmd; +extern struct cmd_element l23_cfg_ms_cmd; |