Browse Source

[master] Merged trac3732b (remaining bundy code)

Francis Dupont 9 years ago
parent
commit
9175fccc74

+ 1 - 3
configure.ac

@@ -1093,9 +1093,7 @@ fi
 # Add some default CPP flags needed for Boost, identified by the AX macro.
 CPPFLAGS="$CPPFLAGS $CPPFLAGS_BOOST_THREADCONF"
 
-# I can't get some of the #include <asio.hpp> right without this
-# TODO: find the real cause of asio/boost wanting pthreads
-# (this currently only occurs for src/lib/cc/session_unittests)
+# Can be required by gtest, boost and perhaps still asio
 PTHREAD_LDFLAGS=
 AC_CHECK_LIB(pthread, pthread_create,[ PTHREAD_LDFLAGS=-lpthread ], [])
 AC_SUBST(PTHREAD_LDFLAGS)

+ 0 - 3
src/lib/cc/.gitignore

@@ -1,3 +0,0 @@
-/cc_messages.cc
-/cc_messages.h
-/s-messages

+ 1 - 23
src/lib/cc/Makefile.am

@@ -2,32 +2,10 @@ SUBDIRS = . tests
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
-
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
-if USE_GXX
-# ASIO header files used in session.cc will trigger the "unused-parameter"
-# warning.  Unfortunately there doesn't seem to be an easy way to selectively
-# avoid the error.  As a short term workaround we suppress this warning
-# for the entire this module.  See also src/bin/auth/Makefile.am.
-AM_CXXFLAGS += -Wno-unused-parameter
-AM_CXXFLAGS += -fno-strict-aliasing
-endif
 
 lib_LTLIBRARIES = libkea-cc.la
 libkea_cc_la_SOURCES = data.cc data.h
 libkea_cc_la_SOURCES += command_interpreter.cc command_interpreter.h
-libkea_cc_la_SOURCES += logger.cc logger.h
-nodist_libkea_cc_la_SOURCES = cc_messages.cc cc_messages.h
-libkea_cc_la_LIBADD = $(top_builddir)/src/lib/log/libkea-log.la
-
-CLEANFILES = *.gcno *.gcda cc_messages.cc cc_messages.h s-messages
-
-cc_messages.cc cc_messages.h: s-messages
-
-s-messages: cc_messages.mes
-	$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/cc/cc_messages.mes
-	touch $@
-
-BUILT_SOURCES = cc_messages.cc cc_messages.h
 
-EXTRA_DIST = cc_messages.mes
+CLEANFILES = *.gcno *.gcda

+ 0 - 32
src/lib/cc/cc_messages.mes

@@ -1,32 +0,0 @@
-# Copyright (C) 2010, 2014  Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-$NAMESPACE isc::cc
-
-% CC_RECEIVE Received a message over control channel: %1
-Debug message, noting that a message was received over control channel.
-
-% CC_SEND Sending message over control channel: '%1'
-Debug message, the code is about to send a message over the control channel.
-
-% CC_REGISTER_COMMAND_HANDLER Handler for command '%1' registered
-Command Handler for a given command has been registered. This means that
-the software enabled handling of said command.
-
-% CC_PROCESS_COMMAND Processing command '%1'
-Debug message, noting that the software is processing received command.
-
-% CC_READ_ERROR Received truncated or malformed command (%1)
-A read error indicates that either the communication was interrupted (e.g.
-truncated packet received) or the entity had sent malformed command.

+ 0 - 23
src/lib/cc/logger.cc

@@ -1,23 +0,0 @@
-// Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
-//
-// Permission to use, copy, modify, and/or distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-// PERFORMANCE OF THIS SOFTWARE.
-
-#include <cc/logger.h>
-
-namespace isc {
-namespace cc {
-
-isc::log::Logger logger("cc");
-
-}
-}

+ 0 - 46
src/lib/cc/logger.h

@@ -1,46 +0,0 @@
-// Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
-//
-// Permission to use, copy, modify, and/or distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-// PERFORMANCE OF THIS SOFTWARE.
-
-#ifndef CC_LOGGER_H
-#define CC_LOGGER_H
-
-#include <cc/cc_messages.h>
-#include <log/macros.h>
-
-/// \file cc/logger.h
-/// \brief Command Channel library global logger
-///
-/// This holds the logger for the CC library. It is a private header
-/// and should not be included in any publicly used header, only in local
-/// cc files.
-
-namespace isc {
-namespace cc {
-
-/// Trace basic operation
-const int DBG_TRACE_BASIC = DBGLVL_TRACE_BASIC;
-
-/// This includes messages being sent and received, waiting for messages
-/// and alike.
-const int DBG_TRACE_DETAILED = DBGLVL_TRACE_DETAIL;
-
-// Declaration of the logger.
-extern isc::log::Logger logger;
-
-} // namespace cc
-} // namespace isc
-
-/// \brief Logger for this library
-
-#endif

+ 0 - 8
src/lib/config/TODO

@@ -1,8 +0,0 @@
-Open issues for lib/config:
-
-* Error output currently goes to stdout, and we need to use
-  decent logging for that.
-* Add "expect failure" tests to the unit tests.
-* This cpp version does not use recvmsg() with a sequence number to
-  prevent other messages sneaking in before the answer it expects.
-  (because lib/cc/session.cc|h does not support that yet).

+ 1 - 3
src/lib/config/config_log.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011,2015  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -19,8 +19,6 @@
 namespace isc {
 namespace config {
 
-isc::log::Logger config_logger("config");
-
 isc::log::Logger command_logger("commands");
 
 } // namespace nsas

+ 3 - 11
src/lib/config/config_log.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2011,2015  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -23,20 +23,12 @@ namespace config {
 
 /// @brief Command processing Logger
 ///
-/// Define the logger used to log messages.  We could define it in multiple
-/// modules, but defining in a single module and linking to it saves time and
-/// space.
-extern isc::log::Logger config_logger;
-
-/// @brief Command processing Logger
-///
 /// Define the logger used to log messages related to command processing.
+/// We could define it in multiple modules, but defining in a single
+/// module and linking to it saves time and space.
 extern isc::log::Logger command_logger;
 
 // Enumerate configuration elements as they are processed.
-const int DBG_CONFIG_PROCESS = DBGLVL_TRACE_BASIC;
-
-// Enumerate configuration elements as they are processed.
 const int DBG_COMMAND = DBGLVL_COMMAND;
 
 } // namespace config

+ 0 - 85
src/lib/config/config_messages.mes

@@ -97,88 +97,3 @@ command. If the command socket is open, this command can now be issued.
 This debug message indicates that the daemon stopped supporting specified
 command. This command can no longer be issued. If the command socket is
 open and this command is issued, the daemon will not be able to process it.
-
-% CONFIG_CCSESSION_MSG error in CC session message: %1
-There was a problem with an incoming message on the command and control
-channel. The message does not appear to be a valid command, and is
-missing a required element or contains an unknown data format. This
-most likely means that another Kea module is sending a bad message.
-The message itself is ignored by this module.
-
-% CONFIG_CCSESSION_MSG_INTERNAL error handling CC session message: %1
-There was an internal problem handling an incoming message on the command
-and control channel. An unexpected exception was thrown, details of
-which are appended to the message. The module will continue to run,
-but will not send back an answer.
-
-The most likely cause of this error is a programming error.  Please raise
-a bug report.
-
-% CONFIG_CCSESSION_STOPPING error sending stopping message: %1
-There was a problem when sending a message signaling that the module using
-this CCSession is stopping. This message is sent so that the rest of the
-system is aware that the module is no longer running. Apart from logging
-this message, the error itself is ignored, and the ModuleCCSession is
-still stopped. The specific exception message is printed.
-
-% CONFIG_CCSESSION_STOPPING_UNKNOWN unknown error sending stopping message
-Similar to CONFIG_CCSESSION_STOPPING, but in this case the exception that
-is seen is not a standard exception, and further information is unknown.
-This is a bug.
-
-% CONFIG_GET_FAIL error getting configuration from cfgmgr: %1
-The configuration manager returned an error when this module requested
-the configuration. The full error message answer from the configuration
-manager is appended to the log error. The most likely cause is that
-the module is of a different (command specification) version than the
-running configuration manager.
-
-% CONFIG_JSON_PARSE JSON parse error in %1: %2
-There was an error parsing the JSON file. The given file does not appear
-to be in valid JSON format. Please verify that the filename is correct
-and that the contents are valid JSON.
-
-% CONFIG_LOG_EXPLICIT will use logging configuration for explicitly-named logger %1
-This is a debug message.  When processing the "loggers" part of the
-configuration file, the configuration library found an entry for the named
-logger that matches the logger specification for the program.  The logging
-configuration for the program will be updated with the information.
-
-% CONFIG_LOG_IGNORE_EXPLICIT ignoring logging configuration for explicitly-named logger %1
-This is a debug message.  When processing the "loggers" part of the
-configuration file, the configuration library found an entry for the
-named logger.  As this does not match the logger specification for the
-program, it has been ignored.
-
-% CONFIG_LOG_IGNORE_WILD ignoring logging configuration for wildcard logger %1
-This is a debug message.  When processing the "loggers" part of the
-configuration file, the configuration library found the named wildcard
-entry (one containing the "*" character) that matched a logger already
-matched by an explicitly named entry.  The configuration is ignored.
-
-% CONFIG_LOG_WILD_MATCH will use logging configuration for wildcard logger %1
-This is a debug message.  When processing the "loggers" part of
-the configuration file, the configuration library found the named
-wildcard entry (one containing the "*" character) that matches a logger
-specification in the program. The logging configuration for the program
-will be updated with the information.
-
-% CONFIG_MOD_SPEC_FORMAT module specification error in %1: %2
-The given file does not appear to be a valid specification file: details
-are included in the message. Please verify that the filename is correct
-and that its contents are a valid Kea module specification.
-
-% CONFIG_MOD_SPEC_REJECT module specification rejected by cfgmgr: %1
-The specification file for this module was rejected by the configuration
-manager. The full error message answer from the configuration manager is
-appended to the log error. The most likely cause is that the module is of
-a different (specification file) version than the running configuration
-manager.
-
-% CONFIG_OPEN_FAIL error opening %1: %2
-There was an error opening the given file. The reason for the failure
-is included in the message.
-
-% CONFIG_RPC_SEQ RPC call %1 to %2 with seq %3
-Debug message, saying there's a RPC call of given command to given module. It
-has internal sequence number as listed in the message.

File diff suppressed because it is too large
+ 1 - 85
src/lib/config/documentation.txt


+ 1 - 2
src/lib/config/tests/data_def_unittests_config.h.in

@@ -1,4 +1,4 @@
-// Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")   
+// Copyright (C) 2009, 2015  Internet Systems Consortium, Inc. ("ISC")   
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -13,4 +13,3 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #define TEST_DATA_PATH "@abs_srcdir@/testdata"
-#define LOG_SPEC_FILE "@abs_top_srcdir@/src/bin/cfgmgr/plugins/logging.spec"

+ 0 - 1
src/lib/config/tests/testdata/.gitignore

@@ -1 +0,0 @@
-/b10-config.db

+ 1 - 15
src/lib/config/tests/testdata/Makefile.am

@@ -1,18 +1,4 @@
-CLEANFILES = b10-config.db
-
-BUILT_SOURCES = b10-config.db
-
-# cfgmgr_test (under lib/python) will override b10-config.db, so we make a
-# writable copy in the builddir.
-b10-config.db: b10-config.db.master
-	cp $(srcdir)/b10-config.db.master $@
-
-EXTRA_DIST =  b10-config-bad1.db
-EXTRA_DIST += b10-config-bad2.db
-EXTRA_DIST += b10-config-bad3.db
-EXTRA_DIST += b10-config-bad4.db
-EXTRA_DIST += b10-config.db.master #.db will be auto-generated
-EXTRA_DIST += data22_1.data
+EXTRA_DIST  = data22_1.data
 EXTRA_DIST += data22_2.data
 EXTRA_DIST += data22_3.data
 EXTRA_DIST += data22_4.data

+ 0 - 1
src/lib/config/tests/testdata/b10-config-bad1.db

@@ -1 +0,0 @@
-{"version": 0}

+ 0 - 1
src/lib/config/tests/testdata/b10-config-bad2.db

@@ -1 +0,0 @@
-{'version':

+ 0 - 0
src/lib/config/tests/testdata/b10-config-bad3.db


+ 0 - 1
src/lib/config/tests/testdata/b10-config-bad4.db

@@ -1 +0,0 @@
-{'version': 2}

+ 0 - 1
src/lib/config/tests/testdata/b10-config.db.master

@@ -1 +0,0 @@
-{"version": 2, "TestModule": {"test": 125}}