From: Tomek Mrugalski Date: Tue, 27 Dec 2016 18:25:31 +0000 (+0100) Subject: [master] Merge branch 'trac5039' (SimpleParser) X-Git-Tag: trac5021_base~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3cd100455bcc20698cfb314ffe41fb755d04aee1;p=thirdparty%2Fkea.git [master] Merge branch 'trac5039' (SimpleParser) # Conflicts: # src/bin/dhcp4/Makefile.am # src/bin/dhcp4/json_config_parser.cc # src/bin/dhcp6/Makefile.am # src/bin/dhcp6/dhcp6.dox # src/bin/dhcp6/json_config_parser.cc # src/bin/dhcp6/tests/Makefile.am --- 3cd100455bcc20698cfb314ffe41fb755d04aee1 diff --cc src/bin/dhcp4/Makefile.am index 4e3e11e093,d395f458a4..2eb33e27e6 --- a/src/bin/dhcp4/Makefile.am +++ b/src/bin/dhcp4/Makefile.am @@@ -62,12 -62,8 +62,11 @@@ libdhcp4_la_SOURCES += json_config_pars libdhcp4_la_SOURCES += dhcp4_log.cc dhcp4_log.h libdhcp4_la_SOURCES += dhcp4_srv.cc dhcp4_srv.h libdhcp4_la_SOURCES += dhcp4to6_ipc.cc dhcp4to6_ipc.h - +libdhcp4_la_SOURCES += dhcp4_lexer.ll location.hh position.hh stack.hh +libdhcp4_la_SOURCES += dhcp4_parser.cc dhcp4_parser.h +libdhcp4_la_SOURCES += parser_context.cc parser_context.h parser_context_decl.h - libdhcp4_la_SOURCES += kea_controller.cc + libdhcp4_la_SOURCES += simple_parser4.cc simple_parser4.h nodist_libdhcp4_la_SOURCES = dhcp4_messages.h dhcp4_messages.cc EXTRA_DIST += dhcp4_messages.mes diff --cc src/bin/dhcp4/json_config_parser.cc index b27ee09f3c,37c1262d88..bcfad010e8 --- a/src/bin/dhcp4/json_config_parser.cc +++ b/src/bin/dhcp4/json_config_parser.cc @@@ -424,11 -424,9 +424,8 @@@ DhcpConfigParser* createGlobalDhcp4Conf parser = new IfacesConfigParser4(); } else if (config_id.compare("subnet4") == 0) { parser = new Subnets4ListConfigParser(config_id); - } else if (config_id.compare("option-data") == 0) { - parser = new OptionDataListParser(config_id, CfgOptionPtr(), AF_INET); - } else if (config_id.compare("option-def") == 0) { - parser = new OptionDefListParser(config_id, globalContext()); + // option-data and option-def have been converted to SimpleParser already. - } else if ((config_id.compare("version") == 0) || - (config_id.compare("next-server") == 0)) { + } else if ((config_id.compare("next-server") == 0)) { parser = new StringParser(config_id, globalContext()->string_values_); } else if (config_id.compare("lease-database") == 0) { diff --cc src/bin/dhcp6/Makefile.am index d3277bd22e,b1f6899e32..514b0a269b --- a/src/bin/dhcp6/Makefile.am +++ b/src/bin/dhcp6/Makefile.am @@@ -63,12 -63,8 +63,11 @@@ libdhcp6_la_SOURCES += dhcp6_srv.cc dhc libdhcp6_la_SOURCES += ctrl_dhcp6_srv.cc ctrl_dhcp6_srv.h libdhcp6_la_SOURCES += json_config_parser.cc json_config_parser.h libdhcp6_la_SOURCES += dhcp6to4_ipc.cc dhcp6to4_ipc.h - +libdhcp6_la_SOURCES += dhcp6_lexer.ll location.hh position.hh stack.hh +libdhcp6_la_SOURCES += dhcp6_parser.cc dhcp6_parser.h +libdhcp6_la_SOURCES += parser_context.cc parser_context.h parser_context_decl.h - libdhcp6_la_SOURCES += kea_controller.cc + libdhcp6_la_SOURCES += simple_parser6.cc simple_parser6.h nodist_libdhcp6_la_SOURCES = dhcp6_messages.h dhcp6_messages.cc EXTRA_DIST += dhcp6_messages.mes diff --cc src/bin/dhcp6/dhcp6.dox index fc13d5befb,da23fefcbc..f86e342a96 --- a/src/bin/dhcp6/dhcp6.dox +++ b/src/bin/dhcp6/dhcp6.dox @@@ -24,17 -24,8 +24,19 @@@ component implementation @section dhcpv6ConfigParser Configuration Parsers in DHCPv6 +Three minutes overview. If you are here only to learn absolute minimum about +the new parser, here's how you use it: + +@code + // The following code: + json = isc::data::Element::fromJSONFile(file_name, true); + + // can be replaced with this: + Parser6Context parser; + json = parser.parseFile(file_name, Parser6Context::PARSER_DHCP6); - @endcode ++ + Note: parsers are currently being migrated to @ref isc::data::SimpleParser. See + @ref ccSimpleParser page for details. The common configuration parsers for the DHCP servers are located in the src/lib/dhcpsrv/parsers/ directory. Parsers specific to the DHCPv6 component diff --cc src/bin/dhcp6/tests/Makefile.am index 9192f3dbca,a2dd2358bb..2d844b78e4 --- a/src/bin/dhcp6/tests/Makefile.am +++ b/src/bin/dhcp6/tests/Makefile.am @@@ -94,7 -93,7 +94,8 @@@ dhcp6_unittests_SOURCES += dhcp6_messag dhcp6_unittests_SOURCES += kea_controller_unittest.cc dhcp6_unittests_SOURCES += dhcp6to4_ipc_unittest.cc dhcp6_unittests_SOURCES += classify_unittests.cc +dhcp6_unittests_SOURCES += parser_unittest.cc + dhcp6_unittests_SOURCES += simple_parser6_unittest.cc nodist_dhcp6_unittests_SOURCES = marker_file.h test_libraries.h diff --cc src/lib/dhcpsrv/Makefile.am index 6c8f48bb0f,fbd269bec6..28aded2cda --- a/src/lib/dhcpsrv/Makefile.am +++ b/src/lib/dhcpsrv/Makefile.am @@@ -20,8 -20,9 +20,6 @@@ if HAVE_CQ AM_CPPFLAGS += $(CQL_CPPFLAGS) endif - AM_CXXFLAGS = $(KEA_CXXFLAGS) -# This is a temporary workaround until we have Kea-wide support for C++11. -AM_CXXFLAGS = $(KEA_CXXFLAGS) -std=c++11 -- # The files in the subfolder must be explicitly specified here so # as they are copied to the distribution. The other option would # be to specify a whole 'parsers' folder here but that would also