summaryrefslogtreecommitdiff
path: root/action.h
diff options
context:
space:
mode:
Diffstat (limited to 'action.h')
-rw-r--r--action.h38
1 files changed, 28 insertions, 10 deletions
diff --git a/action.h b/action.h
index 9a24600..1fa05c1 100644
--- a/action.h
+++ b/action.h
@@ -5,19 +5,20 @@
*
* Copyright 2007 Rainer Gerhards and Adiscon GmbH.
*
- * This program 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 2
- * of the License, or (at your option) any later version.
+ * This file is part of rsyslog.
*
- * This program is distributed in the hope that it will be useful,
+ * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * 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.
*/
@@ -26,6 +27,14 @@
#include "syslogd-types.h"
#include "sync.h"
+#include "queue.h"
+
+/* external data - this is to be removed when we change the action
+ * object interface (will happen some time..., at latest when the
+ * config file format is changed). -- rgerhards, 2008-01-28
+ */
+extern int glbliActionResumeRetryCount;
+
/* the following struct defines the action object data structure
*/
@@ -36,8 +45,9 @@ struct action_s {
short bSuspended; /* is the related action temporarily suspended? */
time_t ttResumeRtry; /* when is it time to retry the resume? */
int iResumeInterval;/* resume interval for this action */
+ int iResumeRetryCount;/* how often shall we retry a suspended action? (-1 --> eternal) */
int iNbrResRtry; /* number of retries since last suspend */
- struct moduleInfo *pMod;/* pointer to output module handling this selector */
+ struct modInfo_s *pMod;/* pointer to output module handling this selector */
void *pModData; /* pointer to module data - content is module-specific */
int f_ReduceRepeated;/* reduce repeated lines 0 - no, 1 - yes */
int f_prevcount; /* repetition cnt of prevline */
@@ -45,13 +55,13 @@ struct action_s {
int iNumTpls; /* number of array entries for template element below */
struct template **ppTpl;/* array of template to use - strings must be passed to doAction
* in this order. */
-
- uchar **ppMsgs; /* array of message pointers for doAction */
struct msg* f_pMsg; /* pointer to the message (this will replace the other vars with msg
* content later). This is preserved after the message has been
* processed - it is also used to detect duplicates.
*/
+ queue_t *pQueue; /* action queue */
SYNC_OBJ_TOOL; /* required for mutex support */
+ pthread_mutex_t mutActExec; /* mutex to guard actual execution of doAction for single-threaded modules */
};
typedef struct action_s action_t;
@@ -59,11 +69,18 @@ typedef struct action_s action_t;
/* function prototypes
*/
rsRetVal actionConstruct(action_t **ppThis);
+rsRetVal actionConstructFinalize(action_t *pThis);
rsRetVal actionDestruct(action_t *pThis);
+rsRetVal actionAddCfSysLineHdrl(void);
rsRetVal actionTryResume(action_t *pThis);
rsRetVal actionSuspend(action_t *pThis);
rsRetVal actionDbgPrint(action_t *pThis);
rsRetVal actionSetGlobalResumeInterval(int iNewVal);
+rsRetVal actionDoAction(action_t *pAction);
+rsRetVal actionCallAction(action_t *pAction, msg_t *pMsg);
+rsRetVal actionWriteToAction(action_t *pAction);
+rsRetVal actionClassInit(void);
+rsRetVal addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringRequest_t *pOMSR, int bSuspended);
#if 1
#define actionIsSuspended(pThis) ((pThis)->bSuspended == 1)
@@ -72,6 +89,7 @@ rsRetVal actionSetGlobalResumeInterval(int iNewVal);
inline int actionIsSuspended(action_t *pThis)
{
int i;
+ ASSERT(pThis != NULL);
i = pThis->bSuspended == 1;
dbgprintf("in IsSuspend(), returns %d\n", i);
return i;