summaryrefslogtreecommitdiffstats
path: root/src/bin/netconf
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2019-02-09 01:47:45 +0100
committerFrancis Dupont <fdupont@isc.org>2019-03-13 13:37:54 +0100
commitc5ecc2be01274fd6db75fb354c2a79750751fd3c (patch)
treeb266918ff52c3b1794414d8184fa07e25771a78a /src/bin/netconf
parent[master] Fixed #481 merge error (diff)
downloadkea-c5ecc2be01274fd6db75fb354c2a79750751fd3c.tar.xz
kea-c5ecc2be01274fd6db75fb354c2a79750751fd3c.zip
[441-make-distcheck-fails-on-fedora-29-automake-1-16] Second attempt to fix automake 1.16 issue; distribute generated file
Diffstat (limited to 'src/bin/netconf')
-rw-r--r--src/bin/netconf/.gitignore3
-rw-r--r--src/bin/netconf/Makefile.am46
-rw-r--r--src/bin/netconf/netconf_messages.cc85
-rw-r--r--src/bin/netconf/netconf_messages.h46
4 files changed, 166 insertions, 14 deletions
diff --git a/src/bin/netconf/.gitignore b/src/bin/netconf/.gitignore
index 053be53a38..e97eafa0a2 100644
--- a/src/bin/netconf/.gitignore
+++ b/src/bin/netconf/.gitignore
@@ -1,5 +1,2 @@
kea-netconf
kea-netconf.8
-netconf_messages.cc
-netconf_messages.h
-s-messages
diff --git a/src/bin/netconf/Makefile.am b/src/bin/netconf/Makefile.am
index 50040b69b9..a459320c66 100644
--- a/src/bin/netconf/Makefile.am
+++ b/src/bin/netconf/Makefile.am
@@ -11,7 +11,7 @@ if USE_STATIC_LINK
AM_LDFLAGS = -static
endif
-CLEANFILES = *.gcno *.gcda netconf_messages.h netconf_messages.cc s-messages
+CLEANFILES = *.gcno *.gcda
man_MANS = kea-netconf.8
DISTCLEANFILES = $(man_MANS)
@@ -32,14 +32,6 @@ $(man_MANS):
endif
-netconf_messages.h netconf_messages.cc: s-messages
-
-s-messages: netconf_messages.mes
- $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/bin/netconf/netconf_messages.mes
- touch $@
-
-BUILT_SOURCES = netconf_messages.h netconf_messages.cc
-
# convenience archive
noinst_LTLIBRARIES = libnetconf.la
@@ -60,8 +52,7 @@ libnetconf_la_SOURCES += parser_context_decl.h
libnetconf_la_SOURCES += simple_parser.cc simple_parser.h
libnetconf_la_SOURCES += location.hh position.hh stack.hh
libnetconf_la_SOURCES += netconf_lexer.ll netconf_parser.yy
-
-nodist_libnetconf_la_SOURCES = netconf_messages.h netconf_messages.cc
+libnetconf_la_SOURCES += netconf_messages.h netconf_messages.cc
EXTRA_DIST += netconf_messages.mes
EXTRA_DIST += netconf_lexer.ll
@@ -89,6 +80,39 @@ kea_netconf_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(SYSREPO_LI
kea_netconfdir = $(pkgdatadir)
+# If we want to get rid of all generated messages files, we need to use
+# make maintainer-clean. The proper way to introduce custom commands for
+# that operation is to define maintainer-clean-local target. However,
+# make maintainer-clean also removes Makefile, so running configure script
+# is required. To make it easy to rebuild messages without going through
+# reconfigure, a new target messages-clean has been added.
+maintainer-clean-local:
+ rm -f netconf_messages.h netconf_messages.cc
+
+# To regenerate messages files, one can do:
+#
+# make messages-clean
+# make messages
+#
+# This is needed only when a .mes file is modified.
+messages-clean: maintainer-clean-local
+
+if GENERATE_MESSAGES
+
+# Define rule to build logging source files from message file
+messages: netconf_messages.h netconf_messages.cc
+ @echo Message files regenerated
+
+netconf_messages.h netconf_messages.cc: netconf_messages.mes
+ $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/lib/netconf/netconf_messages.mes
+
+else
+
+messages netconf_messages.h netconf_messages.cc:
+ @echo Messages generation disabled. Configure with --enable-generate=,essages to enable it.
+
+endif
+
if GENERATE_PARSER
parser: netconf_lexer.cc location.hh position.hh stack.hh netconf_parser.cc netconf_parser.h
diff --git a/src/bin/netconf/netconf_messages.cc b/src/bin/netconf/netconf_messages.cc
new file mode 100644
index 0000000000..81f01882bf
--- /dev/null
+++ b/src/bin/netconf/netconf_messages.cc
@@ -0,0 +1,85 @@
+// File created from ../../../src/bin/netconf/netconf_messages.mes on Fri Feb 08 2019 20:57
+
+#include <cstddef>
+#include <log/message_types.h>
+#include <log/message_initializer.h>
+
+namespace isc {
+namespace netconf {
+
+extern const isc::log::MessageID NETCONF_BOOT_UPDATE_COMPLETED = "NETCONF_BOOT_UPDATE_COMPLETED";
+extern const isc::log::MessageID NETCONF_CONFIG_CHANGED_DETAIL = "NETCONF_CONFIG_CHANGED_DETAIL";
+extern const isc::log::MessageID NETCONF_CONFIG_CHANGE_EVENT = "NETCONF_CONFIG_CHANGE_EVENT";
+extern const isc::log::MessageID NETCONF_CONFIG_CHECK_FAIL = "NETCONF_CONFIG_CHECK_FAIL";
+extern const isc::log::MessageID NETCONF_CONFIG_FAIL = "NETCONF_CONFIG_FAIL";
+extern const isc::log::MessageID NETCONF_FAILED = "NETCONF_FAILED";
+extern const isc::log::MessageID NETCONF_GET_CONFIG = "NETCONF_GET_CONFIG";
+extern const isc::log::MessageID NETCONF_GET_CONFIG_FAILED = "NETCONF_GET_CONFIG_FAILED";
+extern const isc::log::MessageID NETCONF_GET_CONFIG_STARTED = "NETCONF_GET_CONFIG_STARTED";
+extern const isc::log::MessageID NETCONF_LOG_CHANGE_FAIL = "NETCONF_LOG_CHANGE_FAIL";
+extern const isc::log::MessageID NETCONF_MODULE_INSTALL = "NETCONF_MODULE_INSTALL";
+extern const isc::log::MessageID NETCONF_MODULE_MISSING_ERR = "NETCONF_MODULE_MISSING_ERR";
+extern const isc::log::MessageID NETCONF_MODULE_MISSING_WARN = "NETCONF_MODULE_MISSING_WARN";
+extern const isc::log::MessageID NETCONF_MODULE_REVISION_ERR = "NETCONF_MODULE_REVISION_ERR";
+extern const isc::log::MessageID NETCONF_MODULE_REVISION_WARN = "NETCONF_MODULE_REVISION_WARN";
+extern const isc::log::MessageID NETCONF_RUN_EXIT = "NETCONF_RUN_EXIT";
+extern const isc::log::MessageID NETCONF_SET_CONFIG = "NETCONF_SET_CONFIG";
+extern const isc::log::MessageID NETCONF_SET_CONFIG_FAILED = "NETCONF_SET_CONFIG_FAILED";
+extern const isc::log::MessageID NETCONF_SET_CONFIG_STARTED = "NETCONF_SET_CONFIG_STARTED";
+extern const isc::log::MessageID NETCONF_STARTED = "NETCONF_STARTED";
+extern const isc::log::MessageID NETCONF_SUBSCRIBE_CONFIG = "NETCONF_SUBSCRIBE_CONFIG";
+extern const isc::log::MessageID NETCONF_SUBSCRIBE_CONFIG_FAILED = "NETCONF_SUBSCRIBE_CONFIG_FAILED";
+extern const isc::log::MessageID NETCONF_UPDATE_CONFIG = "NETCONF_UPDATE_CONFIG";
+extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_COMPLETED = "NETCONF_UPDATE_CONFIG_COMPLETED";
+extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_FAILED = "NETCONF_UPDATE_CONFIG_FAILED";
+extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_STARTED = "NETCONF_UPDATE_CONFIG_STARTED";
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG = "NETCONF_VALIDATE_CONFIG";
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_COMPLETED = "NETCONF_VALIDATE_CONFIG_COMPLETED";
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_FAILED = "NETCONF_VALIDATE_CONFIG_FAILED";
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_REJECTED = "NETCONF_VALIDATE_CONFIG_REJECTED";
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_STARTED = "NETCONF_VALIDATE_CONFIG_STARTED";
+
+} // namespace netconf
+} // namespace isc
+
+namespace {
+
+const char* values[] = {
+ "NETCONF_BOOT_UPDATE_COMPLETED", "Boot-update configuration completed for server %1",
+ "NETCONF_CONFIG_CHANGED_DETAIL", "YANG configuration changed: %1",
+ "NETCONF_CONFIG_CHANGE_EVENT", "Received YANG configuration change %1 event",
+ "NETCONF_CONFIG_CHECK_FAIL", "Netconf configuration check failed: %1",
+ "NETCONF_CONFIG_FAIL", "Netconf configuration failed: %1",
+ "NETCONF_FAILED", "application experienced a fatal error: %1",
+ "NETCONF_GET_CONFIG", "got configuration from %1 server: %2",
+ "NETCONF_GET_CONFIG_FAILED", "getting configuration from %1 server failed: %2",
+ "NETCONF_GET_CONFIG_STARTED", "getting configuration from %1 server",
+ "NETCONF_LOG_CHANGE_FAIL", "Netconf configuration change logging failed: %1",
+ "NETCONF_MODULE_INSTALL", "Sysrepo (un)installs a module: %1 (revision %2)",
+ "NETCONF_MODULE_MISSING_ERR", "Missing essential module %1 in sysrepo",
+ "NETCONF_MODULE_MISSING_WARN", "Missing module %1 in sysrepo",
+ "NETCONF_MODULE_REVISION_ERR", "Essential module %1 does have the right revision: expected %2, got %3",
+ "NETCONF_MODULE_REVISION_WARN", "Module %1 does have the right revision: expected %2, got %3",
+ "NETCONF_RUN_EXIT", "application is exiting the event loop",
+ "NETCONF_SET_CONFIG", "set configuration to %1 server: %2",
+ "NETCONF_SET_CONFIG_FAILED", "setting configuration to %1 server failed: %2",
+ "NETCONF_SET_CONFIG_STARTED", "setting configuration to %1 server",
+ "NETCONF_STARTED", "Netconf (version %1) started",
+ "NETCONF_SUBSCRIBE_CONFIG", "subscribing configuration changes for %1 server with %2 module",
+ "NETCONF_SUBSCRIBE_CONFIG_FAILED", "subscribe configuration changes for %1 server with %2 module failed: %3",
+ "NETCONF_UPDATE_CONFIG", "updating configuration with %1 server: %2",
+ "NETCONF_UPDATE_CONFIG_COMPLETED", "completed updating configuration for %1 server",
+ "NETCONF_UPDATE_CONFIG_FAILED", "updating configuration with %1 server: %2",
+ "NETCONF_UPDATE_CONFIG_STARTED", "started updating configuration for %1 server",
+ "NETCONF_VALIDATE_CONFIG", "validating configuration with %1 server: %2",
+ "NETCONF_VALIDATE_CONFIG_COMPLETED", "completed validating configuration for %1 server",
+ "NETCONF_VALIDATE_CONFIG_FAILED", "validating configuration with %1 server got an error: %2",
+ "NETCONF_VALIDATE_CONFIG_REJECTED", "validating configuration with %1 server was rejected: %2",
+ "NETCONF_VALIDATE_CONFIG_STARTED", "started validating configuration for %1 server",
+ NULL
+};
+
+const isc::log::MessageInitializer initializer(values);
+
+} // Anonymous namespace
+
diff --git a/src/bin/netconf/netconf_messages.h b/src/bin/netconf/netconf_messages.h
new file mode 100644
index 0000000000..6ace56de8b
--- /dev/null
+++ b/src/bin/netconf/netconf_messages.h
@@ -0,0 +1,46 @@
+// File created from ../../../src/bin/netconf/netconf_messages.mes on Fri Feb 08 2019 20:57
+
+#ifndef NETCONF_MESSAGES_H
+#define NETCONF_MESSAGES_H
+
+#include <log/message_types.h>
+
+namespace isc {
+namespace netconf {
+
+extern const isc::log::MessageID NETCONF_BOOT_UPDATE_COMPLETED;
+extern const isc::log::MessageID NETCONF_CONFIG_CHANGED_DETAIL;
+extern const isc::log::MessageID NETCONF_CONFIG_CHANGE_EVENT;
+extern const isc::log::MessageID NETCONF_CONFIG_CHECK_FAIL;
+extern const isc::log::MessageID NETCONF_CONFIG_FAIL;
+extern const isc::log::MessageID NETCONF_FAILED;
+extern const isc::log::MessageID NETCONF_GET_CONFIG;
+extern const isc::log::MessageID NETCONF_GET_CONFIG_FAILED;
+extern const isc::log::MessageID NETCONF_GET_CONFIG_STARTED;
+extern const isc::log::MessageID NETCONF_LOG_CHANGE_FAIL;
+extern const isc::log::MessageID NETCONF_MODULE_INSTALL;
+extern const isc::log::MessageID NETCONF_MODULE_MISSING_ERR;
+extern const isc::log::MessageID NETCONF_MODULE_MISSING_WARN;
+extern const isc::log::MessageID NETCONF_MODULE_REVISION_ERR;
+extern const isc::log::MessageID NETCONF_MODULE_REVISION_WARN;
+extern const isc::log::MessageID NETCONF_RUN_EXIT;
+extern const isc::log::MessageID NETCONF_SET_CONFIG;
+extern const isc::log::MessageID NETCONF_SET_CONFIG_FAILED;
+extern const isc::log::MessageID NETCONF_SET_CONFIG_STARTED;
+extern const isc::log::MessageID NETCONF_STARTED;
+extern const isc::log::MessageID NETCONF_SUBSCRIBE_CONFIG;
+extern const isc::log::MessageID NETCONF_SUBSCRIBE_CONFIG_FAILED;
+extern const isc::log::MessageID NETCONF_UPDATE_CONFIG;
+extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_COMPLETED;
+extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_FAILED;
+extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_STARTED;
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG;
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_COMPLETED;
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_FAILED;
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_REJECTED;
+extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_STARTED;
+
+} // namespace netconf
+} // namespace isc
+
+#endif // NETCONF_MESSAGES_H