|
@@ -1,4 +1,4 @@
|
|
|
-// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC")
|
|
|
+// Copyright (C) 2013 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,31 +13,31 @@
|
|
|
// PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
#include <config.h>
|
|
|
-#include <d2srv/d2srv_log.h>
|
|
|
+#include <d2/d2_log.h>
|
|
|
#include <log/logger_support.h>
|
|
|
#include <log/logger_manager.h>
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
-using namespace isc::d2srv;
|
|
|
+using namespace isc::d2;
|
|
|
using namespace std;
|
|
|
|
|
|
/// This file contains entry point (main() function) for standard DHCP-DDNS
|
|
|
-/// server, b10-d2srv, component for BIND10 framework. It parses command-line
|
|
|
+/// 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 d2srvSession.
|
|
|
+/// D2Server and other classes, see \ref d2Session.
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
-const char* const D2SRV_NAME = "b10-d2srv";
|
|
|
+const char* const D2_NAME = "b10-d2";
|
|
|
|
|
|
void
|
|
|
usage() {
|
|
|
- cerr << "Usage: " << D2SRV_NAME << " [-v] [-s] [-p number]" << endl;
|
|
|
+ cerr << "Usage: " << D2_NAME << " [-v] [-s]" << endl;
|
|
|
cerr << " -v: verbose output" << endl;
|
|
|
cerr << " -s: stand-alone mode (don't connect to BIND10)" << endl;
|
|
|
exit(EXIT_FAILURE);
|
|
@@ -47,6 +47,12 @@ usage() {
|
|
|
int
|
|
|
main(int argc, char* argv[]) {
|
|
|
int ch;
|
|
|
+
|
|
|
+ // 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?
|
|
|
|
|
@@ -72,18 +78,20 @@ main(int argc, char* argv[]) {
|
|
|
|
|
|
// Initialize logging. If verbose, we'll use maximum verbosity.
|
|
|
// If standalone is enabled, do not buffer initial log messages
|
|
|
- isc::log::initLogger(D2SRV_NAME,
|
|
|
+ isc::log::initLogger(D2_NAME,
|
|
|
(verbose_mode ? isc::log::DEBUG : isc::log::INFO),
|
|
|
isc::log::MAX_DEBUG_LEVEL, NULL, !stand_alone);
|
|
|
- LOG_INFO(d2srv_logger, D2SRV_STARTING);
|
|
|
- LOG_DEBUG(d2srv_logger, DBGLVL_START_SHUT, D2SRV_START_INFO)
|
|
|
+ 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" );
|
|
|
|
|
|
|
|
|
- int ret = EXIT_SUCCESS;
|
|
|
+ // 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);
|
|
|
- LOG_INFO(d2srv_logger, D2SRV_SHUTDOWN);
|
|
|
- return (ret);
|
|
|
+ LOG_INFO(d2_logger, D2_SHUTDOWN);
|
|
|
+ return (EXIT_SUCCESS);
|
|
|
}
|
|
|
|