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/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/1061
hnbgw: vty: set explicit go_parent_cb
A second level of depth will be added to the hnbgw node soon, which will need
explicit go-parent logic.
Change-Id: I8d1c18a396c215e8425ae49872b5c73316087d7d
---
M include/osmocom/iuh/hnbgw.h
M src/hnbgw.c
M src/hnbgw_vty.c
3 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/61/1061/1
diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h
index 4edd05f..6cc7984 100644
--- a/include/osmocom/iuh/hnbgw.h
+++ b/include/osmocom/iuh/hnbgw.h
@@ -148,6 +148,7 @@
void hnb_context_release(struct hnb_context *ctx);
void hnbgw_vty_init(struct hnb_gw *gw, void *tall_ctx);
+int hnbgw_vty_go_parent(struct vty *vty);
const char *hnbgw_get_iuh_local_ip(struct hnb_gw *gw);
uint16_t hnbgw_get_iuh_local_port(struct hnb_gw *gw);
diff --git a/src/hnbgw.c b/src/hnbgw.c
index ebafae9..ac988d8 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -365,6 +365,7 @@
static struct vty_app_info vty_info = {
.name = "OsmoHNBGW",
.version = "0",
+ .go_parent_cb = hnbgw_vty_go_parent,
};
static struct {
diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index 89fc124..25930d1 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -54,6 +54,23 @@
return CMD_SUCCESS;
}
+int hnbgw_vty_go_parent(struct vty *vty)
+{
+ switch (vty->node) {
+ default:
+ case HNBGW_NODE:
+ vty->node = CONFIG_NODE;
+ vty->index = NULL;
+ break;
+ case CONFIG_NODE:
+ vty->node = ENABLE_NODE;
+ vty->index = NULL;
+ break;
+ }
+
+ return vty->node;
+}
+
static void vty_dump_hnb_info(struct vty *vty, struct hnb_context *hnb)
{
struct hnbgw_context_map *map;
--
To view, visit https://gerrit.osmocom.org/1061
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d1c18a396c215e8425ae49872b5c73316087d7d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>