Debian Codegraph @

runtime/conf.h

raw
1 /* Definitions for config file handling (not yet an object).
2 *
3 * Copyright 2008-2012 Adiscon GmbH.
4 *
5 * This file is part of rsyslog.
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 #ifndef INCLUDED_CONF_H
22 #define INCLUDED_CONF_H
23 #include "action.h"
24
25 /* definitions used for doNameLine to differentiate between different command types
26 * (with otherwise identical code). This is a left-over from the previous config
27 * system. It stays, because it is still useful. So do not wonder why it looks
28 * somewhat strange (at least its name). -- rgerhards, 2007-08-01
29 */
30 enum eDirective { DIR_TEMPLATE = 0, DIR_OUTCHANNEL = 1, DIR_ALLOWEDSENDER = 2 };
31 extern ecslConfObjType currConfObj;
32 extern int bConfStrictScoping; /* force strict scoping during config processing? */
33
34 /* interfaces */
35 BEGINinterface(conf) /* name must also be changed in ENDinterface macro! */
36 rsRetVal (*doNameLine)(uchar **pp, void *pVal);
37 rsRetVal (*cfsysline)(uchar *p);
38 rsRetVal (*doModLoad)(uchar **pp, __attribute__((unused)) void *pVal);
39 rsRetVal (*GetNbrActActions)(rsconf_t *conf, int *);
40 /* version 4 -- 2010-07-23 rgerhards */
41 /* "just" added global variables
42 * FYI: we reconsider repacking as a non-object, as only the core currently
43 * accesses this module. The current object structure complicates things without
44 * any real benefit.
45 */
46 /* version 5 -- 2011-04-19 rgerhards */
47 /* complete revamp, we now use the rsconf object */
48 /* version 6 -- 2011-07-06 rgerhards */
49 /* again a complete revamp, using flex/bison based parser now */
50 ENDinterface(conf)
51 #define confCURR_IF_VERSION 6 /* increment whenever you change the interface structure! */
52 /* in Version 3, entry point "ReInitConf()" was removed, as we do not longer need
53 * to support restart-type HUP -- rgerhards, 2009-07-15
54 */
55
56
57 /* prototypes */
58 PROTOTYPEObj(conf);
59
60
61 /* TODO: the following 2 need to go in conf obj interface... */
62 rsRetVal cflineParseTemplateName(uchar **pp, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *dfltTplName);
63 rsRetVal cflineParseFileName(
64 uchar *p, uchar *pFileName, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *pszTpl);
65
66 rsRetVal DecodePRIFilter(uchar *pline, uchar pmask[]);
67 rsRetVal cflineDoAction(rsconf_t *conf, uchar **p, action_t **ppAction);
68 extern EHostnameCmpMode eDfltHostnameCmpMode;
69 extern cstr_t *pDfltHostnameCmp;
70 extern cstr_t *pDfltProgNameCmp;
71
72 #endif /* #ifndef INCLUDED_CONF_H */