1 /* a dummy module to be loaded if we cannot build this module, but 2 * configure required it to be "optional". 3 * 4 * Copyright 2020 Rainer Gerhards and Adiscon GmbH. 5 * 6 * This file is part of rsyslog. 7 * 8 * Licensed under the Apache License, Version 2.0 (the "License"); 9 * you may not use this file except in compliance with the License. 10 * You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * -or- 14 * see COPYING.ASL20 in the source distribution 15 * 16 * Unless required by applicable law or agreed to in writing, software 17 * distributed under the License is distributed on an "AS IS" BASIS, 18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 * See the License for the specific language governing permissions and 20 * limitations under the License. 21 */ 22 #include "config.h" 23 #include "rsyslog.h" 24 #include <stdio.h> 25 #include <stdarg.h> 26 #include <stdlib.h> 27 #include <string.h> 28 #include <assert.h> 29 #include <signal.h> 30 #include <errno.h> 31 #include <unistd.h> 32 #include <stdint.h> 33 #include <pthread.h> 34 #include "conf.h" 35 #include "syslogd-types.h" 36 #include "srUtils.h" 37 #include "template.h" 38 #include "module-template.h" 39 #include "errmsg.h" 40 #include "parserif.h" 41 42 #define MODULE_NAME(x) #x 43 44 MODULE_TYPE_OUTPUT 45 MODULE_TYPE_NOKEEP 46 MODULE_CNFNAME(MODULE_NAME(MODNAME)) 47 48 49 DEF_OMOD_STATIC_DATA 50 51 /* config variables */ 52 typedef struct _instanceData { 53 char *dummy; 54 } instanceData; 55 56 typedef struct wrkrInstanceData { 57 instanceData *pData; 58 } wrkrInstanceData_t; 59 60 struct modConfData_s { 61 }; 62 63 /* modConf ptr to use for the current load process */ 64 static modConfData_t *loadModConf = NULL; 65 /* modConf ptr to use for the current exec process */ 66 static modConfData_t *runModConf = NULL; 67 68 69 70 71 BEGINbeginCnfLoad 72 CODESTARTbeginCnfLoad 73 loadModConf = pModConf; 74 ENDbeginCnfLoad 75 76 BEGINendCnfLoad 77 CODESTARTendCnfLoad 78 ENDendCnfLoad 79 80 BEGINcheckCnf 81 CODESTARTcheckCnf 82 ENDcheckCnf 83 84 BEGINactivateCnf 85 CODESTARTactivateCnf 86 runModConf = pModConf; 87 ENDactivateCnf 88 89 BEGINfreeCnf 90 CODESTARTfreeCnf 91 ENDfreeCnf 92 93 94 BEGINcreateWrkrInstance 95 CODESTARTcreateWrkrInstance 96 ENDcreateWrkrInstance 97 98 99 BEGINisCompatibleWithFeature 100 CODESTARTisCompatibleWithFeature 101 ENDisCompatibleWithFeature 102 103 104 BEGINfreeInstance 105 CODESTARTfreeInstance 106 ENDfreeInstance 107 108 109 BEGINfreeWrkrInstance 110 CODESTARTfreeWrkrInstance 111 ENDfreeWrkrInstance 112 113 114 BEGINsetModCnf 115 CODESTARTsetModCnf 116 (void) lst; 117 parser_errmsg("%s is an optional module which could not be built on your platform " 118 "please remove it from the configuration or upgrade your platform", MODULE_NAME(MODNAME)); 119 ENDsetModCnf 120 121 122 BEGINnewActInst 123 CODESTARTnewActInst 124 (void) pData; 125 (void) ppModData; 126 parser_errmsg("%s is an optional module which could not be built on your platform " 127 "please remove it from the configuration or upgrade your platform", MODULE_NAME(MODNAME)); 128 ENDnewActInst 129 130 131 BEGINdbgPrintInstInfo 132 CODESTARTdbgPrintInstInfo 133 ENDdbgPrintInstInfo 134 135 136 BEGINtryResume 137 CODESTARTtryResume 138 ENDtryResume 139 140 141 BEGINdoAction_NoStrings 142 CODESTARTdoAction 143 (void) pMsgData; 144 ENDdoAction 145 146 147 NO_LEGACY_CONF_parseSelectorAct 148 149 150 BEGINmodExit 151 CODESTARTmodExit 152 ENDmodExit 153 154 155 BEGINqueryEtryPt 156 CODESTARTqueryEtryPt 157 CODEqueryEtryPt_STD_OMOD_QUERIES 158 CODEqueryEtryPt_STD_OMOD8_QUERIES 159 CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES 160 CODEqueryEtryPt_STD_CONF2_OMOD_QUERIES 161 CODEqueryEtryPt_STD_CONF2_QUERIES 162 ENDqueryEtryPt 163 164 165 BEGINmodInit() 166 CODESTARTmodInit 167 /* we only support the current interface specification */ 168 *ipIFVersProvided = CURR_MOD_IF_VERSION; 169 CODEmodInit_QueryRegCFSLineHdlr 170 dbgprintf("dummy module compiled with rsyslog version %s.\n", VERSION); 171 ENDmodInit 172