]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: track name of command in cmd_element
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 10 Feb 2017 15:42:49 +0000 (16:42 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 10 Feb 2017 15:44:28 +0000 (16:44 +0100)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/command.h

index 7986c676fcaf19e26412a91ef76cbe3eb01ba32e..29283418ce54281dd2e6f2f9392559eefacfc980 100644 (file)
@@ -220,6 +220,8 @@ struct cmd_element
 
   /* handler function for command */
   int (*func) (const struct cmd_element *, struct vty *, int, struct cmd_token *[]);
+
+  const char *name;             /* symbol name for debugging */
 };
 
 /* Return value of the commands. */
@@ -252,6 +254,7 @@ struct cmd_element
     .doc = helpstr, \
     .attr = attrs, \
     .daemon = dnum, \
+    .name = #cmdname, \
   };
 
 #define DEFUN_CMD_FUNC_DECL(funcname) \