vty: Add functions to access index and node

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.
This commit is contained in:
Holger Hans Peter Freyther 2010-09-14 02:24:03 +08:00
parent 2e228fc2af
commit 08aaded3b8
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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) {