]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/grammar_sandbox.c
Merge pull request #7220 from idryzhov/fix-clear-isis
[mirror_frr.git] / lib / grammar_sandbox.c
index 20d5879c67784278225635c000c540bc00ccf3d7..a40b815caa74329dae7df28453ee3a4aed74945d 100644 (file)
@@ -28,7 +28,6 @@
 #endif
 
 #include "command.h"
-#include "memory_vty.h"
 #include "graph.h"
 #include "linklist.h"
 #include "command_match.h"
@@ -39,12 +38,12 @@ DEFINE_MTYPE_STATIC(LIB, CMD_TOKENS, "Command desc")
 
 /** headers **/
 void grammar_sandbox_init(void);
-void pretty_print_graph(struct vty *vty, struct graph_node *, int, int,
-                       struct graph_node **, size_t);
-void init_cmdgraph(struct vty *, struct graph **);
+static void pretty_print_graph(struct vty *vty, struct graph_node *, int, int,
+                              struct graph_node **, size_t);
+static void init_cmdgraph(struct vty *, struct graph **);
 
 /** shim interface commands **/
-struct graph *nodegraph = NULL, *nodegraph_free = NULL;
+static struct graph *nodegraph = NULL, *nodegraph_free = NULL;
 
 #define check_nodegraph()                                                      \
        do {                                                                   \
@@ -400,7 +399,7 @@ DEFUN (grammar_findambig,
                        if (!nodegraph)
                                continue;
                        vty_out(vty, "scanning node %d (%s)\n", scannode - 1,
-                               node_names[scannode - 1]);
+                               cnode->name);
                }
 
                commands = cmd_graph_permutations(nodegraph);
@@ -492,8 +491,9 @@ void grammar_sandbox_init(void)
  * @param start the node to take as the root
  * @param level indent level for recursive calls, always pass 0
  */
-void pretty_print_graph(struct vty *vty, struct graph_node *start, int level,
-                       int desc, struct graph_node **stack, size_t stackpos)
+static void pretty_print_graph(struct vty *vty, struct graph_node *start,
+                              int level, int desc, struct graph_node **stack,
+                              size_t stackpos)
 {
        // print this node
        char tokennum[32];
@@ -551,7 +551,7 @@ void pretty_print_graph(struct vty *vty, struct graph_node *start, int level,
 }
 
 /** stuff that should go in command.c + command.h */
-void init_cmdgraph(struct vty *vty, struct graph **graph)
+static void init_cmdgraph(struct vty *vty, struct graph **graph)
 {
        // initialize graph, add start noe
        *graph = graph_new();