-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015,2017 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
/// To avoid static initialization fiasco problems, the containers shared by
/// all instances of this class are dynamically allocated on first use, and
/// held in the smart pointers which are de-allocated only when all instances
-/// of the class are destructred. After the object has been created with the
+/// of the class are destructed. After the object has been created with the
/// constructor, the \c MessageInitializer::loadDictionary static function is
/// called to populate the messages defined in various instances of the
/// \c MessageInitializer class to the global dictionary.
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 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
/// @return Returns a DCfgContextBasePtr to the new context instance.
virtual DCfgContextBasePtr createNewContext() = 0;
- /// @brief Replaces existing context with a new, emtpy context.
+ /// @brief Replaces existing context with a new, empty context.
void resetContext();
/// @brief Update the current context.
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015,2017 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
///
/// The method extracts the set of configuration elements for the
/// module-name which matches the controller's app_name_ and passes that
- /// set into @c udpateConfig().
+ /// set into @c updateConfig().
///
/// The file may contain an arbitrary number of other modules.
///
-// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2017 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
/// pointer to instigating IOSignal from which the value of OS signal (i.e.
/// SIGINT, SIGUSR1...) can be obtained. Note that calling popSignal()
/// removes the IOSignalPtr from the queue, which should reduce its
-/// reference count to zero upon exiting the handler (unless a delibrate
+/// reference count to zero upon exiting the handler (unless a deliberate
/// copy of it is made).
///
/// A typical IOSignalHandler might be structured as follows:
/// This class is designed specifically to make managing them painless.
/// It maintains an internal map of IOSignals keyed by sequence_id. When a
/// signal is created via the pushSignal() method it is added to the map. When
-/// a signal is retrevied via the popSignal() method it is removed from the map.
+/// a signal is retrieved via the popSignal() method it is removed from the map.
class IOSignalQueue {
public:
/// @brief Constructor
/// control to IOService::run()).
///
/// @param signum OS signal value of the signal to propagate
- /// @param handler IOSignalHandler to invoke when the signal is delivererd.
+ /// @param handler IOSignalHandler to invoke when the signal is delivered.
///
/// @return The sequence_id of the newly created signal.
///
///
/// @throw IOSignalError if there is no matching IOSignal in the map for
/// the given sequence_id. Other than by doubling popping, this should be
- /// very unlikley.
+ /// very unlikely.
IOSignalPtr popSignal(IOSignalId sequence_id);
/// @brief Erases the contents of the queue.
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015,2017 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
ObservationPtr StatsMgr::getObservation(const std::string& name) const {
/// @todo: Implement contexts.
- // Currently we keep everyting in a global context.
+ // Currently we keep everything in a global context.
return (global_->get(name));
}
void StatsMgr::addObservation(const ObservationPtr& stat) {
/// @todo: Implement contexts.
- // Currently we keep everyting in a global context.
+ // Currently we keep everything in a global context.
return (global_->add(stat));
}
bool StatsMgr::deleteObservation(const std::string& name) {
/// @todo: Implement contexts.
- // Currently we keep everyting in a global context.
+ // Currently we keep everything in a global context.
return (global_->del(name));
}
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015,2017 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
/// As of May 2015, Tomek ran performance benchmarks (see unit-tests in
/// stats_mgr_unittest.cc with performance in their names) and it seems
/// the code is able to register ~2.5-3 million observations per second, even
-/// with 1000 different statistics recored. That seems sufficient for now,
+/// with 1000 different statistics recorded. That seems sufficient for now,
/// so there is no immediate need to develop any multi-threading solutions
/// for now. However, should this decision be revised in the future, the
/// best place for it would to be modify @ref addObservation method here.
/// significantly. While it's possible to log on sufficiently high debug
/// level, such a log would be not that useful)
/// - dependency (statistics are intended to be a lightweight library, adding
-/// dependency on libkea-log, which has its own dependecies, including
+/// dependency on libkea-log, which has its own dependencies, including
/// external log4cplus, is against 'lightweight' design)
/// - if logging of specific statistics is warranted, it is recommended to
/// add log entries in the code that calls StatsMgr.
-# Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014-2015,2017 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
# This function uses PID file to obtain the PID and then calls
# 'kill -0 <pid>' to check if the process is alive.
# The PID files are expected to be located in the ${PID_FILE_PATH},
-# and their names should match the follwing pattern:
+# and their names should match the following pattern:
# <cfg_file_name>.<proc_name>.pid. If the <cfg_file_name> is not
# specified a 'test_config' is used by default.
#
# _GET_RECONFIGS: number of configurations so far.
# _GET_RECONFIG_ERRORS: number of configuration errors.
get_reconfigs() {
- # Grep log file for CONFIG_COMPLETE occurences. There should
- # be one occurence per (re)configuration.
+ # Grep log file for CONFIG_COMPLETE occurrences. There should
+ # be one occurrence per (re)configuration.
_GET_RECONFIGS=$( grep -o CONFIG_COMPLETE ${LOG_FILE} | wc -w )
# Grep log file for CONFIG_LOAD_FAIL to check for configuration
# failures.
}
# Exists the test in the clean way.
-# It peformes the cleanup and prints whether the test has passed or failed.
+# It performes the cleanup and prints whether the test has passed or failed.
# If a test fails, the Kea log is dumped.
clean_exit() {
exit_code=${1} # Exit code to be returned by the exit function.
# of message occurrences to show up. If the expected number of
# message doesn't occur, the error status is returned.
# Return value:
-# _WAIT_FOR_MESSAGE: 0 if the message hasn't occured, 1 otherwise.
+# _WAIT_FOR_MESSAGE: 0 if the message hasn't occurred, 1 otherwise.
wait_for_message() {
local timeout=${1} # Expected timeout value in seconds.
local message="${2}" # Expected message id.
# Waits for server to be down.
# Return value:
-# _WAIT_FOR_SERVER_DOWN: 1 if server is down, 0 if timeout occured and the
+# _WAIT_FOR_SERVER_DOWN: 1 if server is down, 0 if timeout occurred and the
# server is still running.
wait_for_server_down() {
local timeout=${1} # Timeout specified in seconds.
-// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2017 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
/// true, the file will be opened and the internal pointer will be set
/// to the end of file.
///
- /// @param seek_to_end A boolean value which indicates if the intput and
+ /// @param seek_to_end A boolean value which indicates if the input and
/// output file pointer should be set at the end of file.
///
/// @throw CSVFileError when IO operation fails.
-// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2015,2017 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
/// after every start of your process. Calling srand() is enough. This
/// method uses default rand(), which is usually a LCG pseudo-random
/// number generator, so it is not suitable for security
-/// purposes. Please get a decent PRNG implementation, like Mersene
+/// purposes. Please get a decent PRNG implementation, like Mersenne
/// twister, if you are doing anything related with security.
///
/// PRNG initialization is left out of this function on purpose. It may
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 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
void
StateModel::startModel(const int start_state) {
- // Intialize dictionaries of events and states.
+ // Initialize dictionaries of events and states.
initDictionaries();
// Set the current state to starting state and enter the run loop.
getState(END_ST);
}
-void
+void
StateModel::onModelFailure(const std::string&) {
// Empty implementation to make deriving classes simpler.
}
-// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2017 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
/// @brief Adds a state definition to the set of states.
///
/// @param value is the numeric value of the state
- /// @param label is the text label to assig to the state
+ /// @param label is the text label to assign to the state
/// @param handler is the bound instance method which handles the state's
///
/// @throw StateModelError if the value is already defined in the set, or
/// @brief Begins execution of the model.
///
/// This method invokes initDictionaries method to initialize the event
- /// and state dictionaries and then starts the model execution setting
+ /// and state dictionaries and then starts the model execution setting
/// the current state to the given start state, and the event to START_EVT.
///
/// @param start_state is the state in which to begin execution.
/// @brief Initializes the event and state dictionaries.
///
/// This method invokes the define and verify methods for both events and
- /// states to initialize their respective dictionaries.
+ /// states to initialize their respective dictionaries.
///
/// @throw StateModelError or others indirectly, as this method calls
/// dictionary define and verify methods.
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015,2017 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
///
/// This method is used internally by the @c StopwatchImpl class and
/// its derivations. This class simply returns the value of
- /// @c boost::posix_time::micrisec_clock::univeral_time(), which is
+ /// @c boost::posix_time::microsec_clock::univeral_time(), which is
/// a current timestamp. The derivations may replace it with the
/// custom implementations. The typical use case is for the unit tests
/// to customize the behavior of this function to return well known
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015,2017 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
/// @brief Returns the number of valid columns found in the header
/// For newly created files this will always match the number of defined
/// columns (i.e. getColumnCount()). For existing files, this will be
- /// the number of columns in the header that match the defined columnns.
+ /// the number of columns in the header that match the defined columns.
/// When this number is less than getColumnCount() it means the input file
/// is from an earlier schema. This value is zero until the file has
/// been opened.
/// true, the file will be opened and the internal pointer will be set
/// to the end of file.
///
- /// @param seek_to_end A boolean value which indicates if the intput and
+ /// @param seek_to_end A boolean value which indicates if the input and
/// output file pointer should be set at the end of file.
///
/// @throw VersionedCSVFileError if schema has not been defined,
-// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015,2017 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
// destructors that throw.
if (source_ != SOCKET_NOT_VALID) {
if (close(source_)) {
- // An error occured.
+ // An error occurred.
s << "Could not close source: " << strerror(errno);
}
if (sink_ != SOCKET_NOT_VALID) {
if (close(sink_)) {
- // An error occured.
+ // An error occurred.
if (error_string.empty()) {
s << "could not close sink: " << strerror(errno);
}
-// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2017 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
}
}
- // All done, add the last message to the global dictionaty.
+ // All done, add the last message to the global dictionary.
if (!msgid.empty()) {
addToDictionary(msgid, msgtext, description, filename);
}
if (line[0] != '#') {
lines1.push_back(line);
}
- }
+ }
// Remove leading/trailing empty line sequences from the result
LinesType lines2 = removeEmptyLeadingTrailing(lines1);