diff options
-rw-r--r-- | AUTHORS | 6 | ||||
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 164 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/ipacct.h | 4 | ||||
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/run.c | 5 |
8 files changed, 45 insertions, 160 deletions
@@ -1,5 +1 @@ | |||
1 | Sergey Poznyakoff <gray@farlep.net> | Sergey Poznyakoff <gray@gnu.org.ua> | |
2 | |||
3 | NOTE: 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. | ||
@@ -1,5 +1,19 @@ | |||
1 | 2008-07-07 Sergey Poznyakoff <gray@gnu.org.ua> | 1 | 2008-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 @@ | |||
1 | AUTOMAKE_OPTIONS = 1.6 readme-alpha | 1 | AUTOMAKE_OPTIONS = 1.6 readme-alpha |
2 | ACLOCAL_AMFLAGS = -I m4 | 2 | ACLOCAL_AMFLAGS = -I m4 |
3 | 3 | ||
4 | SUBDIRS=libpcap lib src m4 | 4 | SUBDIRS=lib src m4 |
5 | EXTRA_DIST=ipacct.conf.example | 5 | EXTRA_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 | # |
18 | AC_PREREQ(2.53) | 18 | AC_PREREQ(2.53) |
19 | AC_INIT(ipacct, 0.2, bug-ipacct@cvs.farlep.net) | 19 | AC_INIT(ipacct, 1.0, bug-ipacct@gnu.org.ua) |
20 | AC_CONFIG_SRCDIR(src/ipacct.h) | 20 | AC_CONFIG_SRCDIR(src/ipacct.h) |
21 | AC_CANONICAL_SYSTEM | 21 | AC_CANONICAL_SYSTEM |
22 | AM_INIT_AUTOMAKE(no-exeext) | 22 | AM_INIT_AUTOMAKE(no-exeext) |
@@ -35,11 +35,9 @@ AC_HEADER_STDC | |||
35 | AC_HEADER_DIRENT | 35 | AC_HEADER_DIRENT |
36 | AC_HEADER_SYS_WAIT | 36 | AC_HEADER_SYS_WAIT |
37 | AC_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) | 37 | AC_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) |
38 | AC_SUBST(INCLUDES) | 38 | AC_CHECK_HEADER(pcap.h,:, |
39 | AC_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 | |||
43 | dnl Checks for typedefs, structures, and compiler characteristics. | 41 | dnl Checks for typedefs, structures, and compiler characteristics. |
44 | AC_C_CONST | 42 | AC_C_CONST |
45 | AC_C_INLINE | 43 | AC_C_INLINE |
@@ -53,6 +51,9 @@ AC_STRUCT_TM | |||
53 | dnl Check for libraries | 51 | dnl Check for libraries |
54 | AC_CHECK_LIB(socket, main) | 52 | AC_CHECK_LIB(socket, main) |
55 | AC_CHECK_LIB(nsl, main) | 53 | AC_CHECK_LIB(nsl, main) |
54 | AC_CHECK_LIB(pcap, pcap_init, | ||
55 | [LIBS="-lpcap $LIBS"], | ||
56 | [AC_MSG_ERROR([Required library libpcap not found])]) | ||
56 | 57 | ||
57 | dnl Checks for library functions. | 58 | dnl Checks for library functions. |
58 | AC_PROG_GCC_TRADITIONAL | 59 | AC_PROG_GCC_TRADITIONAL |
@@ -97,142 +98,23 @@ extern char *program_invocation_name; | |||
97 | #endif]) | 98 | #endif]) |
98 | fi | 99 | fi |
99 | 100 | ||
100 | dnl libpcap stuff | ||
101 | dnl All the stuff below has been shamelessly stolen from libpcap-0.4 | ||
102 | dnl configure.in | ||
103 | dnl | ||
104 | dnl Not all versions of test support -c (character special) but it's a | ||
105 | dnl better way of testing since the device might be protected. So we | ||
106 | dnl check in our normal order using -r and then check the for the /dev | ||
107 | dnl guys again using -c. | ||
108 | dnl | ||
109 | AC_SUBST(V_PCAP) | ||
110 | AC_ARG_WITH(pcap, [ --with-pcap=TYPE use packet capture TYPE]) | ||
111 | AC_MSG_CHECKING(packet capture type) | ||
112 | if test ! -z "$with_pcap" ; then | ||
113 | V_PCAP="$withval" | ||
114 | elif test -r /dev/bpf0 ; then | ||
115 | V_PCAP=bpf | ||
116 | elif test -r /usr/include/net/pfilt.h ; then | ||
117 | V_PCAP=pf | ||
118 | elif test -r /dev/enet ; then | ||
119 | V_PCAP=enet | ||
120 | elif test -r /dev/nit ; then | ||
121 | V_PCAP=snit | ||
122 | elif test -r /usr/include/sys/net/nit.h ; then | ||
123 | V_PCAP=nit | ||
124 | elif test -r /usr/include/net/raw.h ; then | ||
125 | V_PCAP=snoop | ||
126 | elif test -r /usr/include/sys/dlpi.h ; then | ||
127 | V_PCAP=dlpi | ||
128 | elif test -r /usr/include/linux/socket.h ; then | ||
129 | V_PCAP=linux | ||
130 | elif test -c /dev/bpf0 ; then # check again in case not readable | ||
131 | V_PCAP=bpf | ||
132 | elif test -c /dev/enet ; then # check again in case not readable | ||
133 | V_PCAP=enet | ||
134 | elif test -c /dev/nit ; then # check again in case not readable | ||
135 | V_PCAP=snit | ||
136 | else | ||
137 | V_PCAP=null | ||
138 | fi | ||
139 | AC_MSG_RESULT($V_PCAP) | ||
140 | |||
141 | case "$V_PCAP" in | ||
142 | |||
143 | dlpi) | ||
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 | |||
163 | linux) | ||
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 | |||
175 | null) | ||
176 | AC_MSG_WARN(cannot determine packet capture interface) | ||
177 | AC_MSG_WARN((see the INSTALL doc for more info)) | ||
178 | ;; | ||
179 | |||
180 | esac | ||
181 | |||
182 | case "$target_os" in | ||
183 | |||
184 | aix*) | ||
185 | AC_DEFINE(_SUN,1,[workarounds to enable certain features]) | ||
186 | ;; | ||
187 | |||
188 | hpux9*) | ||
189 | AC_DEFINE(HAVE_HPUX9,1,[Define this if we are on a HP-UX 9 system]) | ||
190 | ;; | ||
191 | |||
192 | hpux10.0*) | ||
193 | ;; | ||
194 | |||
195 | hpux10.1*) | ||
196 | ;; | ||
197 | |||
198 | hpux*) | ||
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 | |||
203 | sinix*) | ||
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 | |||
217 | solaris*) | ||
218 | AC_DEFINE(HAVE_SOLARIS,1,[Define this if we are on a Solaris]) | ||
219 | ;; | ||
220 | |||
221 | linux*) | ||
222 | V_INCLS="$V_INCLS -Ilinux-include" | ||
223 | ;; | ||
224 | esac | ||
225 | |||
226 | AC_MSG_CHECKING(for log facility) | 101 | AC_MSG_CHECKING(for log facility) |
227 | log_facility="LOG_DAEMON" | 102 | LOG_FACILITY="LOG_DAEMON" |
228 | AC_ARG_WITH(log-facility, | 103 | AC_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, | 105 | if test -n "$LOG_FACILITY"; then |
231 | log_facility=$withval)) | 106 | logfacility=`echo $LOG_FACILITY | tr a-z A-Z` |
232 | AC_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 | ||
114 | fi | ||
115 | AC_DEFINE_UNQUOTED(LOGFACILITY, $LOG_FACILITY, | ||
233 | [The syslog facility to be used for diagnostics]) | 116 | [The syslog facility to be used for diagnostics]) |
234 | AC_MSG_RESULT($log_facility) | 117 |