]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/command_graph.h
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / command_graph.h
index 879148844c5ec3cae2ef754e97323e9d488f9cb3..82d562694cd844e67219af6736f97912964abb80 100644 (file)
@@ -42,14 +42,17 @@ struct vty;
  * The type determines what kind of data the token can match (in the
  * matching use case) or hold (in the argv use case).
  */
+/* clang-format off */
 enum cmd_token_type {
-       WORD_TKN,       // words
+       WORD_TKN,        // words
        VARIABLE_TKN,    // almost anything
        RANGE_TKN,       // integer range
-       IPV4_TKN,       // IPV4 addresses
+       IPV4_TKN,        // IPV4 addresses
        IPV4_PREFIX_TKN, // IPV4 network prefixes
-       IPV6_TKN,       // IPV6 prefixes
+       IPV6_TKN,        // IPV6 prefixes
        IPV6_PREFIX_TKN, // IPV6 network prefixes
+       MAC_TKN,         // Ethernet address
+       MAC_PREFIX_TKN,  // Ethernet address w/ CIDR mask
 
        /* plumbing types */
        FORK_TKN,  // marks subgraph beginning
@@ -59,6 +62,7 @@ enum cmd_token_type {
 
        SPECIAL_TKN = FORK_TKN,
 };
+/* clang-format on */
 
 #define IS_VARYING_TOKEN(x) ((x) >= VARIABLE_TKN && (x) < FORK_TKN)
 
@@ -112,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 */