summaryrefslogtreecommitdiffstats
path: root/net.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-11 16:43:13 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-11 16:43:13 +0000
commite946e122d02987552874595f2613c07ce0c0aa23 (patch)
tree4bdf6d726cd80f991e971145f549bc9618c005cc /net.c
parenta98aeec6d0e5739ada471ece2b308ea787c3804a (diff)
downloadrsyslog-e946e122d02987552874595f2613c07ce0c0aa23.tar.gz
rsyslog-e946e122d02987552874595f2613c07ce0c0aa23.tar.xz
rsyslog-e946e122d02987552874595f2613c07ce0c0aa23.zip
implemented module unload handling (required a number of interface changes)
Diffstat (limited to 'net.c')
-rw-r--r--net.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/net.c b/net.c
index 74b27806..12058349 100644
--- a/net.c
+++ b/net.c
@@ -546,7 +546,7 @@ static inline int MaskCmp(struct NetAddr *pAllow, uint8_t bits, struct sockaddr
* returns 1, if the sender is allowed, 0 otherwise.
* rgerhards, 2005-09-26
*/
-int isAllowedSender(struct AllowedSenders *pAllowRoot, struct sockaddr *pFrom, const char *pszFromHost)
+static int isAllowedSender(struct AllowedSenders *pAllowRoot, struct sockaddr *pFrom, const char *pszFromHost)
{
struct AllowedSenders *pAllow;
@@ -577,10 +577,11 @@ int isAllowedSender(struct AllowedSenders *pAllowRoot, struct sockaddr *pFrom, c
* It still needs to be a bit better adapted to rsyslog.
* rgerhards 2005-09-19
*/
-#ifndef BSD
#include <sys/utsname.h>
-int should_use_so_bsdcompat(void)
+static int
+should_use_so_bsdcompat(void)
{
+#ifndef BSD
static int init_done;
static int so_bsdcompat_is_obsolete;
@@ -608,10 +609,10 @@ int should_use_so_bsdcompat(void)
so_bsdcompat_is_obsolete = 1;
}
return !so_bsdcompat_is_obsolete;
-}
#else /* #ifndef BSD */
-#define should_use_so_bsdcompat() 1
+ return 1;
#endif /* #ifndef BSD */
+}
#ifndef SO_BSDCOMPAT
/* this shall prevent compiler errors due to undfined name */
#define SO_BSDCOMPAT 0
@@ -1046,10 +1047,22 @@ CODESTARTobjQueryInterface(net)
pIf->debugListenInfo = debugListenInfo;
pIf->create_udp_socket = create_udp_socket;
pIf->closeUDPListenSockets = closeUDPListenSockets;
+ pIf->isAllowedSender = isAllowedSender;
+ pIf->should_use_so_bsdcompat = should_use_so_bsdcompat;
finalize_it:
ENDobjQueryInterface(net)
+/* exit our class
+ * rgerhards, 2008-03-10
+ */
+BEGINObjClassExit(net, OBJ_IS_LOADABLE_MODULE) /* CHANGE class also in END MACRO! */
+CODESTARTObjClassExit(net)
+ /* release objects we no longer need */
+ objRelease(errmsg, CORE_COMPONENT);
+ENDObjClassExit(net)
+
+
/* Initialize the net class. Must be called as the very first method
* before anything else is called inside this class.
* rgerhards, 2008-02-19
@@ -1067,6 +1080,7 @@ ENDObjClassInit(net)
BEGINmodExit
CODESTARTmodExit
+ netClassExit();
ENDmodExit
@@ -1081,7 +1095,7 @@ CODESTARTmodInit
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
/* Initialize all classes that are in our module - this includes ourselfs */
- CHKiRet(netClassInit()); /* must be done after tcps_sess, as we use it */
+ CHKiRet(netClassInit(pModInfo)); /* must be done after tcps_sess, as we use it */
ENDmodInit
/* vi:set ai:
*/