summaryrefslogtreecommitdiffstats
path: root/module-template.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-26 12:07:23 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-26 12:07:23 +0000
commit54669873b0469aa69a4c9f88bcf88470218082f8 (patch)
tree1042b7096d3332dc92abbb8c4ee9fdc0af1f7e55 /module-template.h
parent1904ce3f5aa11f190c881ccda650c1f464fe9271 (diff)
downloadrsyslog-54669873b0469aa69a4c9f88bcf88470218082f8.tar.gz
rsyslog-54669873b0469aa69a4c9f88bcf88470218082f8.tar.xz
rsyslog-54669873b0469aa69a4c9f88bcf88470218082f8.zip
- implemented needUDPSocket() interface
- replaced (mis) use of f_prevcount in omfwd.c -> now data element in instance data is used for retry counting - removed f->f_type from syslogd.c, omfwd.c - removed f->f_file from omfwd.c, omfile.c - f->f_flags is gone away
Diffstat (limited to 'module-template.h')
-rw-r--r--module-template.h32
1 files changed, 23 insertions, 9 deletions
diff --git a/module-template.h b/module-template.h
index 55b8f821..c8f1e79e 100644
--- a/module-template.h
+++ b/module-template.h
@@ -120,6 +120,27 @@ static rsRetVal dbgPrintInstInfo(selector_t *f, void *pModData)\
}
+/* needUDPSocket()
+ * Talks back to syslogd if the global UDP syslog socket is needed for
+ * sending. Returns 0 if not, 1 if needed. This interface hopefully goes
+ * away at some time, because it is kind of a hack. However, currently
+ * there is no way around it, so we need to support it.
+ * rgerhards, 2007-07-26
+ */
+#define BEGINneedUDPSocket \
+static rsRetVal needUDPSocket(void *pModData)\
+{\
+ rsRetVal iRet = RS_RET_FALSE;\
+ instanceData *pData = NULL;
+
+#define CODESTARTneedUDPSocket \
+ pData = (instanceData*) pModData;
+
+#define ENDneedUDPSocket \
+ return iRet;\
+}
+
+
/* onSelectReadyWrite()
* Extra comments:
* This is called when select() returned with a writable file descriptor
@@ -230,6 +251,8 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\
*pEtryPoint = getWriteFDForSelect;\
} else if(!strcmp((char*) name, "onSelectReadyWrite")) {\
*pEtryPoint = onSelectReadyWrite;\
+ } else if(!strcmp((char*) name, "needUDPSocket")) {\
+ *pEtryPoint = needUDPSocket;\
}
/* modInit()
@@ -261,15 +284,6 @@ rsRetVal modInit##uniqName(int iIFVersRequested __attribute__((unused)), int *ip
return iRet;\
}
-/*
- */
-#define BEGIN \
-
-#define CODESTART \
-
-#define END \
-
-
#endif /* #ifndef MODULE_TEMPLATE_H_INCLUDED */
/*
* vi:set ai: