- die Verwendung von syslog kann nun abgeschaltet werden.
This commit is contained in:
parent
6284acf6ca
commit
50352dc93b
|
@ -9,9 +9,12 @@
|
|||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: acconfig.h,v 1.3 2001/12/25 22:01:47 alex Exp $
|
||||
* $Id: acconfig.h,v 1.4 2001/12/27 01:44:49 alex Exp $
|
||||
*
|
||||
* $Log: acconfig.h,v $
|
||||
* Revision 1.4 2001/12/27 01:44:49 alex
|
||||
* - die Verwendung von syslog kann nun abgeschaltet werden.
|
||||
*
|
||||
* Revision 1.3 2001/12/25 22:01:47 alex
|
||||
* - neue configure-Option "--enable-sniffer".
|
||||
*
|
||||
|
@ -29,5 +32,7 @@
|
|||
|
||||
#undef SNIFFER
|
||||
|
||||
#undef USE_SYSLOG
|
||||
|
||||
|
||||
/* -eof- */
|
||||
|
|
36
configure.in
36
configure.in
|
@ -9,9 +9,12 @@
|
|||
# Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
# der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
#
|
||||
# $Id: configure.in,v 1.7 2001/12/27 00:37:07 alex Exp $
|
||||
# $Id: configure.in,v 1.8 2001/12/27 01:44:49 alex Exp $
|
||||
#
|
||||
# $Log: configure.in,v $
|
||||
# Revision 1.8 2001/12/27 01:44:49 alex
|
||||
# - die Verwendung von syslog kann nun abgeschaltet werden.
|
||||
#
|
||||
# Revision 1.7 2001/12/27 00:37:07 alex
|
||||
# - Erkennung der "portab header" geaendert, CFLAGS werden nun anders gesetzt.
|
||||
#
|
||||
|
@ -52,6 +55,9 @@ AC_LANG_C
|
|||
|
||||
# -- Hilfsprogramme --
|
||||
|
||||
AC_PROG_AWK
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
|
||||
|
@ -59,6 +65,8 @@ AC_PROG_RANLIB
|
|||
|
||||
AC_HEADER_STDC
|
||||
|
||||
AC_HEADER_TIME
|
||||
|
||||
AC_CHECK_HEADER(portab.h,[
|
||||
AC_CHECK_HEADER(imp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
|
||||
AC_CHECK_HEADER(exp.h,,AC_MSG_ERROR([Alex \"portability headers\" (portab.h an friends) not found!]))
|
||||
|
@ -69,9 +77,10 @@ AC_CHECK_HEADER(portab.h,[
|
|||
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([netinet/in.h sys/socket.h],,[required C headers missing!])
|
||||
|
||||
AC_CHECK_HEADERS([stdint.h])
|
||||
AC_CHECK_HEADERS([ \
|
||||
arpa/inet.h errno.h fcntl.h netinet/in.h stdint.h string.h \
|
||||
sys/socket.h sys/time.h unistd.h \
|
||||
],,[required C header missing!])
|
||||
|
||||
# -- Datentypen --
|
||||
|
||||
|
@ -90,12 +99,29 @@ AC_TRY_COMPILE([
|
|||
|
||||
# -- Funktionen --
|
||||
|
||||
AC_CHECK_FUNCS([socket],,[required functions missing!])
|
||||
AC_FUNC_MALLOC
|
||||
|
||||
AC_CHECK_FUNCS([ \
|
||||
gethostname inet_ntoa memmove memset select \
|
||||
socket strcasecmp strchr strerror strstr \
|
||||
],,[required function missing!])
|
||||
|
||||
# -- Libraries --
|
||||
|
||||
# -- Konfigurationsoptionen --
|
||||
|
||||
AC_ARG_ENABLE(syslog,
|
||||
[ --disable-syslog disable syslog (autodetected by default)],
|
||||
[ if test "$enableval" = "yes"; then
|
||||
AC_CHECK_HEADER(syslog.h,AC_DEFINE(USE_SYSLOG, 1),AC_MSG_ERROR([Can't enable syslog: syslog.h not found!]))
|
||||
else
|
||||
AC_MSG_RESULT([disabling syslog])
|
||||
fi
|
||||
],
|
||||
[ AC_CHECK_HEADER(syslog.h,AC_DEFINE(USE_SYSLOG, 1))
|
||||
]
|
||||
)
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug show additional debug output],
|
||||
if test "$enableval" = "yes"; then
|
||||
|
|
|
@ -9,11 +9,14 @@
|
|||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: log.c,v 1.9 2001/12/26 03:22:16 alex Exp $
|
||||
* $Id: log.c,v 1.10 2001/12/27 01:44:49 alex Exp $
|
||||
*
|
||||
* log.c: Logging-Funktionen
|
||||
*
|
||||
* $Log: log.c,v $
|
||||
* Revision 1.10 2001/12/27 01:44:49 alex
|
||||
* - die Verwendung von syslog kann nun abgeschaltet werden.
|
||||
*
|
||||
* Revision 1.9 2001/12/26 03:22:16 alex
|
||||
* - string.h wird nun includiert.
|
||||
*
|
||||
|
@ -54,7 +57,10 @@
|
|||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef USE_SYSLOG
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
|
||||
#include <exp.h>
|
||||
#include "log.h"
|
||||
|
@ -66,6 +72,11 @@ GLOBAL VOID Log_Init( VOID )
|
|||
|
||||
strcpy( txt, "" );
|
||||
|
||||
#ifdef USE_SYSLOG
|
||||
if( txt[0] ) strcat( txt, "+" );
|
||||
else strcat( txt, "-" );
|
||||
strcat( txt, "SYSLOG" );
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
if( txt[0] ) strcat( txt, "+" );
|
||||
else strcat( txt, "-" );
|
||||
|
@ -77,7 +88,9 @@ GLOBAL VOID Log_Init( VOID )
|
|||
strcat( txt, "SNIFFER" );
|
||||
#endif
|
||||
|
||||
#ifdef USE_SYSLOG
|
||||
openlog( PACKAGE, LOG_CONS|LOG_PID, LOG_LOCAL5 );
|
||||
#endif
|
||||
Log( LOG_NOTICE, PACKAGE" version "VERSION"%s started.", txt );
|
||||
} /* Log_Init */
|
||||
|
||||
|
@ -85,7 +98,9 @@ GLOBAL VOID Log_Init( VOID )
|
|||
GLOBAL VOID Log_Exit( VOID )
|
||||
{
|
||||
Log( LOG_NOTICE, PACKAGE" done.");
|
||||
#ifdef USE_SYSLOG
|
||||
closelog( );
|
||||
#endif
|
||||
} /* Log_Exit */
|
||||
|
||||
|
||||
|
@ -109,7 +124,9 @@ GLOBAL VOID Log( CONST INT Level, CONST CHAR *Format, ... )
|
|||
|
||||
/* ... und ausgeben */
|
||||
printf( "[%d] %s\n", Level, msg );
|
||||
#ifdef USE_SYSLOG
|
||||
syslog( Level, msg );
|
||||
#endif
|
||||
|
||||
va_end( ap );
|
||||
} /* Log */
|
||||
|
|
|
@ -9,11 +9,14 @@
|
|||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: log.h,v 1.3 2001/12/12 23:31:24 alex Exp $
|
||||
* $Id: log.h,v 1.4 2001/12/27 01:44:49 alex Exp $
|
||||
*
|
||||
* log.h: Logging-Funktionen (Header)
|
||||
*
|
||||
* $Log: log.h,v $
|
||||
* Revision 1.4 2001/12/27 01:44:49 alex
|
||||
* - die Verwendung von syslog kann nun abgeschaltet werden.
|
||||
*
|
||||
* Revision 1.3 2001/12/12 23:31:24 alex
|
||||
* - Zum Loggen wird nun auch syslog verwendet.
|
||||
*
|
||||
|
@ -29,7 +32,18 @@
|
|||
#define __log_h__
|
||||
|
||||
|
||||
#include <syslog.h>
|
||||
#ifdef USE_SYSLOG
|
||||
# include <syslog.h>
|
||||
#else
|
||||
# define LOG_EMERG 0
|
||||
# define LOG_ALERT 1
|
||||
# define LOG_CRIT 2
|
||||
# define LOG_ERR 3
|
||||
# define LOG_WARNING 4
|
||||
# define LOG_NOTICE 5
|
||||
# define LOG_INFO 6
|
||||
# define LOG_DEBUG 7
|
||||
#endif
|
||||
|
||||
|
||||
GLOBAL VOID Log_Init( VOID );
|
||||
|
|
Loading…
Reference in New Issue