[PATCH] osmo-iuh[master]: hnbgw: vty: set explicit go_parent_cb

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
Thu Oct 27 12:05:07 UTC 2016


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/1061

to look at the new patch set (#2).

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, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/61/1061/2

diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h
index 92d7674..850c4d9 100644
--- a/include/osmocom/iuh/hnbgw.h
+++ b/include/osmocom/iuh/hnbgw.h
@@ -148,3 +148,4 @@
 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);
diff --git a/src/hnbgw.c b/src/hnbgw.c
index 2eecbea..16a2e43 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -346,6 +346,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 ff75aea..a458c76 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -54,6 +54,27 @@
 	return CMD_SUCCESS;
 }
 
+int hnbgw_vty_go_parent(struct vty *vty)
+{
+	switch (vty->node) {
+	case IUH_NODE:
+		vty->node = HNBGW_NODE;
+		vty->index = NULL;
+		break;
+	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: newpatchset
Gerrit-Change-Id: I8d1c18a396c215e8425ae49872b5c73316087d7d
Gerrit-PatchSet: 2
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list