]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
advanced.json is now parsed properly again
authorTomek Mrugalski <tomasz@isc.org>
Sun, 13 Nov 2016 01:46:53 +0000 (10:46 +0900)
committerTomek Mrugalski <tomasz@isc.org>
Sun, 13 Nov 2016 01:46:53 +0000 (10:46 +0900)
src/bin/dhcp6/Makefile.am
src/bin/dhcp6/dhcp6_parser.yy

index a7fc4848435b15177b7edaa32283ccaef81eca97..7b5bc22c0bf66f5a54144b3cb2cf1c8b35419874 100644 (file)
@@ -122,7 +122,7 @@ parser: dhcp6_lexer.cc location.hh position.hh stack.hh dhcp6_parser.cc dhcp6_pa
 # This is especially useful if yydebug_ is set to 1 as that variable
 # will cause parser to print out its internal state.
 location.hh position.hh stack.hh dhcp6_parser.cc dhcp6_parser.h: dhcp6_parser.yy
-       $(YACC) --defines=dhcp6_parser.h -o dhcp6_parser.cc dhcp6_parser.yy
+       $(YACC) --defines=dhcp6_parser.h --report=all --report-file=dhcp6_parser.report -o dhcp6_parser.cc dhcp6_parser.yy
 
 dhcp6_lexer.cc: dhcp6_lexer.ll
        $(LEX) --prefix parser6_ -o dhcp6_lexer.cc dhcp6_lexer.ll
index 81cf5b7f1fcdfd5eef9fbb606c84281013bc0a89..e6a31a5113c78312b8bdeba0512f36ae29fe5996 100644 (file)
@@ -284,10 +284,19 @@ mac_sources: MAC_SOURCES {
     ElementPtr l(new ListElement());
     ctx.stack_.back()->set("mac-sources", l);
     ctx.stack_.push_back(l);
-} COLON list {
+} COLON LSQUARE_BRACKET mac_sources_list RSQUARE_BRACKET {
     ctx.stack_.pop_back();
 };
 
+mac_sources_list: mac_sources_value
+| mac_sources_list COMMA mac_sources_value;
+
+mac_sources_value: DUID {
+    ElementPtr duid(new StringElement("duid")); ctx.stack_.back()->add(duid);
+}| STRING {
+    ElementPtr duid(new StringElement($1)); ctx.stack_.back()->add(duid);
+};
+
 host_reservation_identifiers: HOST_RESERVATION_IDENTIFIERS COLON LSQUARE_BRACKET {
     ElementPtr l(new ListElement());
     ctx.stack_.back()->set("host-reservation-identifiers", l);
@@ -401,8 +410,7 @@ option_data_entry: LCURLY_BRACKET {
 
 // This defines parameters specified inside the map that itself
 // is an entry in option-data list.
-option_data_params: {}
-| option_data_param
+option_data_params: option_data_param
 | option_data_params COMMA option_data_param;
 
 option_data_param:
@@ -550,7 +558,7 @@ ip_addresses: IP_ADDRESSES COLON {
     ElementPtr l(new ListElement());
     ctx.stack_.back()->set("ip-addresses", l);
     ctx.stack_.push_back(l);
-} list { 
+} list {
     ctx.stack_.pop_back();
 };
 
@@ -558,7 +566,7 @@ prefixes: PREFIXES COLON  {
     ElementPtr l(new ListElement());
     ctx.stack_.back()->set("prefixes", l);
     ctx.stack_.push_back(l);
-} list { 
+} list {
     ctx.stack_.pop_back();
 };