summaryrefslogtreecommitdiff
path: root/lib/cmdtree.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cmdtree.h')
-rw-r--r--lib/cmdtree.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/cmdtree.h b/lib/cmdtree.h
index cdcf347006..e9a10d7ec5 100644
--- a/lib/cmdtree.h
+++ b/lib/cmdtree.h
@@ -20,13 +20,24 @@ struct graph_node
{
enum graph_node_type type;
vector children;
- int is_leaf, is_root;
+ int is_root; // true if first token in command
+ int is_leaf; // true if last token in command
+
int (*func)(struct vty *, int, const char *[]);
+
+ /* various data fields for nodes */
+ char* text; // for words and variables
+ int value; // for numbers
+ int start, end; // for ranges
};
/*
* Adds a child to a node. If the node already has the exact same
* child, nothing is done.
+ * @param[in] parent node
+ * @param[in] child node
+ * @return the new child, or the existing child if the parent already has the
+ * new child
*/
extern struct graph_node *
add_node(struct graph_node *, struct graph_node *);