summaryrefslogtreecommitdiffstats
path: root/runtime/ruleset.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-10 16:49:14 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-10 16:49:14 +0200
commit6f4e3c4e4c85acdcf58969970484a54639ecc8f9 (patch)
tree1e3470e4ac9738c7713f1ef1a0558ed881457d44 /runtime/ruleset.h
parent9704f129f72ec9ece11aeccea4bbf0cbccb116cb (diff)
downloadrsyslog-6f4e3c4e4c85acdcf58969970484a54639ecc8f9.tar.gz
rsyslog-6f4e3c4e4c85acdcf58969970484a54639ecc8f9.tar.xz
rsyslog-6f4e3c4e4c85acdcf58969970484a54639ecc8f9.zip
restructered code in perparation for multiple rule set support
... this was long overdue, and I finlly tackeld it. It turned out to be more complex than I initially thought. The next step now probably is to actually implement multiple rule sets and the beauty that comes with them.
Diffstat (limited to 'runtime/ruleset.h')
-rw-r--r--runtime/ruleset.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/runtime/ruleset.h b/runtime/ruleset.h
new file mode 100644
index 00000000..b609e6b3
--- /dev/null
+++ b/runtime/ruleset.h
@@ -0,0 +1,56 @@
+/* The ruleset object.
+ *
+ * This implements rulesets within rsyslog.
+ *
+ * Copyright 2009 Rainer Gerhards and Adiscon GmbH.
+ *
+ * This file is part of the rsyslog runtime library.
+ *
+ * The rsyslog runtime library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The rsyslog runtime 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 the rsyslog runtime library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * A copy of the GPL can be found in the file "COPYING" in this distribution.
+ * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution.
+ */
+#ifndef INCLUDED_RULESET_H
+#define INCLUDED_RULESET_H
+
+#include "linkedlist.h"
+
+/* the ruleset object */
+struct ruleset_s {
+ BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */
+ linkedList_t llRules; /* this is NOT a pointer - no typo here ;) */
+ uchar *pszName; /* name of our ruleset */
+};
+
+/* interfaces */
+BEGINinterface(ruleset) /* name must also be changed in ENDinterface macro! */
+ INTERFACEObjDebugPrint(ruleset);
+ rsRetVal (*DebugPrintAll)(void);
+ rsRetVal (*Construct)(ruleset_t **ppThis);
+ rsRetVal (*ConstructFinalize)(ruleset_t __attribute__((unused)) *pThis);
+ rsRetVal (*Destruct)(ruleset_t **ppThis);
+ rsRetVal (*IterateAllActions)(rsRetVal (*pFunc)(void*, void*), void* pParam);
+ rsRetVal (*DestructAllActions)(void);
+ rsRetVal (*AddRule)(ruleset_t *pThis, rule_t **ppRule);
+ rsRetVal (*ProcessMsg)(ruleset_t *pThis, msg_t *pMsg);
+ rsRetVal (*SetName)(ruleset_t *pThis, uchar *pszName);
+ENDinterface(ruleset)
+#define rulesetCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */
+
+
+/* prototypes */
+PROTOTYPEObj(ruleset);
+
+#endif /* #ifndef INCLUDED_RULESET_H */