diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-04-20 14:34:46 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-04-22 17:14:55 -0400 |
| commit | 26fbe47294b56bf58a7452e55d24c4204042959d (patch) | |
| tree | b4d6fdcd68b8cf5a70be9071c106c6521013184d /lib/command_graph.h | |
| parent | 8f2a4d3047139723416dfe6ccccd3c8f54653ef7 (diff) | |
lib: add ability to dump cli mode graph
The grammar sandbox has had the ability to dump individual commands as
DOT graphs, but now that generalized DOT support is present it's trivial
to extend this to entire submodes. This is quite useful for visualizing
the CLI space when debugging CLI errors.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command_graph.h')
| -rw-r--r-- | lib/command_graph.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/command_graph.h b/lib/command_graph.h index ec68e284ed..82d562694c 100644 --- a/lib/command_graph.h +++ b/lib/command_graph.h @@ -116,5 +116,21 @@ extern void cmd_graph_parse(struct graph *graph, struct cmd_element *cmd); extern void cmd_graph_names(struct graph *graph); extern void cmd_graph_merge(struct graph *old, struct graph *new, int direction); +/* + * Print callback for DOT dumping. + * + * See graph.h for more details. + */ +extern void cmd_graph_node_print_cb(struct graph_node *gn, struct buffer *buf); +/* + * Dump command graph to DOT. + * + * cmdgraph + * A command graph to dump + * + * Returns: + * String allocated with MTYPE_TMP representing this graph + */ +char *cmd_graph_dump_dot(struct graph *cmdgraph); #endif /* _FRR_COMMAND_GRAPH_H */ |
