[syslog-ng] [PATCH] dummy: Remove this module.

Gergely Nagy algernon at balabit.hu
Mon Mar 26 14:47:35 CEST 2012


The dummy module does nothing, yet, is installed by default. It's not
a terribly great example of a simple module, either. For these reasons
and more, lets bid it a tearful farewell.

Signed-off-by: Gergely Nagy <algernon at balabit.hu>
---
 configure.in                   |    1 -
 modules/Makefile.am            |    2 +-
 modules/dummy/Makefile.am      |   14 -------
 modules/dummy/dummy-grammar.ym |   75 ---------------------------------------
 modules/dummy/dummy-parser.c   |   48 -------------------------
 modules/dummy/dummy-parser.h   |   35 ------------------
 modules/dummy/dummy.c          |   76 ----------------------------------------
 modules/dummy/dummy.h          |   37 -------------------
 8 files changed, 1 insertions(+), 287 deletions(-)
 delete mode 100644 modules/dummy/Makefile.am
 delete mode 100644 modules/dummy/dummy-grammar.ym
 delete mode 100644 modules/dummy/dummy-parser.c
 delete mode 100644 modules/dummy/dummy-parser.h
 delete mode 100644 modules/dummy/dummy.c
 delete mode 100644 modules/dummy/dummy.h

diff --git a/configure.in b/configure.in
index 995c202..d9b50bc 100644
--- a/configure.in
+++ b/configure.in
@@ -1160,7 +1160,6 @@ AC_OUTPUT(dist.conf
 	  lib/Makefile 
 	  syslog-ng/Makefile 
 	  modules/Makefile 
-          modules/dummy/Makefile
           modules/afsocket/Makefile
           modules/afsql/Makefile
           modules/afstreams/Makefile
diff --git a/modules/Makefile.am b/modules/Makefile.am
index bbb3b1a..983f67a 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -1 +1 @@
-SUBDIRS = afsocket afsql afstreams affile afprog afuser afmongodb afsmtp csvparser confgen syslogformat pacctformat basicfuncs dbparser tfjson tfuuid jsonparser dummy
+SUBDIRS = afsocket afsql afstreams affile afprog afuser afmongodb afsmtp csvparser confgen syslogformat pacctformat basicfuncs dbparser tfjson tfuuid jsonparser
diff --git a/modules/dummy/Makefile.am b/modules/dummy/Makefile.am
deleted file mode 100644
index 5e90ff6..0000000
--- a/modules/dummy/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-moduledir = @moduledir@
-AM_CPPFLAGS = -I$(top_srcdir)/lib -I../../lib
-module_LTLIBRARIES = libdummy.la
-
-export top_srcdir
-
-libdummy_la_SOURCES = dummy-grammar.y dummy.c dummy.h dummy-parser.c dummy-parser.h
-libdummy_la_LIBADD = $(MODULE_DEPS_LIBS)
-libdummy_la_LDFLAGS = $(MODULE_LDFLAGS)
-
-BUILT_SOURCES = dummy-grammar.y dummy-grammar.c dummy-grammar.h
-EXTRA_DIST = $(BUILT_SOURCES) dummy-grammar.ym
-
-include $(top_srcdir)/build/lex-rules.am
diff --git a/modules/dummy/dummy-grammar.ym b/modules/dummy/dummy-grammar.ym
deleted file mode 100644
index 3179e11..0000000
--- a/modules/dummy/dummy-grammar.ym
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2002-2010 BalaBit IT Ltd, Budapest, Hungary
- * Copyright (c) 1998-2010 Balázs Scheidler
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * As an additional exemption you are allowed to compile & link against the
- * OpenSSL libraries as published by the OpenSSL project. See the file
- * COPYING for details.
- *
- */
-
-%code requires {
-
-#include "dummy-parser.h"
-
-}
-
-%code {
-
-#include "cfg-parser.h"
-#include "dummy-grammar.h"
-#include "plugin.h"
-
-extern LogDriver *last_driver;
-
-}
-
-%name-prefix "dummy_"
-%lex-param {CfgLexer *lexer}
-%parse-param {CfgLexer *lexer}
-%parse-param {LogDriver **instance}
-%parse-param {gpointer arg}
-
-
-/* INCLUDE_DECLS */
-
-%token KW_DUMMY
-%token KW_DUMMY_OPT
-
-%%
-
-start
-        : LL_CONTEXT_DESTINATION KW_DUMMY
-          {
-            last_driver = *instance = dummy_dd_new();
-          }
-          '(' dummy_options ')'         { YYACCEPT; }
-	;
-
-dummy_options
-        : dummy_option dummy_options
-	|
-	;
-
-dummy_option
-        : KW_DUMMY_OPT '(' yesno ')'    { ((DummyDestDriver *)last_driver)->opt = $3; };
-	| dest_driver_option
-        ;
-
-
-/* INCLUDE_RULES */
-
-%%
diff --git a/modules/dummy/dummy-parser.c b/modules/dummy/dummy-parser.c
deleted file mode 100644
index 2951563..0000000
--- a/modules/dummy/dummy-parser.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2002-2010 BalaBit IT Ltd, Budapest, Hungary
- * Copyright (c) 1998-2010 Balázs Scheidler
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * As an additional exemption you are allowed to compile & link against the
- * OpenSSL libraries as published by the OpenSSL project. See the file
- * COPYING for details.
- *
- */
-
-#include "dummy.h"
-#include "cfg-parser.h"
-#include "dummy-grammar.h"
-
-extern int dummy_debug;
-int dummy_parse(CfgLexer *lexer, DummyDestDriver **instance, gpointer arg);
-
-static CfgLexerKeyword dummy_keywords[] = {
-  { "dummy",                    KW_DUMMY },
-  { "dummy_opt", 		KW_DUMMY_OPT },
-  { NULL }
-};
-
-CfgParser dummy_parser =
-{
-#if ENABLE_DEBUG
-  .debug_flag = &dummy_debug,
-#endif
-  .name = "dummy",
-  .keywords = dummy_keywords,
-  .parse = (int (*)(CfgLexer *lexer, gpointer *instance, gpointer arg)) dummy_parse,
-  .cleanup = (void (*)(gpointer)) log_pipe_unref,
-};
-
-CFG_PARSER_IMPLEMENT_LEXER_BINDING(dummy_, LogDriver **)
diff --git a/modules/dummy/dummy-parser.h b/modules/dummy/dummy-parser.h
deleted file mode 100644
index 37a9e8f..0000000
--- a/modules/dummy/dummy-parser.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2002-2010 BalaBit IT Ltd, Budapest, Hungary
- * Copyright (c) 1998-2010 Balázs Scheidler
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * As an additional exemption you are allowed to compile & link against the
- * OpenSSL libraries as published by the OpenSSL project. See the file
- * COPYING for details.
- *
- */
-
-#ifndef DUMMY_PARSER_H_INCLUDED
-#define DUMMY_PARSER_H_INCLUDED
-
-#include "cfg-parser.h"
-#include "cfg-lexer.h"
-#include "dummy.h"
-
-extern CfgParser dummy_parser;
-
-CFG_PARSER_DECLARE_LEXER_BINDING(dummy_, LogDriver **)
-
-#endif
diff --git a/modules/dummy/dummy.c b/modules/dummy/dummy.c
deleted file mode 100644
index f27667b..0000000
--- a/modules/dummy/dummy.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2002-2010 BalaBit IT Ltd, Budapest, Hungary
- * Copyright (c) 1998-2010 Balázs Scheidler
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * As an additional exemption you are allowed to compile & link against the
- * OpenSSL libraries as published by the OpenSSL project. See the file
- * COPYING for details.
- *
- */
-
-#include "dummy.h"
-#include "dummy-parser.h"
-#include "plugin.h"
-#include "messages.h"
-
-static void
-dummy_dd_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options, gpointer user_data)
-{
-  DummyDestDriver *self = (DummyDestDriver *) s;
-  msg_notice("Dummy plugin received a message",
-             evt_tag_str("msg", log_msg_get_value(msg, LM_V_MESSAGE, NULL)),
-             evt_tag_int("opt", self->opt),
-             NULL);
-
-  log_dest_driver_queue_method(s, msg, path_options, user_data);
-}
-
-LogDriver *
-dummy_dd_new(void)
-{
-  DummyDestDriver *self = g_new0(DummyDestDriver, 1);
-
-  log_dest_driver_init_instance(&self->super);
-  self->super.super.super.queue = dummy_dd_queue;
-
-  return &self->super.super;
-}
-
-extern CfgParser dummy_dd_parser;
-
-static Plugin dummy_plugin =
-{
-  .type = LL_CONTEXT_DESTINATION,
-  .name = "dummy",
-  .parser = &dummy_parser,
-};
-
-gboolean
-dummy_module_init(GlobalConfig *cfg, CfgArgs *args)
-{
-  plugin_register(cfg, &dummy_plugin, 1);
-  return TRUE;
-}
-
-const ModuleInfo module_info =
-{
-  .canonical_name = "dummy",
-  .version = VERSION,
-  .description = "The dummy module is a sample destination driver not really doing any kind of useful work.",
-  .core_revision = SOURCE_REVISION,
-  .plugins = &dummy_plugin,
-  .plugins_len = 1,
-};
diff --git a/modules/dummy/dummy.h b/modules/dummy/dummy.h
deleted file mode 100644
index d99c7bf..0000000
--- a/modules/dummy/dummy.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2002-2010 BalaBit IT Ltd, Budapest, Hungary
- * Copyright (c) 1998-2010 Balázs Scheidler
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * As an additional exemption you are allowed to compile & link against the
- * OpenSSL libraries as published by the OpenSSL project. See the file
- * COPYING for details.
- *
- */
-
-#ifndef DUMMY_H_INCLUDED
-#define DUMMY_H_INCLUDED
-
-#include "driver.h"
-
-typedef struct
-{
-  LogDestDriver super;
-  gint opt;
-} DummyDestDriver;
-
-LogDriver *dummy_dd_new(void);
-
-#endif
-- 
1.7.9




More information about the syslog-ng mailing list