aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS6
-rw-r--r--ChangeLog14
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac164
-rw-r--r--src/Makefile.am4
-rw-r--r--src/ipacct.h4
-rw-r--r--src/main.c6
-rw-r--r--src/run.c5
8 files changed, 45 insertions, 160 deletions
diff --git a/AUTHORS b/AUTHORS
index 73237d8..db7f07f 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,5 +1 @@
1Sergey Poznyakoff <gray@farlep.net> Sergey Poznyakoff <gray@gnu.org.ua>
2
3NOTE: ipacct is distributed with the subdirectory libpcap, which is
4 a separate package, not a part of ipacct proper. See file
5 libpcap/COPYING for details.
diff --git a/ChangeLog b/ChangeLog
index 9c7468d..c4dfba8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
12008-07-07 Sergey Poznyakoff <gray@gnu.org.ua> 12008-07-07 Sergey Poznyakoff <gray@gnu.org.ua>
2 2
3 Remove inlcuded libpcap.
4
5 * libpcap: Remove
6 * INSTALL: Remove
7 * Makefile.am (SUBDIRS): Remove libpcap
8 * configure.ac: Remove libpcap
9 Use LOG_FACILITY instead of --with-log-facility
10 * ylwrap: Remove.
11 * src/Makefile.am (ipacct_LDADD): Use -lpcap.
12 * src/ipacct.h: Do not include ip_var.h
13 * src/main.c: Do not include pcap-int.h
14 * src/run.c: Do not include pcap-int.h
15 (run): Use pcap_fileno.
16
3 * src/main.c (parse_opt): Remove leftover uses of optarg. 17 * src/main.c (parse_opt): Remove leftover uses of optarg.
4 (main): Do not use optind. 18 (main): Do not use optind.
5 19
diff --git a/Makefile.am b/Makefile.am
index 1ba1e23..4101da5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
1AUTOMAKE_OPTIONS = 1.6 readme-alpha 1AUTOMAKE_OPTIONS = 1.6 readme-alpha
2ACLOCAL_AMFLAGS = -I m4 2ACLOCAL_AMFLAGS = -I m4
3 3
4SUBDIRS=libpcap lib src m4 4SUBDIRS=lib src m4
5EXTRA_DIST=ipacct.conf.example 5EXTRA_DIST=ipacct.conf.example
6 6
diff --git a/configure.ac b/configure.ac
index 10fa942..a244400 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17# 17#
18AC_PREREQ(2.53) 18AC_PREREQ(2.53)
19AC_INIT(ipacct, 0.2, bug-ipacct@cvs.farlep.net) 19AC_INIT(ipacct, 1.0, bug-ipacct@gnu.org.ua)
20AC_CONFIG_SRCDIR(src/ipacct.h) 20AC_CONFIG_SRCDIR(src/ipacct.h)
21AC_CANONICAL_SYSTEM 21AC_CANONICAL_SYSTEM
22AM_INIT_AUTOMAKE(no-exeext) 22AM_INIT_AUTOMAKE(no-exeext)
@@ -35,11 +35,9 @@ AC_HEADER_STDC
35AC_HEADER_DIRENT 35AC_HEADER_DIRENT
36AC_HEADER_SYS_WAIT 36AC_HEADER_SYS_WAIT
37AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h malloc.h sys/ioccom.h sys/sockio.h getopt.h) 37AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h malloc.h sys/ioccom.h sys/sockio.h getopt.h)
38AC_SUBST(INCLUDES) 38AC_CHECK_HEADER(pcap.h,:,
39AC_CHECK_HEADERS(netinet/if_ether.h netinet/ip_var.h, 39 [AC_MSG_ERROR([Required header pcap.h not found])])
40 [], 40
41 [INCLUDES=-I'$(top_srcdir)/libpcap/linux-include'; break])
42
43dnl Checks for typedefs, structures, and compiler characteristics. 41dnl Checks for typedefs, structures, and compiler characteristics.
44AC_C_CONST 42AC_C_CONST
45AC_C_INLINE 43AC_C_INLINE
@@ -53,6 +51,9 @@ AC_STRUCT_TM
53dnl Check for libraries 51dnl Check for libraries
54AC_CHECK_LIB(socket, main) 52AC_CHECK_LIB(socket, main)
55AC_CHECK_LIB(nsl, main) 53AC_CHECK_LIB(nsl, main)
54AC_CHECK_LIB(pcap, pcap_init,
55 [LIBS="-lpcap $LIBS"],
56 [AC_MSG_ERROR([Required library libpcap not found])])
56 57
57dnl Checks for library functions. 58dnl Checks for library functions.
58AC_PROG_GCC_TRADITIONAL 59AC_PROG_GCC_TRADITIONAL
@@ -97,142 +98,23 @@ extern char *program_invocation_name;
97#endif]) 98#endif])
98fi 99fi
99 100
100dnl libpcap stuff
101dnl All the stuff below has been shamelessly stolen from libpcap-0.4
102dnl configure.in
103dnl
104dnl Not all versions of test support -c (character special) but it's a
105dnl better way of testing since the device might be protected. So we
106dnl check in our normal order using -r and then check the for the /dev
107dnl guys again using -c.
108dnl
109AC_SUBST(V_PCAP)
110AC_ARG_WITH(pcap, [ --with-pcap=TYPE use packet capture TYPE])
111AC_MSG_CHECKING(packet capture type)
112if test ! -z "$with_pcap" ; then
113 V_PCAP="$withval"
114elif test -r /dev/bpf0 ; then
115 V_PCAP=bpf
116elif test -r /usr/include/net/pfilt.h ; then
117 V_PCAP=pf
118elif test -r /dev/enet ; then
119 V_PCAP=enet
120elif test -r /dev/nit ; then
121 V_PCAP=snit
122elif test -r /usr/include/sys/net/nit.h ; then
123 V_PCAP=nit
124elif test -r /usr/include/net/raw.h ; then
125 V_PCAP=snoop
126elif test -r /usr/include/sys/dlpi.h ; then
127 V_PCAP=dlpi
128elif test -r /usr/include/linux/socket.h ; then
129 V_PCAP=linux
130elif test -c /dev/bpf0 ; then # check again in case not readable
131 V_PCAP=bpf
132elif test -c /dev/enet ; then # check again in case not readable
133 V_PCAP=enet
134elif test -c /dev/nit ; then # check again in case not readable
135 V_PCAP=snit
136else
137 V_PCAP=null
138fi
139AC_MSG_RESULT($V_PCAP)
140
141case "$V_PCAP" in
142
143dlpi)
144 AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
145 AC_MSG_CHECKING(for /dev/dlpi device)
146 if test -c /dev/dlpi ; then
147 AC_MSG_RESULT(yes)
148 AC_DEFINE(HAVE_DEV_DLPI,1,[Define this if you have /dev/dlpi])
149 else
150 AC_MSG_RESULT(no)
151 dir="/dev/dlpi"
152 AC_MSG_CHECKING(for $dir directory)
153 if test -d $dir ; then
154 AC_MSG_RESULT(yes)
155 AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir",
156 [Path to pcap device])
157 else
158 AC_MSG_RESULT(no)
159 fi
160 fi
161 ;;
162
163linux)
164 AC_CHECK_HEADERS(net/if_arp.h)
165 AC_MSG_CHECKING(Linux kernel version)
166 AC_CACHE_VAL(ac_cv_linux_vers,
167 ac_cv_linux_vers=`uname -r 2>&1 | \
168 sed -n -e '$s/.* //' -e '$s/\..*//p'`)
169 AC_MSG_RESULT($ac_cv_linux_vers)
170 if test $ac_cv_linux_vers -lt 2 ; then
171 AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
172 fi
173 ;;
174
175null)
176 AC_MSG_WARN(cannot determine packet capture interface)
177 AC_MSG_WARN((see the INSTALL doc for more info))
178 ;;
179
180esac
181
182case "$target_os" in
183
184aix*)
185 AC_DEFINE(_SUN,1,[workarounds to enable certain features])
186 ;;
187
188hpux9*)
189 AC_DEFINE(HAVE_HPUX9,1,[Define this if we are on a HP-UX 9 system])
190 ;;
191
192hpux10.0*)
193 ;;
194
195hpux10.1*)
196 ;;
197
198hpux*)
199 dnl HPUX 10.20 and above is similar to HPUX 9...
200 AC_DEFINE(HAVE_HPUX10_20,1,[Define this if we are on a HP-UX 10.20 system])
201 ;;
202
203sinix*)
204 AC_MSG_CHECKING(if SINIX compiler defines sinix)
205 AC_CACHE_VAL(ac_cv_cc_sinix_defined,
206 AC_TRY_COMPILE(
207 [],
208 [int i = sinix;],
209 ac_cv_cc_sinix_defined=yes,
210 ac_cv_cc_sinix_defined=no))
211 AC_MSG_RESULT($ac_cv_cc_sinix_defined)
212 if test $ac_cv_cc_sinix_defined = no ; then
213 AC_DEFINE(sinix,1,[Define this if we are on a sinix system])
214 fi
215 ;;
216
217solaris*)
218 AC_DEFINE(HAVE_SOLARIS,1,[Define this if we are on a Solaris])
219 ;;
220
221linux*)
222 V_INCLS="$V_INCLS -Ilinux-include"
223 ;;
224esac
225
226AC_MSG_CHECKING(for log facility) 101AC_MSG_CHECKING(for log facility)
227log_facility="LOG_DAEMON" 102LOG_FACILITY="LOG_DAEMON"
228AC_ARG_WITH(log-facility, 103AC_ARG_VAR([LOG_FACILITY],
229 [ --with-log-facility=facility enable logging to the given facility], 104 [Default syslog facility])
230 AC_TRY_COMPILE([#include <syslog.h>], int lf = $withval, 105if test -n "$LOG_FACILITY"; then
231 log_facility=$withval)) 106 logfacility=`echo $LOG_FACILITY | tr a-z A-Z`
232AC_DEFINE_UNQUOTED(LOGFACILITY, $log_facility, 107 case $logfacility in
108 USER|DAEMON|AUTH|AUTHPRIV|MAIL|CRON|LOCAL[[0-7]])
109 LOG_FACILITY=LOG_$logfacility;;
110 LOG_USER|LOG_DAEMON|LOG_AUTH|LOG_AUTHPRIV|LOG_MAIL|LOG_CRON|LOG_LOCAL[[0-7]])
111 LOG_FACILITY=$logfacility;;
112 *) AC_MSG_ERROR([Invalid value of LOG_FACILITY]);;
113 esac
114fi
115AC_DEFINE_UNQUOTED(LOGFACILITY, $LOG_FACILITY,
233 [The syslog facility to be used for diagnostics]) 116 [The syslog facility to be used for diagnostics])
234AC_MSG_RESULT($log_facility) 117