Commits

Marek Denis  committed ab3c10f

Logging module now called DionaeaLogger. Fixed database handling in logger.

  • Participants
  • Parent commits f2aca66

Comments (0)

Files changed (15)

File conf/quechua.conf.dist

 
 quechua: {
     libraries: {
-        load = ["stdch","stubproc","filelogger","reverter","stubalg","dnchan","ipproc","postprocessortest"];
+        load = ["stdch","stubproc","filelogger","reverter","stubalg","dnchan","ipproc","dionaealogger"];
         files= {stdch = "stdch.so";
                 stubproc="stdch.so";
                 filelogger = "stdch.so";
                 stubalg="algorithmstub.so";
                 dnchan="dnchan.so";
                 ipproc="ipproc.so";
-                postprocessortest="postprocessortest.so";
+                dionaealogger="dionaealogger.so";
         };
         
     };
     };
 
     loggers: {
-        load = ["postprocessortest","filelogger"];
+        load = ["dionaealogger","filelogger"];
         filelogger: {
         };
 
-        postprocessortest: {
+        dionaealogger: {
             user="user";
             password="secret";
             hostname="hostname";
             processor: {
                 name = "ipproc";
             };
-            logger = "postprocessortest";
+            logger = "dionaealogger";
 
             type = "oneshot"; // possibilites are [scheduled,triggered,oneshot]
             schedule = "5s"; 

File configure.ac

                  modules/channel/dionaeaHarvester/Makefile
                  modules/processor/IpProcessor/Makefile
                  modules/logger/Makefile
-                 modules/logger/postprocessortest/Makefile])
+                 modules/logger/dionaealogger/Makefile])
 PKG_CHECK_MODULES([GLIBMM],[glibmm-2.4 >= 2.24.2])
 PKG_CHECK_MODULES([LIBCONFIGXX],[libconfig++ >= 1.3.2])
 # Check for extra libraries

File include/types.h

 
 typedef std::bad_alloc alloc_ex;
 
+typedef std::logic_error logic_ex;
+
 typedef pqxx::work dbwork_t;
 typedef pqxx::connection dbconnection_t;
 typedef pqxx::result dbresult_t;

File modules/channel/dionaeaHarvester/dionaeaHarvester.cc

 inline bool DionaeaHarvester::check_and_complain_connection(const dbconnection_t* c) {
     if(check_connection(c))
         return true;
-    LOG(ERROR) << "DionaeaHarvester, check your database and/or connection";
+    LOG(ERROR) << internal->name << ": check your database and/or connection";
     return false;
 };
 

File modules/channel/dionaeaHarvester/selects.cc

                                                  "remote_host, remote_port "
                                                  "FROM dionaea.connections "
                                                  "WHERE connection_timestamp BETWEEN "
-                                                 "%s AND %s ORDER BY connection ; ";
-//                                                 "CURRENT_TIMESTAMP - interval '10 years '  AND CURRENT_TIMESTAMP ORDER BY connection LIMIT 100; ";
+//                                                 "%s AND %s ORDER BY connection ; ";
+                                                 "CURRENT_TIMESTAMP - interval '10 years '  AND CURRENT_TIMESTAMP ORDER BY connection LIMIT 10000; ";
 ;

File modules/logger/Makefile.am

 
 AUTOMAKE_OPTIONS = foreign
 
-SUBDIRS =  postprocessortest
-DIST_SUBDIRS = postprocessortest
+SUBDIRS =  dionaealogger
+DIST_SUBDIRS = dionaealogger

File modules/logger/Makefile.in

 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
-SUBDIRS = postprocessortest
-DIST_SUBDIRS = postprocessortest
+SUBDIRS = dionaealogger
+DIST_SUBDIRS = dionaealogger
 all: all-recursive
 
 .SUFFIXES:

File modules/logger/dionaealogger/Makefile.am

+# $Id$
+#
+
+AUTOMAKE_OPTIONS = foreign
+
+AM_CFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/src
+AM_CFLAGS+=`pkg-config --cflags glibmm-2.4`
+AM_CFLAGS+=-fno-strict-aliasing -fPIC -std=c++0x
+
+AM_LDFLAGS=`pkg-config --libs glibmm-2.4`
+
+
+pkglib_LTLIBRARIES = dionaealogger.la
+
+dionaealogger_la_SOURCES=../../../src/interface-logger.cc
+dionaealogger_la_SOURCES+= dionaealogger.cc
+dionaealogger_la_SOURCES+= ../../data/indextransactions.cc
+dionaealogger_la_SOURCES+= ../../data/itemsets.cc
+
+dionaealogger_la_LDFLAGS = -module  -no-undefined -avoid-version ${AM_LDFLAGS} ${AM_CFLAGS}
+
+dionaealogger_la_CPPFLAGS = ${AM_CFLAGS}
+

File modules/logger/dionaealogger/Makefile.in

+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# $Id$
+#
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = modules/logger/dionaealogger
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+dionaealogger_la_LIBADD =
+am_dionaealogger_la_OBJECTS = dionaealogger_la-interface-logger.lo \
+	dionaealogger_la-dionaealogger.lo \
+	dionaealogger_la-indextransactions.lo \
+	dionaealogger_la-itemsets.lo
+dionaealogger_la_OBJECTS = $(am_dionaealogger_la_OBJECTS)
+dionaealogger_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(dionaealogger_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(dionaealogger_la_SOURCES)
+DIST_SOURCES = $(dionaealogger_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GLIBMM_CFLAGS = @GLIBMM_CFLAGS@
+GLIBMM_LIBS = @GLIBMM_LIBS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCONFIGXX_CFLAGS = @LIBCONFIGXX_CFLAGS@
+LIBCONFIGXX_LIBS = @LIBCONFIGXX_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+acx_pthread_config = @acx_pthread_config@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src `pkg-config \
+	--cflags glibmm-2.4` -fno-strict-aliasing -fPIC -std=c++0x
+AM_LDFLAGS = `pkg-config --libs glibmm-2.4`
+pkglib_LTLIBRARIES = dionaealogger.la
+dionaealogger_la_SOURCES = ../../../src/interface-logger.cc \
+	dionaealogger.cc ../../data/indextransactions.cc \
+	../../data/itemsets.cc
+dionaealogger_la_LDFLAGS = -module  -no-undefined -avoid-version ${AM_LDFLAGS} ${AM_CFLAGS}
+dionaealogger_la_CPPFLAGS = ${AM_CFLAGS}
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modules/logger/dionaealogger/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign modules/logger/dionaealogger/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+dionaealogger.la: $(dionaealogger_la_OBJECTS) $(dionaealogger_la_DEPENDENCIES) 
+	$(dionaealogger_la_LINK) -rpath $(pkglibdir) $(dionaealogger_la_OBJECTS) $(dionaealogger_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dionaealogger_la-dionaealogger.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dionaealogger_la-indextransactions.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dionaealogger_la-interface-logger.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dionaealogger_la-itemsets.Plo@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+@am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+dionaealogger_la-interface-logger.lo: ../../../src/interface-logger.cc
+@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dionaealogger_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dionaealogger_la-interface-logger.lo -MD -MP -MF $(DEPDIR)/dionaealogger_la-interface-logger.Tpo -c -o dionaealogger_la-interface-logger.lo `test -f '../../../src/interface-logger.cc' || echo '$(srcdir)/'`../../../src/interface-logger.cc
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dionaealogger_la-interface-logger.Tpo $(DEPDIR)/dionaealogger_la-interface-logger.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../../../src/interface-logger.cc' object='dionaealogger_la-interface-logger.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dionaealogger_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dionaealogger_la-interface-logger.lo `test -f '../../../src/interface-logger.cc' || echo '$(srcdir)/'`../../../src/interface-logger.cc
+
+dionaealogger_la-dionaealogger.lo: dionaealogger.cc
+@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dionaealogger_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dionaealogger_la-dionaealogger.lo -MD -MP -MF $(DEPDIR)/dionaealogger_la-dionaealogger.Tpo -c -o dionaealogger_la-dionaealogger.lo `test -f 'dionaealogger.cc' || echo '$(srcdir)/'`dionaealogger.cc
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dionaealogger_la-dionaealogger.Tpo $(DEPDIR)/dionaealogger_la-dionaealogger.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='dionaealogger.cc' object='dionaealogger_la-dionaealogger.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dionaealogger_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dionaealogger_la-dionaealogger.lo `test -f 'dionaealogger.cc' || echo '$(srcdir)/'`dionaealogger.cc
+
+dionaealogger_la-indextransactions.lo: ../../data/indextransactions.cc
+@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dionaealogger_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dionaealogger_la-indextransactions.lo -MD -MP -MF $(DEPDIR)/dionaealogger_la-indextransactions.Tpo -c -o dionaealogger_la-indextransactions.lo `test -f '../../data/indextransactions.cc' || echo '$(srcdir)/'`../../data/indextransactions.cc
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dionaealogger_la-indextransactions.Tpo $(DEPDIR)/dionaealogger_la-indextransactions.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../../data/indextransactions.cc' object='dionaealogger_la-indextransactions.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dionaealogger_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dionaealogger_la-indextransactions.lo `test -f '../../data/indextransactions.cc' || echo '$(srcdir)/'`../../data/indextransactions.cc
+
+dionaealogger_la-itemsets.lo: ../../data/itemsets.cc
+@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dionaealogger_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dionaealogger_la-itemsets.lo -MD -MP -MF $(DEPDIR)/dionaealogger_la-itemsets.Tpo -c -o dionaealogger_la-itemsets.lo `test -f '../../data/itemsets.cc' || echo '$(srcdir)/'`../../data/itemsets.cc
+@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dionaealogger_la-itemsets.Tpo $(DEPDIR)/dionaealogger_la-itemsets.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../../data/itemsets.cc' object='dionaealogger_la-itemsets.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dionaealogger_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dionaealogger_la-itemsets.lo `test -f '../../data/itemsets.cc' || echo '$(srcdir)/'`../../data/itemsets.cc
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

File modules/logger/dionaealogger/dionaealogger.cc

+/* 
+ * Quechua - the lightweight data mining framework
+ *
+ * Copyright (C) 2012 Marek Denis <quechua@octogan.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dionaealogger.h"
+
+char DionaeaLogger::buf[1024];
+
+DionaeaLogger::DionaeaLogger() : Logger(),connection(NULL) {
+};
+
+DionaeaLogger::~DionaeaLogger() {
+   if(connection) stop();
+}
+
+bool  DionaeaLogger::load_misc_conf(const setting_t& misc) {
+   try {
+       misc.lookupValue("user",credentials.user);
+       misc.lookupValue("password",credentials.password);
+       misc.lookupValue("hostname",credentials.hostname);
+       misc.lookupValue("database",credentials.database);
+   } catch(setting_ex& ex) {
+      LOG(WARN) << internal->name << ": One of the required settings was not found. "
+                << "You must specify: "
+                << "-user\n-pass\n-hostname\n-database name";
+       return false;
+   }
+   return true;
+}
+
+bool DionaeaLogger::prepare() {
+   string_t connection_credentials = "dbname=" + credentials.database + 
+                                     " user=" + credentials.user +
+                                     " password=" + credentials.password + 
+                                     " host=" + credentials.hostname;
+   try {
+       connection = new dbconnection_t(connection_credentials);
+   } catch(alloc_ex& ex) {
+       LOG(ERROR) << internal->name << ": Cannot allocate memory for connection object";
+       return false;
+   } catch(connection_ex& ex) {
+       LOG(WARN) << internal->name << ": Database connection problem";
+       delete connection;
+       connection = NULL;
+       return false;
+   } catch(exception& ex) {
+       LOG(WARN) << internal->name << ": Unexpected exception catched: " << ex.what();
+       delete connection;
+       connection = NULL;
+       return false;
+   }
+
+   LOG(INFO) << internal->name << ": Connected to "<< credentials.user << "@" 
+             << credentials.hostname << ":" << credentials.database;
+   return true;
+};
+
+bool DionaeaLogger::stop() {
+   if(!connection)
+       return true;
+   connection->disconnect();
+   LOG(INFO) << internal->name << ": Disconnected from " << credentials.user << "@" 
+             << credentials.hostname << ":" << credentials.database;
+   connection=NULL;
+   return true;
+}
+
+void DionaeaLogger::logwork(datapack_ptr data) {
+   DionaeaConnections* connections = dynamic_cast<DionaeaConnections*>(data.get());
+   db_stamp*           stamp       = dynamic_cast<db_stamp*>(connections->getstamp().get());
+
+   list<DionaeaConnections::unindexedTransaction*>::iterator it;
+   list<DionaeaConnections::unindexedTransaction*>::iterator end;
+   it = connections->rows.begin();
+   end= connections->rows.end();
+    
+   try {
+     if(!check_and_complain_connection(connection))
+         return;
+
+     dbwork_t work(*connection);
+     index_t oid = 0;
+
+     if(!(oid = get_oid(&work)))
+         return;
+     if(!insert_into_operation(&work,oid,stamp->from,stamp->to))
+         return;
+
+     for(;it!=connections->rows.end();++it) {
+         if(!insert_into_freq_itemsets(&work,oid,*it))
+             return;
+     }
+       work.commit();
+    
+   } catch(connection_ex& ex) {
+       LOG(ERROR) << internal->name << ": Check your database and/or connection";
+   } catch (commit_ex& ex) {
+       LOG(WARN) << internal->name << ": "
+                 << "Not sure whether transaction was commited "
+                 << ex.what();
+   } catch(exception& ex) {
+       LOG(ERROR) << internal->name << ": Unhandled exception caught: " << ex.what();
+   }
+}
+
+char* DionaeaLogger::quotize(char* dst, size_t n, const char* src) {
+   memset(dst,0,n);
+   snprintf(dst,n,"'%s'",src);
+   return dst;
+};
+
+inline bool DionaeaLogger::check_connection(const dbconnection_t* c) {
+    return c && c->is_open();
+};
+
+inline bool DionaeaLogger::check_and_complain_connection(const dbconnection_t* c) {
+    if(check_connection(c))
+        return true;
+    LOG(ERROR) << internal->name << ": check your database and/or connection";
+    return false;
+};
+
+bool DionaeaLogger::exec_query(dbwork_t& w,dbresult_t& r, const char* q, bool commit) {
+    try {
+        r = w.exec(q);
+        if(commit)
+            w.commit();
+    } catch(connection_ex& ex) {
+        LOG(ERROR) << internal->name << ": Check your database and/or connection "
+                   << ex.what();
+        return false;
+    } catch (undefined_column_ex& ex) {
+        LOG(ERROR) << internal->name << ": Missing column? Check your SQL query and/or database, something is wrong\n"
+                   << "Query executed: " << q
+                   << " " << ex.what();
+        return false;
+        
+    } catch (commit_ex& ex) {
+        LOG(WARN) << internal->name  << ": Not sure whether transaction was commited. " 
+                  << ex.what();
+        return false;
+
+    } catch(undef_table_ex& ex) {
+        LOG(ERROR) << internal->name  << ": Trying to read from non existed table while executing SQL: " 
+                   << q << " " << ex.what();
+        return false;
+
+    } catch(sql_ex& ex) {
+        LOG(ERROR) << internal->name << ": For SQL: " << q
+                   << " an SQL exception was caught, discarding the data "
+                   << ex.what();
+        return false;
+
+    } catch(logic_ex& ex) {
+        LOG(CRITIC) << internal->name << ": logic_error exception was caught when executing SQL query. "
+                    << ex.what();
+        return false;
+
+    } catch(exception& ex) {
+        LOG(CRITIC) << internal->name << ": While executing SQL: " << q << " unhandled exception was catched, rethrowing";
+        throw ex;
+    }
+
+    return true;
+}
+
+index_t DionaeaLogger::get_oid(dbwork_t* w) {
+    static const char* sel_oid="SELECT nextval('miner.operation_id_seq');";
+    dbresult_t result;
+
+    if(!exec_query(*w,result,sel_oid,false) || result.empty() ) {
+        LOG(ERROR) << internal->name << ": Couldn't fetch oid";
+        return 0;
+    }
+    return result[0][0].as<index_t>();
+  
+}
+
+bool DionaeaLogger::insert_into_operation(dbwork_t* w, index_t& oid, const string_t& from, const string_t& to) {
+   static const char* insert_op = "INSERT INTO miner.operation (id,start_time,end_time) VALUES (%lu, %s, %s);";
+   memset(buf,0,1024);
+   snprintf(buf,1024,insert_op,oid,from.c_str(),to.c_str());
+   dbresult_t r; // we need faked object for exec_query() - how about making it static ?
+   return exec_query(*w,r,buf,false);
+// w->exec(buf);
+}
+
+bool DionaeaLogger::insert_into_freq_itemsets(dbwork_t* w,index_t& oid,DionaeaConnections::unindexedTransaction* txn) {
+   static char proto[8];
+   static char src_host[64];
+   static char dst_host[64];
+   static const char* insert = "INSERT INTO miner.freq_itemsets (oid, protocol, remote_host, remote_port, local_host, local_port, count, generator) VALUES (%lu, %s, %s, %d, %s, %d, %d, %s);";
+
+   memset(buf,0,1024);
+   snprintf(buf,1024,insert,oid,
+   txn->protocol?quotize(proto,8,txn->protocol):"NULL", // proto
+   txn->src_host?quotize(src_host,64,txn->src_host):"NULL", // remote host
+   txn->src_port,
+   txn->dst_host?quotize(dst_host,64,txn->dst_host):"NULL", // remote host
+   txn->dst_port,
+   txn->count,
+   txn->generator?"true":"false");
+
+   dbresult_t r;// we need faked object for exec_query() - how about making it static ?
+   return exec_query(*w,r,buf,false);
+// w->exec(buf);
+}
+
+

File modules/logger/dionaealogger/dionaealogger.h

+/* 
+ * Quechua - the lightweight data mining framework
+ *
+ * Copyright (C) 2012 Marek Denis <quechua@octogan.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef POSTPROCLOG_H
+#define POSTPROCLOG_H
+
+#include "../../../include/types.h"
+#include "../../../include/interface-common.h"
+#include "../../../include/interface-logger.h"
+#include "../../data/types.h"
+#include "../../data/dionaeaconnections.h"
+#include "../../data/indextransactions.h"
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+using std::exception;
+using std::nothrow;
+
+
+class DionaeaLogger : public Logger {
+    struct credentials_s {
+        string_t user;
+        string_t password;
+        string_t hostname;
+        string_t database;
+    };
+ protected: 
+        dbconnection_t* connection;
+        credentials_s credentials;
+        static char buf[1024];
+        /* internal methods */
+        char* quotize(char* dst, size_t n, const char* src);
+        inline bool check_connection(const dbconnection_t* c);
+        inline bool check_and_complain_connection(const dbconnection_t* c);
+        bool exec_query(dbwork_t& w,dbresult_t& r, const char* q,bool commit = false);
+        index_t get_oid(dbwork_t* w);
+        bool insert_into_operation(dbwork_t* w, index_t& oid, const string_t& from, const string_t& to);
+        bool insert_into_freq_itemsets(dbwork_t* w,index_t& oid,DionaeaConnections::unindexedTransaction* txn);
+ public:
+    DionaeaLogger();
+    virtual ~DionaeaLogger();
+
+    bool load_misc_conf(const setting_t& misc);
+   
+    bool prepare();
+    bool stop();
+    void logwork(datapack_ptr data);
+
+}; // DionaeaLogger
+
+extern "C" Logger* create_logger() {
+    return new DionaeaLogger();
+};
+
+#endif 

File modules/logger/postprocessortest/Makefile.am

-# $Id$
-#
-
-AUTOMAKE_OPTIONS = foreign
-
-AM_CFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/src
-AM_CFLAGS+=`pkg-config --cflags glibmm-2.4`
-AM_CFLAGS+=-fno-strict-aliasing -fPIC -std=c++0x
-
-AM_LDFLAGS=`pkg-config --libs glibmm-2.4`
-
-
-pkglib_LTLIBRARIES = postprocessortest.la
-
-#postprocessortest_la_SOURCES = ../../../src/interface-logger.cc iplogger.cc ../../data/indextransactions.cc ../../data/itemsets.cc
-
-postprocessortest_la_SOURCES=../../../src/interface-logger.cc
-postprocessortest_la_SOURCES+=iplogger.cc
-postprocessortest_la_SOURCES+=../../data/indextransactions.cc
-postprocessortest_la_SOURCES+=../../data/itemsets.cc
-
-postprocessortest_la_LDFLAGS = -module  -no-undefined -avoid-version ${AM_LDFLAGS} ${AM_CFLAGS}
-
-postprocessortest_la_CPPFLAGS = ${AM_CFLAGS}
-

File modules/logger/postprocessortest/Makefile.in

-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# $Id$
-#
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = modules/logger/postprocessortest
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
-	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
-	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
-	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-postprocessortest_la_LIBADD =
-am_postprocessortest_la_OBJECTS =  \
-	postprocessortest_la-interface-logger.lo \
-	postprocessortest_la-iplogger.lo \
-	postprocessortest_la-indextransactions.lo \
-	postprocessortest_la-itemsets.lo
-postprocessortest_la_OBJECTS = $(am_postprocessortest_la_OBJECTS)
-postprocessortest_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
-	$(CXXFLAGS) $(postprocessortest_la_LDFLAGS) $(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(postprocessortest_la_SOURCES)
-DIST_SOURCES = $(postprocessortest_la_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GLIBMM_CFLAGS = @GLIBMM_CFLAGS@
-GLIBMM_LIBS = @GLIBMM_LIBS@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBCONFIGXX_CFLAGS = @LIBCONFIGXX_CFLAGS@
-LIBCONFIGXX_LIBS = @LIBCONFIGXX_LIBS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PTHREAD_CC = @PTHREAD_CC@
-PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
-PTHREAD_LIBS = @PTHREAD_LIBS@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-acx_pthread_config = @acx_pthread_config@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = @pkgpythondir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
-AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src `pkg-config \
-	--cflags glibmm-2.4` -fno-strict-aliasing -fPIC -std=c++0x
-AM_LDFLAGS = `pkg-config --libs glibmm-2.4`
-pkglib_LTLIBRARIES = postprocessortest.la
-
-#postprocessortest_la_SOURCES = ../../../src/interface-logger.cc iplogger.cc ../../data/indextransactions.cc ../../data/itemsets.cc
-postprocessortest_la_SOURCES = ../../../src/interface-logger.cc \
-	iplogger.cc ../../data/indextransactions.cc \
-	../../data/itemsets.cc
-postprocessortest_la_LDFLAGS = -module  -no-undefined -avoid-version ${AM_LDFLAGS} ${AM_CFLAGS}
-postprocessortest_la_CPPFLAGS = ${AM_CFLAGS}
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cc .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modules/logger/postprocessortest/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign modules/logger/postprocessortest/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-postprocessortest.la: $(postprocessortest_la_OBJECTS) $(postprocessortest_la_DEPENDENCIES) 
-	$(postprocessortest_la_LINK) -rpath $(pkglibdir) $(postprocessortest_la_OBJECTS) $(postprocessortest_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postprocessortest_la-indextransactions.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postprocessortest_la-interface-logger.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postprocessortest_la-iplogger.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/postprocessortest_la-itemsets.Plo@am__quote@
-
-.cc.o:
-@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cc.obj:
-@am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cc.lo:
-@am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-postprocessortest_la-interface-logger.lo: ../../../src/interface-logger.cc
-@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(postprocessortest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT postprocessortest_la-interface-logger.lo -MD -MP -MF $(DEPDIR)/postprocessortest_la-interface-logger.Tpo -c -o postprocessortest_la-interface-logger.lo `test -f '../../../src/interface-logger.cc' || echo '$(srcdir)/'`../../../src/interface-logger.cc
-@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/postprocessortest_la-interface-logger.Tpo $(DEPDIR)/postprocessortest_la-interface-logger.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../../../src/interface-logger.cc' object='postprocessortest_la-interface-logger.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(postprocessortest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o postprocessortest_la-interface-logger.lo `test -f '../../../src/interface-logger.cc' || echo '$(srcdir)/'`../../../src/interface-logger.cc
-
-postprocessortest_la-iplogger.lo: iplogger.cc
-@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(postprocessortest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT postprocessortest_la-iplogger.lo -MD -MP -MF $(DEPDIR)/postprocessortest_la-iplogger.Tpo -c -o postprocessortest_la-iplogger.lo `test -f 'iplogger.cc' || echo '$(srcdir)/'`iplogger.cc
-@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/postprocessortest_la-iplogger.Tpo $(DEPDIR)/postprocessortest_la-iplogger.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='iplogger.cc' object='postprocessortest_la-iplogger.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(postprocessortest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o postprocessortest_la-iplogger.lo `test -f 'iplogger.cc' || echo '$(srcdir)/'`iplogger.cc
-
-postprocessortest_la-indextransactions.lo: ../../data/indextransactions.cc
-@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(postprocessortest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT postprocessortest_la-indextransactions.lo -MD -MP -MF $(DEPDIR)/postprocessortest_la-indextransactions.Tpo -c -o postprocessortest_la-indextransactions.lo `test -f '../../data/indextransactions.cc' || echo '$(srcdir)/'`../../data/indextransactions.cc
-@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/postprocessortest_la-indextransactions.Tpo $(DEPDIR)/postprocessortest_la-indextransactions.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../../data/indextransactions.cc' object='postprocessortest_la-indextransactions.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(postprocessortest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o postprocessortest_la-indextransactions.lo `test -f '../../data/indextransactions.cc' || echo '$(srcdir)/'`../../data/indextransactions.cc
-
-postprocessortest_la-itemsets.lo: ../../data/itemsets.cc
-@am__fastdepCXX_TRUE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(postprocessortest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT postprocessortest_la-itemsets.lo -MD -MP -MF $(DEPDIR)/postprocessortest_la-itemsets.Tpo -c -o postprocessortest_la-itemsets.lo `test -f '../../data/itemsets.cc' || echo '$(srcdir)/'`../../data/itemsets.cc
-@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/postprocessortest_la-itemsets.Tpo $(DEPDIR)/postprocessortest_la-itemsets.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='../../data/itemsets.cc' object='postprocessortest_la-itemsets.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(postprocessortest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o postprocessortest_la-itemsets.lo `test -f '../../data/itemsets.cc' || echo '$(srcdir)/'`../../data/itemsets.cc
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-pkglibLTLIBRARIES \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-pkglibLTLIBRARIES
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:

File modules/logger/postprocessortest/iplogger.cc

-/* 
- * Quechua - the lightweight data mining framework
- *
- * Copyright (C) 2012 Marek Denis <quechua@octogan.net>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "iplogger.h"
-
-char PostProcessorLogger::buf[1024];
-
-PostProcessorLogger::PostProcessorLogger() : Logger(),connection(NULL) {
-};
-
-PostProcessorLogger::~PostProcessorLogger() {
-   if(connection) stop();
-}
-
-bool  PostProcessorLogger::load_misc_conf(const setting_t& misc) {
-   try {
-       misc.lookupValue("user",credentials.user);
-       misc.lookupValue("password",credentials.password);
-       misc.lookupValue("hostname",credentials.hostname);
-       misc.lookupValue("database",credentials.database);
-   } catch(setting_ex& ex) {
-      LOG(WARN) << "One of the required settings was not found. "
-                << "You must specify: "
-                << "-user\n-pass\n-hostname\n-database name";
-       return false;
-   }
-   return true;
-}
-
-bool PostProcessorLogger::prepare() {
-   string_t connection_credentials = "dbname=" + credentials.database + 
-                                     " user=" + credentials.user +
-                                     " password=" + credentials.password + 
-                                     " host=" + credentials.hostname;
-   try {
-       connection = new dbconnection_t(connection_credentials);
-   } catch(alloc_ex& ex) {
-       LOG(ERROR) << "dionaeaHarvester: Cannot allocate memory for connection object";
-       return false;
-   } catch(connection_ex& ex) {
-       LOG(WARN) << "PostProcessorLogger: Database connection problem";
-       delete connection;
-       connection = NULL;
-       return false;
-   } catch(exception& ex) {
-       LOG(WARN) << "Unexpected exception catched: " << ex.what();
-       delete connection;
-       connection = NULL;
-       return false;
-   }
-
-   LOG(INFO) << "Connected to "<< credentials.user << "@" 
-             << credentials.hostname << ":" << credentials.database;
-   return true;
-};
-
-bool PostProcessorLogger::stop() {
-   if(!connection)
-       return true;
-   connection->disconnect();
-   LOG(INFO) << "Logger: Disconnected from " << credentials.user << "@" 
-             << credentials.hostname << ":" << credentials.database;
-   connection=NULL;
-   return true;
-}
-
-void PostProcessorLogger::logwork(datapack_ptr data) {
-   DionaeaConnections* connections = dynamic_cast<DionaeaConnections*>(data.get());
-   db_stamp* stamp = dynamic_cast<db_stamp*>(connections->getstamp().get());
-
-   list<DionaeaConnections::unindexedTransaction*>::iterator it;
-   list<DionaeaConnections::unindexedTransaction*>::iterator end;
-   it = connections->rows.begin();
-   end= connections->rows.end();
-
-   dbwork_t work(*connection);
-   index_t oid = 0;
-
-   if(!(oid = get_oid(&work))) return;
-
-   insert_into_operation(&work,oid,stamp->from,stamp->to);
-
-   for(;it!=connections->rows.end();++it) {
-       insert_into_preprocesstest(&work,oid,*it);
-   }
-   try {
-       work.commit();
-   } catch (commit_ex& ex) {
-       LOG(WARN) << "Logger " << internal->name << ". "
-                 << "Not sure whether transaction was commited for oid: " << oid;
-   }
-}
-
-char* PostProcessorLogger::quotize(char* dst, size_t n, const char* src) {
-   memset(dst,0,n);
-   snprintf(dst,n,"'%s'",src);
-   return dst;
-};
-
-index_t PostProcessorLogger::get_oid(dbwork_t* w) {
-   static const char* sel_oid="SELECT nextval('miner.operation_id_seq');";
-   dbresult_t result = w->exec(sel_oid);
-   if(result.empty()) { // error
-       LOG(ERROR) << "Logger "<< internal->name << " at: " << this << " Couldn't fetch oid";
-       return 0;
-   }
-
-   return result[0][0].as<index_t>();
-}
-
-
-
-void PostProcessorLogger::insert_into_operation(dbwork_t* w, index_t& oid, const string_t& from, const string_t& to) {
-   static const char* insert_op = "INSERT INTO miner.operation (id,start_time,end_time) VALUES (%lu, %s, %s);";
-   memset(buf,0,1024);
-   snprintf(buf,1024,insert_op,oid,from.c_str(),to.c_str());
-   w->exec(buf);
-}
-
-void PostProcessorLogger::insert_into_preprocesstest(dbwork_t* w,index_t& oid,DionaeaConnections::unindexedTransaction* txn) {
-   static char proto[8];
-   static char src_host[64];
-   static char dst_host[64];
-   static const char* insert = "INSERT INTO miner.postprocess_test (oid, protocol, remote_host, remote_port, local_host, local_port, count, generator) VALUES (%lu, %s, %s, %d, %s, %d, %d, %s);";
-
-   memset(buf,0,1024);
-   snprintf(buf,1024,insert,oid,
-   txn->protocol?quotize(proto,8,txn->protocol):"NULL", // proto
-   txn->src_host?quotize(src_host,64,txn->src_host):"NULL", // remote host
-   txn->src_port,
-   txn->dst_host?quotize(dst_host,64,txn->dst_host):"NULL", // remote host
-   txn->dst_port,
-   txn->count,
-   txn->generator?"true":"false");
-
-   w->exec(buf);
-}
-
-

File modules/logger/postprocessortest/iplogger.h

-/* 
- * Quechua - the lightweight data mining framework
- *
- * Copyright (C) 2012 Marek Denis <quechua@octogan.net>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef POSTPROCLOG_H
-#define POSTPROCLOG_H
-
-#include "../../../include/types.h"
-#include "../../../include/interface-common.h"
-#include "../../../include/interface-logger.h"
-#include "../../data/types.h"
-#include "../../data/dionaeaconnections.h"
-#include "../../data/indextransactions.h"
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-using std::exception;
-using std::nothrow;
-
-class PostProcessorLogger : public Logger {
-    struct credentials_s {
-        string_t user;
-        string_t password;
-        string_t hostname;
-        string_t database;
-    };
- protected: 
-        dbconnection_t* connection;
-        credentials_s credentials;
-        static char buf[1024];
-        /* internal methods */
-        char* quotize(char* dst, size_t n, const char* src);
-        index_t get_oid(dbwork_t* w);
-        void insert_into_operation(dbwork_t* w, index_t& oid, const string_t& from, const string_t& to);
-        void insert_into_preprocesstest(dbwork_t* w,index_t& oid,DionaeaConnections::unindexedTransaction* txn);
- public:
-    PostProcessorLogger();
-    virtual ~PostProcessorLogger();
-
-    bool load_misc_conf(const setting_t& misc);
-   
-    bool prepare();
-    bool stop();
-    void logwork(datapack_ptr data);
-
-}; // PostProcessorLogger
-
-extern "C" Logger* create_logger() {
-    return new PostProcessorLogger();
-};
-
-#endif