diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/vty/command.h | 2 | ||||
-rw-r--r-- | include/osmocom/vty/vty.h | 23 |
2 files changed, 25 insertions, 0 deletions
diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 0fa5175a..cb2edaaf 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -161,6 +161,7 @@ struct desc { #define CMD_COMPLETE_MATCH 8 #define CMD_COMPLETE_LIST_MATCH 9 #define CMD_SUCCESS_DAEMON 10 +#define CMD_ERR_INVALID_INDENT 11 /* Argc max counts. */ #define CMD_ARGC_MAX 256 @@ -368,6 +369,7 @@ void vty_install_default(int node_type); char *argv_concat(const char **argv, int argc, int shift); vector cmd_make_strvec(const char *); +int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p); void cmd_free_strvec(vector); vector cmd_describe_command(); char **cmd_complete_command(); diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index 544e1fa0..02ba03ee 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -3,6 +3,8 @@ #include <stdio.h> #include <stdarg.h> +#include <osmocom/core/linuxlist.h> + /*! \defgroup vty VTY (Virtual TTY) interface * @{ * \file vty.h */ @@ -45,6 +47,20 @@ enum vty_type { VTY_SHELL_SERV }; +struct vty_parent_node { + struct llist_head entry; + + /*! private data, specified by creator */ + void *priv; + + /*! Node status of this vty */ + int node; + + /*! When reading from a config file, these are the indenting characters expected for children of + * this VTY node. */ + char *indent; +}; + /*! Internal representation of a single VTY */ struct vty { /*! underlying file (if any) */ @@ -134,6 +150,13 @@ struct vty { /*! In configure mode. */ int config; + + /*! List of parent nodes, last item is the outermost parent. */ + struct llist_head parent_nodes; + + /*! When reading from a config file, these are the indenting characters expected for children of + * the current VTY node. */ + char *indent; }; /* Small macro to determine newline is newline only or linefeed needed. */ |