-/* ulogd_LOGEMU.c, Version $Revision: 1.9 $
+/* ulogd_LOGEMU.c, Version $Revision: 1.10 $
*
* ulogd output target for syslog logging emulation
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: ulogd_LOGEMU.c,v 1.9 2002/04/27 19:45:51 laforge Exp $
+ * $Id: ulogd_LOGEMU.c,v 1.10 2002/12/09 14:42:43 laforge Exp $
*
*/
#include <string.h>
#include <time.h>
#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <ulogd/ulogd.h>
timestr = ctime(&now) + 4;
/* truncate time */
- if (tmp = strchr(timestr, '\n'))
+ if ((tmp = strchr(timestr, '\n')))
*tmp = '\0';
/* truncate hostname */
- if (tmp = strchr(hostname, '.'))
+ if ((tmp = strchr(hostname, '.')))
*tmp = '\0';
/* print time and hostname */
-/* ulogd, Version $Revision: 1.28 $
+/* ulogd, Version $Revision: 1.29 $
*
- * $Id: ulogd.c,v 1.28 2002/07/30 07:23:36 laforge Exp $
+ * $Id: ulogd.c,v 1.29 2002/12/09 14:42:43 laforge Exp $
*
* userspace logging daemon for the netfilter ULOG target
* of the linux 2.4 netfilter subsystem.
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: ulogd.c,v 1.28 2002/07/30 07:23:36 laforge Exp $
+ * $Id: ulogd.c,v 1.29 2002/12/09 14:42:43 laforge Exp $
*
* Modifications:
* 14 Jun 2001 Martin Josefsson <gandalf@wlug.westbo.se>
#include <string.h>
#include <stdarg.h>
#include <time.h>
+#include <ctype.h>
#include <signal.h>
#include <dlfcn.h>
#include <sys/types.h>
return 0;
}
+#ifdef DEBUG
/* dump out the contents of the interpreter hash */
static void interh_dump(void)
{
i, (ulogd_interh[i])->name);
}
+#endif
/* key hash allocation granularity */
#define KEYH_ALLOC_GRAN 20
return id;
}
+#ifdef DEBUG
/* dump the keyhash to standard output */
static void keyh_dump(void)
{
printf("ulogd_keyh[%lu] = %s:%u\n", i,
ulogd_keyh[i].interp->name, ulogd_keyh[i].offset);
}
+#endif
/* get keyid by name */
unsigned int keyh_getid(const char *name)
/* endless loop receiving packets and handling them over to
* handle_packet */
- while (len = ipulog_read(libulog_h, libulog_buf,
- bufsiz_ce.u.value, 1)) {
+ while ((len = ipulog_read(libulog_h, libulog_buf,
+ bufsiz_ce.u.value, 1))) {
if (len <= 0) {
/* this is not supposed to happen */
"ipulog_errno == %d, errno = %d\n",
len, ipulog_errno, errno);
} else {
- while (upkt = ipulog_get_packet(libulog_h,
- libulog_buf, len)) {
+ while ((upkt = ipulog_get_packet(libulog_h,
+ libulog_buf, len))) {
DEBUGP("==> packet received\n");
handle_packet(upkt);
}
/* hackish, but result is the same */
sigterm_handler(SIGTERM);
+ return(0);
}