Commit 0dcc4f4f authored by Thomas Markwalder's avatar Thomas Markwalder

[2954] Additional review comment cleanup.

parent b3dda76d
......@@ -689,6 +689,7 @@ INPUT = ../src/lib/exceptions \
../src/lib/dhcp \
../src/lib/dhcpsrv \
../src/bin/dhcp4 \
../src/bin/d2 \
../tests/tools/perfdhcp \
devel
......
......@@ -53,6 +53,7 @@ nodist_b10_d2_SOURCES = d2_messages.h d2_messages.cc
EXTRA_DIST += d2_messages.mes
b10_d2_LDADD = $(top_builddir)/src/lib/log/libb10-log.la
b10_d2_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
b10_d2dir = $(pkgdatadir)
b10_d2_DATA = d2.spec
......@@ -48,6 +48,14 @@
</cmdsynopsis>
</refsynopsisdiv>
<refsynopsisdiv>
<cmdsynopsis>
<command>b10-d2</command>
<arg><option>-s</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>
......@@ -67,8 +75,16 @@
<varlistentry>
<term><option>-v</option></term>
<listitem><para>
Enable verbose mode.
<!-- TODO: what does this do? -->
Verbose mode sets the logging level to debug. This is primarily
for development purposes in stand-alone mode.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-s</option></term>
<listitem><para>
Causes the process to run without attempting to connect to the
BIND10 message queue. This is for development purposes.
</para></listitem>
</varlistentry>
......
......@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
/// Defines the logger used by the top-level component of b10-dhcp4.
/// Defines the logger used by the top-level component of b10-d2.
#include <d2/d2_log.h>
......
......@@ -22,7 +22,7 @@
namespace isc {
namespace d2 {
/// Define the logger for the "dhcp4" module part of b10-dhcp4. We could define
/// Define the logger for the "d2" module part of b10-d2. We could define
/// a logger in each file, but we would want to define a common name to avoid
/// spelling mistakes, so it is just one small step from there to define a
/// module-common logger.
......
......@@ -19,10 +19,10 @@ This is a debug message issued during a D2 process startup.
% D2_START_INFO pid: %1, verbose: %2, standalone: %3
This is a debug message issued during the D2 process startup.
It lists some information about the parameters with which the
It lists some information about the parameters with which the
process is running.
% D2_SHUTDOWN : process is performing a normal shutting down
This is a debug message issued when a D2 process shuts down
This is a debug message issued when a D2 process shuts down
normally in response to command to stop.
......@@ -23,13 +23,13 @@ using namespace isc::d2;
using namespace std;
/// This file contains entry point (main() function) for standard DHCP-DDNS
/// process, b10-d2, component for BIND10 framework. It parses command-line
/// arguments and instantiates D2Controller class that is responsible for
/// establishing connection with msgq (receiving commands and configuration)
/// process, b10-d2, component for BIND10 framework. It parses command-line
/// arguments and instantiates D2Controller class that is responsible for
/// establishing connection with msgq (receiving commands and configuration)
/// and also creating D2Server object as well.
///
/// For detailed explanation or relations between main(), D2Controller,
/// D2Server and other classes, see \ref d2Session.
/// D2Server and other classes, see \ref d2Session.
namespace {
......@@ -38,8 +38,8 @@ const char* const D2_NAME = "b10-d2";
void
usage() {
cerr << "Usage: " << D2_NAME << " [-v] [-s]" << endl;
cerr << " -v: verbose output" << endl;
cerr << " -s: stand-alone mode (don't connect to BIND10)" << endl;
cerr << " -v: verbose output (only when in stand-alone mode" << endl;
exit(EXIT_FAILURE);
}
} // end of anonymous namespace
......@@ -48,11 +48,10 @@ int
main(int argc, char* argv[]) {
int ch;
// NOTE these parameters are preliminary only. They are here to
// @TODO NOTE these parameters are preliminary only. They are here to
// for symmetry with the DHCP servers. They may or may not
// become part of the eventual implementation.
bool stand_alone = false; // Should be connect to BIND10 msgq?
bool verbose_mode = false; // Should server be verbose?
......@@ -78,16 +77,17 @@ main(int argc, char* argv[]) {
// Initialize logging. If verbose, we'll use maximum verbosity.
// If standalone is enabled, do not buffer initial log messages
// Verbose logging is only enabled when in stand alone mode.
isc::log::initLogger(D2_NAME,
(verbose_mode ? isc::log::DEBUG : isc::log::INFO),
((verbose_mode && stand_alone)
? isc::log::DEBUG : isc::log::INFO),
isc::log::MAX_DEBUG_LEVEL, NULL, !stand_alone);
LOG_INFO(d2_logger, D2_STARTING);
LOG_DEBUG(d2_logger, DBGLVL_START_SHUT, D2_START_INFO)
.arg(getpid()).arg(verbose_mode ? "yes" : "no")
.arg(stand_alone ? "yes" : "no" );
// For now we will sleep awhile to simulate doing something.
// For now we will sleep awhile to simulate doing something.
// Without at least a sleep, the process will start, exit and be
// restarted by Bind10/Init endlessley in a rapid succession.
sleep(1000);
......
......@@ -58,14 +58,8 @@ nodist_d2_unittests_SOURCES = ../d2_messages.h ../d2_messages.cc
d2_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
d2_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
d2_unittests_LDADD = $(GTEST_LDADD)
d2_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libb10-cc.la
d2_unittests_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
d2_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la
d2_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libb10-dhcpsrv.la
d2_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
d2_unittests_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
d2_unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
endif
noinst_PROGRAMS = $(TESTS)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment