]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/command_parse.y
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / command_parse.y
index ba042c33be9c97c4a887ebdc16ed55ba258a842b..1b304a98b2b151dcaa51084d98383b7c340a31cc 100644 (file)
@@ -33,8 +33,8 @@
 /* define api.prefix {cmd_yy} */
 
 /* names for generated header and parser files */
-%defines "command_parse.h"
-%output  "command_parse.c"
+%defines "lib/command_parse.h"
+%output  "lib/command_parse.c"
 
 /* note: code blocks are output in order, to both .c and .h:
  *  1. %code requires
 %token <string> IPV6_PREFIX
 %token <string> VARIABLE
 %token <string> RANGE
+%token <string> MAC
+%token <string> MAC_PREFIX
 
 /* union types for parsed rules */
 %type <node> start
@@ -273,6 +275,16 @@ placeholder_token_real:
 
   XFREE (MTYPE_LEX, $1);
 }
+| MAC
+{
+  $$ = new_token_node (ctx, MAC_TKN, $1, doc_next(ctx));
+  XFREE (MTYPE_LEX, $1);
+}
+| MAC_PREFIX
+{
+  $$ = new_token_node (ctx, MAC_PREFIX_TKN, $1, doc_next(ctx));
+  XFREE (MTYPE_LEX, $1);
+}
 
 placeholder_token:
   placeholder_token_real varname_token
@@ -392,8 +404,8 @@ yyerror (CMD_YYLTYPE *loc, struct parser_ctx *ctx, char const *msg)
   char spacing[256];
   int lineno = 0;
 
-  zlog_err ("%s: FATAL parse error: %s", __func__, msg);
-  zlog_err ("%s: %d:%d-%d of this command definition:", __func__, loc->first_line, loc->first_column, loc->last_column);
+  zlog_notice ("%s: FATAL parse error: %s", __func__, msg);
+  zlog_notice ("%s: %d:%d-%d of this command definition:", __func__, loc->first_line, loc->first_column, loc->last_column);
 
   line = tmpstr;
   do {
@@ -402,7 +414,7 @@ yyerror (CMD_YYLTYPE *loc, struct parser_ctx *ctx, char const *msg)
     if (eol)
       *eol++ = '\0';
 
-    zlog_err ("%s: | %s", __func__, line);
+    zlog_notice ("%s: | %s", __func__, line);
     if (lineno == loc->first_line && lineno == loc->last_line
         && loc->first_column < (int)sizeof(spacing) - 1
         && loc->last_column < (int)sizeof(spacing) - 1) {
@@ -414,7 +426,7 @@ yyerror (CMD_YYLTYPE *loc, struct parser_ctx *ctx, char const *msg)
       memset(spacing, ' ', loc->first_column - 1);
       memset(spacing + loc->first_column - 1, '^', len);
       spacing[loc->first_column - 1 + len] = '\0';
-      zlog_err ("%s: | %s", __func__, spacing);
+      zlog_notice ("%s: | %s", __func__, spacing);
     }
   } while ((line = eol));
   free(tmpstr);