~ubuntu-branches/ubuntu/lucid/rsyslog/lucid

« back to all changes in this revision

Viewing changes to cfsysline.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2007-10-19 17:21:49 UTC
  • Revision ID: james.westby@ubuntu.com-20071019172149-ie6ej2xve33mxiu7
Tags: upstream-1.19.10
ImportĀ upstreamĀ versionĀ 1.19.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Definition of the cfsysline (config file system line) object.
 
2
 *
 
3
 * Copyright 2007 Rainer Gerhards and Adiscon GmbH.
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
18
 *
 
19
 * A copy of the GPL can be found in the file "COPYING" in this distribution.
 
20
 */
 
21
 
 
22
#ifndef CFSYSLINE_H_INCLUDED
 
23
#define CFSYSLINE_H_INCLUDED
 
24
 
 
25
#include "linkedlist.h"
 
26
 
 
27
/* types of configuration handlers
 
28
 */
 
29
typedef enum cslCmdHdlrType {
 
30
        eCmdHdlrInvalid = 0,            /* invalid handler type - indicates a coding error */
 
31
        eCmdHdlrCustomHandler,          /* custom handler, just call handler function */
 
32
        eCmdHdlrUID,
 
33
        eCmdHdlrGID,
 
34
        eCmdHdlrBinary,
 
35
        eCmdHdlrFileCreateMode,
 
36
        eCmdHdlrInt,
 
37
        eCmdHdlrGetChar,
 
38
        eCmdHdlrGetWord
 
39
} ecslCmdHdrlType;
 
40
 
 
41
/* this is a single entry for a parse routine. It describes exactly
 
42
 * one entry point/handler.
 
43
 * The short name is cslch (Configfile SysLine CommandHandler)
 
44
 */
 
45
struct cslCmdHdlr_s { /* config file sysline parse entry */
 
46
        ecslCmdHdrlType eType;                  /* which type of handler is this? */
 
47
        rsRetVal (*cslCmdHdlr)();               /* function pointer to use with handler (params depending on eType) */
 
48
        void *pData;                            /* user-supplied data pointer */
 
49
};
 
50
typedef struct cslCmdHdlr_s cslCmdHdlr_t;
 
51
 
 
52
 
 
53
/* this is the list of known configuration commands with pointers to
 
54
 * their handlers.
 
55
 * The short name is cslc (Configfile SysLine Command)
 
56
 */
 
57
struct cslCmd_s { /* config file sysline parse entry */
 
58
        int bChainingPermitted;                 /* may multiple handlers be chained for this command? */
 
59
        linkedList_t llCmdHdlrs;        /* linked list of command handlers */
 
60
};
 
61
typedef struct cslCmd_s cslCmd_t;
 
62
 
 
63
/* prototypes */
 
64
rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData);
 
65
rsRetVal unregCfSysLineHdlrs(void);
 
66
rsRetVal processCfSysLineCommand(uchar *pCmd, uchar **p);
 
67
rsRetVal cfsyslineInit(void);
 
68
void dbgPrintCfSysLineHandlers(void);
 
69
 
 
70
#endif /* #ifndef CFSYSLINE_H_INCLUDED */