summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-19 06:38:13 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-19 06:38:13 +0000
commit738abe63ace672df7b665593dcc6820a126191c7 (patch)
treece5ac8fa142a5f2982f1e080b3cd8e4e841c5245
parent00c12a28e774c5a8ae010918e8602f8da3698814 (diff)
downloadrsyslog-738abe63ace672df7b665593dcc6820a126191c7.tar.gz
rsyslog-738abe63ace672df7b665593dcc6820a126191c7.tar.xz
rsyslog-738abe63ace672df7b665593dcc6820a126191c7.zip
begin designing module interface
-rw-r--r--syslogd-types.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/syslogd-types.h b/syslogd-types.h
index c598f73d..f15acfee 100644
--- a/syslogd-types.h
+++ b/syslogd-types.h
@@ -288,6 +288,57 @@ struct filed {
};
typedef struct filed selector_t; /* new type name */
+
+/* The following definitions are to be used for modularization. Currently,
+ * the code is NOT actually used. I am just adding pieces to it as I
+ * go along in designing the interface.
+ * rgerhards, 2007-07-19
+ */
+typedef enum eModType_ {
+ eMOD_IN, /* input module */
+ eMOD_OUT, /* output module */
+ eMOD_FILTER /* filter module (not know yet if we will once have such at all...) */
+} eModType_t;
+
+/* how is this module linked? */
+typedef enum eModLinkType_ {
+ eMOD_LINK_STATIC,
+ eMOD_LINK_DYNAMIC_UNLOADED, /* dynalink module, currently not loaded */
+ eMOD_LINK_DYNAMIC_LOADED /* dynalink module, currently loaded */
+} eModLinkType_t;
+
+typedef struct moduleInfo {
+ struct moduleInfo *pNext; /* support for creating a linked module list */
+ int iModVers; /* Interface version of module */
+ eModType_t eModType; /* type of this module */
+ eModLinkType_t eModLinkType;
+ uchar* pszModName; /* printable module name, e.g. for dprintf */
+ /* functions supported by all types of modules */
+ rsRetVal (*modInit)(); /* initialize the module */
+ /* be sure to support version handshake! */
+ rsRetVal (*modExit)(); /* called before termination or module unload */
+ /* below: parse a configuration line - return if processed
+ * or not. If not, must be parsed to next module.
+ */
+ rsRetVal (*parseConfigLine)(uchar **pConfLine);
+ /* below: create an instance of this module. Most importantly the module
+ * can allocate instance memory in this call.
+ */
+ rsRetVal (*createInstance)();
+ union {
+ struct {/* data for input modules */
+ /* input modules come after output modules are finished, I am
+ * currently not really thinking about them. rgerhards, 2007-07-19
+ */
+ };
+ struct {/* data for output modules */
+ /* below: perform the configured action
+ */
+ rsRetVal (*doAction)();
+ };
+ } mod;
+} modInfo_t;
+
#endif /* #ifndef SYSLOGD_TYPES_INCLUDED */
/*
* vi:set ai: