Browse Source

renamed lib/bind-cfgd to lib/config because it will also contain client-config stuff
moved data_def.* and ccsession.* to lib/config/cpp, they are compiled into lib/config/libclient.a (for now)
fixed includes and ldadds for the rest of the stuff

also fixed an include problem in parkinglot/common.h


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@526 e5f2f494-b856-4b98-b285-d166d9295462

Jelte Jansen 15 years ago
parent
commit
0962844906

+ 5 - 3
configure.ac

@@ -130,7 +130,7 @@ AC_CONFIG_FILES([Makefile
                  src/Makefile
                  src/bin/Makefile
                  src/bin/bind10/Makefile
-				 src/bin/cmd-ctrld/Makefile
+                 src/bin/cmd-ctrld/Makefile
                  src/bin/bindctl/Makefile
                  src/bin/host/Makefile
                  src/bin/msgq/Makefile
@@ -138,6 +138,8 @@ AC_CONFIG_FILES([Makefile
                  src/lib/Makefile
                  src/lib/cc/Makefile
                  src/lib/cc/cpp/Makefile
+                 src/lib/config/Makefile
+                 src/lib/config/cpp/Makefile
                  src/lib/dns/Makefile
                ])
 AC_OUTPUT([src/bin/bind-cfgd/bind-cfgd
@@ -145,8 +147,8 @@ AC_OUTPUT([src/bin/bind-cfgd/bind-cfgd
            src/bin/bind10/bind10
            src/bin/bind10/bind10_test
            src/bin/bindctl/run_bindctl
-	   src/bin/msgq/msgq
-	   src/bin/msgq/msgq_test
+           src/bin/msgq/msgq
+           src/bin/msgq/msgq_test
            src/bin/parkinglot/config.h
           ], [
            chmod +x src/bin/bind-cfgd/bind-cfgd

+ 1 - 1
src/bin/bind-cfgd/bind-cfgd.in

@@ -1,6 +1,6 @@
 #!/bin/sh
 # use build time srcdir for now
-BINPATH=@abs_top_srcdir@/src/lib/bind-cfgd/python
+BINPATH=@abs_top_srcdir@/src/lib/config/python
 LIBPATH=@abs_top_srcdir@/src/lib/cc/python
 
 PYTHON_EXEC=${PYTHON_EXEC:-@PYTHON@}

+ 4 - 2
src/bin/parkinglot/Makefile.am

@@ -2,6 +2,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_srcdir)/ext
 
 bin_PROGRAMS = parkinglot
 parkinglot_SOURCES = common.cc common.h zoneset.h zoneset.cc parkinglot.cc
-parkinglot_SOURCES += parkinglot.h ccsession.cc ccsession.h main.cc
+parkinglot_SOURCES += parkinglot.h main.cc
 parkinglot_SOURCES += data_source_plot.h data_source_plot.cc
-parkinglot_LDADD = $(top_srcdir)/src/lib/dns/libdns.a $(top_srcdir)/src/lib/cc/cpp/libcc.a
+parkinglot_LDADD =  $(top_srcdir)/src/lib/dns/libdns.a
+parkinglot_LDADD += $(top_srcdir)/src/lib/config/cpp/libclient.a
+parkinglot_LDADD += $(top_srcdir)/src/lib/cc/cpp/libcc.a

+ 7 - 0
src/bin/parkinglot/common.cc

@@ -13,4 +13,11 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 // $Id$
+#include "common.h"
+#include <iostream>
 
+FatalError::FatalError(std::string m) {
+    msg = m;
+    std::cerr << msg << std::endl;
+    exit(1);
+}

+ 7 - 10
src/bin/parkinglot/common.h

@@ -18,18 +18,15 @@
 #define __COMMON_H 1
 
 #include <stdlib.h>
+#include <string>
 
 class FatalError : public std::exception {
-    public:
-        FatalError(std::string m = "fatal error") {
-            msg = m;
-            std::cerr << msg << std::endl;
-            exit(1);
-        }
-        ~FatalError() throw() {}
-        const char* what() const throw() { return msg.c_str(); }
-    private:
-        std::string msg;
+public:
+    FatalError(std::string m = "fatal error");
+    ~FatalError() throw() {}
+    const char* what() const throw() { return msg.c_str(); }
+private:
+    std::string msg;
 };
 
 #endif // __COMMON_H

+ 4 - 3
src/bin/parkinglot/main.cc

@@ -32,19 +32,20 @@
 
 #include <cc/cpp/session.h>
 #include <cc/cpp/data.h>
+#include <config/cpp/ccsession.h>
 
 #include "zoneset.h"
 #include "parkinglot.h"
-#include "ccsession.h"
 
 #include "common.h"
 
 #include <boost/foreach.hpp>
 
+#include "config.h"
+
 using namespace std;
 
 const string PROGRAM = "ParkingLot";
-const string SPECFILE = "parkinglot.spec";
 const int DNSPORT = 5300;
 
 /* need global var for config/command handlers.
@@ -106,7 +107,7 @@ main(int argc, char* argv[]) {
 
     // initialize command channel
     try {
-        CommandSession cs = CommandSession(PROGRAM, SPECFILE, my_config_handler, my_command_handler);
+        CommandSession cs = CommandSession(PROGRAM, PARKINGLOT_SPECFILE_LOCATION, my_config_handler, my_command_handler);
     
         // main server loop
         fd_set fds;

+ 1 - 1
src/lib/Makefile.am

@@ -1 +1 @@
-SUBDIRS = dns cc
+SUBDIRS = cc config dns

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

@@ -1,7 +1,7 @@
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib/cc/cpp -I$(top_srcdir)/ext -Wall -Werror
 
 lib_LIBRARIES = libcc.a
-libcc_a_SOURCES = data.cc data.h data_def.h data_def.cc session.cc session.h
+libcc_a_SOURCES = data.cc data.h session.cc session.h
 
 TESTS =
 if HAVE_GTEST

+ 1 - 0
src/lib/config/Makefile.am

@@ -0,0 +1 @@
+SUBDIRS = cpp

+ 7 - 0
src/lib/config/cpp/Makefile.am

@@ -0,0 +1,7 @@
+AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_srcdir)/ext -Wall -Werror
+
+lib_LIBRARIES = libclient.a
+libclient_a_SOURCES = data_def.h data_def.cc ccsession.cc ccsession.h
+
+
+

+ 4 - 4
src/bin/parkinglot/ccsession.cc

@@ -33,10 +33,10 @@
 #include <boost/foreach.hpp>
 
 #include <cc/cpp/data.h>
-#include <cc/cpp/data_def.h>
+#include <data_def.h>
 #include <cc/cpp/session.h>
 
-#include "common.h"
+//#include "common.h"
 #include "ccsession.h"
 #include "config.h"
 
@@ -53,9 +53,9 @@ CommandSession::read_data_definition(const std::string& filename) {
     std::ifstream file;
 
     // this file should be declared in a @something@ directive
-    file.open(PARKINGLOT_SPECFILE_LOCATION);
+    file.open(filename.c_str());
     if (!file) {
-        cout << "error opening " << PARKINGLOT_SPECFILE_LOCATION << endl;
+        cout << "error opening " << filename << endl;
         exit(1);
     }
 

+ 1 - 1
src/bin/parkinglot/ccsession.h

@@ -19,8 +19,8 @@
 
 #include <string>
 
+#include <config/cpp/data_def.h>
 #include <cc/cpp/session.h>
-#include <cc/cpp/data_def.h>
 #include <cc/cpp/data.h>
 
 class CommandSession {

src/lib/cc/cpp/data_def.cc → src/lib/config/cpp/data_def.cc


+ 1 - 1
src/lib/cc/cpp/data_def.h

@@ -1,7 +1,7 @@
 #ifndef _DATA_DEF_H
 #define _DATA_DEF_H 1
 
-#include "data.h"
+#include <cc/cpp/data.h>
 
 #include <sstream>
 

src/lib/bind-cfgd/python/bind-cfgd.py → src/lib/config/python/bind-cfgd.py