| 1 |
/* Definition of the omsr (omodStringRequest) object. |
| 2 |
* |
| 3 |
* Copyright 2007-2012 Rainer Gerhards and Adiscon GmbH. |
| 4 |
* |
| 5 |
* This file is part of the rsyslog runtime library. |
| 6 |
* |
| 7 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 |
* you may not use this file except in compliance with the License. |
| 9 |
* You may obtain a copy of the License at |
| 10 |
* |
| 11 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
* -or- |
| 13 |
* see COPYING.ASL20 in the source distribution |
| 14 |
* |
| 15 |
* Unless required by applicable law or agreed to in writing, software |
| 16 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 17 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 |
* See the License for the specific language governing permissions and |
| 19 |
* limitations under the License. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef OBJOMSR_H_INCLUDED |
| 23 |
#define OBJOMSR_H_INCLUDED |
| 24 |
|
| 25 |
/* define flags for required template options */ |
| 26 |
#define OMSR_NO_RQD_TPL_OPTS 0 |
| 27 |
#define OMSR_RQD_TPL_OPT_SQL 1 |
| 28 |
/* only one of OMSR_TPL_AS_ARRAY, _AS_MSG, or _AS_JSON must be specified, |
| 29 |
* if all are given results are unpredictable. |
| 30 |
*/ |
| 31 |
#define OMSR_TPL_AS_ARRAY 2 /* introduced in 4.1.6, 2009-04-03 */ |
| 32 |
#define OMSR_TPL_AS_MSG 4 /* introduced in 5.3.4, 2009-11-02 */ |
| 33 |
#define OMSR_TPL_AS_JSON 8 /* introduced in 6.5.1, 2012-09-02 */ |
| 34 |
/* next option is 16, 32, 64, ... */ |
| 35 |
|
| 36 |
struct omodStringRequest_s { /* strings requested by output module for doAction() */ |
| 37 |
int iNumEntries; /* number of array entries for data elements below */ |
| 38 |
uchar **ppTplName; /* pointer to array of template names */ |
| 39 |
int *piTplOpts; /* pointer to array of check-options when pulling template */ |
| 40 |
}; |
| 41 |
typedef struct omodStringRequest_s omodStringRequest_t; |
| 42 |
|
| 43 |
/* prototypes */ |
| 44 |
rsRetVal OMSRdestruct(omodStringRequest_t *pThis); |
| 45 |
rsRetVal OMSRconstruct(omodStringRequest_t **ppThis, int iNumEntries); |
| 46 |
rsRetVal OMSRsetEntry(omodStringRequest_t *pThis, int iEntry, uchar *pTplName, int iTplOpts); |
| 47 |
rsRetVal OMSRgetSupportedTplOpts(unsigned long *pOpts); |
| 48 |
int OMSRgetEntryCount(omodStringRequest_t *pThis); |
| 49 |
int OMSRgetEntry(omodStringRequest_t *pThis, int iEntry, uchar **ppTplName, int *piTplOpts); |
| 50 |
|
| 51 |
#endif /* #ifndef OBJOMSR_H_INCLUDED */ |