aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-09-14 02:24:03 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-09-14 02:24:03 +0800
commit08aaded3b88dfe1da70a2923932c909e389d265e (patch)
treeb8bc7c92b3259706cef083413dda0a1b742bfb04
parent2e228fc2af9df41517163fd6575ff509c33096ad (diff)
vty: Add functions to access index and node0.1.20
It is easier to call these two functions from bindings than wrapping the vty structure and figuring out the alignment of the enum on all different ABIs.
-rw-r--r--include/osmocom/vty/vty.h2
-rw-r--r--src/vty/vty.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h
index e5a9d0d7..8035585d 100644
--- a/include/osmocom/vty/vty.h
+++ b/include/osmocom/vty/vty.h
@@ -155,6 +155,8 @@ int vty_config_unlock (struct vty *);
int vty_shell (struct vty *);
int vty_shell_serv (struct vty *);
void vty_hello (struct vty *);
+void *vty_current_index(struct vty *);
+int vty_current_node(struct vty *vty);
extern void *tall_vty_ctx;
#endif
diff --git a/src/vty/vty.c b/src/vty/vty.c
index ff17abf6..5c5a908d 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -248,6 +248,15 @@ int vty_out_newline(struct vty *vty)
return 0;
}
+void *vty_current_index(struct vty *vty)
+{
+ return vty->index;
+}
+int vty_current_node(struct vty *vty)
+{
+ return vty->node;
+}
+
int vty_config_lock(struct vty *vty)
{
if (vty_config == 0) {