summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-16 11:36:22 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-16 11:36:22 +0200
commit75f3cb34e6ce1c8c782e5c612765dc39b76cc3df (patch)
tree16f7ef0b88b8e102a36169f5082818cc505051ed
parent8f8f65abb66d1a7839c30c2d1b4b4d653a8990cc (diff)
downloadrsyslog-75f3cb34e6ce1c8c782e5c612765dc39b76cc3df.zip
rsyslog-75f3cb34e6ce1c8c782e5c612765dc39b76cc3df.tar.gz
rsyslog-75f3cb34e6ce1c8c782e5c612765dc39b76cc3df.tar.xz
moved net module to runtime
after careful analysis, I concluded that it is OK to place the current net.c/.h code under LGPL. Individual contributor agreement is given and no sysklogd code remains (see net.c for details).
-rw-r--r--Makefile.am9
-rw-r--r--runtime/Makefile.am11
-rw-r--r--runtime/net.c (renamed from net.c)33
-rw-r--r--runtime/net.h (renamed from net.h)21
-rw-r--r--tcpsrv.c1
5 files changed, 44 insertions, 31 deletions
diff --git a/Makefile.am b/Makefile.am
index 5829ff8..cc3b41b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -60,14 +60,7 @@ endif
if ENABLE_INET
-pkglib_LTLIBRARIES += lmnet.la lmtcpsrv.la lmtcpclt.la
-#
-# network support
-#
-lmnet_la_SOURCES = net.c net.h
-lmnet_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
-lmnet_la_LDFLAGS = -module -avoid-version $(rsrt_libs)
-lmnet_la_LIBADD =
+pkglib_LTLIBRARIES += lmtcpsrv.la lmtcpclt.la
#
#
# TCP (stream) server support
diff --git a/runtime/Makefile.am b/runtime/Makefile.am
index 048ef41..8cb3a63 100644
--- a/runtime/Makefile.am
+++ b/runtime/Makefile.am
@@ -75,3 +75,14 @@ lmregexp_la_LDFLAGS = -module -avoid-version $(rsrt_libs)
lmregexp_la_LIBADD =
endif
+if ENABLE_INET
+pkglib_LTLIBRARIES += lmnet.la
+#
+# network support
+#
+lmnet_la_SOURCES = net.c net.h
+lmnet_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags)
+lmnet_la_LDFLAGS = -module -avoid-version $(rsrt_libs)
+lmnet_la_LIBADD =
+
+endif # if ENABLE_INET
diff --git a/net.c b/runtime/net.c
index bbd6bec..84c286d 100644
--- a/net.c
+++ b/runtime/net.c
@@ -12,24 +12,32 @@
* long term, but it is good to have it out of syslogd.c. Maybe this here is
* an interim location ;)
*
- * Copyright 2007 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2007, 2008 Rainer Gerhards and Adiscon GmbH.
*
- * This file is part of rsyslog.
+ * rgerhards, 2008-04-16: I changed this code to LGPL today. I carefully analyzed
+ * that it does not borrow code from the original sysklogd and that I have
+ * permission to do so from all other contributors. My analysis found that all
+ * code from sysklogd has been superseeded by our own functionality, so it
+ * is OK to move this file to LGPL. Some variable sysklogd variable names
+ * remain, but even this will change as the net object evolves.
*
- * Rsyslog is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * This file is part of the rsyslog runtime library.
+ *
+ * The rsyslog runtime library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Rsyslog is distributed in the hope that it will be useful,
+ * The rsyslog runtime library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the rsyslog runtime library. If not, see <http://www.gnu.org/licenses/>.
*
* A copy of the GPL can be found in the file "COPYING" in this distribution.
+ * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution.
*/
#include "config.h"
@@ -792,9 +800,8 @@ rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN
/* if we reach this point, we obtained a non-numeric hostname and can now process it */
- /* Convert to lower case, just like LocalDomain above
- */
- for (p = pszHostFQDN ; *p ; p++)
+ /* Convert to lower case */
+ for(p = pszHostFQDN ; *p ; p++)
if (isupper((int) *p))
*p = tolower(*p);
@@ -815,6 +822,9 @@ rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN
} else {
/* now check if we belong to any of the domain names that were specified
* in the -s command line option. If so, remove and we are done.
+ * TODO: this must go away! -- rgerhards, 2008-04-16
+ * For proper modularization, this must be done different, e.g. via a
+ * "to be stripped" property of *this* object itself.
*/
if (StripDomains) {
count=0;
@@ -833,6 +843,7 @@ rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN
* door would be wide-open for all kinds of mixing up of hosts. Because of this,
* you'll see comparison against the full string (pszHost) below. The termination
* still occurs at *p, which points at the first dot after the hostname.
+ * TODO: this must also go away - see comment above -- rgerhards, 2008-04-16
*/
if (LocalHosts) {
count=0;
diff --git a/net.h b/runtime/net.h
index 0f5b0bc..a0791a9 100644
--- a/net.h
+++ b/runtime/net.h
@@ -1,29 +1,29 @@
/* Definitions for network-related stuff.
*
- * Copyright 2007 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2007, 2008 Rainer Gerhards and Adiscon GmbH.
*
- * This file is part of rsyslog.
+ * This file is part of the rsyslog runtime library.
*
- * Rsyslog is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
+ * The rsyslog runtime library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
- * Rsyslog is distributed in the hope that it will be useful,
+ * The rsyslog runtime library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with Rsyslog. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the rsyslog runtime library. If not, see <http://www.gnu.org/licenses/>.
*
* A copy of the GPL can be found in the file "COPYING" in this distribution.
+ * A copy of the LGPL can be found in the file "COPYING.LESSER" in this distribution.
*/
#ifndef INCLUDED_NET_H
#define INCLUDED_NET_H
-#ifdef SYSLOG_INET
#include <netinet/in.h>
#include <sys/socket.h> /* this is needed on HP UX -- rgerhards, 2008-03-04 */
@@ -49,7 +49,7 @@ struct NetAddr {
};
#ifndef SO_BSDCOMPAT
- /* this shall prevent compiler errors due to undfined name */
+ /* this shall prevent compiler errors due to undefined name */
# define SO_BSDCOMPAT 0
#endif
@@ -114,5 +114,4 @@ PROTOTYPEObj(net);
/* the name of our library binary */
#define LM_NET_FILENAME "lmnet"
-#endif /* #ifdef SYSLOG_INET */
#endif /* #ifndef INCLUDED_NET_H */
diff --git a/tcpsrv.c b/tcpsrv.c
index 955fb9b..daa373c 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -572,7 +572,6 @@ Run(tcpsrv_t *pThis)
for (i = 0; i < *pThis->pSocksLstn; i++) {
if (FD_ISSET(pThis->pSocksLstn[i+1], &readfds)) {
dbgprintf("New connect on TCP inetd socket: #%d\n", pThis->pSocksLstn[i+1]);
-RUNLOG_VAR("%p", &pNewSess);
SessAccept(pThis, &pNewSess, pThis->pSocksLstn[i+1]);
--nfds; /* indicate we have processed one */
}