diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 0bf76e9b..edd233fa 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -246,7 +246,19 @@ WHITE [ \t] return IP4; } -({XIGIT}{2}){16,}|{XIGIT}{2}(:{XIGIT}{2}){15,}|hex:({XIGIT}{2}*|{XIGIT}{2}(:{XIGIT}{2})*) { +{XIGIT}{2}(:{XIGIT}{2}){5} { + mac_addr mac; + char *s = yytext; + + int len = bstrhextobin(s, mac.addr); + if (len != 6) + cf_error("Invalid MAC address"); + + cf_lval.mac = mac; + return MAC_; +} + +({XIGIT}{2}){10,}|{XIGIT}{2}(:{XIGIT}{2}){9,}|hex:({XIGIT}{2}*|{XIGIT}{2}(:{XIGIT}{2})*) { char *s = yytext; struct adata *bs; diff --git a/conf/confbase.Y b/conf/confbase.Y index 27c422ea..9e566ce7 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -16,6 +16,7 @@ CF_HDR #include "lib/socket.h" #include "lib/timer.h" #include "lib/string.h" +#include "lib/evpn.h" #include "nest/protocol.h" #include "nest/iface.h" #include "nest/route.h" @@ -86,7 +87,9 @@ CF_DECLS ip_addr a; ip4_addr ip4; ip6_addr ip6; + mac_addr mac; net_addr net; + evpn_esi esi; net_addr *net_ptr; struct symbol *s; struct keyword *kw; @@ -135,6 +138,7 @@ CF_DECLS %token NUM ENUM_TOKEN %token IP4 %token IP6 +%token MAC_ %token VPN_RD %token CF_SYM_KNOWN CF_SYM_UNDEFINED CF_SYM_METHOD_BARE CF_SYM_METHOD_ARGS %token TEXT @@ -146,8 +150,10 @@ CF_DECLS %type