From: Andrei Pavel Date: Mon, 31 Oct 2022 16:27:42 +0000 (+0200) Subject: [#2601] clean up header includes and makefiles in NETCONF code X-Git-Tag: Kea-2.3.3~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a34abb3d1b5e15bdf72f7e79b9c25ffc754ccb6b;p=thirdparty%2Fkea.git [#2601] clean up header includes and makefiles in NETCONF code --- diff --git a/src/bin/netconf/control_socket.h b/src/bin/netconf/control_socket.h index 180a4247cb..50192a3523 100644 --- a/src/bin/netconf/control_socket.h +++ b/src/bin/netconf/control_socket.h @@ -10,8 +10,8 @@ #ifndef CONTROL_SOCKET_H #define CONTROL_SOCKET_H -#include #include +#include namespace isc { namespace netconf { diff --git a/src/bin/netconf/http_control_socket.cc b/src/bin/netconf/http_control_socket.cc index 192ad08f3c..cf90ebfc32 100644 --- a/src/bin/netconf/http_control_socket.cc +++ b/src/bin/netconf/http_control_socket.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -9,15 +9,15 @@ #include -#include -#include #include #include #include +#include +#include #include #include #include -#include +#include using namespace std; using namespace isc::asiolink; diff --git a/src/bin/netconf/http_control_socket.h b/src/bin/netconf/http_control_socket.h index 42bcb30855..86f62cda61 100644 --- a/src/bin/netconf/http_control_socket.h +++ b/src/bin/netconf/http_control_socket.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/location.hh b/src/bin/netconf/location.hh index 40ace584a9..842a1114e8 100644 --- a/src/bin/netconf/location.hh +++ b/src/bin/netconf/location.hh @@ -300,7 +300,7 @@ namespace isc { namespace netconf { } #line 14 "netconf_parser.yy" -} } // isc::netconf +} } // isc::netconf #line 305 "location.hh" #endif // !YY_NETCONF_LOCATION_HH_INCLUDED diff --git a/src/bin/netconf/main.cc b/src/bin/netconf/main.cc index 3481b5b171..24baae91fe 100644 --- a/src/bin/netconf/main.cc +++ b/src/bin/netconf/main.cc @@ -5,8 +5,10 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include -#include + #include +#include + #include #include diff --git a/src/bin/netconf/netconf.cc b/src/bin/netconf/netconf.cc index fc768413e6..7c9ec92e80 100644 --- a/src/bin/netconf/netconf.cc +++ b/src/bin/netconf/netconf.cc @@ -9,16 +9,15 @@ #include +#include #include #include #include -#include #include #include -#include - #include +#include using namespace std; using namespace isc::config; diff --git a/src/bin/netconf/netconf.h b/src/bin/netconf/netconf.h index cdf0373290..54ee61adb6 100644 --- a/src/bin/netconf/netconf.h +++ b/src/bin/netconf/netconf.h @@ -9,9 +9,9 @@ #ifndef NETCONF_H #define NETCONF_H -#include #include #include +#include #include #include diff --git a/src/bin/netconf/netconf_cfg_mgr.cc b/src/bin/netconf/netconf_cfg_mgr.cc index 0945e755f1..f9f9512f5b 100644 --- a/src/bin/netconf/netconf_cfg_mgr.cc +++ b/src/bin/netconf/netconf_cfg_mgr.cc @@ -1,16 +1,20 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include + +#include +#include +#include #include #include #include -#include -#include -#include + +#include +#include using namespace isc::config; using namespace isc::dhcp; diff --git a/src/bin/netconf/netconf_cfg_mgr.h b/src/bin/netconf/netconf_cfg_mgr.h index b9a8279665..a8d37f53fe 100644 --- a/src/bin/netconf/netconf_cfg_mgr.h +++ b/src/bin/netconf/netconf_cfg_mgr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -9,10 +9,9 @@ #include #include -#include #include -#include -#include +#include + #include namespace isc { diff --git a/src/bin/netconf/netconf_config.cc b/src/bin/netconf/netconf_config.cc index b3e94257cc..b3ed215051 100644 --- a/src/bin/netconf/netconf_config.cc +++ b/src/bin/netconf/netconf_config.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,13 +6,10 @@ #include -#include +#include #include +#include #include -#include - -#include -#include #include #include diff --git a/src/bin/netconf/netconf_config.h b/src/bin/netconf/netconf_config.h index 1b9d82cd37..3f7a40d01a 100644 --- a/src/bin/netconf/netconf_config.h +++ b/src/bin/netconf/netconf_config.h @@ -7,17 +7,17 @@ #ifndef NETCONF_CONFIG_H #define NETCONF_CONFIG_H -#include #include -#include +#include #include -#include +#include #include - -#include +#include #include + #include +#include namespace isc { namespace netconf { @@ -273,7 +273,7 @@ private: using CfgServerPtr = std::shared_ptr; /// @brief Defines a map of CfgServers, keyed by the name. -using CfgServersMap = std::map; +using CfgServersMap = std::unordered_map; /// @brief Defines a iterator pairing of name and CfgServer using CfgServersMapPair = std::pair; diff --git a/src/bin/netconf/netconf_controller.cc b/src/bin/netconf/netconf_controller.cc index 2d8c438d1b..4fcc771509 100644 --- a/src/bin/netconf/netconf_controller.cc +++ b/src/bin/netconf/netconf_controller.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/netconf_controller.h b/src/bin/netconf/netconf_controller.h index 73f1aff740..97207fe858 100644 --- a/src/bin/netconf/netconf_controller.h +++ b/src/bin/netconf/netconf_controller.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/netconf_log.cc b/src/bin/netconf/netconf_log.cc index 96b192c262..97079ea2e4 100644 --- a/src/bin/netconf/netconf_log.cc +++ b/src/bin/netconf/netconf_log.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/netconf_log.h b/src/bin/netconf/netconf_log.h index ded7b40dc2..6d36e3f466 100644 --- a/src/bin/netconf/netconf_log.h +++ b/src/bin/netconf/netconf_log.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/netconf_parser.cc b/src/bin/netconf/netconf_parser.cc index 83792aa700..3587cbcdf8 100644 --- a/src/bin/netconf/netconf_parser.cc +++ b/src/bin/netconf/netconf_parser.cc @@ -44,7 +44,7 @@ // Unqualified %code blocks. -#line 33 "netconf_parser.yy" +#line 36 "netconf_parser.yy" #include @@ -378,43 +378,43 @@ namespace isc { namespace netconf { switch (yykind) { case symbol_kind::S_STRING: // "constant string" -#line 107 "netconf_parser.yy" +#line 110 "netconf_parser.yy" { yyoutput << yysym.value.template as < std::string > (); } #line 384 "netconf_parser.cc" break; case symbol_kind::S_INTEGER: // "integer" -#line 107 "netconf_parser.yy" +#line 110 "netconf_parser.yy" { yyoutput << yysym.value.template as < int64_t > (); } #line 390 "netconf_parser.cc" break; case symbol_kind::S_FLOAT: // "floating point" -#line 107 "netconf_parser.yy" +#line 110 "netconf_parser.yy" { yyoutput << yysym.value.template as < double > (); } #line 396 "netconf_parser.cc" break; case symbol_kind::S_BOOLEAN: // "boolean" -#line 107 "netconf_parser.yy" +#line 110 "netconf_parser.yy" { yyoutput << yysym.value.template as < bool > (); } #line 402 "netconf_parser.cc" break; case symbol_kind::S_value: // value -#line 107 "netconf_parser.yy" +#line 110 "netconf_parser.yy" { yyoutput << yysym.value.template as < ElementPtr > (); } #line 408 "netconf_parser.cc" break; case symbol_kind::S_map_value: // map_value -#line 107 "netconf_parser.yy" +#line 110 "netconf_parser.yy" { yyoutput << yysym.value.template as < ElementPtr > (); } #line 414 "netconf_parser.cc" break; case symbol_kind::S_socket_type_value: // socket_type_value -#line 107 "netconf_parser.yy" +#line 110 "netconf_parser.yy" { yyoutput << yysym.value.template as < ElementPtr > (); } #line 420 "netconf_parser.cc" break; @@ -689,25 +689,25 @@ namespace isc { namespace netconf { switch (yyn) { case 2: // $@1: %empty -#line 118 "netconf_parser.yy" +#line 121 "netconf_parser.yy" { ctx.ctx_ = ctx.NO_KEYWORDS; } #line 695 "netconf_parser.cc" break; case 4: // $@2: %empty -#line 119 "netconf_parser.yy" +#line 122 "netconf_parser.yy" { ctx.ctx_ = ctx.CONFIG; } #line 701 "netconf_parser.cc" break; case 6: // $@3: %empty -#line 120 "netconf_parser.yy" +#line 123 "netconf_parser.yy" { ctx.ctx_ = ctx.NETCONF; } #line 707 "netconf_parser.cc" break; case 8: // $@4: %empty -#line 128 "netconf_parser.yy" +#line 131 "netconf_parser.yy" { // Parse the Netconf map ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); @@ -717,7 +717,7 @@ namespace isc { namespace netconf { break; case 9: // sub_netconf: "{" $@4 global_params "}" -#line 132 "netconf_parser.yy" +#line 135 "netconf_parser.yy" { // parsing completed } @@ -725,7 +725,7 @@ namespace isc { namespace netconf { break; case 10: // json: value -#line 139 "netconf_parser.yy" +#line 142 "netconf_parser.yy" { // Push back the JSON value on the stack ctx.stack_.push_back(yystack_[0].value.as < ElementPtr > ()); @@ -734,49 +734,49 @@ namespace isc { namespace netconf { break; case 11: // value: "integer" -#line 145 "netconf_parser.yy" +#line 148 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ElementPtr(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location))); } #line 740 "netconf_parser.cc" break; case 12: // value: "floating point" -#line 146 "netconf_parser.yy" +#line 149 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ElementPtr(new DoubleElement(yystack_[0].value.as < double > (), ctx.loc2pos(yystack_[0].location))); } #line 746 "netconf_parser.cc" break; case 13: // value: "boolean" -#line 147 "netconf_parser.yy" +#line 150 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ElementPtr(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location))); } #line 752 "netconf_parser.cc" break; case 14: // value: "constant string" -#line 148 "netconf_parser.yy" +#line 151 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); } #line 758 "netconf_parser.cc" break; case 15: // value: "null" -#line 149 "netconf_parser.yy" +#line 152 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ElementPtr(new NullElement(ctx.loc2pos(yystack_[0].location))); } #line 764 "netconf_parser.cc" break; case 16: // value: map -#line 150 "netconf_parser.yy" +#line 153 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } #line 770 "netconf_parser.cc" break; case 17: // value: list_generic -#line 151 "netconf_parser.yy" +#line 154 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } #line 776 "netconf_parser.cc" break; case 18: // $@5: %empty -#line 155 "netconf_parser.yy" +#line 158 "netconf_parser.yy" { // This code is executed when we're about to start parsing // the content of the map @@ -787,7 +787,7 @@ namespace isc { namespace netconf { break; case 19: // map: "{" $@5 map_content "}" -#line 160 "netconf_parser.yy" +#line 163 "netconf_parser.yy" { // map parsing completed. If we ever want to do any wrap up // (maybe some sanity checking), this would be the best place @@ -797,13 +797,13 @@ namespace isc { namespace netconf { break; case 20: // map_value: map -#line 166 "netconf_parser.yy" +#line 169 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ctx.stack_.back(); ctx.stack_.pop_back(); } #line 803 "netconf_parser.cc" break; case 23: // not_empty_map: "constant string" ":" value -#line 180 "netconf_parser.yy" +#line 183 "netconf_parser.yy" { // map containing a single entry ctx.unique(yystack_[2].value.as < std::string > (), ctx.loc2pos(yystack_[2].location)); @@ -813,7 +813,7 @@ namespace isc { namespace netconf { break; case 24: // not_empty_map: not_empty_map "," "constant string" ":" value -#line 185 "netconf_parser.yy" +#line 188 "netconf_parser.yy" { // map consisting of a shorter map followed by // comma and string:value @@ -824,7 +824,7 @@ namespace isc { namespace netconf { break; case 25: // not_empty_map: not_empty_map "," -#line 191 "netconf_parser.yy" +#line 194 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -832,7 +832,7 @@ namespace isc { namespace netconf { break; case 26: // $@6: %empty -#line 196 "netconf_parser.yy" +#line 199 "netconf_parser.yy" { ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.push_back(l); @@ -841,14 +841,14 @@ namespace isc { namespace netconf { break; case 27: // list_generic: "[" $@6 list_content "]" -#line 199 "netconf_parser.yy" +#line 202 "netconf_parser.yy" { } #line 848 "netconf_parser.cc" break; case 30: // not_empty_list: value -#line 206 "netconf_parser.yy" +#line 209 "netconf_parser.yy" { // List consisting of a single element. ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ()); @@ -857,7 +857,7 @@ namespace isc { namespace netconf { break; case 31: // not_empty_list: not_empty_list "," value -#line 210 "netconf_parser.yy" +#line 213 "netconf_parser.yy" { // List ending with , and a value. ctx.stack_.back()->add(yystack_[0].value.as < ElementPtr > ()); @@ -866,7 +866,7 @@ namespace isc { namespace netconf { break; case 32: // not_empty_list: not_empty_list "," -#line 214 "netconf_parser.yy" +#line 217 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -874,7 +874,7 @@ namespace isc { namespace netconf { break; case 33: // unknown_map_entry: "constant string" ":" -#line 226 "netconf_parser.yy" +#line 229 "netconf_parser.yy" { const std::string& where = ctx.contextName(); const std::string& keyword = yystack_[1].value.as < std::string > (); @@ -885,7 +885,7 @@ namespace isc { namespace netconf { break; case 34: // $@7: %empty -#line 234 "netconf_parser.yy" +#line 237 "netconf_parser.yy" { // This code is executed when we're about to start parsing // the content of the map @@ -896,7 +896,7 @@ namespace isc { namespace netconf { break; case 35: // netconf_syntax_map: "{" $@7 global_object "}" -#line 239 "netconf_parser.yy" +#line 242 "netconf_parser.yy" { // map parsing completed. If we ever want to do any wrap up // (maybe some sanity checking), this would be the best place @@ -906,7 +906,7 @@ namespace isc { namespace netconf { break; case 36: // $@8: %empty -#line 246 "netconf_parser.yy" +#line 249 "netconf_parser.yy" { // Let's create a MapElement that will represent it, add it to the // top level map (that's already on the stack) and put the new map @@ -924,7 +924,7 @@ namespace isc { namespace netconf { break; case 37: // global_object: "Netconf" $@8 ":" "{" global_params "}" -#line 258 "netconf_parser.yy" +#line 261 "netconf_parser.yy" { // Ok, we're done with parsing Netconf. Let's take the map // off the stack. @@ -935,7 +935,7 @@ namespace isc { namespace netconf { break; case 39: // global_object_comma: global_object "," -#line 267 "netconf_parser.yy" +#line 270 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -943,7 +943,7 @@ namespace isc { namespace netconf { break; case 44: // not_empty_global_params: not_empty_global_params "," -#line 278 "netconf_parser.yy" +#line 281 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -951,7 +951,7 @@ namespace isc { namespace netconf { break; case 54: // boot_update: "boot-update" ":" "boolean" -#line 296 "netconf_parser.yy" +#line 299 "netconf_parser.yy" { ctx.unique("boot-update", ctx.loc2pos(yystack_[2].location)); ElementPtr flag(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location))); @@ -961,7 +961,7 @@ namespace isc { namespace netconf { break; case 55: // subscribe_changes: "subscribe-changes" ":" "boolean" -#line 302 "netconf_parser.yy" +#line 305 "netconf_parser.yy" { ctx.unique("subscribe-changes", ctx.loc2pos(yystack_[2].location)); ElementPtr flag(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location))); @@ -971,7 +971,7 @@ namespace isc { namespace netconf { break; case 56: // validate_changes: "validate-changes" ":" "boolean" -#line 308 "netconf_parser.yy" +#line 311 "netconf_parser.yy" { ctx.unique("validate-changes", ctx.loc2pos(yystack_[2].location)); ElementPtr flag(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location))); @@ -981,7 +981,7 @@ namespace isc { namespace netconf { break; case 57: // $@9: %empty -#line 314 "netconf_parser.yy" +#line 317 "netconf_parser.yy" { ctx.enter(ctx.NO_KEYWORDS); } @@ -989,7 +989,7 @@ namespace isc { namespace netconf { break; case 58: // user_context: "user-context" $@9 ":" map_value -#line 316 "netconf_parser.yy" +#line 319 "netconf_parser.yy" { ElementPtr parent = ctx.stack_.back(); ElementPtr user_context = yystack_[0].value.as < ElementPtr > (); @@ -1016,7 +1016,7 @@ namespace isc { namespace netconf { break; case 59: // $@10: %empty -#line 339 "netconf_parser.yy" +#line 342 "netconf_parser.yy" { ctx.enter(ctx.NO_KEYWORDS); } @@ -1024,7 +1024,7 @@ namespace isc { namespace netconf { break; case 60: // comment: "comment" $@10 ":" "constant string" -#line 341 "netconf_parser.yy" +#line 344 "netconf_parser.yy" { ElementPtr parent = ctx.stack_.back(); ElementPtr user_context(new MapElement(ctx.loc2pos(yystack_[3].location))); @@ -1053,7 +1053,7 @@ namespace isc { namespace netconf { break; case 61: // $@11: %empty -#line 367 "netconf_parser.yy" +#line 370 "netconf_parser.yy" { ctx.unique("hooks-libraries", ctx.loc2pos(yystack_[0].location)); ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); @@ -1065,7 +1065,7 @@ namespace isc { namespace netconf { break; case 62: // hooks_libraries: "hooks-libraries" $@11 ":" "[" hooks_libraries_list "]" -#line 373 "netconf_parser.yy" +#line 376 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1074,7 +1074,7 @@ namespace isc { namespace netconf { break; case 67: // not_empty_hooks_libraries_list: not_empty_hooks_libraries_list "," -#line 384 "netconf_parser.yy" +#line 387 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1082,7 +1082,7 @@ namespace isc { namespace netconf { break; case 68: // $@12: %empty -#line 389 "netconf_parser.yy" +#line 392 "netconf_parser.yy" { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->add(m); @@ -1092,7 +1092,7 @@ namespace isc { namespace netconf { break; case 69: // hooks_library: "{" $@12 hooks_params "}" -#line 393 "netconf_parser.yy" +#line 396 "netconf_parser.yy" { ctx.stack_.pop_back(); } @@ -1100,7 +1100,7 @@ namespace isc { namespace netconf { break; case 72: // hooks_params: hooks_params "," -#line 399 "netconf_parser.yy" +#line 402 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1108,7 +1108,7 @@ namespace isc { namespace netconf { break; case 76: // $@13: %empty -#line 409 "netconf_parser.yy" +#line 412 "netconf_parser.yy" { ctx.unique("library", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1117,7 +1117,7 @@ namespace isc { namespace netconf { break; case 77: // library: "library" $@13 ":" "constant string" -#line 412 "netconf_parser.yy" +#line 415 "netconf_parser.yy" { ElementPtr lib(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("library", lib); @@ -1127,7 +1127,7 @@ namespace isc { namespace netconf { break; case 78: // $@14: %empty -#line 418 "netconf_parser.yy" +#line 421 "netconf_parser.yy" { ctx.unique("parameters", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1136,7 +1136,7 @@ namespace isc { namespace netconf { break; case 79: // parameters: "parameters" $@14 ":" map_value -#line 421 "netconf_parser.yy" +#line 424 "netconf_parser.yy" { ctx.stack_.back()->set("parameters", yystack_[0].value.as < ElementPtr > ()); ctx.leave(); @@ -1145,7 +1145,7 @@ namespace isc { namespace netconf { break; case 80: // $@15: %empty -#line 429 "netconf_parser.yy" +#line 432 "netconf_parser.yy" { ctx.unique("managed-servers", ctx.loc2pos(yystack_[2].location)); ElementPtr m(new MapElement(ctx.loc2pos(yystack_[2].location))); @@ -1157,7 +1157,7 @@ namespace isc { namespace netconf { break; case 81: // managed_servers: "managed-servers" ":" "{" $@15 servers_entries "}" -#line 435 "netconf_parser.yy" +#line 438 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1166,7 +1166,7 @@ namespace isc { namespace netconf { break; case 86: // not_empty_servers_entries: not_empty_servers_entries "," -#line 446 "netconf_parser.yy" +#line 449 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1174,7 +1174,7 @@ namespace isc { namespace netconf { break; case 92: // $@16: %empty -#line 462 "netconf_parser.yy" +#line 465 "netconf_parser.yy" { ctx.unique("dhcp4", ctx.loc2pos(yystack_[0].location)); ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); @@ -1186,7 +1186,7 @@ namespace isc { namespace netconf { break; case 93: // dhcp4_server: "dhcp4" $@16 ":" "{" managed_server_params "}" -#line 468 "netconf_parser.yy" +#line 471 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1195,7 +1195,7 @@ namespace isc { namespace netconf { break; case 94: // $@17: %empty -#line 474 "netconf_parser.yy" +#line 477 "netconf_parser.yy" { ctx.unique("dhcp6", ctx.loc2pos(yystack_[0].location)); ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); @@ -1207,7 +1207,7 @@ namespace isc { namespace netconf { break; case 95: // dhcp6_server: "dhcp6" $@17 ":" "{" managed_server_params "}" -#line 480 "netconf_parser.yy" +#line 483 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1216,7 +1216,7 @@ namespace isc { namespace netconf { break; case 96: // $@18: %empty -#line 486 "netconf_parser.yy" +#line 489 "netconf_parser.yy" { ctx.unique("d2", ctx.loc2pos(yystack_[0].location)); ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); @@ -1228,7 +1228,7 @@ namespace isc { namespace netconf { break; case 97: // d2_server: "d2" $@18 ":" "{" managed_server_params "}" -#line 492 "netconf_parser.yy" +#line 495 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1237,7 +1237,7 @@ namespace isc { namespace netconf { break; case 98: // $@19: %empty -#line 498 "netconf_parser.yy" +#line 501 "netconf_parser.yy" { ctx.unique("ca", ctx.loc2pos(yystack_[0].location)); ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); @@ -1249,7 +1249,7 @@ namespace isc { namespace netconf { break; case 99: // ca_server: "ca" $@19 ":" "{" managed_server_params "}" -#line 504 "netconf_parser.yy" +#line 507 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1258,7 +1258,7 @@ namespace isc { namespace netconf { break; case 102: // managed_server_params: managed_server_params "," -#line 512 "netconf_parser.yy" +#line 515 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1266,7 +1266,7 @@ namespace isc { namespace netconf { break; case 111: // $@20: %empty -#line 529 "netconf_parser.yy" +#line 532 "netconf_parser.yy" { ctx.unique("model", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1275,7 +1275,7 @@ namespace isc { namespace netconf { break; case 112: // model: "model" $@20 ":" "constant string" -#line 532 "netconf_parser.yy" +#line 535 "netconf_parser.yy" { ElementPtr model(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("model", model); @@ -1285,7 +1285,7 @@ namespace isc { namespace netconf { break; case 113: // $@21: %empty -#line 539 "netconf_parser.yy" +#line 542 "netconf_parser.yy" { ctx.unique("control-socket", ctx.loc2pos(yystack_[0].location)); ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); @@ -1297,7 +1297,7 @@ namespace isc { namespace netconf { break; case 114: // control_socket: "control-socket" $@21 ":" "{" control_socket_params "}" -#line 545 "netconf_parser.yy" +#line 548 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1306,7 +1306,7 @@ namespace isc { namespace netconf { break; case 117: // control_socket_params: control_socket_params "," -#line 553 "netconf_parser.yy" +#line 556 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1314,7 +1314,7 @@ namespace isc { namespace netconf { break; case 124: // $@22: %empty -#line 566 "netconf_parser.yy" +#line 569 "netconf_parser.yy" { ctx.unique("socket-type", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.SOCKET_TYPE); @@ -1323,7 +1323,7 @@ namespace isc { namespace netconf { break; case 125: // socket_type: "socket-type" $@22 ":" socket_type_value -#line 569 "netconf_parser.yy" +#line 572 "netconf_parser.yy" { ctx.stack_.back()->set("socket-type", yystack_[0].value.as < ElementPtr > ()); ctx.leave(); @@ -1332,25 +1332,25 @@ namespace isc { namespace netconf { break; case 126: // socket_type_value: "unix" -#line 575 "netconf_parser.yy" +#line 578 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("unix", ctx.loc2pos(yystack_[0].location))); } #line 1338 "netconf_parser.cc" break; case 127: // socket_type_value: "http" -#line 576 "netconf_parser.yy" +#line 579 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("http", ctx.loc2pos(yystack_[0].location))); } #line 1344 "netconf_parser.cc" break; case 128: // socket_type_value: "stdout" -#line 577 "netconf_parser.yy" +#line 580 "netconf_parser.yy" { yylhs.value.as < ElementPtr > () = ElementPtr(new StringElement("stdout", ctx.loc2pos(yystack_[0].location))); } #line 1350 "netconf_parser.cc" break; case 129: // $@23: %empty -#line 580 "netconf_parser.yy" +#line 583 "netconf_parser.yy" { ctx.unique("socket-name", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1359,7 +1359,7 @@ namespace isc { namespace netconf { break; case 130: // socket_name: "socket-name" $@23 ":" "constant string" -#line 583 "netconf_parser.yy" +#line 586 "netconf_parser.yy" { ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("socket-name", name); @@ -1369,7 +1369,7 @@ namespace isc { namespace netconf { break; case 131: // $@24: %empty -#line 590 "netconf_parser.yy" +#line 593 "netconf_parser.yy" { ctx.unique("socket-url", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1378,7 +1378,7 @@ namespace isc { namespace netconf { break; case 132: // socket_url: "socket-url" $@24 ":" "constant string" -#line 593 "netconf_parser.yy" +#line 596 "netconf_parser.yy" { ElementPtr url(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("socket-url", url); @@ -1388,7 +1388,7 @@ namespace isc { namespace netconf { break; case 133: // $@25: %empty -#line 603 "netconf_parser.yy" +#line 606 "netconf_parser.yy" { ctx.unique("loggers", ctx.loc2pos(yystack_[0].location)); ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); @@ -1400,7 +1400,7 @@ namespace isc { namespace netconf { break; case 134: // loggers: "loggers" $@25 ":" "[" loggers_entries "]" -#line 609 "netconf_parser.yy" +#line 612 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1409,7 +1409,7 @@ namespace isc { namespace netconf { break; case 137: // loggers_entries: loggers_entries "," -#line 618 "netconf_parser.yy" +#line 621 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1417,7 +1417,7 @@ namespace isc { namespace netconf { break; case 138: // $@26: %empty -#line 624 "netconf_parser.yy" +#line 627 "netconf_parser.yy" { ElementPtr l(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->add(l); @@ -1427,7 +1427,7 @@ namespace isc { namespace netconf { break; case 139: // logger_entry: "{" $@26 logger_params "}" -#line 628 "netconf_parser.yy" +#line 631 "netconf_parser.yy" { ctx.stack_.pop_back(); } @@ -1435,7 +1435,7 @@ namespace isc { namespace netconf { break; case 142: // logger_params: logger_params "," -#line 634 "netconf_parser.yy" +#line 637 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1443,7 +1443,7 @@ namespace isc { namespace netconf { break; case 150: // $@27: %empty -#line 648 "netconf_parser.yy" +#line 651 "netconf_parser.yy" { ctx.unique("name", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1452,7 +1452,7 @@ namespace isc { namespace netconf { break; case 151: // name: "name" $@27 ":" "constant string" -#line 651 "netconf_parser.yy" +#line 654 "netconf_parser.yy" { ElementPtr name(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("name", name); @@ -1462,7 +1462,7 @@ namespace isc { namespace netconf { break; case 152: // debuglevel: "debuglevel" ":" "integer" -#line 657 "netconf_parser.yy" +#line 660 "netconf_parser.yy" { ctx.unique("debuglevel", ctx.loc2pos(yystack_[2].location)); ElementPtr dl(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location))); @@ -1472,7 +1472,7 @@ namespace isc { namespace netconf { break; case 153: // $@28: %empty -#line 663 "netconf_parser.yy" +#line 666 "netconf_parser.yy" { ctx.unique("severity", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1481,7 +1481,7 @@ namespace isc { namespace netconf { break; case 154: // severity: "severity" $@28 ":" "constant string" -#line 666 "netconf_parser.yy" +#line 669 "netconf_parser.yy" { ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("severity", sev); @@ -1491,7 +1491,7 @@ namespace isc { namespace netconf { break; case 155: // $@29: %empty -#line 672 "netconf_parser.yy" +#line 675 "netconf_parser.yy" { ctx.unique("output_options", ctx.loc2pos(yystack_[0].location)); ElementPtr l(new ListElement(ctx.loc2pos(yystack_[0].location))); @@ -1503,7 +1503,7 @@ namespace isc { namespace netconf { break; case 156: // output_options_list: "output_options" $@29 ":" "[" output_options_list_content "]" -#line 678 "netconf_parser.yy" +#line 681 "netconf_parser.yy" { ctx.stack_.pop_back(); ctx.leave(); @@ -1512,7 +1512,7 @@ namespace isc { namespace netconf { break; case 159: // output_options_list_content: output_options_list_content "," -#line 685 "netconf_parser.yy" +#line 688 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1520,7 +1520,7 @@ namespace isc { namespace netconf { break; case 160: // $@30: %empty -#line 690 "netconf_parser.yy" +#line 693 "netconf_parser.yy" { ElementPtr m(new MapElement(ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->add(m); @@ -1530,7 +1530,7 @@ namespace isc { namespace netconf { break; case 161: // output_entry: "{" $@30 output_params_list "}" -#line 694 "netconf_parser.yy" +#line 697 "netconf_parser.yy" { ctx.stack_.pop_back(); } @@ -1538,7 +1538,7 @@ namespace isc { namespace netconf { break; case 164: // output_params_list: output_params_list "," -#line 700 "netconf_parser.yy" +#line 703 "netconf_parser.yy" { ctx.warnAboutExtraCommas(yystack_[0].location); } @@ -1546,7 +1546,7 @@ namespace isc { namespace netconf { break; case 170: // $@31: %empty -#line 712 "netconf_parser.yy" +#line 715 "netconf_parser.yy" { ctx.unique("output", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1555,7 +1555,7 @@ namespace isc { namespace netconf { break; case 171: // output: "output" $@31 ":" "constant string" -#line 715 "netconf_parser.yy" +#line 718 "netconf_parser.yy" { ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("output", sev); @@ -1565,7 +1565,7 @@ namespace isc { namespace netconf { break; case 172: // flush: "flush" ":" "boolean" -#line 721 "netconf_parser.yy" +#line 724 "netconf_parser.yy" { ctx.unique("flush", ctx.loc2pos(yystack_[2].location)); ElementPtr flush(new BoolElement(yystack_[0].value.as < bool > (), ctx.loc2pos(yystack_[0].location))); @@ -1575,7 +1575,7 @@ namespace isc { namespace netconf { break; case 173: // maxsize: "maxsize" ":" "integer" -#line 727 "netconf_parser.yy" +#line 730 "netconf_parser.yy" { ctx.unique("maxsize", ctx.loc2pos(yystack_[2].location)); ElementPtr maxsize(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location))); @@ -1585,7 +1585,7 @@ namespace isc { namespace netconf { break; case 174: // maxver: "maxver" ":" "integer" -#line 733 "netconf_parser.yy" +#line 736 "netconf_parser.yy" { ctx.unique("maxver", ctx.loc2pos(yystack_[2].location)); ElementPtr maxver(new IntElement(yystack_[0].value.as < int64_t > (), ctx.loc2pos(yystack_[0].location))); @@ -1595,7 +1595,7 @@ namespace isc { namespace netconf { break; case 175: // $@32: %empty -#line 739 "netconf_parser.yy" +#line 742 "netconf_parser.yy" { ctx.unique("pattern", ctx.loc2pos(yystack_[0].location)); ctx.enter(ctx.NO_KEYWORDS); @@ -1604,7 +1604,7 @@ namespace isc { namespace netconf { break; case 176: // pattern: "pattern" $@32 ":" "constant string" -#line 742 "netconf_parser.yy" +#line 745 "netconf_parser.yy" { ElementPtr sev(new StringElement(yystack_[0].value.as < std::string > (), ctx.loc2pos(yystack_[0].location))); ctx.stack_.back()->set("pattern", sev); @@ -2249,24 +2249,24 @@ namespace isc { namespace netconf { const short NetconfParser::yyrline_[] = { - 0, 118, 118, 118, 119, 119, 120, 120, 128, 128, - 139, 145, 146, 147, 148, 149, 150, 151, 155, 155, - 166, 171, 172, 180, 185, 191, 196, 196, 202, 203, - 206, 210, 214, 226, 234, 234, 246, 246, 264, 267, - 272, 273, 276, 277, 278, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 296, 302, 308, 314, 314, 339, - 339, 367, 367, 378, 379, 382, 383, 384, 389, 389, - 397, 398, 399, 402, 405, 406, 409, 409, 418, 418, - 429, 429, 440, 441, 444, 445, 446, 454, 455, 456, - 457, 458, 462, 462, 474, 474, 486, 486, 498, 498, - 510, 511, 512, 518, 519, 520, 521, 522, 523, 524, - 525, 529, 529, 539, 539, 551, 552, 553, 558, 559, - 560, 561, 562, 563, 566, 566, 575, 576, 577, 580, - 580, 590, 590, 603, 603, 616, 617, 618, 624, 624, - 632, 633, 634, 639, 640, 641, 642, 643, 644, 645, - 648, 648, 657, 663, 663, 672, 672, 683, 684, 685, - 690, 690, 698, 699, 700, 705, 706, 707, 708, 709, - 712, 712, 721, 727, 733, 739, 739 + 0, 121, 121, 121, 122, 122, 123, 123, 131, 131, + 142, 148, 149, 150, 151, 152, 153, 154, 158, 158, + 169, 174, 175, 183, 188, 194, 199, 199, 205, 206, + 209, 213, 217, 229, 237, 237, 249, 249, 267, 270, + 275, 276, 279, 280, 281, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 299, 305, 311, 317, 317, 342, + 342, 370, 370, 381, 382, 385, 386, 387, 392, 392, + 400, 401, 402, 405, 408, 409, 412, 412, 421, 421, + 432, 432, 443, 444, 447, 448, 449, 457, 458, 459, + 460, 461, 465, 465, 477, 477, 489, 489, 501, 501, + 513, 514, 515, 521, 522, 523, 524, 525, 526, 527, + 528, 532, 532, 542, 542, 554, 555, 556, 561, 562, + 563, 564, 565, 566, 569, 569, 578, 579, 580, 583, + 583, 593, 593, 606, 606, 619, 620, 621, 627, 627, + 635, 636, 637, 642, 643, 644, 645, 646, 647, 648, + 651, 651, 660, 666, 666, 675, 675, 686, 687, 688, + 693, 693, 701, 702, 703, 708, 709, 710, 711, 712, + 715, 715, 724, 730, 736, 742, 742 }; void @@ -2298,10 +2298,10 @@ namespace isc { namespace netconf { #line 14 "netconf_parser.yy" -} } // isc::netconf +} } // isc::netconf #line 2303 "netconf_parser.cc" -#line 748 "netconf_parser.yy" +#line 751 "netconf_parser.yy" void diff --git a/src/bin/netconf/netconf_parser.h b/src/bin/netconf/netconf_parser.h index 6f91bd6191..c465ecbaf0 100644 --- a/src/bin/netconf/netconf_parser.h +++ b/src/bin/netconf/netconf_parser.h @@ -47,16 +47,19 @@ // "%code requires" blocks. #line 17 "netconf_parser.yy" -#include #include -#include #include +#include + +#include +#include + using namespace isc::netconf; using namespace isc::data; using namespace std; -#line 60 "netconf_parser.h" +#line 63 "netconf_parser.h" # include # include // std::abort @@ -205,7 +208,7 @@ using namespace std; #line 14 "netconf_parser.yy" namespace isc { namespace netconf { -#line 209 "netconf_parser.h" +#line 212 "netconf_parser.h" @@ -2378,8 +2381,8 @@ switch (yykind) #line 14 "netconf_parser.yy" -} } // isc::netconf -#line 2383 "netconf_parser.h" +} } // isc::netconf +#line 2386 "netconf_parser.h" diff --git a/src/bin/netconf/netconf_parser.yy b/src/bin/netconf/netconf_parser.yy index 10048dea84..cc2d9684b8 100644 --- a/src/bin/netconf/netconf_parser.yy +++ b/src/bin/netconf/netconf_parser.yy @@ -15,11 +15,14 @@ %define parse.assert %code requires { -#include #include -#include #include +#include + +#include +#include + using namespace isc::netconf; using namespace isc::data; using namespace std; diff --git a/src/bin/netconf/netconf_process.cc b/src/bin/netconf/netconf_process.cc index 55fe070d3c..eafc036108 100644 --- a/src/bin/netconf/netconf_process.cc +++ b/src/bin/netconf/netconf_process.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -7,16 +7,14 @@ #include #include -#include -#include -#include -#include #include #include #include #include - -#include +#include +#include +#include +#include using namespace isc::asiolink; using namespace isc::config; diff --git a/src/bin/netconf/netconf_process.h b/src/bin/netconf/netconf_process.h index 2aa69fc783..ccc768ea91 100644 --- a/src/bin/netconf/netconf_process.h +++ b/src/bin/netconf/netconf_process.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/parser_context.cc b/src/bin/netconf/parser_context.cc index d84e1941e0..0fad211472 100644 --- a/src/bin/netconf/parser_context.cc +++ b/src/bin/netconf/parser_context.cc @@ -6,15 +6,15 @@ #include -#include -#include -#include -#include -//#include #include +#include +#include +#include +#include + #include -#include #include +#include namespace isc { namespace netconf { diff --git a/src/bin/netconf/parser_context.h b/src/bin/netconf/parser_context.h index 7438adb354..cb62152ab4 100644 --- a/src/bin/netconf/parser_context.h +++ b/src/bin/netconf/parser_context.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/parser_context_decl.h b/src/bin/netconf/parser_context_decl.h index 6697a362d0..43cb515c4a 100644 --- a/src/bin/netconf/parser_context_decl.h +++ b/src/bin/netconf/parser_context_decl.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/simple_parser.cc b/src/bin/netconf/simple_parser.cc index 1574ddf581..791ce5d459 100644 --- a/src/bin/netconf/simple_parser.cc +++ b/src/bin/netconf/simple_parser.cc @@ -6,13 +6,12 @@ #include -#include -#include #include #include #include #include -#include +#include +#include using namespace isc::data; diff --git a/src/bin/netconf/simple_parser.h b/src/bin/netconf/simple_parser.h index dc9a00db7d..53978c0270 100644 --- a/src/bin/netconf/simple_parser.h +++ b/src/bin/netconf/simple_parser.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/stdout_control_socket.cc b/src/bin/netconf/stdout_control_socket.cc index 6422993c95..949ffe2c0d 100644 --- a/src/bin/netconf/stdout_control_socket.cc +++ b/src/bin/netconf/stdout_control_socket.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -9,8 +9,10 @@ #include -#include #include +#include + +#include using namespace std; using namespace isc::config; diff --git a/src/bin/netconf/stdout_control_socket.h b/src/bin/netconf/stdout_control_socket.h index a8acfbcaf1..a241a9ed5d 100644 --- a/src/bin/netconf/stdout_control_socket.h +++ b/src/bin/netconf/stdout_control_socket.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/tests/Makefile.am b/src/bin/netconf/tests/Makefile.am index 65d5657a98..629cf85c42 100644 --- a/src/bin/netconf/tests/Makefile.am +++ b/src/bin/netconf/tests/Makefile.am @@ -2,13 +2,14 @@ SUBDIRS = . shtests EXTRA_DIST = testdata/get_config.json -AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib +AM_CPPFLAGS = +AM_CPPFLAGS += -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_builddir)/src AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin -AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/netconf/tests\" AM_CPPFLAGS += -DCFG_EXAMPLES=\"$(abs_top_srcdir)/doc/examples/netconf\" -AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/netconf/tests\" +AM_CPPFLAGS += -DKEATEST_MODULE AM_CPPFLAGS += -DSYNTAX_FILE=\"$(abs_srcdir)/../netconf_parser.yy\" +AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/netconf/tests\" AM_CPPFLAGS += $(BOOST_INCLUDES) $(CRYPTO_CFLAGS) $(CRYPTO_INCLUDES) AM_CPPFLAGS += $(LIBYANG_CPPFLAGS) AM_CPPFLAGS += $(LIBYANG_INCLUDEDIR) diff --git a/src/bin/netconf/tests/basic_library.cc b/src/bin/netconf/tests/basic_library.cc index f2186e085b..cd0be6896a 100644 --- a/src/bin/netconf/tests/basic_library.cc +++ b/src/bin/netconf/tests/basic_library.cc @@ -14,13 +14,13 @@ /// - hookpt_one callout is supplied. #include + #include using namespace isc::hooks; using namespace std; namespace { - extern "C" { // Callouts. All return their result through the "result" argument. @@ -67,6 +67,5 @@ load(isc::hooks::LibraryHandle&) { return (0); } -} -} - +} // extern "C" +} // namespace diff --git a/src/bin/netconf/tests/control_socket_unittests.cc b/src/bin/netconf/tests/control_socket_unittests.cc index bc8ba7eb76..d9ba2f24e8 100644 --- a/src/bin/netconf/tests/control_socket_unittests.cc +++ b/src/bin/netconf/tests/control_socket_unittests.cc @@ -6,10 +6,8 @@ #include -#include -#include -#include -#include +#include + #include #include #include @@ -19,12 +17,15 @@ #include #include #include -#include +#include +#include +#include +#include #include +#include #include -#include - +#include #include #include diff --git a/src/bin/netconf/tests/get_config_unittest.cc b/src/bin/netconf/tests/get_config_unittest.cc index 1b8b3af863..d673515164 100644 --- a/src/bin/netconf/tests/get_config_unittest.cc +++ b/src/bin/netconf/tests/get_config_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,20 +6,19 @@ #include -#include +#include + #include -#include -#include -#include +#include #include #include +#include +#include +#include -#include - -#include #include +#include #include -#include #include "test_data_files_config.h" #include "test_libraries.h" diff --git a/src/bin/netconf/tests/netconf_cfg_mgr_unittests.cc b/src/bin/netconf/tests/netconf_cfg_mgr_unittests.cc index 86e5c37815..c0dc0881f3 100644 --- a/src/bin/netconf/tests/netconf_cfg_mgr_unittests.cc +++ b/src/bin/netconf/tests/netconf_cfg_mgr_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,18 +6,18 @@ #include +#include + +#include +#include #include #include -#include -#include -#include +#include #include -#include +#include #include #include -#include - -#include +#include using namespace std; using namespace isc; diff --git a/src/bin/netconf/tests/netconf_controller_unittests.cc b/src/bin/netconf/tests/netconf_controller_unittests.cc index 2b2f8bb633..cbc762ffc1 100644 --- a/src/bin/netconf/tests/netconf_controller_unittests.cc +++ b/src/bin/netconf/tests/netconf_controller_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,17 +6,15 @@ #include +#include + #include +#include #include #include -#include #include #include -#include - -#include - using namespace isc::asiolink::test; using namespace isc::netconf; using namespace isc::data; diff --git a/src/bin/netconf/tests/netconf_process_unittests.cc b/src/bin/netconf/tests/netconf_process_unittests.cc index 7e30f3e057..2a0ce33064 100644 --- a/src/bin/netconf/tests/netconf_process_unittests.cc +++ b/src/bin/netconf/tests/netconf_process_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,17 +6,15 @@ #include -#include -#include +#include + #include #include +#include +#include #include #include -#include - -#include - #include using namespace boost::posix_time; diff --git a/src/bin/netconf/tests/netconf_unittests.cc b/src/bin/netconf/tests/netconf_unittests.cc index 205fef7b75..cf7cd407bf 100644 --- a/src/bin/netconf/tests/netconf_unittests.cc +++ b/src/bin/netconf/tests/netconf_unittests.cc @@ -6,31 +6,33 @@ #include +#include + +#include +#include +#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include #include +#include +#include +#include +#include +#include +#include #include -#include - #include +#include #include #include +#include using namespace std; using namespace isc; @@ -362,12 +364,14 @@ TEST_F(NetconfAgentTest, initSysrepo) { // Verifies that the checkModule method emits expected errors. TEST_F(NetconfAgentLogTest, checkModule) { - // keatest-module should not be in YANG_REVISIONS. - EXPECT_EQ(0, YANG_REVISIONS.count("keatest-module")); - // But kea-dhcp[46]-server must be in. + // Various modules should be available. + EXPECT_EQ(1, YANG_REVISIONS.count("keatest-module")); ASSERT_EQ(1, YANG_REVISIONS.count("kea-dhcp4-server")); ASSERT_EQ(1, YANG_REVISIONS.count("kea-dhcp6-server")); + // Non-existing modules should not. + EXPECT_EQ(0, agent_->modules_.count("does-not-exist")); + // kea-dhcp[46]-server should be available. EXPECT_NO_THROW_LOG(agent_->initSysrepo()); EXPECT_EQ(1, agent_->modules_.count("kea-dhcp4-server")); diff --git a/src/bin/netconf/tests/parser_unittests.cc b/src/bin/netconf/tests/parser_unittests.cc index cabfe4a335..5bfb236d72 100644 --- a/src/bin/netconf/tests/parser_unittests.cc +++ b/src/bin/netconf/tests/parser_unittests.cc @@ -6,6 +6,8 @@ #include +#include + #include #include #include @@ -14,10 +16,9 @@ #include #include -#include - +#include #include -#include +#include #include diff --git a/src/bin/netconf/tests/run_unittests.cc b/src/bin/netconf/tests/run_unittests.cc index b735a8e964..0065ec6519 100644 --- a/src/bin/netconf/tests/run_unittests.cc +++ b/src/bin/netconf/tests/run_unittests.cc @@ -7,8 +7,9 @@ #include #include -#include + #include +#include int main(int argc, char* argv[]) { diff --git a/src/bin/netconf/tests/test_libraries.h.in b/src/bin/netconf/tests/test_libraries.h.in index f90d682cf2..f402b1c3bd 100644 --- a/src/bin/netconf/tests/test_libraries.h.in +++ b/src/bin/netconf/tests/test_libraries.h.in @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/netconf/unix_control_socket.cc b/src/bin/netconf/unix_control_socket.cc index 62dbd80d39..480b74ad96 100644 --- a/src/bin/netconf/unix_control_socket.cc +++ b/src/bin/netconf/unix_control_socket.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -9,13 +9,13 @@ #include -#include #include #include #include #include #include #include +#include using namespace std; using namespace isc::asiolink; diff --git a/src/bin/netconf/unix_control_socket.h b/src/bin/netconf/unix_control_socket.h index 2cb0b3d10e..1595ddba8d 100644 --- a/src/bin/netconf/unix_control_socket.h +++ b/src/bin/netconf/unix_control_socket.h @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/lib/yang/adaptor.cc b/src/lib/yang/adaptor.cc index 3af89a7d7e..fc66339d63 100644 --- a/src/lib/yang/adaptor.cc +++ b/src/lib/yang/adaptor.cc @@ -7,7 +7,6 @@ #include #include -#include #include @@ -42,7 +41,7 @@ Adaptor::fromParent(const string& name, ConstElementPtr parent, if (!param) { return; } - BOOST_FOREACH(ElementPtr item, list->listValue()) { + for (ElementPtr const& item : list->listValue()) { // don't override. Skip this entry if it already has the parameter. if (item->contains(name)) { continue; @@ -56,7 +55,7 @@ Adaptor::toParent(const string& name, ElementPtr parent, ConstElementPtr list) { ConstElementPtr param; bool first = true; - BOOST_FOREACH(ElementPtr item, list->listValue()) { + for (ElementPtr const& item : list->listValue()) { if (first) { first = false; param = item->get(name); @@ -70,7 +69,7 @@ Adaptor::toParent(const string& name, ElementPtr parent, } } if (!first && param) { - BOOST_FOREACH(ElementPtr item, list->listValue()) { + for (ElementPtr const& item : list->listValue()) { if (param) { item->remove(name); } diff --git a/src/lib/yang/adaptor.h b/src/lib/yang/adaptor.h index 35efeca08a..8142725872 100644 --- a/src/lib/yang/adaptor.h +++ b/src/lib/yang/adaptor.h @@ -7,8 +7,8 @@ #ifndef ISC_ADAPTOR_H #define ISC_ADAPTOR_H 1 -#include #include +#include namespace isc { namespace yang { diff --git a/src/lib/yang/adaptor_config.h b/src/lib/yang/adaptor_config.h index a9422aaacb..6f644a3c60 100644 --- a/src/lib/yang/adaptor_config.h +++ b/src/lib/yang/adaptor_config.h @@ -11,7 +11,6 @@ #include #include #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/adaptor_host.cc b/src/lib/yang/adaptor_host.cc index 3a85c419af..990a103f72 100644 --- a/src/lib/yang/adaptor_host.cc +++ b/src/lib/yang/adaptor_host.cc @@ -9,8 +9,10 @@ #include #include #include + #include #include +#include using namespace std; using namespace isc::data; diff --git a/src/lib/yang/adaptor_option.cc b/src/lib/yang/adaptor_option.cc index 02acde1c30..811de8eb1b 100644 --- a/src/lib/yang/adaptor_option.cc +++ b/src/lib/yang/adaptor_option.cc @@ -6,9 +6,9 @@ #include -#include -#include #include +#include +#include using namespace std; using namespace isc::data; diff --git a/src/lib/yang/adaptor_option.h b/src/lib/yang/adaptor_option.h index 66af45df9e..a07fe7836e 100644 --- a/src/lib/yang/adaptor_option.h +++ b/src/lib/yang/adaptor_option.h @@ -10,8 +10,7 @@ #include #include -#include -#include +#include namespace isc { namespace yang { @@ -21,7 +20,7 @@ namespace yang { /// /// The map is used to store space+name to code mappings so for /// an option data without a code entry the code entry can be supplied. -using OptionCodes = std::map; +using OptionCodes = std::unordered_map; /// @brief JSON adaptor for option data or definition setting defaults. /// diff --git a/src/lib/yang/adaptor_pool.cc b/src/lib/yang/adaptor_pool.cc index 2edfcfde10..54966afc5a 100644 --- a/src/lib/yang/adaptor_pool.cc +++ b/src/lib/yang/adaptor_pool.cc @@ -9,6 +9,8 @@ #include #include +#include + using namespace std; using namespace isc::data; diff --git a/src/lib/yang/adaptor_pool.h b/src/lib/yang/adaptor_pool.h index 84af9dba2d..f1262be628 100644 --- a/src/lib/yang/adaptor_pool.h +++ b/src/lib/yang/adaptor_pool.h @@ -8,7 +8,6 @@ #define ISC_ADAPTOR_POOL_H 1 #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/adaptor_subnet.h b/src/lib/yang/adaptor_subnet.h index ad0d279708..270792f2a7 100644 --- a/src/lib/yang/adaptor_subnet.h +++ b/src/lib/yang/adaptor_subnet.h @@ -7,15 +7,16 @@ #ifndef ISC_ADAPTOR_SUBNET_H #define ISC_ADAPTOR_SUBNET_H 1 -#include #include -#include +#include + +#include namespace isc { namespace yang { /// @brief Set of SubnetIDs. -using SubnetIDSet = std::set; +using SubnetIDSet = std::unordered_set; /// @brief JSON adaptor for subnets adding IDs and canonizes relays. /// diff --git a/src/lib/yang/pretests/Makefile.am b/src/lib/yang/pretests/Makefile.am index 1fb72e8138..cc28db62ae 100644 --- a/src/lib/yang/pretests/Makefile.am +++ b/src/lib/yang/pretests/Makefile.am @@ -1,10 +1,16 @@ + + + + CLEANFILES = *.gcno *.gcda TESTS = sysrepo_setup_tests sysrepo_setup_tests_SOURCES = sysrepo_setup_tests.cc -sysrepo_setup_tests_CPPFLAGS = -I$(top_builddir)/src/lib +sysrepo_setup_tests_CPPFLAGS = +sysrepo_setup_tests_CPPFLAGS += -I$(top_builddir)/src/lib sysrepo_setup_tests_CPPFLAGS += -I$(top_srcdir)/src/lib +sysrepo_setup_tests_CPPFLAGS += -DKEATEST_MODULE sysrepo_setup_tests_CPPFLAGS += $(LIBYANG_CPPFLAGS) sysrepo_setup_tests_CPPFLAGS += $(LIBYANG_INCLUDEDIR) sysrepo_setup_tests_CPPFLAGS += $(LIBYANGCPP_CPPFLAGS) @@ -13,7 +19,6 @@ sysrepo_setup_tests_CPPFLAGS += $(SYSREPO_CPPFLAGS) sysrepo_setup_tests_CPPFLAGS += $(SYSREPO_INCLUDEDIR) sysrepo_setup_tests_CPPFLAGS += $(SYSREPOCPP_CPPFLAGS) sysrepo_setup_tests_CPPFLAGS += $(SYSREPOCPP_INCLUDEDIR) -sysrepo_setup_tests_CPPFLAGS += -DSYSREPO_REPO=\"@SR_REPO_PATH@\" sysrepo_setup_tests_LDFLAGS = $(AM_LDFLAGS) sysrepo_setup_tests_LDADD = sysrepo_setup_tests_LDADD += $(LIBYANG_LIBS) diff --git a/src/lib/yang/pretests/sysrepo_setup_tests.cc b/src/lib/yang/pretests/sysrepo_setup_tests.cc index b815d24e9b..9af238657c 100644 --- a/src/lib/yang/pretests/sysrepo_setup_tests.cc +++ b/src/lib/yang/pretests/sysrepo_setup_tests.cc @@ -6,7 +6,6 @@ #include -#define KEATEST_MODULE #include #include @@ -15,6 +14,7 @@ #include #include #include +#include using namespace std; using namespace libyang; @@ -24,8 +24,6 @@ using namespace isc::yang; using libyang::Context; using libyang::Module; -const string REPOSITORY = SYSREPO_REPO; - /// @brief Returns nicely formed error message if module is missing /// /// @param name name of the YANG module to complain about diff --git a/src/lib/yang/tests/Makefile.am b/src/lib/yang/tests/Makefile.am index 517a07d656..c3635ed65f 100644 --- a/src/lib/yang/tests/Makefile.am +++ b/src/lib/yang/tests/Makefile.am @@ -1,4 +1,6 @@ -AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib +AM_CPPFLAGS = +AM_CPPFLAGS += -DKEATEST_MODULE +AM_CPPFLAGS += -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib AM_CPPFLAGS += $(BOOST_INCLUDES) AM_CPPFLAGS += $(LIBYANG_CPPFLAGS) AM_CPPFLAGS += $(LIBYANG_INCLUDEDIR) diff --git a/src/lib/yang/tests/adaptor_config_unittests.cc b/src/lib/yang/tests/adaptor_config_unittests.cc index 76d0582070..a429badc71 100644 --- a/src/lib/yang/tests/adaptor_config_unittests.cc +++ b/src/lib/yang/tests/adaptor_config_unittests.cc @@ -6,12 +6,14 @@ #include +#include + #include #include #include #include -#include +#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/adaptor_host_unittests.cc b/src/lib/yang/tests/adaptor_host_unittests.cc index 6a50420817..0d50632d88 100644 --- a/src/lib/yang/tests/adaptor_host_unittests.cc +++ b/src/lib/yang/tests/adaptor_host_unittests.cc @@ -6,11 +6,11 @@ #include +#include + #include #include -#include - using namespace std; using namespace isc; using namespace isc::data; diff --git a/src/lib/yang/tests/adaptor_option_unittests.cc b/src/lib/yang/tests/adaptor_option_unittests.cc index d9bfd563aa..8d073ef595 100644 --- a/src/lib/yang/tests/adaptor_option_unittests.cc +++ b/src/lib/yang/tests/adaptor_option_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,6 +6,8 @@ #include +#include + #include #include #include @@ -13,8 +15,6 @@ #include #include -#include - using namespace std; using namespace isc; using namespace isc::data; diff --git a/src/lib/yang/tests/adaptor_pool_unittests.cc b/src/lib/yang/tests/adaptor_pool_unittests.cc index 367502af6f..6152834bf6 100644 --- a/src/lib/yang/tests/adaptor_pool_unittests.cc +++ b/src/lib/yang/tests/adaptor_pool_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,12 +6,12 @@ #include +#include + #include #include #include -#include - using namespace std; using namespace isc; using namespace isc::data; diff --git a/src/lib/yang/tests/adaptor_subnet_unittests.cc b/src/lib/yang/tests/adaptor_subnet_unittests.cc index 00ac3ca39e..85aac8a4a7 100644 --- a/src/lib/yang/tests/adaptor_subnet_unittests.cc +++ b/src/lib/yang/tests/adaptor_subnet_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,11 +6,11 @@ #include +#include + #include #include -#include - using namespace std; using namespace isc; using namespace isc::data; diff --git a/src/lib/yang/tests/adaptor_unittests.cc b/src/lib/yang/tests/adaptor_unittests.cc index 431e8b0ad2..5289b13d87 100644 --- a/src/lib/yang/tests/adaptor_unittests.cc +++ b/src/lib/yang/tests/adaptor_unittests.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -6,11 +6,11 @@ #include +#include + #include #include -#include - using namespace std; using namespace isc; using namespace isc::data; diff --git a/src/lib/yang/tests/config_unittests.cc b/src/lib/yang/tests/config_unittests.cc index fdb286482c..f04b8f6e23 100644 --- a/src/lib/yang/tests/config_unittests.cc +++ b/src/lib/yang/tests/config_unittests.cc @@ -6,19 +6,20 @@ #include +#include + #include #include -#include -#include #include -#include #include - -#include - -#include +#include +#include +#include #include +#include + +#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/run_unittests.cc b/src/lib/yang/tests/run_unittests.cc index c0847cad14..dee9346bda 100644 --- a/src/lib/yang/tests/run_unittests.cc +++ b/src/lib/yang/tests/run_unittests.cc @@ -7,8 +7,9 @@ #include #include -#include + #include +#include int main(int argc, char* argv[]) { diff --git a/src/lib/yang/tests/sysrepo_setup.h b/src/lib/yang/tests/sysrepo_setup.h index 1f551c4768..c46fad57da 100644 --- a/src/lib/yang/tests/sysrepo_setup.h +++ b/src/lib/yang/tests/sysrepo_setup.h @@ -9,14 +9,14 @@ #include +#include + #include #include #include #include -#include - namespace isc { namespace yang { namespace test { diff --git a/src/lib/yang/tests/translator_class_unittests.cc b/src/lib/yang/tests/translator_class_unittests.cc index 1caa44af4c..f38b39c4f7 100644 --- a/src/lib/yang/tests/translator_class_unittests.cc +++ b/src/lib/yang/tests/translator_class_unittests.cc @@ -6,11 +6,12 @@ #include +#include + +#include #include #include -#include -#include #include using namespace std; diff --git a/src/lib/yang/tests/translator_control_socket_unittests.cc b/src/lib/yang/tests/translator_control_socket_unittests.cc index 5f87ed2d4a..5f10a920d8 100644 --- a/src/lib/yang/tests/translator_control_socket_unittests.cc +++ b/src/lib/yang/tests/translator_control_socket_unittests.cc @@ -6,11 +6,11 @@ #include +#include + +#include #include #include -#include - -#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/translator_database_unittests.cc b/src/lib/yang/tests/translator_database_unittests.cc index d536d859bc..ccd22f9de3 100644 --- a/src/lib/yang/tests/translator_database_unittests.cc +++ b/src/lib/yang/tests/translator_database_unittests.cc @@ -6,11 +6,11 @@ #include +#include + +#include #include #include -#include - -#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/translator_host_unittests.cc b/src/lib/yang/tests/translator_host_unittests.cc index 4d9b4c05b4..e4a97d5b01 100644 --- a/src/lib/yang/tests/translator_host_unittests.cc +++ b/src/lib/yang/tests/translator_host_unittests.cc @@ -6,11 +6,12 @@ #include +#include + +#include #include #include -#include -#include #include using namespace std; diff --git a/src/lib/yang/tests/translator_logger_unittests.cc b/src/lib/yang/tests/translator_logger_unittests.cc index d767bd4f66..ae29a42b2e 100644 --- a/src/lib/yang/tests/translator_logger_unittests.cc +++ b/src/lib/yang/tests/translator_logger_unittests.cc @@ -6,11 +6,11 @@ #include +#include + +#include #include #include -#include - -#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/translator_option_data_unittests.cc b/src/lib/yang/tests/translator_option_data_unittests.cc index 161cff88b6..8830d42084 100644 --- a/src/lib/yang/tests/translator_option_data_unittests.cc +++ b/src/lib/yang/tests/translator_option_data_unittests.cc @@ -6,12 +6,11 @@ #include +#include + +#include #include #include -#include - -#include -#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/translator_option_def_unittests.cc b/src/lib/yang/tests/translator_option_def_unittests.cc index 188245bd41..6aa099b661 100644 --- a/src/lib/yang/tests/translator_option_def_unittests.cc +++ b/src/lib/yang/tests/translator_option_def_unittests.cc @@ -6,12 +6,11 @@ #include +#include + +#include #include #include -#include - -#include -#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/translator_pd_pool_unittests.cc b/src/lib/yang/tests/translator_pd_pool_unittests.cc index a811de9b54..23ac632026 100644 --- a/src/lib/yang/tests/translator_pd_pool_unittests.cc +++ b/src/lib/yang/tests/translator_pd_pool_unittests.cc @@ -6,11 +6,12 @@ #include +#include + +#include #include #include -#include -#include #include using namespace std; diff --git a/src/lib/yang/tests/translator_pool_unittests.cc b/src/lib/yang/tests/translator_pool_unittests.cc index 93b9b2eeef..a68c20f408 100644 --- a/src/lib/yang/tests/translator_pool_unittests.cc +++ b/src/lib/yang/tests/translator_pool_unittests.cc @@ -6,11 +6,12 @@ #include +#include + +#include #include #include -#include -#include #include using namespace std; diff --git a/src/lib/yang/tests/translator_shared_network_unittests.cc b/src/lib/yang/tests/translator_shared_network_unittests.cc index 4308130c84..374419aa44 100644 --- a/src/lib/yang/tests/translator_shared_network_unittests.cc +++ b/src/lib/yang/tests/translator_shared_network_unittests.cc @@ -6,11 +6,11 @@ #include +#include + +#include #include #include -#include - -#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/translator_subnet_unittests.cc b/src/lib/yang/tests/translator_subnet_unittests.cc index e87eb68a7f..332711ef11 100644 --- a/src/lib/yang/tests/translator_subnet_unittests.cc +++ b/src/lib/yang/tests/translator_subnet_unittests.cc @@ -6,11 +6,11 @@ #include +#include + +#include #include #include -#include - -#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/translator_unittests.cc b/src/lib/yang/tests/translator_unittests.cc index b38164adce..b2c79ff1b0 100644 --- a/src/lib/yang/tests/translator_unittests.cc +++ b/src/lib/yang/tests/translator_unittests.cc @@ -6,11 +6,11 @@ #include +#include + #include -#include #include - -#include +#include using namespace std; using namespace isc; diff --git a/src/lib/yang/tests/translator_utils_unittests.cc b/src/lib/yang/tests/translator_utils_unittests.cc index de56acdc0d..e463d73bda 100644 --- a/src/lib/yang/tests/translator_utils_unittests.cc +++ b/src/lib/yang/tests/translator_utils_unittests.cc @@ -6,11 +6,11 @@ #include +#include + #include -#include #include - -#include +#include #include diff --git a/src/lib/yang/tests/yang_configs.h b/src/lib/yang/tests/yang_configs.h index e94d302d20..bd9a6b1eb6 100644 --- a/src/lib/yang/tests/yang_configs.h +++ b/src/lib/yang/tests/yang_configs.h @@ -7,8 +7,10 @@ #ifndef ISC_YANG_CONFIGS_H #define ISC_YANG_CONFIGS_H -#include #include +#include + +#include namespace isc { namespace yang { diff --git a/src/lib/yang/testutils/translator_test.cc b/src/lib/yang/testutils/translator_test.cc index e8f6e12a9c..ecf18fc6dd 100644 --- a/src/lib/yang/testutils/translator_test.cc +++ b/src/lib/yang/testutils/translator_test.cc @@ -10,7 +10,8 @@ #include -#include +#include +#include using namespace std; using namespace isc::data; diff --git a/src/lib/yang/testutils/translator_test.h b/src/lib/yang/testutils/translator_test.h index a3127b2157..fa7a26a35d 100644 --- a/src/lib/yang/testutils/translator_test.h +++ b/src/lib/yang/testutils/translator_test.h @@ -8,8 +8,8 @@ #define ISC_TRANSLATOR_TEST_H 1 #include + #include -#include #include namespace isc { diff --git a/src/lib/yang/translator.cc b/src/lib/yang/translator.cc index 6a293ce95a..0922f248fe 100644 --- a/src/lib/yang/translator.cc +++ b/src/lib/yang/translator.cc @@ -6,12 +6,13 @@ #include -#include #include +#include #include #include +#include using namespace std; using namespace isc::data; diff --git a/src/lib/yang/translator_class.cc b/src/lib/yang/translator_class.cc index add2ff0678..868ed931e2 100644 --- a/src/lib/yang/translator_class.cc +++ b/src/lib/yang/translator_class.cc @@ -6,9 +6,10 @@ #include -#include #include +#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_class.h b/src/lib/yang/translator_class.h index 2659786e9f..851851f4d9 100644 --- a/src/lib/yang/translator_class.h +++ b/src/lib/yang/translator_class.h @@ -9,7 +9,6 @@ #include #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_config.cc b/src/lib/yang/translator_config.cc index 1c1dafbb39..b53ea660e8 100644 --- a/src/lib/yang/translator_config.cc +++ b/src/lib/yang/translator_config.cc @@ -6,9 +6,10 @@ #include -#include #include +#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_config.h b/src/lib/yang/translator_config.h index a049fe0d84..911d2ef726 100644 --- a/src/lib/yang/translator_config.h +++ b/src/lib/yang/translator_config.h @@ -8,12 +8,11 @@ #define ISC_TRANSLATOR_CONFIG_H 1 #include +#include #include #include -#include -#include #include -#include +#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_control_socket.cc b/src/lib/yang/translator_control_socket.cc index 4fb4384402..e881479a4e 100644 --- a/src/lib/yang/translator_control_socket.cc +++ b/src/lib/yang/translator_control_socket.cc @@ -6,9 +6,10 @@ #include -#include #include +#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_control_socket.h b/src/lib/yang/translator_control_socket.h index 8d563a3d6b..39aabc3f71 100644 --- a/src/lib/yang/translator_control_socket.h +++ b/src/lib/yang/translator_control_socket.h @@ -8,7 +8,6 @@ #define ISC_TRANSLATOR_CONTROL_SOCKET_H 1 #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_database.cc b/src/lib/yang/translator_database.cc index 046c092e42..a37914495f 100644 --- a/src/lib/yang/translator_database.cc +++ b/src/lib/yang/translator_database.cc @@ -6,9 +6,10 @@ #include -#include #include +#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_database.h b/src/lib/yang/translator_database.h index a5e0216804..0657a34e79 100644 --- a/src/lib/yang/translator_database.h +++ b/src/lib/yang/translator_database.h @@ -8,7 +8,7 @@ #define ISC_TRANSLATOR_DATABASE_H 1 #include -#include + namespace isc { namespace yang { diff --git a/src/lib/yang/translator_host.cc b/src/lib/yang/translator_host.cc index ea01420315..f24ae783b5 100644 --- a/src/lib/yang/translator_host.cc +++ b/src/lib/yang/translator_host.cc @@ -6,9 +6,10 @@ #include -#include #include +#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_host.h b/src/lib/yang/translator_host.h index 45dcdf3c91..65f169bfa2 100644 --- a/src/lib/yang/translator_host.h +++ b/src/lib/yang/translator_host.h @@ -8,7 +8,6 @@ #define ISC_TRANSLATOR_HOST_H 1 #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_logger.cc b/src/lib/yang/translator_logger.cc index 2b3ddcf3bb..fb1856f380 100644 --- a/src/lib/yang/translator_logger.cc +++ b/src/lib/yang/translator_logger.cc @@ -6,9 +6,10 @@ #include -#include #include +#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_logger.h b/src/lib/yang/translator_logger.h index 1adfcadf22..af0e5f7199 100644 --- a/src/lib/yang/translator_logger.h +++ b/src/lib/yang/translator_logger.h @@ -8,7 +8,6 @@ #define ISC_TRANSLATOR_LOGGER_H 1 #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_option_data.cc b/src/lib/yang/translator_option_data.cc index 5f5ba8e515..bb75c47568 100644 --- a/src/lib/yang/translator_option_data.cc +++ b/src/lib/yang/translator_option_data.cc @@ -6,9 +6,10 @@ #include -#include #include +#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_option_data.h b/src/lib/yang/translator_option_data.h index 10aeb69a1c..ace9a36770 100644 --- a/src/lib/yang/translator_option_data.h +++ b/src/lib/yang/translator_option_data.h @@ -8,7 +8,6 @@ #define ISC_TRANSLATOR_OPTION_DATA_H 1 #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_option_def.cc b/src/lib/yang/translator_option_def.cc index 5e49852f46..0154f88d52 100644 --- a/src/lib/yang/translator_option_def.cc +++ b/src/lib/yang/translator_option_def.cc @@ -6,9 +6,10 @@ #include -#include #include +#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_option_def.h b/src/lib/yang/translator_option_def.h index 07cfd97aee..1a32b9e23d 100644 --- a/src/lib/yang/translator_option_def.h +++ b/src/lib/yang/translator_option_def.h @@ -8,7 +8,7 @@ #define ISC_TRANSLATOR_OPTION_DEF_H 1 #include -#include + namespace isc { namespace yang { diff --git a/src/lib/yang/translator_pd_pool.cc b/src/lib/yang/translator_pd_pool.cc index 58311cf80b..81bdcb7941 100644 --- a/src/lib/yang/translator_pd_pool.cc +++ b/src/lib/yang/translator_pd_pool.cc @@ -9,7 +9,9 @@ #include #include #include + #include + #include using namespace std; diff --git a/src/lib/yang/translator_pd_pool.h b/src/lib/yang/translator_pd_pool.h index 5756a7ffb5..7812209bc0 100644 --- a/src/lib/yang/translator_pd_pool.h +++ b/src/lib/yang/translator_pd_pool.h @@ -8,7 +8,6 @@ #define ISC_TRANSLATOR_PD_POOL_H 1 #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_pool.cc b/src/lib/yang/translator_pool.cc index 088227a040..04ddb5da6d 100644 --- a/src/lib/yang/translator_pool.cc +++ b/src/lib/yang/translator_pool.cc @@ -6,12 +6,14 @@ #include -#include #include +#include #include #include #include + #include + #include using namespace std; diff --git a/src/lib/yang/translator_pool.h b/src/lib/yang/translator_pool.h index 9ae9f5226c..6b5605a8d4 100644 --- a/src/lib/yang/translator_pool.h +++ b/src/lib/yang/translator_pool.h @@ -8,7 +8,6 @@ #define ISC_TRANSLATOR_POOL_H 1 #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_shared_network.cc b/src/lib/yang/translator_shared_network.cc index ed43d3eb3a..517b59a0e7 100644 --- a/src/lib/yang/translator_shared_network.cc +++ b/src/lib/yang/translator_shared_network.cc @@ -7,8 +7,8 @@ #include #include -#include #include + #include using namespace std; diff --git a/src/lib/yang/translator_shared_network.h b/src/lib/yang/translator_shared_network.h index a95024aca3..ec8e94740d 100644 --- a/src/lib/yang/translator_shared_network.h +++ b/src/lib/yang/translator_shared_network.h @@ -9,7 +9,6 @@ #include #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/translator_subnet.h b/src/lib/yang/translator_subnet.h index 07427009bb..60e54b2657 100644 --- a/src/lib/yang/translator_subnet.h +++ b/src/lib/yang/translator_subnet.h @@ -11,7 +11,6 @@ #include #include #include -#include namespace isc { namespace yang { diff --git a/src/lib/yang/yang_revisions.h b/src/lib/yang/yang_revisions.h index 9cba6038dd..6c9286b0c9 100644 --- a/src/lib/yang/yang_revisions.h +++ b/src/lib/yang/yang_revisions.h @@ -7,14 +7,14 @@ #ifndef ISC_YANG_REVISIONS_H #define ISC_YANG_REVISIONS_H 1 -#include #include +#include namespace isc { namespace yang { // Table of module name / revision. -static const std::map YANG_REVISIONS = { +static const std::unordered_map YANG_REVISIONS = { #ifdef KEATEST_MODULE { "keatest-module", "2018-11-20" }, #endif // KEATEST_MODULE diff --git a/src/lib/yang/yang_revisions.h.skel b/src/lib/yang/yang_revisions.h.skel index 76edaa25ec..7acf0ff2ab 100644 --- a/src/lib/yang/yang_revisions.h.skel +++ b/src/lib/yang/yang_revisions.h.skel @@ -1,4 +1,4 @@ -// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -7,19 +7,19 @@ #ifndef ISC_YANG_REVISIONS_H #define ISC_YANG_REVISIONS_H 1 -#include #include +#include namespace isc { namespace yang { // Table of module name / revision. -static const std::map YANG_REVISIONS = { +static const std::unordered_map YANG_REVISIONS = { // Fill this by: // cd .../src/share/yang/modules // sh utils/gen-revisions.sh > r // insert the r file here -}; +}; // YANG_REVISIONS } // namespace yang } // namespace isc