diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-04 15:54:40 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-04 15:54:40 +0200 |
commit | 3dd73d7f7194139a9b8bf1668f6192ead0c801ec (patch) | |
tree | e0cd4203227043a4057b8fa461ceab79f787998d /grammar/rainerscript.c | |
parent | 72f9fe88b24428067557a71405ee641a641bf7c4 (diff) | |
download | rsyslog-3dd73d7f7194139a9b8bf1668f6192ead0c801ec.tar.gz rsyslog-3dd73d7f7194139a9b8bf1668f6192ead0c801ec.tar.bz2 rsyslog-3dd73d7f7194139a9b8bf1668f6192ead0c801ec.zip |
new ruleengine: legacy action object properly constructed
Diffstat (limited to 'grammar/rainerscript.c')
-rw-r--r-- | grammar/rainerscript.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 6e3bae68..20cf2f6d 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -39,6 +39,7 @@ #include "rainerscript.h" #include "conf.h" #include "parserif.h" +#include "rsconf.h" #include "grammar.h" #include "queue.h" #include "srUtils.h" @@ -1555,6 +1556,9 @@ cnfstmtPrint(struct cnfstmt *root, int indent) //dbgprintf("stmt %p, indent %d, type '%c'\n", expr, indent, expr->nodetype); for(stmt = root ; stmt != NULL ; stmt = stmt->next) { switch(stmt->nodetype) { + case S_NOP: + doIndent(indent); dbgprintf("NOP\n"); + break; case S_STOP: doIndent(indent); dbgprintf("STOP\n"); break; @@ -1694,6 +1698,27 @@ cnfstmtNewAct(struct nvlst *lst) done: return cnfstmt; } +struct cnfstmt * +cnfstmtNewLegaAct(uchar *actline) +{ + struct cnfstmt* cnfstmt; + rsRetVal localRet; + if((cnfstmt = cnfstmtNew(S_ACT)) == NULL) + goto done; + cnfstmt->printable = (uchar*)strdup((char*)actline); + localRet = cflineDoAction(loadConf, &actline, &cnfstmt->d.act); + if(localRet != RS_RET_OK && localRet != RS_RET_OK_WARN) { + parser_errmsg("%s occured in file '%s' around line %d", + (localRet == RS_RET_OK_WARN) ? "warnings" : "errors", + cnfcurrfn, yylineno); + if(localRet != RS_RET_OK_WARN) { + cnfstmt->nodetype = S_NOP; /* disable action! */ + goto done; + } + } +done: return cnfstmt; +} + struct cnfrule * cnfruleNew(enum cnfFiltType filttype, struct cnfactlst *actlst) { |