diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-21 16:54:05 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-21 16:54:05 +0200 |
commit | 88caccecf8dd8beaf46915df05241a44f7d635f6 (patch) | |
tree | 7d6db5808b3bdd2453f041fef5c808b8fab36119 /plugins/omdtn/omdtn.c | |
parent | 6e410a76f64d74fec03de27a6ca1f3f996844917 (diff) | |
parent | 8e536c5b25ca1a7106f541149cf0d76bdf9237da (diff) | |
download | rsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.tar.gz rsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.tar.xz rsyslog-88caccecf8dd8beaf46915df05241a44f7d635f6.zip |
Merge branch 'master' into beta
Conflicts:
ChangeLog
configure.ac
doc/manual.html
Diffstat (limited to 'plugins/omdtn/omdtn.c')
-rw-r--r-- | plugins/omdtn/omdtn.c | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/plugins/omdtn/omdtn.c b/plugins/omdtn/omdtn.c new file mode 100644 index 00000000..761bde79 --- /dev/null +++ b/plugins/omdtn/omdtn.c @@ -0,0 +1,130 @@ +/* omdtn.c + * This is the plugin for rsyslog use in the interplanetary Internet, + * especially useful for rsyslog in space ships of all kinds. + * The core idea was introduced in early 2009 and considered + * doable. + * + * Note that this has not yet been tested for robustness but needs + * to prior to placing it on top of a rocket. + * + * NOTE: read comments in module-template.h for more specifics! + * + * File begun on 2009-04-01 by RGerhards + * + * Copyright 2009 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * + * Rsyslog 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. + * + * Rsyslog 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 Rsyslog. If not, see <http://www.gnu.org/licenses/>. + * + * A copy of the GPL can be found in the file "COPYING" in this distribution. + */ +#include "config.h" +#include "rsyslog.h" +#include <stdio.h> +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> +#include <signal.h> +#include <errno.h> +#include <unistd.h> +#include "dirty.h" +#include "syslogd-types.h" +#include "srUtils.h" +#include "template.h" +#include "module-template.h" +#include "errmsg.h" +#include "cfsysline.h" + +MODULE_TYPE_OUTPUT + +/* internal structures + */ +DEF_OMOD_STATIC_DATA + +typedef struct _instanceData { +} instanceData; + +BEGINcreateInstance +CODESTARTcreateInstance +ENDcreateInstance + + +BEGINisCompatibleWithFeature +CODESTARTisCompatibleWithFeature + if(eFeat == sFEATURERepeatedMsgReduction) + iRet = RS_RET_OK; +ENDisCompatibleWithFeature + + +BEGINfreeInstance +CODESTARTfreeInstance +ENDfreeInstance + + +BEGINdbgPrintInstInfo +CODESTARTdbgPrintInstInfo +ENDdbgPrintInstInfo + + +BEGINtryResume +CODESTARTtryResume +ENDtryResume + +BEGINdoAction +CODESTARTdoAction + write(1, (char*)ppString[0], strlen((char*)ppString[0])); +ENDdoAction + + +BEGINparseSelectorAct +CODESTARTparseSelectorAct +CODE_STD_STRING_REQUESTparseSelectorAct(1) + /* first check if this config line is actually for us */ + if(strncmp((char*) p, ":omstdout:", sizeof(":omstdout:") - 1)) { + ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); + } + + /* ok, if we reach this point, we have something for us */ + p += sizeof(":omstdout:") - 1; /* eat indicator sequence (-1 because of '\0'!) */ + CHKiRet(createInstance(&pData)); + + /* check if a non-standard template is to be applied */ + if(*(p-1) == ';') + --p; + CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, 0, (uchar*) "RSYSLOG_FileFormat")); +CODE_STD_FINALIZERparseSelectorAct +ENDparseSelectorAct + + +BEGINmodExit +CODESTARTmodExit +ENDmodExit + + +BEGINqueryEtryPt +CODESTARTqueryEtryPt +CODEqueryEtryPt_STD_OMOD_QUERIES +ENDqueryEtryPt + + +BEGINmodInit() +CODESTARTmodInit + *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ +CODEmodInit_QueryRegCFSLineHdlr +ENDmodInit + +/* vi:set ai: + */ |