diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-07-07 14:06:29 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-07-07 14:06:29 +0000 |
commit | 118829fa654f6edeb35e5dda2f6e8215bacf26ca (patch) | |
tree | 2ef0b33fd74d1fec16af7318acaf3f033d52ccbd | |
parent | 80e5249134411d5d8e67eb13edf7e3b92795f0ac (diff) | |
download | ipacct-118829fa654f6edeb35e5dda2f6e8215bacf26ca.tar.gz ipacct-118829fa654f6edeb35e5dda2f6e8215bacf26ca.tar.bz2 |
Remove inlcuded libpcap.
* libpcap: Remove
* INSTALL: Remove
* Makefile.am (SUBDIRS): Remove libpcap
* configure.ac: Remove libpcap
Use LOG_FACILITY instead of --with-log-facility
Raise version no. to 1.0.
* ylwrap: Remove.
* src/Makefile.am (ipacct_LDADD): Use -lpcap.
* src/ipacct.h: Do not include ip_var.h
* src/main.c: Do not include pcap-int.h
* src/run.c: Do not include pcap-int.h
(run): Use pcap_fileno.
* AUTHORS: Update
* ylwrap, INSTALL: Remove.
-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. | ||
@@ -2,2 +2,16 @@ | |||
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. |
diff --git a/Makefile.am b/Makefile.am index 1ba1e23..4101da5 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -3,3 +3,3 @@ 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 |
diff --git a/configure.ac b/configure.ac index 10fa942..a244400 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -18,3 +18,3 @@ | |||
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) |
@@ -37,7 +37,5 @@ 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. |
@@ -55,2 +53,5 @@ 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 | ||
@@ -99,140 +100,21 @@ 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 | AC_MSG_RESULT($LOG_FACILITY) |
235 | |||
236 | 118 | ||
237 | AC_OUTPUT(libpcap/Makefile lib/Makefile src/Makefile m4/Makefile Makefile) | 119 | AC_OUTPUT(lib/Makefile src/Makefile m4/Makefile Makefile) |
238 | 120 | ||
diff --git a/src/Makefile.am b/src/Makefile.am index 46bbc49..34104d6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -4,5 +4,5 @@ ipacct_SOURCES = main.c run.c utils.c iputil.c bpf_dump.c cons_raw.c \ | |||
4 | config.y list.c | 4 | config.y list.c |
5 | ipacct_LDADD = ../lib/libipacct.a ../libpcap/libpcap.a | 5 | ipacct_LDADD = ../lib/libipacct.a |
6 | noinst_HEADERS = ipacct.h report.h list.h | 6 | noinst_HEADERS = ipacct.h report.h list.h |
7 | INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/libpcap @INCLUDES@ | 7 | INCLUDES = -I$(top_srcdir)/lib |
8 | AM_CFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" | 8 | AM_CFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" |
diff --git a/src/ipacct.h b/src/ipacct.h index df8869d..406dd90 100644 --- a/src/ipacct.h +++ b/src/ipacct.h | |||
@@ -16,3 +16,3 @@ | |||
16 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | 16 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
17 | /* $Id: ipacct.h,v 1.6 2005/05/20 12:55:18 gray Exp $ */ | 17 | /* $Id: ipacct.h,v 1.7 200 |