tcpstat-1.5/0040755000175000000000000000000007614315537012363 5ustar phermanwheeltcpstat-1.5/doc/0040755000175000000000000000000007614315535013126 5ustar phermanwheeltcpstat-1.5/doc/Makefile.am0100644000175000000000000000011307414673063015153 0ustar phermanwheelAUTOMAKE_OPTIONS = foreign no-dependencies man_MANS = tcpstat.1 tcpprof.1 tcpstat-1.5/doc/Tips_and_Tricks.txt0100644000175000000000000001526707275357403016762 0ustar phermanwheeltcpstat v1.5 EXAMPLES OF USAGE ------------------------------ Paul Herman Cologne, Germany. tcpstat has many options which may seem like a lot at first, but this is what makes tcpstat so configurable (yes, it is one of *those* kinds of programs.) It's real power is seen when the options are combined. So first: 1. BASIC USAGE ----------- To simply get the basic garden variety statistics every 5 seconds, try: tcpstat -i fxp0 tcpstat -r file.dump The first one gathers its data from the "fxp0" interface (can be replaced by "eth0" if you use Linux, for example), and the second line does the same thing, but gets its data from a file. These types of files can be generated and saved using tcpdump(1). 2. OK, GOT THAT, BUT WHILE MONITORING AN INTERFACE, TCPSTAT RUNS FOREVER. HOW DO I STOP IT? -------------------------------------------------- One simple way is "Control-C" (or sending it a KILL signal...) However, sometimes admins like to run tcpstat for a long time unattended in the background. The solution in this case is to simply tell it how many seconds it should run before quitting. For example, you want to have tcpstat listen to eth0 for 2 Hours, and write statistics in a file every minute. 2 Hours = 7200 seconds, and 1 minute is 60 seconds, so we just enter: tcpstat -i eth0 -s 7200 60 > output.file.txt After 2 hours, all the statistics will be in the "output.file.txt" file. By the way, the -s option has no effect when reading the data from a file, of course. 2. OBSERVING TRAFFIC ONLY FOR CERTAIN PORTS ---------------------------------------- If you just want to get statistics from packets to or from certain ports, try: tcpstat -f "port http" -i fxp0 tcpstat -f "port (http or smtp)" -i fxp0 The first one shows statistics only for http traffic, while the second command shows statistics for mail and web traffic combined. In fact, the filter option (-f) is very very cool indeed. It can select certain hosts, networks, IP protocols, packet length, and even IP flags like SYN, FIN, ACK, etc. See the man page for tcpdump(1) for information on the syntax of the -f option. 3. WHAT KIND OF STATISTICS ARE AVAILABLE? -------------------------------------- Quite a few. The man page gives a complete list of all the output options (these are the "%" thingies.) Let's take a look at a few. tcpstat -o "Time: %r\tmin=%m\tmax=%M\n" tcpstat -o "Time: %r\ttcp=%T\tudp=%U\ticmp=%C\n" First of all, you might ask, "what are all these '\' things?". This is standard notation for special output characters. For example, every "\t" is interpreted as a "tab" character (good for spacing), and each "\n" is a new-line character. It is usually a good idea to have a "\n" at the end, otherwise all your lines will run together. So back to the two examples from above. The first example first displays a time stamp (the time in the middle of the interval), then prints the minimum and maximum size of all packets in that interval. It would look something like: Time: 2.500000 min=88 max=88 Time: 7.500000 min=76 max=88 Time: 12.500000 min=48 max=384 Time: 17.500000 min=44 max=436 Time: 22.500000 min=88 max=88 The second example once again displays the time stamp for the interval, and then reports how many TCP, UDP, and ICMP packets there were in each interval. It would look something like: Time: 2.500000 tcp=0 udp=0 icmp=9 Time: 7.500000 tcp=0 udp=1 icmp=10 Time: 12.500000 tcp=1 udp=14 icmp=9 Time: 17.500000 tcp=5 udp=3 icmp=9 Time: 22.500000 tcp=0 udp=0 icmp=8 Not surprising to see, that these two came from the same file. Looking at the first interval we see right away that there were only same sized ICMP packets (in this case, they were just pings to my host.) 4. THE OTHER MODES OF OPERATION ---------------------------- tcpstat offers two other useful modes of operation: "Accounting Mode", and "Bandwidth Mode." Say you have a 56k modem and you just recorded all of your network traffic with tcpdump into a "dump.file" file. tcpstat -r dump.file -b 57600 tcpstat -r dump.file -a The first command will tell you exactly how often your modem was "maxed out" (it is possible to achieve a faster baud rate that 56k with hardware compression.) The second command will display traffic estimates based on this small sample, if you were continuously online for example. These two commands are also useful for ISPs to decide if current lines are adequate to handle current traffic, and to estimate how much traffic a customer will pull each day, month, etc. Of course, the larger the sample, the more accurate your results. 5. WRITING DIFFERENT STATISTICS TO MULTIPLE FILES ---------------------------------------------- Starting in version 1.2 it is possible to write multiple statistics to multiple files with just one tcpstat command. Suppose you want daily plots of nice looking graphs of TCP, UDP, and ICMP statistics on your web page of your "vr0" interface. First, you generate three separate files which a graphing program like "gnuplot" can easily read and put something like this in a crontab file: tcpstat -i vr0 -s 86400 -o "%s\t%T\n%3%s\t%U\n%4%s\t%C\n" \ 1>/tmp/stats/tcp.xy 3>/tmp/stats/udp.xy 4>/tmp/stats/icmp.xy Then you can run your favorite gnuplot script on these files. So what the heck did that -o option do? Starting from left to right: %s - print a timestamp on stdout (default in the beginning) \t - follow timestamp with a tab character to separate data %T - print the number of TCP packets for this interval \n - ...followed by a newline %3 - tell tcpstat that the following data is outputed to filedesc 3 %s\t - once again, a timestamp followed by tab (like above) on filedesc 3 %U - print on filedesc 3 the number of UDP packets for this interval. \n - newline on filedesc 3 %4 - change to filedesc 4 %s\t - .... etc. 6. RUNNING MULTIPLE TCPSTATS FROM ONE TCPDUMP ------------------------------------------ Suppose you want many different kinds of tcpstat statistics, but you don't want to have more than one BPF filter in the kernel, which robs you of kernel/network resources. A good example would be, you want different tcpstat statistics for different multicast groups. Here's the trick: Since tcpstat can read it's tcpdump file from stdin, you do something like the following: mkfifo dumpfile.1 dumpfile.2 dumpfile.3 ## as many as you need tcpdump -l -w - | tee dumpfile.1 | tee dumpfile.2 > dumpfile.3 This way, only one BPF filter is open in the kernel. Now, you go to other consoles: tcpstat -r dumpfile.1 -f "filter expr 1" tcpstat -r dumpfile.2 -f "filter expr 2" tcpstat -r dumpfile.3 -f "filter expr 3" Thanks to Joe Thykattil for helping me work out this idea. tcpstat-1.5/doc/tcpprof.10100644000175000000000000001357607520021244014661 0ustar phermanwheel.\" Copyright (c) 2001 Paul Herman .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $Id: tcpprof.1,v 1.4 2002/07/25 16:09:08 pherman Exp $ .\" --- .\" .Dd December 22, 2001 .Dt TCPPROF 1 .Os .Sh NAME .Nm tcpprof .Nd report profile of network traffic .Sh SYNOPSIS .Nm .Op Fl ?hdnpR .Op Fl f Ar filter expr .Op Fl i Ar interface .Op Fl P Ar port .Op Fl r Ar filename .Op Fl s Ar seconds .Op Fl S Ar letters .Op Fl t Ar lines .Sh DESCRIPTION .Nm reports a profile of network traffic by ranking it by link type, ip protocol, TCP/UDP port, ip address, or network address. .Pp Network information is collected either by reading data from .Ar filename , or by directly monitoring the network interface .Ar interface . The default action for .Nm is to automatically search for an appropriate interface, and to generate a profile before it exits. .Pp When reading data from .Ar filename , .Nm will display the profile and exit immediately after the entire file has been processed. When collecting data from .Ar interface , .Nm will keep running unless the .Fl s option had been specified. .Pp .Sh OPTIONS The options are as follows: .Bl -tag -width Fl .It Fl f Ar filter expr Filter the packets according the rules given by .Ar filter expr . For the syntax of these rules, see .Xr tcpdump 1 . The argument must be quoted if it contains spaces in order to separate it from other options. .It Fl h , Fl ? Display version and a brief help message. .It Fl d .Nm will track the source and destination information separately, where applicable, and identify source data with a ">" and destination data with "<". For example, a "http <" statistic signifies all traffic with destination port 80 (http). This option only applies to port, host and network statistics. .It Fl i Ar interface Do a live capture (rather than read from a file) on the interface .Ar interface given on the command line. If .Ar interface is "auto" then .Nm tries to find an appropriate one by itself. .It Fl P Ar port This tells .Nm to ignore TCP and UDP ports greater than or equal to .Ar port when displaying port statistics. This is not the same as filtering these port numbers out of the data set. This way, packets with i.e. the source port above .Ar port and the destination port below .Ar port will be able to still count the lower port number as a statistic. In addition, this doesn't affect the other statistic types (link, protocol, etc.) .It Fl p Set the interface into non-promiscuous mode (promiscuous is the default) when doing live captures. .It Fl r Ar filename Read all data from .Ar filename , which may be a regular file, a named pipe or "-" to read it's data from standard input. Acceptable file formats include pcap .Xr (tcpdump 1 files) and "snoop" format files. .Ar filename is usually a file created by the .Xr tcpdump 1 command using the "-w" option. .It Fl S Ar letters Tells .Nm which statistics to display. .Ar letters must be a string of one or more of the following letters: .Bl -tag -width %%%% .It l show stats about the link layer .It i show stats about all ip protocols .It p show stats about TCP/UDP ports .It h show stats about hosts/ip addresses .It n show stats about network addresses .It a a synonym for "liphn" .El .It Fl s Ar seconds When monitoring an interface, .Nm runs for only .Ar seconds seconds, and then quits. Has no effect when reading data from a file. .It Fl t Ar lines When printing a profile of the data, .Nm will display a maximum of .Ar lines lines for each statistic. .El .Sh SIGNALS Upon receiving a SIGINT, .Nm will print any remaining statistics, and then exit. .Sh FILES .Bl -tag -width /dev/bpfXXX -compact .It Pa /dev/bpf Ns Sy n the packet filter device .El .Sh EXAMPLES .Dl tcpprof -i fxp0 -S a .Pp Displays a complete profile of network data passing through the fxp0 network interface, after the user enters ^C (control C). .Pp .Dl tcpprof -r file.dump -S a .Pp Displays a complete profile of network data from the .Xr tcpdump 1 generated file "file.dump". .Pp .Sh SEE ALSO .Xr tcpdump 1 , .Xr pcap 3 , .Xr bpf 4 .Re .Sh HISTORY .Nm was first written along side tcpstat in Winter 1998 using FreeBSD 3.0, and then finaly retrofited for Linux in Spring 2000. It became installed along with tcpstat since version 1.5. .Sh AUTHORS .An Paul Herman Aq pherman@frenchfries.net .br Cologne, Germany. .Pp Please send all bug reports to this address. .Sh BUGS Not tested with link types other than Ethernet, PPP, and "None" types. .Pp There may be problems reading non-IPv4 packets across platforms when reading null type link layers. This is due to a lack of a standardized packet type descriptor in libpcap for this link type. .Pp Snoop file formats cannot be read from stdin or named pipes. tcpstat-1.5/doc/tcpstat.10100644000175000000000000002654107614314614014674 0ustar phermanwheel.\" Copyright (c) 2000 Paul Herman .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $Id: tcpstat.1,v 1.33 2003/01/24 19:52:44 pherman Exp $ .\" --- .\" Paul says: man-o-man I just went through 2 whole bags of doritos(tm) .\" trying to write this manpage by hand. There's gotta be a better .\" way to do this . . . .\" .Dd April 29, 2000 .Dt TCPSTAT 1 .Os .Sh NAME .Nm tcpstat .Nd report network interface statistics .Sh SYNOPSIS .Nm tcpstat .Op Fl ?haeFlp .Op Fl B Ar bps .Op Fl b Ar bps .Op Fl f Ar filter expr .Op Fl i Ar interface .Op Fl o Ar output .Op Fl R Ar seconds .Op Fl r Ar filename .Op Fl s Ar seconds .Op Ar interval .Sh DESCRIPTION .Nm reports certain network interface statistics much like .Xr vmstat 8 does for system statistics. Statistics include bandwidth being used, number of packets, average packet size, and much more. .Pp Network information is collected either by reading data from .Ar filename , or by directly monitoring the network interface .Ar interface . The default action for .Nm is to automatically search for an appropriate interface, and to show current statistics on it. .Pp .Ar interval is the sample interval, in seconds, in which the statistics are based upon and when in default mode, how often the display is updated. If -1 is given, then the interval is taken to be the entire length of the sample. Default is 5 seconds. .Pp When reading data from .Ar filename , .Nm will exit immediately after the entire file has been processed. When collecting data from .Ar interface , .Nm will keep running unless the .Fl s option had been specified. .Pp .Sh OPTIONS The options are as follows: .Bl -tag -width Fl .It Fl a Accounting mode. Displays the estimated number of bytes per second, minute, hour, day, and month. .It Fl b Ar bps Bandwidth mode. Displays the total number of seconds the data-throughput exceeded .Ar bps , and the percentage of total time this was, as if the interface were limited to .Ar bps bits per second. See the .Sx NOTES section below to see how the .Ar interval affects bandwidth calculation. .It Fl B Ar bps "Dumb" bandwidth mode. Displays the total number of seconds the data-throughput exceeded .Ar bps , and the percentage of total time this was. See the .Sx NOTES section below to see difference between "dumb" and normal bandwidth modes. .It Fl e Suppresses the display of empty intervals. .It Fl F Flush all output streams after printing each interval. Sometimes useful when redirecting output into a file, or piping tcpstat into another program like .Xr grep 1 . .It Fl f Ar filter expr Filter the packets according the rules given by .Ar filter expr . For the syntax of these rules, see .Xr tcpdump 1 . The argument must be quoted if it contains spaces in order to separate it from other options. .It Fl h , Fl ? Display version and a brief help message. .It Fl i Ar interface Do a live capture (rather than read from a file) on the interface .Ar interface given on the command line. If .Ar interface is "auto" then .Nm tries to find an appropriate one by itself. .It Fl l Include the size of the link-layer header when calculating statistics. (Ethernet only, right now. Usually 14 bytes per packet.) .It Fl p Set the interface into non-promiscuous mode (promiscuous is the default) when doing live captures. .It Fl o Ar format Set the output format when displaying statistics. See the .Sx OUTPUT FORMAT section below for a description of the syntax. .It Fl R Ar seconds Show the timestamp relative to .Ar seconds . Avoid this option, because it will most likely go away in future versions. .It Fl r Ar filename Read all data from .Ar filename , which may be a regular file, a named pipe or "-" to read it's data from standard input. Acceptable file formats include pcap .Xr (tcpdump 1 files) and "snoop" format files. .Ar filename is usually a file created by the .Xr tcpdump 1 command using the "-w" option. .It Fl s Ar seconds When monitoring an interface, .Nm runs for only .Ar seconds seconds, and then quits. When reading from a data file, .Nm prints statistics for .Ar seconds seconds relative to the first packet seen. .El .Sh OUTPUT FORMAT The .Ar output string is any quoted string, and .Nm will write this string to the stdout. In addition, .Nm will substitute certain values for substrings which begin with a "%", as well as most standard .Xr printf 3 "\\" escape characters. Here is a list of all substitution strings: .Bl -tag -width %%%% .It % Ns A the number of ARP packets .It % Ns a the average packet size in bytes .It % Ns B the number of bytes per second .It % Ns b the number of bits per second .It % Ns C the number of ICMP and ICMPv6 packets .It % Ns d the standard deviation of the size of each packet in bytes .It % Ns I the number of IPv4 packets .It % Ns l the network "load" over the last minute, similar to .Xr uptime 1 .It % Ns M the maximum packet size in bytes .It % Ns m the minimum packet size in bytes .It % Ns N the number of bytes .It % Ns n the number of packets .It % Ns p the number of packets per second .It % Ns R same as %S, but relative to the first packet seen .It % Ns r same as %s, but relative to the first packet seen .It % Ns S the timestamp for the interval in seconds after the "UNIX epoch" .It % Ns s the timestamp for the interval in seconds.microseconds after the "UNIX epoch" .It % Ns T the number of TCP packets .It % Ns U the number of UDP packets .It % Ns V the number of IPv6 packets .It % Ns Ar number switch the output to the file descriptor .Ar number at this point in the string. All output for each interval before this parameter is by default the standard output (file descriptor 1). Useful when redirecting the output into more than one file (or fifo) for separate statistics. Be sure you know where they are going. Writing to "dangling" file descriptors (without directing them to a specific destination) may produce unexpected results. .It % Ns % the "%" character .El .Pp The default .Ar format string for .Nm is: .Pp "Time:%S\\tn=%n\\tavg=%a\\tstddev=%d\\tbps=%b\en" .Pp which will produce an output which would look similar to: .Bd -literal -offset left Time:940948785 n=107 avg=251.81 stddev=422.45 bps=43110.40 Time:940948790 n=99 avg=400.21 stddev=539.39 bps=63393.60 Time:940948795 n=43 avg=257.16 stddev=352.83 bps=17692.80 .Ed .Pp It is worth noting for example, that many of the protocol filters (%T, %U, etc.) may be seen as being redundant because protocols can be filtered using .Fl f (see .Sx OPTIONS above) .Sh SIGNALS Upon receiving a SIGINT, .Nm will print any remaining statistics, and then exit. Upon receiving a SIGUSR1 when printing intervals, .Nm will print the current statistics immediately. This can be useful when using an interval length of "-1" to print statistics on demand. .Sh FILES .Bl -tag -width /dev/bpfXXX -compact .It Pa /dev/bpf Ns Sy n the packet filter device .El .Sh EXAMPLES .Dl tcpstat -i fxp0 .Pp Displays the default statistics every 5 seconds of all traffic currently passing through the fxp0 network interface. .Pp .Dl tcpstat -r file.dump .Pp Displays the default statistics every 5 seconds from the .Xr tcpdump 1 generated file "file.dump". .Pp .Dl "tcpstat -f 'port (smtp or http)' -o '%S %b\en' -r file.dump" 2.3 .Pp Displays every 2.3 seconds the timestamp together with smtp and http traffic throughput of the data from "file.dump", in a format which would be suitable for .Xr gnuplot 1 . .Pp .Dl tcpstat -b 28800 -r file.dump 0.5 .Pp Displays what percentage of the traffic in file.dump exceeded the speed of my modem (28800 bits per second.) .Pp .Sh SEE ALSO .Xr tcpdump 1 , .Xr pcap 3 , .Xr bpf 4 , .Xr printf 3 .Re .Sh NOTES .Ss Interval size affects bandwidth Due to the nature of how bandwidth is actually measured (from discrete samples of data), the bandwidth numbers displayed will vary according to the .Ar interval variable. Generally speaking, if you often have rapid bursts of packet data, the bandwidth reported will not reflect this when .Ar interval is sufficiently large. This results in an "averaging" effect, which may or may not be desired. On the other hand, if .Ar interval is too small (say < 0.01), this results in unrealisticaly large bandwidths for very short amounts of time. .Pp The reason for the latter is that most network interfaces do not hand over packets bit by bit, but rather packet by packet. Thus, each packet is reported as being tranfered "instantaneously", resulting in "infinite" (or rather indeterminable) bandwidth. Thus, when counting single bits on the wire, there really is no such thing as "bandwidth" because they aren't really moving from the network stack's point of view (cf. Zeno's Paradox.) .Pp A possible solution is to internaly spline the packet sizes together and report the bandwidth as the scalar integral over the given interval, but this has yet to be implimented, and to be honest, would be the proverbial cruise missle to destroy an ant hill. .Pp That being said (whew!), a "good value" for .Ar interval is usualy somewhere between 0.5 and 2. .Ss Difference between normal and 'dumb' bandwidth modes. In normal bandwidth mode, when an interval exceeds the given bandwidth, the extra bytes are "moved" into the next interval. This has the effect of trying to imagine how overloaded an interface would be if the interface had a smaller bandwidth, yet same amount of data tried to get through. .Pp In "dumb" bandwidth mode, each interval which exceeds the given bandwidth is simply counted. Nothin' else. .Sh HISTORY .Nm was first written in Winter 1998 using .Fx 3.0 , and then finaly retrofited for Linux in Spring 2000. .Sh AUTHORS .An Paul Herman Aq pherman@frenchfries.net .br Cologne, Germany. .Pp Please send all bug reports to this address. .Sh BUGS Due to a bug in libpcap, tcpstat will hang indefinately under Linux when no packets arrive. This is because the timeout in pcap_open_live() is ignored under Linux when the interface is idle, which causes pcap_dispatch() to never return. .Pp Not tested with link types other than Ethernet, PPP, and "None" types. .Pp There may be problems reading non-IPv4 packets across platforms when reading null type link layers. This is due to a lack of a standardized packet type descriptor in libpcap for this link type. .Pp Snoop file formats cannot be read from stdin or named pipes. tcpstat-1.5/doc/Makefile.in0100644000175000000000000001441707614314671015177 0ustar phermanwheel# Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ DEPDIR = @DEPDIR@ EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD_TCPPROF = @LD_TCPPROF@ MATHLIB = @MATHLIB@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ TCPPROF = @TCPPROF@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies man_MANS = tcpstat.1 tcpprof.1 subdir = doc mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = DIST_SOURCES = NROFF = nroff MANS = $(man_MANS) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status uninstall-info-am: man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ $(mkinstalldirs) "$(distdir)/$$dir"; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: $(mkinstalldirs) $(DESTDIR)$(man1dir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-man install-exec-am: install-info: install-info-am install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man1 .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-man1 install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic uninstall uninstall-am \ uninstall-info-am uninstall-man uninstall-man1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: tcpstat-1.5/AUTHORS0100644000175000000000000000101107230440620013403 0ustar phermanwheelTcpstat authors --------------- Paul Herman http://www.frenchfries.net/paul/tcpstat/ Contributors ------------ The Author would like to thank the following people for thier contributions: Randy Hron - Tested tcpstat development under Solaris 2.6, 7 and 8 Tomasz Chmielecki - Suggested '-F' option Matthew King - Helped with snoop file compatibility. Thanks Matt! Joe Thykattil - Gave me the idea using fifos for multiple reads which helped me find the stdin bug fixed in 1.4 -- tcpstat-1.5/COPYING0100644000175000000000000000251507103016626013404 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ tcpstat-1.5/ChangeLog0100644000175000000000000000532407523354661014136 0ustar phermanwheelTcpstat Change Log ------------------ 1.5: 2002/07/27: tcpstat has "zero padding" to print empty intervals after last packet seen 2002/06/19: Fixed a bug which printed the wrong bandwidth when capturing packets for a shorter amount of time than the interval 2002/06/15: Fixed an '-e' bug that printed empty intervals with no data 2002/05/12: Updated to automake-1.5 and autoconf-2.52 2002/01/18: Added the "-d" option to tcpprof to track source/dest data 2001/12/22: Ported to Mac OS X 2001/04/14: Added SIGUSR1 feature, which forces a statistic update 2001/03/15: Ported to Tru64 UNIX 4.0 2001/03/15: Ported to Tru64 UNIX 5.1 2001/02/11: Now works on AIX 4.3 1.4: 2001/01/15: now reads stdin properly. Reading snoop files from stdin is still broke 2000/10/20: fixed a bug in "-s" option. exited too early on some platforms 2000/09/13: now compiles under the native HPUX compiler 1.3: 2000/08/08: Basic IPv6 capabilities, including the %V output statistic 2000/07/31: New %l "network load" statistic 2000/07/15: added "-e" option to not print empty intervals 2000/07/10: now can read snoop file format (from Sun) 2000/07/09: fixed a bug which prevented printing of arp headers 2000/06/21: fixed many packet printing bugs 2000/06/16: smarter linking. Before math library was linked to all progs 2000/06/14: wrote new program, catpcap. See src/README 2000/06/14: Handles Ethernet link types better 2000/06/10: Handles PPP link types better 2000/06/07: New src/tcpprof. Now works. Will move to own package soon... 2000/05/30: Handles SIGINT (^C) a lot better 2000/05/30: make now works completely with BSD make 1.2: 2000/05/13: Now allows output on multiple file desc. (%number option) 2000/05/13: Implemented the -s option 2000/05/11: Added smarter bandwidth calculation. Moved old to "dumb" 2000/05/11: Added option -F to flush stdout after printing each line 2000/05/08: Fixed a bug which ignored intervals of -1 2000/05/08: Removed negligible buffer overflow potential 2000/05/05: Now compiles under Solaris 1.1: 2000/05/04: Bandwidth mode now properly includes the last interval 2000/05/03: Added new output stats (%A, %C, %I, %M, %m, %R, %r, %T, %U) 2000/05/03: Added IP variable support for NULL type link layers 2000/05/02: Fixed a bug which causes a SIGFPE in bandwidth mode 2000/05/02: Added support for BSD/OS (ethernet_stub.h) 2000/05/02: Improved libpcap detection in configure 2000/05/02: Improved buffer overflow prevention 1.0: 2000/05/01 - Initial public release 2000/04/27 - Awww man, gotta write manpages and docs if i wanna release this! 2000/04/20 - Renamed a bunch of options and output strings to make room for future options. tcpstat-1.5/INSTALL0100644000175000000000000001722707102316705013410 0ustar phermanwheelBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. tcpstat-1.5/LICENSE0100644000175000000000000000251507103016626013356 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ tcpstat-1.5/Makefile.am0100644000175000000000000000011207467347446014420 0ustar phermanwheelOBJEXT=o AUTOMAKE_OPTIONS = foreign no-dependencies SUBDIRS = doc lib src tcpstat-1.5/NEWS0100644000175000000000000000003007103016626013036 0ustar phermanwheelNo news is good news... tcpstat-1.5/README0100644000175000000000000000677407544711401013246 0ustar phermanwheelTcpstat v1.5 ------------ LICENSE ------- This software can be freely distributed under the terms of the "BSD License." See the "LICENSE" file distributed with this software for more information. INTRODUCTION ------------ tcpstat reports certain network interface statistics much like vmstat(8) does for system statistics. tcpstat gets its information by either monitoring a specific interface, or by reading previously saved tcpdump(1) data from a file. Because this program has a lot more to with network info than just TCP stuff, the "tcp" in tcpstat should really be "net", but someone already got dibbs on the name "netstat" a long, long time ago. Rats! :) TESTED PLATFORMS ---------------- -- BSD * FreeBSD 3.x, 4.x, 5.0 * NetBSD 1.5 * OpenBSD 2.7 * BSD/OS 3.0, 4.0 * Mac OS X 10.1 -- Compaq/Digital * Tru64 Unix 4.0 (*) * Tru64 Unix 5.1 (*) -- HP * HPUX 11.0 -- IBM * AIX 4.3 -- Linux * Debian 2.2 * Mandrake 7.2, 8.0 * RedHat 6.0, 6.2, 7.0, 7.2 * Slackware 7.0, 8.0 * SuSE 6.4, 7.0 * TurboLinux IA64 000828 (*) -- Sun * Solaris 2.5, 2.6, 7, 8 If your OS is not listed, email me and tell me how it went. I'd like to port this to as many unix platforms as possible. (*) Thanks to Compaq's testdrive program. INSTALLATION ------------ If you have compiled and installed any software from source before, you should know the routine by now: 1) Unpack the archive 2) cd tcpstat-1.5 (or whatever the directory name is) 3) ./configure 4) make 5) make install (as root, if necessary) tcpstat *does* require the pcap library, so you make have to set the library and include paths with "configure" manually. See "./configure --help" USAGE ----- Tcpstat needs input, be it "live" from a network interface, or from a "tcpdump" file written at some previous time. The command line options determine where tcpstat gets it's info. The man page is the best place to see how to use it. Some examples (from the man page): tcpstat -i fxp0 Displays the default statistics every 5 seconds of all traffic currently passing through the fxp0 network interface. tcpstat -r file.dump Displays the default statistics every 5 seconds from the tcpdump(1) generated file "file.dump". tcpstat -f 'port (smtp or http)' -o '%S %b\n' -r file.dump 2.3 Displays every 2.3 seconds the timestamp together with smtp and http traffic throughput of the data from "file.dump", in a format which would be suitable for gnuplot(1). tcpstat -b 28800 -r file.dump 0.5 Displays what percentage of the traffic in file.dump exceeded the speed of my modem (28800 bits per second.) NOTES ----- There is the option which allows the user to write to any (and/or multiple) arbitrary file descriptor(s). This is a very nice feature, and lets tcpstat write separate statistics into different files or pipes, for example. This is in and of itself not a security risk, because the user can do this trivially with any shell. However, if you choose to install the program setuid, then the user will be able to write on open file descriptors (for example the open /dev/bpf device) that the user in some cases may not normally have access to. Installing the program setuid is strongly discouraged, but if it is a must in your environment, you can disable this feature using the configure feature: ./configure --disable-fdesc AUTHOR ------ Paul Herman Cologne, Germany. Please send all bug reports to this address. Thanks for trying this out, and I hope it helps. It did for me. tcpstat-1.5/aclocal.m40100644000175000000000000004501307614314670014220 0ustar phermanwheel# aclocal.m4 generated automatically by aclocal 1.5 # Copyright 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 5 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # We require 2.13 because we rely on SHELL being computed by configure. AC_PREREQ([2.13]) # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED. # The purpose of this macro is to provide the user with a means to # check macros which are provided without letting her know how the # information is coded. # If this macro is not defined by Autoconf, define it here. ifdef([AC_PROVIDE_IFELSE], [], [define([AC_PROVIDE_IFELSE], [ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE]) # ---------------------------------------------- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first]) fi # Define the identity of the package. PACKAGE=$1 AC_SUBST(PACKAGE)dnl VERSION=$2 AC_SUBST(VERSION)dnl ifelse([$3],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. ifdef([m4_pattern_allow], [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl # Autoconf 2.50 always computes EXEEXT. However we need to be # compatible with 2.13, for now. So we always define EXEEXT, but we # don't compute it. AC_SUBST(EXEEXT) # Similar for OBJEXT -- only we only use OBJEXT if the user actually # requests that it be used. This is a bit dumb. : ${OBJEXT=o} AC_SUBST(OBJEXT) # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_DEP_TRACK])dnl AC_REQUIRE([AM_SET_DEPDIR])dnl AC_PROVIDE_IFELSE([AC_PROG_][CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_][CC], defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_][CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_][CXX], defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) # # Check to make sure that the build environment is sane. # # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # serial 2 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= am_backtick='`' AC_MSG_WARN([${am_backtick}missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # --------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX" or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'] [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type" AC_SUBST([$1DEPMODE]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST(DEPDIR) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) pushdef([subst], defn([AC_SUBST])) subst(AMDEPBACKSLASH) popdef([subst]) ]) # Generate code to set up dependency tracking. # This macro should only be invoked once -- use via AC_REQUIRE. # Usage: # AM_OUTPUT_DEPENDENCY_COMMANDS # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[ AC_OUTPUT_COMMANDS([ test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do case "$mf" in Makefile) dirpart=.;; */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; *) continue;; esac grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`echo "$file" | sed -e 's|/[^/]*$||'` $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])]) # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include='#' am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote='"' _am_result=BSD fi fi AC_SUBST(am__include) AC_SUBST(am__quote) AC_MSG_RESULT($_am_result) rm -f confinc confmf ]) # serial 3 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. # # FIXME: Once using 2.50, use this: # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [errprint(__file__:__line__: [$0: invalid condition: $1 ])dnl m4exit(1)])dnl ifelse([$1], [FALSE], [errprint(__file__:__line__: [$0: invalid condition: $1 ])dnl m4exit(1)])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi]) # Like AC_CONFIG_HEADER, but automatically create stamp file. # serial 3 # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. We must strip everything past the first ":", # and everything past the last "/". AC_PREREQ([2.12]) AC_DEFUN([AM_CONFIG_HEADER], [ifdef([AC_FOREACH],dnl [dnl init our file count if it isn't already m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0])) dnl prepare to store our destination file list for use in config.status AC_FOREACH([_AM_File], [$1], [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*])) m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index)) dnl and add it to the list of files AC keeps track of, along dnl with our hook AC_CONFIG_HEADERS(_AM_File, dnl COMMANDS, [, INIT-CMDS] [# update the timestamp echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index[" ][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS m4_popdef([_AM_Dest])])],dnl [AC_CONFIG_HEADER([$1]) AC_OUTPUT_COMMANDS( ifelse(patsubst([$1], [[^ ]], []), [], [test -z "$CONFIG_HEADERS" || echo timestamp >dnl patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl [am_indx=1 for am_file in $1; do case " \$CONFIG_HEADERS " in *" \$am_file "*) am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\` if test -n "\$am_dir"; then am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\` for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do am_tmpdir=\$am_tmpdir\$am_subdir/ if test ! -d \$am_tmpdir; then mkdir \$am_tmpdir fi done fi echo timestamp > "\$am_dir"stamp-h\$am_indx ;; esac am_indx=\`expr \$am_indx + 1\` done]) ])]) # AM_CONFIG_HEADER # _AM_DIRNAME(PATH) # ----------------- # Like AS_DIRNAME, only do it during macro expansion AC_DEFUN([_AM_DIRNAME], [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1, m4_if(m4_regexp([$1], [^/.*]), -1, [.], m4_patsubst([$1], [^\(/\).*], [\1])), m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl ]) # _AM_DIRNAME tcpstat-1.5/configure.in0100644000175000000000000001227707520367146014701 0ustar phermanwheeldnl Process this file with autoconf to produce a configure script. dnl dnl $Id: configure.in,v 1.39 2002/07/27 00:50:46 pherman Exp $ dnl AC_INIT(src/tcpstat.c) AM_INIT_AUTOMAKE(tcpstat, 1.5) AM_CONFIG_HEADER(include/config.h) dnl ######################### dnl Set Global make Variables dnl ######################### CFLAGS=${CFLAGS:-"-O"} dnl ########################### dnl First, setup my own options dnl ########################### AC_ARG_WITH(pcap-include, [ --with-pcap-include=DIR pcap.h is in DIR]) if test "x${with_pcap_include}" = x -o "x${with_pcap_include}" = xno then # Try to make an educated guess # Hacks for crazy Linux distributions. # C'mon kids get it together, woncha? I mean, base distros go in /usr # and everything else goes in /usr/local... sheesh. # Redhat - /usr/include/pcap # SuSE - /usr/include/nessus for pdir in /usr/include/pcap /usr/include/nessus /usr/local/include /usr/local/include/pcap do if test -r ${pdir}/pcap.h then CPPFLAGS="-I${pdir} "${CPPFLAGS}; break fi done else CPPFLAGS=" -I${with_pcap_include} "${CPPFLAGS} fi AC_ARG_WITH(pcap-lib, [ --with-pcap-lib=DIR libpcap.a is in DIR]) if test "x$with_pcap_lib" = x -o "x$with_pcap_lib" = xno then # Try to make an educated guess for pdir in /usr/local/lib /opt/lib /vol/lib do if test -r ${pdir}/libpcap.a then LDFLAGS="-L${pdir} "${LDFLAGS}; break fi done else LDFLAGS=" -L${with_pcap_lib} "${LDFLAGS} fi AC_ARG_ENABLE(fdesc, [ --disable-fdesc do this if installed setuid]) if test "x${enable_fdesc}" = xno then AC_DEFINE(NO_FILEDESC, 1, [ Disable the ability to write to arbitrary file descriptors. ]) fi dnl ###################################### dnl CHECK FOR VARIOUS OSES (Linux, etc...) dnl ###################################### AC_MSG_CHECKING([to see if I can guess the OS to build for]) my_build_os=${build_os:-`uname -s | tr 'A-Z' 'a-z'`} if test "x${my_build_os}" = x then AC_MSG_ERROR([Can't determine OS. Broken uname?]) else echo ${my_build_os} fi case $my_build_os in aix*) AC_DEFINE(AIX_STRANGENESS, 1, [ defined on AIX systems. ]) ;; osf1*) AC_DEFINE(TRU64_STRANGENESS, 1, [ defined on OSF systems. ]) ;; linux*) AC_DEFINE(_BSD_SOURCE, 1, [ defined usually on linux systems ] ) ;; bsd/os*) ;; freebsd*) ;; sunos*) ;; esac dnl ################### dnl Checks for programs dnl ################### AC_PROG_CC AC_PROG_RANLIB dnl ####################### dnl Checks for header files dnl ####################### AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(sys/time.h sys/stat.h unistd.h strings.h fcntl.h netinet/ip6.h) dnl BSD/OS Seems to not have a good ethernet header, so we gotta wing it AC_CHECK_HEADERS(net/if.h net/ethernet.h netinet/if_ether.h net/ppp_defs.h) dnl ############################################################# dnl Checks for typedefs, structures, and compiler characteristics dnl ############################################################# AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME dnl ############################ dnl Checks for library functions dnl ############################ AC_CHECK_FUNCS(strtol strtoul ualarm perror inet_ntop) AC_CHECK_FUNCS(snprintf, , [ echo "WARNING: You don't seem to have snprintf() (Solaris 2.5.x?)" echo " There may be a slight security problem without it." echo " Probably not -- but you have been warned." ]) dnl math lib? MATHLIB="" AC_CHECK_LIB(m, sqrt, MATHLIB="-lm") dnl socket? Solaris has it somewhere else. AC_CHECK_LIB(c, socket, [:], [ AC_CHECK_LIB(socket, socket, [ LIBS="-lsocket ${LIBS}" ], []) ]) dnl gethostbyaddr? Solaris has it somewhere else. AC_CHECK_LIB(c, gethostbyaddr, [:], [ AC_CHECK_LIB(nsl, gethostbyaddr, [ LIBS="-lnsl ${LIBS}" ], []) ]) dnl getprotobynumber? Solaris has it somewhere else. dnl hope the rest is also there (getnetbyname, getservbyport, etc.) AC_CHECK_LIB(c, getprotobynumber, [:], [ AC_CHECK_LIB(nsl, getprotobynumber, [ LIBS="-lnsl ${LIBS}" ], []) ]) dnl pcap lib? AC_CHECK_HEADERS(net/bpf.h) AC_CHECK_HEADERS(pcap.h, [:], [ AC_MSG_ERROR([ I couldn't find pcap.h. Please install libpcap. If you already have... then please rerun configure with the option --with-pcap-include=DIR with "DIR" being where pcap is found.]) ]) AC_CHECK_LIB(pcap, pcap_major_version, LIBS="-lpcap ${LIBS}", [ AC_MSG_ERROR([ I couldn't find libpcap. Please install libpcap. If you already have... then please rerun configure with the option --with-pcap-lib=DIR with "DIR" being where libpcap is found.]) ]) dnl look for dbopen for tcpprof TCPPROF="" LD_TCPPROF="" AC_CHECK_LIB(c, dbopen, [ TCPPROF=tcpprof ], [ AC_CHECK_LIB(db1, dbopen, [ TCPPROF=tcpprof LD_TCPPROF="-ldb1" AC_DEFINE(USE_DB1_LIBRARY, 1, [ Use the sleepycat DB library. ]) ], [ AC_MSG_WARN([ *** WARNING *** I couldn't locate the Berkeley DB library. The extra utility "tcpprof" will not be built. THIS IS OK!!! "tcpstat" will continue to be built as if this never happened. If you wish to use the extra "tcpprof" program, please install the Berkeley DB library from: ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.tar.gz ]) ]) ]) AC_SUBST(TCPPROF) AC_SUBST(LD_TCPPROF) AC_SUBST(MATHLIB) AC_CONFIG_FILES([ Makefile doc/Makefile lib/Makefile src/Makefile ]) AC_OUTPUT tcpstat-1.5/install-sh0100755000175000000000000001273607102316705014363 0ustar phermanwheel#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 tcpstat-1.5/missing0100755000175000000000000002405007507525700013754 0ustar phermanwheel#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar ${1+"$@"} && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar ${1+"$@"} && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" ${1+"$@"} && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" ${1+"$@"} && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 tcpstat-1.5/mkinstalldirs0100755000175000000000000000132507102316705015155 0ustar phermanwheel#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.1 2000/04/28 14:18:45 pherman Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here tcpstat-1.5/Makefile.in0100644000175000000000000003103507614314671014425 0ustar phermanwheel# Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ DEPDIR = @DEPDIR@ EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD_TCPPROF = @LD_TCPPROF@ MATHLIB = @MATHLIB@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ TCPPROF = @TCPPROF@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ OBJEXT = o AUTOMAKE_OPTIONS = foreign no-dependencies SUBDIRS = doc lib src subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = depcomp = DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README ./include/config.h.in ./include/stamp-h.in AUTHORS \ COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS \ aclocal.m4 configure configure.in install-sh missing \ mkinstalldirs DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$@ $(SHELL) ./config.status $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) include/config.h: include/stamp-h @if test ! -f $@; then \ rm -f include/stamp-h; \ $(MAKE) include/stamp-h; \ else :; fi include/stamp-h: $(srcdir)/./include/config.h.in $(top_builddir)/config.status @rm -f include/stamp-h include/stamp-hT @echo timestamp > include/stamp-hT 2> /dev/null cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=include/config.h \ $(SHELL) ./config.status @mv include/stamp-hT include/stamp-h $(srcdir)/./include/config.h.in: $(srcdir)/./include/stamp-h.in @if test ! -f $@; then \ rm -f $(srcdir)/./include/stamp-h.in; \ $(MAKE) $(srcdir)/./include/stamp-h.in; \ else :; fi $(srcdir)/./include/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) @rm -f $(srcdir)/./include/stamp-h.in $(srcdir)/./include/stamp-h.inT @echo timestamp > $(srcdir)/./include/stamp-h.inT 2> /dev/null cd $(top_srcdir) && $(AUTOHEADER) @mv $(srcdir)/./include/stamp-h.inT $(srcdir)/./include/stamp-h.in distclean-hdr: -rm -f include/config.h uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . # Avoid unsightly `./'. distdir = $(PACKAGE)-$(VERSION) GZIP_ENV = --best distdir: $(DISTFILES) -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/./include @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ $(mkinstalldirs) "$(distdir)/$$dir"; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || (echo "Error: files left after uninstall" 1>&2; \ exit 1) ) \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && $(MAKE) $(AM_MAKEFLAGS) distclean \ && rm -f $(distdir).tar.gz \ && (test `find . -type f -print | wc -l` -eq 0 \ || (echo "Error: files left after distclean" 1>&2; \ exit 1) ) -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) distclean: distclean-recursive -rm -f config.status config.cache config.log distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-recursive dist dist-all distcheck distclean \ distclean-generic distclean-hdr distclean-recursive \ distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ info-recursive install install-am install-data install-data-am \ install-data-recursive install-exec install-exec-am \ install-exec-recursive install-info install-info-am \ install-info-recursive install-man install-recursive \ install-strip installcheck installcheck-am installdirs \ installdirs-am installdirs-recursive maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive mostlyclean \ mostlyclean-generic mostlyclean-recursive tags tags-recursive \ uninstall uninstall-am uninstall-info-am \ uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: tcpstat-1.5/include/0040755000175000000000000000000007614315535014004 5ustar phermanwheeltcpstat-1.5/include/ethernet_stub.h0100644000175000000000000000467307200530772017030 0ustar phermanwheel/* * Fundamental constants relating to ethernet. * * $FreeBSD: src/sys/net/ethernet.h,v 1.9.2.1 1999/08/29 16:28:13 peter Exp $ * $Id: ethernet_stub.h,v 1.4 2000/11/03 12:39:22 pherman Exp $ * */ #ifndef _ETHERNET_STUB_H_ #define _ETHERNET_STUB_H_ /* * The number of bytes in an ethernet (MAC) address. */ #define ETHER_ADDR_LEN 6 /* * The number of bytes in the type field. */ #define ETHER_TYPE_LEN 2 /* * The number of bytes in the trailing CRC field. */ #define ETHER_CRC_LEN 4 /* * The length of the combined header. */ #define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN) /* * The minimum packet length. */ #define ETHER_MIN_LEN 64 /* * The maximum packet length. */ #define ETHER_MAX_LEN 1518 /* * A macro to validate a length with */ #define ETHER_IS_VALID_LEN(foo) \ ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN) /* * Structure of a 10Mb/s Ethernet header. */ struct ether_header { u_char ether_dhost[ETHER_ADDR_LEN]; u_char ether_shost[ETHER_ADDR_LEN]; u_short ether_type; }; /* * Structure of a 48-bit Ethernet address. */ struct ether_addr { u_char octet[ETHER_ADDR_LEN]; }; #define ETHERTYPE_PUP 0x0200 /* PUP protocol */ #define ETHERTYPE_IP 0x0800 /* IP protocol */ #define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */ #define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */ #define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */ #define ETHERTYPE_IPV6 0x86dd /* IPv6 */ #define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */ /* XXX - add more useful types here */ /* * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have * (type-ETHERTYPE_TRAIL)*512 bytes of data followed * by an ETHER type (as given above) and then the (variable-length) header. */ #define ETHERTYPE_TRAIL 0x1000 /* Trailer packet */ #define ETHERTYPE_NTRAILER 16 #define ETHERMTU (ETHER_MAX_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define ETHERMIN (ETHER_MIN_LEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #ifdef I_NEED_ETHER_PROTOS # ifndef KERNEL # include /* * Ethernet address conversion/parsing routines. */ __BEGIN_DECLS struct ether_addr *ether_aton __P((char *)); int ether_hostton __P((char *, struct ether_addr *)); int ether_line __P((char *, struct ether_addr *, char *)); char *ether_ntoa __P((struct ether_addr *)); int ether_ntohost __P((char *, struct ether_addr *)); __END_DECLS #endif /* !KERNEL */ #endif /* I_NEED_ETHER_PROTOS */ #endif /* !_ETHERNET_STUB_H_ */ tcpstat-1.5/include/packetdump.h0100644000175000000000000000343707200530773016310 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: packetdump.h,v 1.2 2000/11/03 12:39:23 pherman Exp $ */ #ifndef PACKETDUMP_PACKETDUMP_H #define PACKETDUMP_PACKETDUMP_H #include "tcpstat.h" #define PP_SHOW_BASICINFO 0x0001 #define PP_SHOW_LINKLAYER 0x0002 #define PP_SHOW_IPHEADER 0x0004 #define PP_SHOW_TCPHEADER 0x0010 #define PP_SHOW_UDPHEADER 0x0020 #define PP_SHOW_ICMPHEADER 0x0040 #define PP_SHOW_PACKETCONTENT 0x0100 #endif /* PACKETDUMP_PACKETDUMP_H */ /**************** END *****************/ tcpstat-1.5/include/snoop.h0100644000175000000000000000354107200530773015305 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: snoop.h,v 1.2 2000/11/03 12:39:23 pherman Exp $ */ #ifndef TCPSTAT_SNOOP_H #define TCPSTAT_SNOOP_H struct snoop_file_header { char magic[8]; /* is "snoop\0\0\0" */ u_int version; /* current version is "2" */ u_int linktype; /* link type */ }; /* link_types */ #define SNOOP_DL_ETHER 0x04 /* Ethernet Bus */ #define SNOOP_DL_FDDI 0x08 /* Fiber Distributed data interface */ struct snoop_packet_header { u_int len; u_int tlen; u_int blen; u_int unused3; u_int secs; u_int usecs; }; #endif /* TCPSTAT_SNOOP_H */ tcpstat-1.5/include/tcpprof.h0100644000175000000000000000372307422173250015625 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: tcpprof.h,v 1.9 2002/01/19 04:31:36 pherman Exp $ */ #ifndef TCPPROF_TCPPROF_H #define TCPPROF_TCPPROF_H #include "tcpstat.h" /* Types of statistics to measure */ #define TYPE_ALL 0x01 #define TYPE_LINK 0x02 #define TYPE_IP_PROTO 0x04 #define TYPE_PORT 0x08 #define TYPE_HOST 0x10 #define TYPE_NET 0x20 typedef struct stat_root { u_int type; u_int count; struct stat_unit **hash; } stat_root; /* stats.c protos */ int stats_initdb(u_int types); int stats_closedb(); void stats_insert(packet_data *pd, u_int types); void show_results(u_int types); #endif /* TCPPROF_TCPPROF_H */ /**************** END *****************/ tcpstat-1.5/include/tcpstat.h0100644000175000000000000001705007476066300015636 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: tcpstat.h,v 1.41 2002/06/01 06:42:08 pherman Exp $ */ #ifndef TCPSTAT_TCPSTAT_H #define TCPSTAT_TCPSTAT_H #ifdef HAVE_CONFIG_H # include "config.h" #else /* Hmmm, try to wing it */ # ifdef __linux__ # define _BSD_SOURCE # endif #endif /* HAVE_CONFIG_H */ #ifdef HAVE_SYS_TYPES_H #include #endif #include /* printf() */ #include /* fork(), execlp() */ #include /* free(), malloc() */ #include /* bzero() */ #include /* sqrt() */ #include /* tolower */ #include /* struct timeval */ #include /* waitpid() */ #ifdef HAVE_SYS_STAT_H # include /* stat() */ #endif #include /* needed by INET stuff (sockaddr) */ #include /* needed by INET stuff (in_addr) */ #include /* needed by INET stuff (n_long) */ #ifdef HAVE_NETINET_IP6_H # ifdef AIX_STRANGENESS # define STEVENS_API /* this gives us BSD style ip6hdr */ # define ip6_hdr ip6hdr # endif # include /* IPv6 structs and constats */ # include /* IPv6 ICMP stuff */ # ifndef INET6 # define INET6 /* Force INET6 code */ # endif # ifdef TRU64_STRANGENESS # ifndef ip6_vfc # define ip6_vfc ip6_vcf /* Is this a Tru64 typo? */ # endif # endif #endif #ifdef HAVE_NET_ETHERNET_H # include /* struct ether_header */ #else # if defined(HAVE_NETINET_IF_ETHER_H) && defined(AIX_STRANGENESS) # include "netinet/if_ether.h" # else # include "ethernet_stub.h" /* Hope this works... */ # endif #endif #ifndef ETHERTYPE_IPX # define ETHERTYPE_IPX 0x8137 /* IPX Protocol */ #endif #ifndef ETHERTYPE_AT # define ETHERTYPE_AT 0x809B /* AppleTalk protocol */ # define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */ #endif #ifndef ETHERTYPE_IPV6 # define ETHERTYPE_IPV6 0x86dd /* IPv6 */ #endif #ifndef ETHER_HDR_LEN # define ETHER_HDR_LEN 14 /* Just in case... */ #endif #ifdef HAVE_NET_IF_H # include /* struct ifnet */ #endif #include /* struct arp_hdr */ #include /* struct ip */ #include /* struct tcphdr */ #include /* struct udphdr */ #include /* struct icmp */ #include /* inet_ntoa() */ #include /* getprotobynumber */ #include /* pcap_*() */ #include #ifdef HAVE_STRINGS_H # include /* Solaris bzero/bcopy/etc... */ #endif #ifdef HAVE_NET_PPP_DEFS_H # include #else # define PPP_HDRLEN 4 #endif /* HAVE_NET_PPP_DEFS_H */ #ifdef HAVE_FCNTL_H # include #else # define O_RDONLY 0x0000 /* open for reading only */ #endif /* HAVE_FCNTL_H */ #ifndef HAVE_PERROR #define perror(x) { fprintf(stderr, "Error: %s\n", x); } #endif /* !HAVE_PERROR */ #ifndef HAVE_SNPRINTF # ifdef __GNUC__ # define snprintf(a, b, c...) sprintf(a, ## c) # else # define snprintf(a, b, c, d) sprintf(a, c, d) # endif /* __GNUC__ */ #endif /* !HAVE_SNPRINTF */ #define BUF_SIZ 4096 /* General string buffer size */ #define PAK_SIZ 32768 #define Double double /* FP accuracy */ /* * Magic numbers for various dump files */ #define PCAP_FILE_MAGIC 0xa1b2c3d4 /* first 4 bytes of PCAP file */ #define PCAP_FILE_MAGIC_RH 0xa1b2cd34 /* proprietary RedHat PCAP file */ #define SNOOP_FILE_MAGIC 0x736e6f6f /* "snoo" */ #define SNOOP_FILE_MAGIC_2 0x70000000 /* "p\0\0\0 */ /* Orthogonal Link types in struct packet_data */ #define LINK_NONE 0x0001 #define LINK_ETHERNET 0x0002 #define LINK_PPP 0x0004 #define GENERIC_LINK_IP 0x0100 #define GENERIC_LINK_IP6 0x0200 #define GENERIC_LINK_OTHER 0xff00 /* supported LINK_NONE types */ #define LINK_NONE_IP 0x0100 #define LINK_NONE_IP6 0x0200 #define LINK_NONE_OTHER 0xff00 /* supported LINK_ETHERNET types */ #define LINK_ETHERNET_IP 0x0100 /* Plain old IP */ #define LINK_ETHERNET_IP6 0x0200 /* New IPv6 */ #define LINK_ETHERNET_ARP 0x0300 /* (A)ddress (R)esolution (P)rotocol */ #define LINK_ETHERNET_REVARP 0x0400 /* Reverse ARP */ #define LINK_ETHERNET_IPX 0x0500 /* IPX */ #define LINK_ETHERNET_AT 0x0600 /* Appletalk */ #define LINK_ETHERNET_AARP 0x0700 /* Appletalk ARP */ #define LINK_ETHERNET_OTHER 0xff00 /* supported LINK_PPP types */ #define LINK_PPP_IP 0x0100 #define LINK_PPP_IP6 0x0200 #define LINK_PPP_IPCP 0x0300 #define LINK_PPP_IPCP6 0x0400 #define LINK_PPP_CCP 0x0500 #define LINK_PPP_LCP 0x0600 #define LINK_PPP_PAP 0x0700 #define LINK_PPP_CHAP 0x0800 #define LINK_PPP_OTHER 0xff00 /* in get_dump_data, flags on how to operate */ #define GET_TCPD_COUNT_LINKSIZE 0x01 #define GET_TCPD_DO_LIVE 0x02 #define GET_TCPD_DO_LIVE_PROMISC 0x04 typedef struct ip_packet { struct ip hdr; union { struct tcphdr tcphdr; struct udphdr udphdr; struct icmp icmp; } body; } ip_packet; #ifdef INET6 typedef struct ip6_packet { struct ip6_hdr hdr; union { struct tcphdr tcphdr; struct udphdr udphdr; struct icmp6_hdr icmp6hdr; } body; } ip6_packet; #endif typedef struct packet_data { struct timeval timestamp; u_int packet_len; u_int buffer_len; u_int link_type; struct ether_header ether; union { struct arphdr arp; struct ip_packet ip; #ifdef INET6 struct ip6_packet ip6; #endif u_char raw[PAK_SIZ]; } data; } packet_data; /************** Prototypes **************/ /* process.c protos */ int get_dump_data(char *fname, char *filter, int flags, Double capture_seconds, void (*hook)(packet_data *, void **), void **args); /* print_packet.c protos */ void print_packet(packet_data *p, int what_to_print); /* utils.c protos */ int is_ethernetarp_packet(packet_data *p); int is_ip_packet(packet_data *p); unsigned char get_ip_proto(packet_data *p); int is_ip_tcp_packet(packet_data *p); int is_ip_udp_packet(packet_data *p); int is_ip_icmp_packet(packet_data *p); #ifdef INET6 int is_ip6_packet(packet_data *p); #endif char *my_basename(char *p); char *my_get_port(u_short port, int n_only); char *my_get_proto(u_short proto, int n_only); char *my_safe_strcpy(char **dst, const char *src); void my_alarm(Double seconds); u_char count_1bits(u_int x); #ifndef HAVE_INET_NTOP char *inet_ntop(int af, void *src, char *dst, int n); #endif /* HAVE_INET_NTOP */ #endif /* TCPSTAT_TCPSTAT_H */ /**************** END *****************/ tcpstat-1.5/include/config.h.in0100644000175000000000000000526107614314671016030 0ustar phermanwheel/* include/config.h.in. Generated automatically from configure.in by autoheader. */ /* defined on AIX systems. */ #undef AIX_STRANGENESS /* Define if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have the header file. */ #undef HAVE_NETINET_IF_ETHER_H /* Define if you have the header file. */ #undef HAVE_NETINET_IP6_H /* Define if you have the header file. */ #undef HAVE_NET_BPF_H /* Define if you have the header file. */ #undef HAVE_NET_ETHERNET_H /* Define if you have the header file. */ #undef HAVE_NET_IF_H /* Define if you have the header file. */ #undef HAVE_NET_PPP_DEFS_H /* Define if you have the header file. */ #undef HAVE_PCAP_H /* Define if you have the `perror' function. */ #undef HAVE_PERROR /* Define if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define if you have the header file. */ #undef HAVE_STDINT_H /* Define if you have the header file. */ #undef HAVE_STDLIB_H /* Define if you have the header file. */ #undef HAVE_STRINGS_H /* Define if you have the header file. */ #undef HAVE_STRING_H /* Define if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define if you have the `ualarm' function. */ #undef HAVE_UALARM /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Disable the ability to write to arbitrary file descriptors. */ #undef NO_FILEDESC /* Name of package */ #undef PACKAGE /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* defined on OSF systems. */ #undef TRU64_STRANGENESS /* Use the sleepycat DB library. */ #undef USE_DB1_LIBRARY /* Version number of package */ #undef VERSION /* defined usually on linux systems */ #undef _BSD_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `unsigned' if does not define. */ #undef size_t tcpstat-1.5/include/stamp-h.in0100644000175000000000000000000007614314671015670 0ustar phermanwheeltcpstat-1.5/include/stamp-h10100644000175000000000000000001207614314700015340 0ustar phermanwheeltimestamp tcpstat-1.5/lib/0040755000175000000000000000000007614315535013127 5ustar phermanwheeltcpstat-1.5/lib/Makefile.am0100644000175000000000000000024607300534430015147 0ustar phermanwheelAUTOMAKE_OPTIONS = foreign no-dependencies noinst_LIBRARIES = libtcpstat.a INCLUDES = -I../include libtcpstat_a_SOURCES = print_packet.c process.c tcpseq.c utils.c tcpstat-1.5/lib/print_packet.c0100644000175000000000000002106507525772254015765 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: print_packet.c,v 1.29 2002/08/12 17:47:24 pherman Exp $ */ #include "tcpstat.h" #include "packetdump.h" char gstr[8192]; void print_arp_header(struct arphdr *arp); void print_ip_header(struct ip *ip); void print_tcp_header(struct tcphdr *tcp, unsigned int len, int wtp); void print_udp_header(struct udphdr *udp, unsigned int len, int wtp); void print_icmp_header(struct icmp *icmp, unsigned int len, int wtp); #ifdef INET6 void print_ip6_header(struct ip6_hdr *ip); void print_icmp6_header(struct icmp6_hdr *icmp6, unsigned int len, int wtp); #endif char *my_charconv(char c) { char *s; gstr[0] = '\0'; s = gstr; if (isgraph((int)c)) *s++ = c; else if (c == ' ') *s++ = c; /* else if (c == '\n') { *s++ = '\\'; *s++ = 'n'; } */ else if (c == '\n' || c == '\r') { *s++ = c; } /* else if (c == '\r') { *s++ = '\\'; *s++ = 'r'; } */ else *s++ = '.'; *s = '\0'; return gstr; } void print_packet(packet_data *p, int what_to_print) { struct ip *ip; struct tcphdr *tcp; struct udphdr *udp; struct icmp *icmp; #ifdef INET6 struct ip6_hdr *ip6; struct icmp6_hdr *icmp6; #endif if (what_to_print & PP_SHOW_BASICINFO) { printf("PACKET SIZE: %u", p->packet_len); if (p->packet_len != p->buffer_len) printf(", (BUFFER SIZE: %u)", p->buffer_len); printf("\n"); } if (what_to_print & PP_SHOW_LINKLAYER) { if (p->ether.ether_type == ETHERTYPE_ARP) { print_arp_header(&(p->data.arp)); printf("---------------------------\n"); return; } } if ((p->link_type & GENERIC_LINK_OTHER) != GENERIC_LINK_IP #ifdef INET6 && (p->link_type & GENERIC_LINK_OTHER) != GENERIC_LINK_IP6 #endif ) return; /* OK, it's an IP Packet */ ip = &(p->data.ip.hdr); tcp= &(p->data.ip.body.tcphdr); udp= &(p->data.ip.body.udphdr); icmp= &(p->data.ip.body.icmp); #ifdef INET6 ip6 = &(p->data.ip6.hdr); tcp= &(p->data.ip6.body.tcphdr); udp= &(p->data.ip6.body.udphdr); icmp6= &(p->data.ip6.body.icmp6hdr); #endif if (what_to_print & PP_SHOW_IPHEADER) { if (is_ip_packet(p)) print_ip_header(ip); #ifdef INET6 if (is_ip6_packet(p)) print_ip6_header(ip6); #endif } p->buffer_len -= sizeof(struct ip); switch (get_ip_proto(p)) { case IPPROTO_TCP: print_tcp_header(tcp, p->buffer_len, what_to_print); break; case IPPROTO_UDP: print_udp_header(udp, p->buffer_len, what_to_print); break; case IPPROTO_ICMP: print_icmp_header(icmp, p->buffer_len, what_to_print); break; #ifdef INET6 case IPPROTO_ICMPV6: print_icmp6_header(icmp6, p->buffer_len, what_to_print); break; #endif default: printf("UNKNOWN IP PROTOCOL! (0x%.4X)\n", (unsigned int)get_ip_proto(p)); break; } } void print_arp_header(struct arphdr *arp) { printf("ARP PACKET:\n"); printf("\thrd=%u pro=%u hln=%u plen=%u op=%u", (unsigned int)htons(arp->ar_hrd), (unsigned int)htons(arp->ar_pro), (unsigned int)arp->ar_hln, (unsigned int)arp->ar_pln, (unsigned int)htons(arp->ar_op) ); printf("\n"); } void print_ip_header(struct ip *ip) { char indnt[64] = " "; struct protoent *ip_prot; printf(" IP HEADER:\n"); ip_prot = getprotobynumber(ip->ip_p); if (ip_prot == NULL) { printf("Couldn't get IP Protocol\n"); return; } printf("%sver=%d hlen=%u TOS=%u len=%u ID=0x%.2X", indnt, #ifdef _IP_VHL ip->ip_vhl >> 4, (ip->ip_vhl & 0x0f) << 2, #else ip->ip_v, ip->ip_hl<<2, #endif (unsigned int)ip->ip_tos, (unsigned int)htons(ip->ip_len), (unsigned int)htons(ip->ip_id) ); printf("\n%sFRAG=0x%.2x TTL=%u Proto=%s cksum=0x%.2X\n", indnt, htons(ip->ip_off), (unsigned int)ip->ip_ttl, ip_prot->p_name, htons(ip->ip_sum) ); printf("%s%s", indnt, inet_ntoa(ip->ip_src) ); printf(" -> %s\n", inet_ntoa(ip->ip_dst) ); } #ifdef INET6 void print_ip6_header(struct ip6_hdr *ip) { char indnt[64] = " "; struct protoent *ip_prot; printf(" IPv6 HEADER:\n"); ip_prot = getprotobynumber(ip->ip6_nxt); if (ip_prot == NULL) { printf("Couldn't get IP Protocol\n"); return; } printf("%sver=%u class=0x%.2X label=0x%.5X plen=%u nxt=%u hlim=%u\n", indnt, (unsigned int)(ip->ip6_vfc & 0xf0) >> 4, (unsigned int)(htonl(ip->ip6_flow) & 0x0ff00000) >> 20, (unsigned int)(htonl(ip->ip6_flow) & 0x000fffff), htons(ip->ip6_plen), (unsigned int)ip->ip6_nxt, (unsigned int)ip->ip6_hlim ); printf("%s%s", indnt, inet_ntop(AF_INET6, &(ip->ip6_src), gstr, sizeof(gstr)) ); printf(" -> %s\n", inet_ntop(AF_INET6, &(ip->ip6_src), gstr, sizeof(gstr)) ); } #endif /* INET6 */ void print_tcp_header(struct tcphdr *tcp, unsigned int len, int wtp) { char indnt[64] = " "; if (wtp & PP_SHOW_TCPHEADER) { printf("%sTCP HEADER:\n", indnt); printf("%ssport=%u dport=%u seq=0x%lX ack=0x%lX doff=0x%.2X\n", indnt, (unsigned int)htons(tcp->th_sport), (unsigned int)htons(tcp->th_dport), (unsigned long int)htonl(tcp->th_seq), (unsigned long int)htonl(tcp->th_ack), tcp->th_off ); printf("%sflags=(0x%X)", indnt, (unsigned int)tcp->th_flags); if (tcp->th_flags & TH_FIN) printf(",FIN"); if (tcp->th_flags & TH_SYN) printf(",SYN"); if (tcp->th_flags & TH_RST) printf(",RST"); if (tcp->th_flags & TH_PUSH) printf(",PUSH"); if (tcp->th_flags & TH_ACK) printf(",ACK"); if (tcp->th_flags & TH_URG) printf(",URG"); printf(" win=%u cksm=0x%.4X urp=0x%.4X", htons(tcp->th_win), htons(tcp->th_sum), htons(tcp->th_urp) ); printf("\n"); } if (wtp & PP_SHOW_PACKETCONTENT) { u_char *p; unsigned int i; p = (u_char *)tcp; p += (tcp->th_off)*sizeof(int); len -= sizeof(struct tcphdr) + sizeof(int); /* Options (sizeof(int)) is there for padding */ if (len>0) { for (i=0; iuh_sport), (unsigned int)htons(udp->uh_dport), (unsigned int)htons(udp->uh_ulen), (unsigned int)htons(udp->uh_sum) ); } if (wtp & PP_SHOW_PACKETCONTENT) { u_char *p; unsigned int i; p = (u_char *)udp; p += sizeof(struct udphdr); len -= sizeof(struct udphdr); for (i=0; iicmp_type, (unsigned int)icmp->icmp_code, (unsigned int)htons(icmp->icmp_cksum) ); } if (wtp & PP_SHOW_PACKETCONTENT) { u_char *p; unsigned int i; p = (u_char *)icmp; p += sizeof(struct icmp); len -= sizeof(struct icmp); for (i=0; iicmp6_type, (unsigned int)icmp6->icmp6_code, (unsigned int)htons(icmp6->icmp6_cksum) ); } if (wtp & PP_SHOW_PACKETCONTENT) { u_char *p; unsigned int i; p = (u_char *)icmp6; p += sizeof(struct icmp6_hdr); len -= sizeof(struct icmp6_hdr); for (i=0; i SECONDS_STEP)? SECONDS_STEP : seconds_left); } #define MAGIC_SIZE 2 int get_dumpfile_info(char *fname, u_int *df_type) { int fd, len; u_int magics[MAGIC_SIZE]; if (df_type == NULL || fname == NULL) return -1; fd = open(fname, O_RDONLY); if (fd == -1) { perror("open()"); return -1; } len = (int)read(fd, magics, MAGIC_SIZE*sizeof(u_int) ); (void)close(fd); if (len != MAGIC_SIZE*sizeof(u_int)) { fprintf(stderr, "read(): couldn't read file magic\n"); return -1; } if (magics[0] == (unsigned int)PCAP_FILE_MAGIC) *df_type = PCAP_FILE_MAGIC; else if (magics[0] == (unsigned int)PCAP_FILE_MAGIC_RH) *df_type = PCAP_FILE_MAGIC_RH; else if (magics[0] == (unsigned int)SNOOP_FILE_MAGIC && magics[1] == (unsigned int)SNOOP_FILE_MAGIC_2) *df_type = SNOOP_FILE_MAGIC; magics[0] = (unsigned int)ntohl(magics[0]); magics[1] = (unsigned int)ntohl(magics[1]); if (magics[0] == (unsigned int)PCAP_FILE_MAGIC) *df_type = PCAP_FILE_MAGIC; else if (magics[0] == (unsigned int)PCAP_FILE_MAGIC_RH) *df_type = PCAP_FILE_MAGIC_RH; else if (magics[0] == (unsigned int)SNOOP_FILE_MAGIC && magics[1] == (unsigned int)SNOOP_FILE_MAGIC_2) *df_type = SNOOP_FILE_MAGIC; return 0; } /* * snoop2pcap() fills a pcap_pkthdr with informaton from a snoop packet. * the packet data is luckily the same, so it is just a matter of * getting the header correct. */ int snoop2pcap(struct snoop_packet_header *sh, struct pcap_pkthdr *ph) { if (sh == NULL || ph == NULL) return -1; ph->ts.tv_sec = ntohl(sh->secs); ph->ts.tv_usec = ntohl(sh->usecs); /* Length of buffer data present */ ph->caplen = (bpf_u_int32)ntohl(sh->tlen); /* Length of buffer data off the wire */ ph->len = (bpf_u_int32)ntohl(sh->len); return 0; } void process_pcap(u_char *user, const struct pcap_pkthdr *h, const u_char *p) { struct hook_and_sinker *hs; struct ether_header *ep; u_int length = h->caplen, x; u_char *packet; hs = (struct hook_and_sinker *) user; packet = (u_char *) p; ep = (struct ether_header *) p; pdata.link_type = 0; switch (hs->linktype) { case DLT_NULL: /* dunno what this is... assume plain IP? */ pdata.link_type |= LINK_NONE; switch (*(int*)packet) { case AF_INET: pdata.link_type |= LINK_NONE_IP; break; #ifdef INET6 case AF_INET6: pdata.link_type |= LINK_NONE_IP6; break; #endif default: break; } packet += sizeof(int); pdata.packet_len = h->len; break; case DLT_EN10MB: packet += sizeof(struct ether_header); length -= sizeof(struct ether_header); /* XXX: these bcopys are VERY expensive, apparently */ bcopy(&(ep->ether_shost), &(pdata.ether.ether_shost), sizeof(struct ether_addr)); bcopy(&(ep->ether_dhost), &(pdata.ether.ether_dhost), sizeof(struct ether_addr)); pdata.link_type |= LINK_ETHERNET; switch (ntohs(ep->ether_type)) { case ETHERTYPE_IP: pdata.link_type |= LINK_ETHERNET_IP; break; #ifdef INET6 case ETHERTYPE_IPV6: pdata.link_type |= LINK_ETHERNET_IP6; break; #endif case ETHERTYPE_ARP: pdata.link_type |= LINK_ETHERNET_ARP; break; case ETHERTYPE_REVARP: pdata.link_type |= LINK_ETHERNET_REVARP; break; case ETHERTYPE_IPX: pdata.link_type |= LINK_ETHERNET_IPX; break; /* XXX: Dunno of the following get caught... */ case ETHERTYPE_AT: pdata.link_type |= LINK_ETHERNET_AT; break; case ETHERTYPE_AARP: pdata.link_type |= LINK_ETHERNET_AARP; break; default: break; } pdata.ether.ether_type = ntohs(ep->ether_type); pdata.packet_len = h->len; /* XXX: this is not exactly correct because IXP, AT, etc. don't have the same linksize */ if (!(hs->proc_flags & GET_TCPD_COUNT_LINKSIZE) ) pdata.packet_len -= ETHER_HDR_LEN; break; case DLT_PPP: pdata.link_type |= LINK_PPP; x = (unsigned int)((packet[2]<<8) | packet[3]); switch (x) { case 0x0021: pdata.link_type |= LINK_PPP_IP; break; case 0x8021: pdata.link_type |= LINK_PPP_IPCP; break; #ifdef INET6 case 0x0057: pdata.link_type |= LINK_PPP_IP6; break; case 0x8057: pdata.link_type |= LINK_PPP_IPCP6; break; #endif case 0x80fd: pdata.link_type |= LINK_PPP_CCP; break; case 0xc021: pdata.link_type |= LINK_PPP_LCP; break; case 0xc023: pdata.link_type |= LINK_PPP_PAP; break; case 0xc223: pdata.link_type |= LINK_PPP_CHAP; break; default: pdata.link_type |= LINK_PPP_OTHER; break; } packet += PPP_HDRLEN; length -= PPP_HDRLEN; pdata.packet_len = h->len; if (!(hs->proc_flags & GET_TCPD_COUNT_LINKSIZE) ) pdata.packet_len -= PPP_HDRLEN; break; default: /* XXX: Assume then plain IP? */ #if DEBUG printf("Unknown Link Type: %X\n", hs->linktype); #endif pdata.packet_len = h->len; break; } length = (lengthts), &(pdata.timestamp), sizeof(struct timeval) ); bcopy(packet, &(pdata.data.raw), length); pdata.buffer_len = length; hs->hook(&pdata, hs->args); } /* * get_snoop_data() reads a snoop file, converts it to pcap format, and * calls a user function pointing to the data * * XXX: filter is not used. capture_seconds also isn't, but snoop is * always read from a file. */ int get_snoop_data(char *fname, char *filter, int flags, Double capture_seconds, void (*hook)(packet_data *, void **), void **args) { u_char *packet; int fd, len, blen, ret = 0; struct snoop_file_header fh; struct snoop_packet_header ph; struct hook_and_sinker hs; struct pcap_pkthdr pcap_hdr; if (flags & GET_TCPD_DO_LIVE) { fprintf(stderr, "Read live snoop data?!? This error should not happen.\n"); return -1; } if (fname == NULL) return -1; fd = open(fname, O_RDONLY); if (fd == -1) { perror("open()"); return -1; } len = read(fd, &fh, sizeof(fh) ); if (len != (int)sizeof(fh)) { fprintf(stderr, "get_snoop_data: Can't read file header\n"); (void)close(fd); return -1; } hs.hook = hook; hs.args = args; hs.proc_flags = flags; switch (ntohl(fh.linktype)) { case SNOOP_DL_ETHER: hs.linktype = DLT_EN10MB; break; default: fprintf(stderr, "get_snoop_data: No support for this link type (yet?)\n"); (void)close(fd); return -1; /* UNREACHED */ break; } /* Main Loop */ while ( (len = (int)read(fd, &ph, sizeof(ph))) != 0) { if (len != (int)sizeof(ph)) { fprintf(stderr, "get_snoop_data: Can't read packet header\n"); ret = -1; break; } blen = ntohl(ph.blen) - sizeof(ph); packet = (u_char *) malloc(blen * sizeof(u_char)); if (packet == NULL) return -1; len = (int)read(fd, packet, blen); if (len != blen) { fprintf(stderr, "get_snoop_data: Can't read packet data\n"); ret = -1; free(packet); break; } (void)snoop2pcap(&ph, &pcap_hdr); process_pcap((u_char *)&hs, &pcap_hdr, packet); free(packet); } (void)close(fd); return ret; } /* * get_pcap_data() is a hook for pcap_loop and * calls a user function pointing to the data */ int get_pcap_data(char *fname, char *filter, int flags, Double capture_seconds, void (*hook)(packet_data *, void **), void **args) { pcap_t *pd; int i; char ebuf[PCAP_ERRBUF_SIZE]; struct bpf_program bpf_prog; struct hook_and_sinker hs; #define SNAPLEN 68 /* XXX: Doesn't belong here */ if (flags & GET_TCPD_DO_LIVE) { if (fname == NULL || (strlen(fname) == strlen("auto") && strncmp(fname, "auto", 4) == 0) ) { fname = pcap_lookupdev(ebuf); if (fname == NULL) { fprintf(stderr, "pcap_lookupdev(): %s\n", ebuf); return -1; } fprintf(stderr, "Listening on %s\n", fname); } pd = pcap_open_live(fname, SNAPLEN, flags & GET_TCPD_DO_LIVE_PROMISC, 100, ebuf); } else pd = pcap_open_offline(fname, ebuf); if (pd == NULL) { fprintf(stderr, "pcap_open(): %s\n", ebuf); return -1; } if (pcap_compile(pd, &bpf_prog, filter, 1, 0) < 0) { fprintf(stderr, "pcap_compile(): %s\n", pcap_geterr(pd)); return -1; } if (pcap_setfilter(pd, &bpf_prog) < 0) { fprintf(stderr, "pcap_setfilter(): %s\n", pcap_geterr(pd)); return -1; } hs.hook = hook; hs.args = args; hs.proc_flags = flags; hs.linktype = (bpf_u_int32)pcap_datalink(pd); run = 1; seconds_left = capture_seconds; /* only catch SIGINT when doing live reads, otherwise just exit */ if (flags & GET_TCPD_DO_LIVE) (void)signal(SIGINT, process_catch_alarm); if (capture_seconds > 0.0 && flags & GET_TCPD_DO_LIVE) { (void)signal(SIGALRM, process_catch_alarm); my_alarm((seconds_left > SECONDS_STEP)? SECONDS_STEP : seconds_left); } while (run) { i = pcap_dispatch(pd, -1, process_pcap, (u_char *)&hs); if (i == 0 && ! (flags & GET_TCPD_DO_LIVE)) run = 0; if (i == -1) { fprintf(stderr, "pcap_dispatch(): %s\n", pcap_geterr(pd) ); run = 0; } } pcap_close(pd); return 0; } /* * get_dump_data() is a hook for pcap_loop and * calls a user function pointing to the data */ int get_dump_data(char *fname, char *filter, int flags, Double capture_seconds, void (*hook)(packet_data *, void **), void **args) { u_int df_type = 0; df_type = PCAP_FILE_MAGIC; /* Default to pcap format */ if ( (strlen(fname) != 1 || *fname != '-') && !(flags & GET_TCPD_DO_LIVE) ) { /* We are not reading data from stdin, and we * are not doing a live dump, so we need to check * to see if the file to be read is a regular file * (or link.) The reason for this is we can't * lseek() on a named pipe. */ #ifdef HAVE_SYS_STAT_H struct stat fst; if (stat(fname, &fst) == -1) { /* Try to get stat() of file */ perror("stat()"); return -1; } if (fst.st_mode & (S_IFREG | S_IFLNK) ) { /* Reading a file */ if (get_dumpfile_info(fname, &df_type)) return -1; } #else /* No idea, just guess */ if (get_dumpfile_info(fname, &df_type)) return -1; #endif } switch(df_type) { case PCAP_FILE_MAGIC: case PCAP_FILE_MAGIC_RH: /* Try RedHat format as well. */ return get_pcap_data(fname, filter, flags, capture_seconds, hook, args); /* NOTREACHED */ break; case SNOOP_FILE_MAGIC: return get_snoop_data(fname, filter, flags, capture_seconds, hook, args); /* NOTREACHED */ break; default: fprintf(stderr, "Sorry, Unknown file format\n"); return -1; /* NOTREACHED */ break; } /* Never reached */ return 0; } tcpstat-1.5/lib/tcpseq.c0100644000175000000000000000447207414673063014577 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: tcpseq.c,v 1.3 2002/01/02 21:05:55 pherman Exp $ */ #include "tcpstat.h" struct tcpseq_ha { struct in_addr src; struct in_addr dst; u_int port; }; struct tcpseq_hash { struct tcpseq_hash *next; struct tcpseq_ha addr; u_int seq; u_int ack; }; struct tcpseq_stats { u_int opened_connections; /* doesn't include full */ u_int closed_connections; /* doesn't include full */ u_int full_connections; /* opened AND closed */ }; struct tcpseq_hash hash_first; int tcpseq_addtostats(packet_data *pd) { u_char flags; struct tcpseq_ha test_ha; struct tcphdr *tp = NULL; struct ip *ip; #ifdef INET6 int is_ip6 = 0; struct ip6_hdr *ip6; ip6 = (struct ip6_hdr *) &pd->data.ip6.hdr; if (is_ip6_packet(pd)) tp= &(pd->data.ip6.body.tcphdr); #endif ip = (struct ip *) &pd->data.ip.hdr; if (is_ip_packet(pd)) tp= &(pd->data.ip.body.tcphdr); if (tp == NULL) return -1; flags = tp->th_flags; if (flags & TH_ACK) { bzero(&test_ha, sizeof(test_ha)); } return 0; } tcpstat-1.5/lib/utils.c0100644000175000000000000001101207414673063014424 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: utils.c,v 1.23 2002/01/02 21:05:55 pherman Exp $ */ #include "tcpstat.h" char str[BUF_SIZ]; int is_ethernetarp_packet(packet_data *p) { return ( (p->link_type & LINK_ETHERNET) && (p->ether.ether_type == ETHERTYPE_ARP) ); /* Requires ethernet.h */ } int is_ip_packet(packet_data *p) { return ((p->link_type & LINK_NONE_OTHER) == GENERIC_LINK_IP); } #ifdef INET6 int is_ip6_packet(packet_data *p) { return ((p->link_type & LINK_NONE_OTHER) == GENERIC_LINK_IP6); } #endif unsigned char get_ip_proto(packet_data *p) { struct ip *ip; if (is_ip_packet(p)) { ip = &(p->data.ip.hdr); return ( ip->ip_p ); } #ifdef INET6 else if (is_ip6_packet(p)) { struct ip6_hdr *ip6; ip6 = &(p->data.ip6.hdr); return ( ip6->ip6_nxt ); } #endif return 0; } int is_ip_tcp_packet(packet_data *p) { return ( get_ip_proto(p) == IPPROTO_TCP ); } int is_ip_udp_packet(packet_data *p) { return ( get_ip_proto(p) == IPPROTO_UDP ); } int is_ip_icmp_packet(packet_data *p) { return ( get_ip_proto(p) == IPPROTO_ICMP #ifdef INET6 || get_ip_proto(p) == IPPROTO_ICMPV6 #endif ); } char *my_basename(char *p) { char *s; s = p; if (!*s || strlen(s) < 2) return p; for (s += strlen(p); s>p && *s != '/'; s--) continue; return (*s == '/')? s+1 : s; } u_char count_1bits(u_int x) { u_char r = 0; int i; for (i=0; i<8*(int)sizeof(x); i++) if ( (x>>i) & 0x1 ) r++; return r; } char *my_get_port(u_short port, int n_only) { struct servent *srvent; if (n_only) { snprintf(str, BUF_SIZ, "%u", port); } else { srvent = getservbyport(htons(port), NULL); if (srvent == NULL) snprintf(str, BUF_SIZ, "%u", port); else snprintf(str, BUF_SIZ, "%s (%u)", srvent->s_name, port); } return str; } char *my_get_proto(u_short proto, int n_only) { struct protoent *ip_prot; if (n_only) { snprintf(str, BUF_SIZ, "%u", proto); } else { ip_prot = getprotobynumber(proto); if (ip_prot == NULL) snprintf(str, BUF_SIZ, "%u", proto); else snprintf(str, BUF_SIZ, "%s", ip_prot->p_name); } return str; } /* XXX: Does this define belong here? */ #define MAX_STRCPY 32768 char *my_safe_strcpy(char **dst, const char *src) { size_t n; n = strlen(src)*sizeof(char); if (n<1) n = 1; if (n>MAX_STRCPY) n = MAX_STRCPY; if (*dst != NULL) free(*dst); *dst = (char *)malloc(n+1); if (*dst == NULL) { perror("my_safe_strcpy()"); exit(-1); } **dst = '\0'; return strncat(*dst, src, n); } void my_alarm(Double seconds) { #ifdef HAVE_UALARM ualarm( (u_int) (seconds*1e6 + 0.5), 0); #else alarm( (u_int) (seconds)); #endif /* HAVE_UALARM */ } #ifndef HAVE_INET_NTOP char *inet_ntop(int af, void *src, char *dst, int n) { int i; unsigned char *ui, u; char c[2]; if (dst == NULL || n<1) return NULL; dst[0] = '\0'; switch (af) { case AF_INET: /* Broken, use inet_ntoa() instead */ break; # ifdef INET6 case AF_INET6: c[1] = 0; for (i=0, ui = (unsigned char *)src; i<16; i++, ui++) { u = (*ui >> 4) & 0x0f; c[0] = (u < 0x0A)? u + '0' : (u-0x0A) + 'A'; strcat(dst, c); u = *ui & 0x0f; c[0] = (u < 0x0A)? u + '0' : (u-0x0A) + 'A'; strcat(dst, c); } break; # endif /* INET6 */ default: break; } return dst; } #endif /* HAVE_INET_NTOP */ tcpstat-1.5/lib/Makefile.in0100644000175000000000000001604407614314671015176 0ustar phermanwheel# Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ DEPDIR = @DEPDIR@ EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD_TCPPROF = @LD_TCPPROF@ MATHLIB = @MATHLIB@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ TCPPROF = @TCPPROF@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies noinst_LIBRARIES = libtcpstat.a INCLUDES = -I../include libtcpstat_a_SOURCES = print_packet.c process.c tcpseq.c utils.c subdir = lib mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) libtcpstat_a_AR = $(AR) cru libtcpstat_a_LIBADD = am_libtcpstat_a_OBJECTS = print_packet.$(OBJEXT) process.$(OBJEXT) \ tcpseq.$(OBJEXT) utils.$(OBJEXT) libtcpstat_a_OBJECTS = $(am_libtcpstat_a_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libtcpstat_a_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(libtcpstat_a_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libtcpstat.a: $(libtcpstat_a_OBJECTS) $(libtcpstat_a_DEPENDENCIES) -rm -f libtcpstat.a $(libtcpstat_a_AR) libtcpstat.a $(libtcpstat_a_OBJECTS) $(libtcpstat_a_LIBADD) $(RANLIB) libtcpstat.a mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `cygpath -w $<` uninstall-info-am: tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ $(mkinstalldirs) "$(distdir)/$$dir"; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic uninstall-am: uninstall-info-am .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am info \ info-am install install-am install-data install-data-am \ install-exec install-exec-am install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic tags \ uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: tcpstat-1.5/src/0040755000175000000000000000000007614315535013150 5ustar phermanwheeltcpstat-1.5/src/Makefile.am0100644000175000000000000000111507354214715015176 0ustar phermanwheelAUTOMAKE_OPTIONS = foreign no-dependencies AM_INSTALL_PROGRAM_FLAGS = -m 755 INCLUDES = -I../include bin_PROGRAMS = tcpstat @TCPPROF@ EXTRA_PROGRAMS = tcpprof noinst_PROGRAMS = packetdump catpcap tcpstat_SOURCES = tcpstat.c tcpstat_LDADD = ../lib/libtcpstat.a @MATHLIB@ tcpstat_DEPENDENCIES = ../lib/libtcpstat.a tcpprof_SOURCES = stats.c tcpprof.c tcpprof_LDADD = ../lib/libtcpstat.a @LD_TCPPROF@ tcpprof_DEPENDENCIES = ../lib/libtcpstat.a packetdump_SOURCES = dump.c packetdump_LDADD = ../lib/libtcpstat.a packetdump_DEPENDENCIES = ../lib/libtcpstat.a catpcap_SOURCES = catpcap.c tcpstat-1.5/src/README0100644000175000000000000000101407121774554014024 0ustar phermanwheelThere are some other (useful?) utilities in this directory: catpcap - Displays *everything* in a raw tcpdump(1) pcap file there is to show. Useful for debuging. packetdump - Another dumping program, written to show the contents of packets better that tcpdump does. tcpprof - A nice program that gives a profile (protocols, ports, hosts, etc...) of the pcap file. Nice indeed, and I think I will break off this program into it's own distribution someday... Paul Herman pherman@frenchfries.net tcpstat-1.5/src/catpcap.c0100644000175000000000000001102507542164555014727 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: catpcap.c,v 1.6 2002/09/18 21:00:29 pherman Exp $ */ #include "tcpstat.h" #if 0 #ifdef WORDS_BIGENDIAN # define LAST_CHAR(x) ( (x) >> 8 ) # define SWAPEM(x) ( (x) ) #else # define LAST_CHAR(x) ( (x) & 0x00ff ) # define SWAPEM(x) ( (((x) << 8)&0xff00) | (((x) >> 8)&0x00ff)) #endif #endif #define SHOW_HIGH_BIT 0 /* GLOBALS */ char filterexpr[BUF_SIZ] = ""; int p_number = 1; char char_conv(char c) { if (isgraph(c)) return c; if (c == ' ') return c; if ((u_char)c > 0xa1 && SHOW_HIGH_BIT) return c; return '.'; } void proc_pcap(u_char *user, const struct pcap_pkthdr *h, const u_char *p) { u_int length = h->caplen, i, j, k, step; u_char *r, *s; char c; r = (u_char *)p; s = (u_char *)p; step = 22; printf("%u: %lu.%.6lu, caplen %u, len %u\n", p_number++, (long unsigned int) h->ts.tv_sec, (long unsigned int) h->ts.tv_usec, h->caplen, h->len ); for (i=0; i #ifdef USE_DB1_LIBRARY # include #else # include #endif extern char numbers_only; extern char registered_only; extern char src_dest_split; extern int ports_to_show; extern int lines_to_show; int tc; /* This is the key used in our B-Tree and includes * data that would differentiate the data from the * rest of the data */ typedef struct stkey { u_int key; char direction; } stkey_t; typedef struct stat_unit { u_quad_t bytes; u_quad_t num_packets; } stat_unit; typedef struct stat_info { stkey_t key; stat_unit unit; } stat_info; typedef struct data_base { u_int type; DB *db; } data_base; data_base *dbs; #define FIRST_COLUMN_WIDTH 25 /* how wide the first column should be */ const char *type_str[] = { "Total", "Link", "IP", "Port", "Host", "Network" }; int compare_keys(const DBT *d1, const DBT *d2) { stkey_t *k1, *k2; if (d1 == NULL || d2 == NULL) return 0; k1 = (stkey_t *)d1->data; k2 = (stkey_t *)d2->data; if (src_dest_split) { if (k1->key == k2->key) { if (k1->direction == k2->direction) return 0; return (k1->direction < k2->direction)? -1 : 1; } return (k1->key < k2->key)? -1 : 1; } else { if (k1->key == k2->key) return 0; return (k1->key < k2->key)? -1 : 1; } return 0; } /* returns: * -1 - error * 0 - found * 1 - not found */ int find_entry(data_base *dbp, stkey_t *key, stat_unit *su) { DB *db = dbp->db; DBT dbt, key_dbt; int ret; key_dbt.data = (void *) key; key_dbt.size = sizeof(stkey_t); ret = db->get(db, &key_dbt, &dbt, 0); if (dbt.data != NULL && ret == 0) bcopy(dbt.data, (void *) su, sizeof(stat_unit) ); return ret; } int next_entry(data_base *dbp, stkey_t *key, stat_unit *su) { DB *db = dbp->db; DBT dbt, key_dbt; int ret; key_dbt.data = (void *) key; key_dbt.size = sizeof(stkey_t); ret = db->seq(db, &key_dbt, &dbt, (key->key == 0)? R_FIRST : R_NEXT); if (dbt.data != NULL && ret == 0) { bcopy(dbt.data, (void *) su, sizeof(stat_unit) ); bcopy(key_dbt.data, (void *) key, sizeof(stkey_t) ); } return ret; } int add_entry(data_base *dbp, stkey_t *key, stat_unit *su) { DB *db = dbp->db; DBT dbt, key_dbt; int ret; key_dbt.data = (void *) key; key_dbt.size = sizeof(stkey_t); dbt.data = (void *) su; dbt.size = sizeof(stat_unit); ret = db->put(db, &key_dbt, &dbt, 0); return ret; } int stats_initdb(u_int s_types) { int i, j; BTREEINFO bi; tc = count_1bits(s_types); if (tc == 0) return 1; dbs = (data_base *) malloc(tc*sizeof(data_base)); if (dbs == NULL) return -1; bi.flags = 0; bi.cachesize = 0; bi.maxkeypage = 0; bi.minkeypage = 0; bi.psize = 0; bi.compare = &compare_keys; bi.prefix = NULL; bi.lorder = 0; /* Init stat_r */ for (i=0,j=0; i>j) & 0x1) { dbs[i].type = 1<sync(db, 0); db->close(db); } return 0; } int bytes_compare(const void *h1, const void *h2) { const stat_info *a, *b; a = (const stat_info *)h1; b = (const stat_info *)h2; /* It's reversed here ... */ return (a->unit.bytes < b->unit.bytes)? 1 : (a->unit.bytes > b->unit.bytes)? -1 : 0; } void print_line(char *label, char *suffix, u_quad_t num_p, u_quad_t bytes, Double pcnt) { char str[1024]; sprintf(str, "%s %s", label, suffix); /* XXX: Why is this here? */ printf("\t%-*s%-10qu%-10qu%-5.4f %%\n", FIRST_COLUMN_WIDTH, str, num_p, bytes, pcnt); } int get_data_from_packet(stkey_t *key, u_int t, packet_data *p, char source) { u_int r, is_ippacket = 0, is_ip6packet = 0; u_short et; struct ether_header *eh; struct ip_packet *ipp; struct tcphdr *th; struct udphdr *uh; eh = &(p->ether); ipp = &(p->data.ip); th = &(ipp->body.tcphdr); uh = &(ipp->body.udphdr); /* Keep track of loop back data */ et = ntohs(eh->ether_type); is_ippacket = is_ip_packet(p); #ifdef INET6 is_ip6packet = is_ip6_packet(p); #endif key->key = 0; switch (t) { case TYPE_ALL: key->key = 2; break; case TYPE_LINK: key->key = p->link_type + 1; break; case TYPE_IP_PROTO: if (is_ippacket) key->key = ipp->hdr.ip_p + 1; #ifdef INET6 else if (is_ip6packet) key->key = get_ip_proto(p) + 1; #endif break; case TYPE_PORT: if (!is_ippacket) break; if (ipp->hdr.ip_p == IPPROTO_TCP) r = (source)? htons(th->th_sport) : htons(th->th_dport); else if (ipp->hdr.ip_p == IPPROTO_UDP) r = (source)? htons(uh->uh_sport) : htons(uh->uh_dport); else r = 0; if (r >= (u_int)ports_to_show && registered_only) r = 0; key->key = r; break; case TYPE_HOST: /* XXX: Assume 32 bit IP Addresses */ if (!is_ippacket) break; key->key = (source)? *(u_int*)&(ipp->hdr.ip_src) : *(u_int*)&(ipp->hdr.ip_dst); break; case TYPE_NET: if (!is_ippacket) break; key->key = (source)? inet_netof(ipp->hdr.ip_src) : inet_netof(ipp->hdr.ip_dst); break; default: break; } return 0; } void add_packet(data_base *dbp, stkey_t *key, packet_data *pd) { stat_unit su; int er; er = find_entry(dbp, key, &su); if (er == -1) { perror("Fatal! find_entry()"); exit(0); } if (er == 0) { /* Key found in the file */ su.num_packets++; su.bytes += pd->packet_len; er = add_entry(dbp, key, &su); if (er == -1) { perror("Fatal! add_entry()"); exit(0); } } else { /* Key not found, insert into db */ su.bytes = pd->packet_len; su.num_packets = 1; er = add_entry(dbp, key, &su); if (er == -1) { perror("Fatal! add_entry()"); exit(0); } } } void show_totals(u_int type, u_int count, stat_info *sip, u_quad_t tb) { char str[256]; u_int i, key; Double pcnt; u_quad_t l, b; stat_unit *u; struct in_addr *addr; b = 0; u = NULL; switch (type) { case TYPE_ALL: for (l=0; lbytes; } pcnt = 100.0 * (Double)b/(Double)tb; print_line( "Total", "", u->num_packets, b, pcnt); break; case TYPE_LINK: for (l=0; lbytes; if (key & LINK_ETHERNET) { switch (key & LINK_ETHERNET_OTHER) { case LINK_ETHERNET_IP: sprintf(str, "Ethernet (IP):"); break; #ifdef INET6 case LINK_ETHERNET_IP6: sprintf(str, "Ethernet (IPv6):"); break; #endif case LINK_ETHERNET_ARP: sprintf(str, "Ethernet (arp):"); break; case LINK_ETHERNET_REVARP: sprintf(str, "Ethernet (revarp):"); break; case LINK_ETHERNET_IPX: sprintf(str, "Ethernet (IPX):"); break; case LINK_ETHERNET_AT: sprintf(str, "Ethernet (AppleTalk):"); break; case LINK_ETHERNET_AARP: sprintf(str, "Ethernet (AppleTalk ARP):"); break; default: sprintf(str, "Ethernet (other):"); break; } } else if (key & LINK_PPP) { switch (key & LINK_PPP_OTHER) { case LINK_PPP_IP: sprintf(str, "PPP (IP):"); break; #ifdef INET6 case LINK_PPP_IP6: sprintf(str, "PPP (IPv6):"); break; case LINK_PPP_IPCP6: sprintf(str, "PPP (IPCP6):"); break; #endif case LINK_PPP_IPCP: sprintf(str, "PPP (IPCP):"); break; case LINK_PPP_LCP: sprintf(str, "PPP (LCP):"); break; case LINK_PPP_CCP: sprintf(str, "PPP (CCP):"); break; case LINK_PPP_PAP: sprintf(str, "PPP (PAP):"); break; case LINK_PPP_CHAP: sprintf(str, "PPP (CHAP):"); break; default: sprintf(str, "PPP (other):"); break; } } else if (key & LINK_NONE) { switch (key & LINK_NONE_OTHER) { case LINK_NONE_IP: sprintf(str, "No Link (IP):"); break; #ifdef INET6 case LINK_NONE_IP6: sprintf(str, "No Link (IPv6):"); break; #endif default: sprintf(str, "No Link (non-IP):"); break; } } else { if (key & 0x0100) sprintf(str, "UNKNOWN (IP):"); else sprintf(str, "UNKNWON (non-IP):"); } pcnt = 100.0 * (Double)b/(Double)tb; print_line(str, "", u->num_packets, b, pcnt); } break; case TYPE_IP_PROTO: for (l=0; lbytes; pcnt = 100.0 * (Double)b/(Double)tb; print_line( my_get_proto(key - 1, numbers_only), "", u->num_packets, b, pcnt); } break; case TYPE_PORT: for (l=0; lbytes; pcnt = 100.0 * (Double)b/(Double)tb; print_line( my_get_port((u_short)key, numbers_only), (src_dest_split)? ((sip[l].key.direction)? "< " : "> ") : "", u->num_packets, b, pcnt); } break; case TYPE_HOST: case TYPE_NET: for (l=0; lbytes; pcnt = 100.0 * (Double)b/(Double)tb; i = key; addr = (struct in_addr *)&i; if (numbers_only || type == TYPE_NET) sprintf(str, "%s", inet_ntoa(*addr)); else { struct hostent *he; he = gethostbyaddr((char *)addr, 4, AF_INET); str[0] = 0; if (he != NULL && he->h_name != NULL) strncat(str, he->h_name, FIRST_COLUMN_WIDTH - 1 - ((src_dest_split)? 2 : 0)); else sprintf(str, "%s", inet_ntoa(*addr)); } print_line(str, (src_dest_split)? ((sip[l].key.direction)? "< " : "> ") : "", u->num_packets, b, pcnt); } break; default: for (l=0; lbytes; pcnt = 100.0 * (Double)b/(Double)tb; printf("\t%-20X%-10qu%-10qu%-5.4f %%\n", key, u->num_packets, b, pcnt); } break; } } void stats_insert(packet_data *pd, u_int types) { u_int i, type; stkey_t key1, key2; for (i=0; i<(u_int)tc; i++) { type=dbs[i].type; key1.direction = 0; key2.direction = 0; switch (type) { case TYPE_PORT: case TYPE_HOST: case TYPE_NET: /* Add src */ get_data_from_packet(&key1, type, pd, 1); if (key1.key) add_packet(&dbs[i], &key1, pd); /* Add dest */ if (src_dest_split) key2.direction = 1; get_data_from_packet(&key2, type, pd, 0); if (key2.key && (key2.key != key1.key || src_dest_split)) /* Don't count duplicates if we don't differeciate src/dest */ add_packet(&dbs[i], &key2, pd); break; default: get_data_from_packet(&key1, type, pd, 1); if (key1.key) add_packet(&dbs[i], &key1, pd); break; } } } u_int extract_entries(data_base *dbp, stat_info **sia) { u_int count = 0; int er; void *ptr; stat_unit su; stkey_t key; key.key = 0; if (*sia != NULL) { free(*sia); *sia = NULL; } for (;;) { er = next_entry(dbp, &key, &su); if (er != 0) break; count++; ptr = (void *) realloc(*sia, count*sizeof(stat_info)); if (ptr == NULL) break; else *sia = (stat_info *) ptr; bcopy((void *)&su, (void *)&(*sia)[count-1].unit, sizeof(stat_unit)); bcopy(&key, &(*sia)[count-1].key, sizeof(stkey_t)); } return count; } void show_results(u_int types) { stat_info *sunits; int i, count; u_quad_t tot; sunits = NULL; count = extract_entries(&dbs[0], &sunits); if (count < 1) { fprintf(stderr, "No packets processed.\n"); return; } tot = sunits[0].unit.bytes; printf("%s Statistics:\n", type_str[ffs(dbs[0].type)-1] ); show_totals(dbs[0].type, 1, sunits, tot); for (i=1; i -1) count = (lines_to_show= port \ \n -r file - read tcpdump data from file \ \n -R - display only registered ports \ \n -s seconds - capture only [seconds] long \ \n -S letters - collect stats \ \n a - collect ALL stats \ \n l - collect link stats \ \n i - collect ip stats \ \n p - collect port stats \ \n h - collect host stats \ \n n - collect network stats \ \n -t lines - show at most [lines] lines for each stat \ \n \ \nExample: %s -S ph -r data.dump \ \n Displays port and host statistics from the file 'data.dump' \ \n" void my_hook(packet_data *pd, void **args) { u_int *types; types = (u_int *) *args++; stats_insert(pd, *types); } /* * process_file() takes the output of tcpdump, saves packets, and creates * statistics */ void process_file(char *fname, u_int s_types, int flags, Double capture_seconds) { void *argv[1]; stats_initdb(s_types); argv[0] = (void *) &s_types; if (get_dump_data(fname, filterexpr, flags, capture_seconds, my_hook, argv) == 0) show_results(s_types); stats_closedb(); } u_int parse_stats_types(char *in) { u_int ret = 0; while (*in) { if (*in == 'l' || *in == 'a' ) ret |= TYPE_LINK; if (*in == 'i' || *in == 'a' ) ret |= TYPE_IP_PROTO; if (*in == 'p' || *in == 'a' ) ret |= TYPE_PORT; if (*in == 'h' || *in == 'a' ) ret |= TYPE_HOST; if (*in == 'n' || *in == 'a' ) ret |= TYPE_NET; in++; } return ret; } int Usage(int r, char *prog) { fprintf(stderr, USAGE, my_basename(prog), prog); return r; } void error(char *s) { fprintf(stderr, "error: %s\n", s); Usage(-1, "tcpprof"); exit(-1); } int main(int argc, char **argv) { char filename[BUF_SIZ]; u_int stats_types = TYPE_ALL; int flags = GET_TCPD_COUNT_LINKSIZE | GET_TCPD_DO_LIVE_PROMISC; int ch; Double capture_seconds = -1.0; filename[0] = 0; while ( (ch = getopt(argc, argv, "h?ndpP:Rf:i:s:S:r:t:")) != -1) { switch(ch) { case 'h': case '?': return Usage(1, argv[0]); break; case 'd': src_dest_split = 1; break; case 'f': strncpy(filterexpr, optarg, BUF_SIZ); break; case 'i': strncpy(filename, optarg, BUF_SIZ); flags |= GET_TCPD_DO_LIVE; break; case 'r': strncpy(filename, optarg, BUF_SIZ); flags &= ~GET_TCPD_DO_LIVE; break; case 'n': numbers_only = 1; break; case 'p': flags &= ~GET_TCPD_DO_LIVE_PROMISC; break; case 'P': ports_to_show = (int) strtol(optarg, NULL, 10); registered_only = 1; break; case 'R': registered_only = 1; break; case 's': capture_seconds = atof(optarg); if (capture_seconds <= 0.0 && capture_seconds != -1.0) return Usage(1, argv[0]); break; case 'S': stats_types |= parse_stats_types(optarg); break; case 't': lines_to_show = (int) strtol(optarg, NULL, 10); break; default: break; } } if (filename == NULL || strlen(filename) < 1) { strncpy(filename, "auto", BUF_SIZ); flags |= GET_TCPD_DO_LIVE; } process_file(filename, stats_types, flags, capture_seconds); return 0; } tcpstat-1.5/src/tcpstat.c0100644000175000000000000004305407520366135014777 0ustar phermanwheel/* * Copyright (c) 2000 Paul Herman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: tcpstat.c,v 1.61 2002/07/27 00:42:05 pherman Exp $ */ #include "tcpstat.h" #define KIL (1024) #define MEG (1024*1024) #define GIG (1024*1024*1024) #define Double double /* FP accuracy */ #define DEFAULT_INTERVAL 5 #define DEFAULT_FORMAT "Time:%S\tn=%n\tavg=%a\tstddev=%d\tbps=%b\n" #define SETUID_WARNING \ "\n \ \n \ \n*** Warning!! tcpstat is running setuid! This is not recommended. \ \n*** I will disable the ability to write to arbitrary file descriptors. \ \n \ " enum { ACTION_INTERVAL, ACTION_BANDWIDTH, ACTION_ACCOUNT, ACTION_LOAD }; /** ** GLOBALS - mostly options to be set on the command line **/ char action = ACTION_INTERVAL; char *filterexpr = NULL; char *outputformat = NULL; Double interval; Double relative_seconds = 0.0; Double bandwidth = 0.0; Double peakbandwidth = 0.0; int get_tcp_flags = 0; /* flags to pass to get_dump_data */ int flush_stdout = 0; /* flushes all fds when set */ int smart_bandwidth = 0; /* when set, use smart bandwidth mode */ int empty_intervals = 1; /* by default print empty intervals */ int is_setuid = 0; /* refuse to use fdescs when setuid */ int print_immediately = 0; /* flag set when SIGUSR1 received */ Double capture_seconds = -1.0; /* -1.0 means infinite */ /* * This is the main structure that keeps track of all the statistics */ typedef struct statistics { struct { Double ts_bigbang; Double total_time; Double total_time_over_bps; Double total_bytes; } global; struct { int packets; int arp; int ip; #ifdef INET6 int ip6; #endif int tcp; int udp; int icmp; } count; int max_packetsize; /* maximum packet size over the interval */ int min_packetsize; /* mininum packet size over the interval */ Double ts_interval_begin; /* timestamp of the first packet in the interval */ Double ts_now; /* timestamp of last packet received */ Double sum; /* sum of of the packet sizes */ Double sum2; /* sum of the squares of the packet sizes */ Double smartb_sum; /* bytes carried over from the last interval */ Double load; /* bps averaged over 1 minute */ } statistics; /* * Handy routine to return a string of only numbers. */ char *my_get_nr(char *f) { static char s[BUF_SIZ]; char *p; int i = 0; if (f == NULL) return NULL; p = f; while (*p && isdigit(*p) ) { i++; p++; } i = (i > (BUF_SIZ-1)) ? BUF_SIZ - 1 : i; /* min(BUF_SIZ,i) */ *s = 0; strncat(s, f, i); return s; } /* * Handy routine to print bytes in a human readable format. */ char *wr_bytes(Double b) { static char s[BUF_SIZ]; if (0) { snprintf(s, BUF_SIZ, "%12.0f Bytes", b); return s; } if ( b > GIG ) { snprintf(s, BUF_SIZ, "%8.1f GB", b/GIG); return s; } if ( b > MEG ) { snprintf(s, BUF_SIZ, "%8.1f MB", b/MEG); return s; } if ( b > KIL ) { snprintf(s, BUF_SIZ, "%8.1f KB", b/KIL); return s; } snprintf(s, BUF_SIZ, "%8.1f B", b); return s; } void catch_signal(int a) { switch (a) { case SIGUSR1: print_immediately = 1; break; default: break; } } /* * Parses the output format, and displays appropriate statistics */ void show_interval(statistics *s, Double dt) { char *f, *fd_str; Double avg, stddev, t_bar, delta_t; /* Used in the PRINTVAL macro which follows */ char printval_str[BUF_SIZ]; int filedesc = 1; /* Handy macro for writing bytes to arbitrary file descriptors */ #define PRINTVAL(x,y) { \ snprintf(printval_str, BUF_SIZ, (x),(y)); \ write(filedesc, printval_str, strlen(printval_str)); \ } if (action != ACTION_INTERVAL) return; if (s->count.packets == 0) { avg = 0; stddev = 0; } else { avg = s->sum/(Double)s->count.packets; stddev = sqrt(s->sum2/(Double)s->count.packets - avg*avg); } delta_t = (interval == -1)? (s->ts_now - s->ts_interval_begin) : dt; t_bar = s->ts_interval_begin + delta_t/2.0; f = outputformat; while (*f) { if (*f == '%') { switch (*(++f)) { case 'A': PRINTVAL("%d", s->count.arp); break; case 'a': PRINTVAL("%.2f", avg); break; case 'B': PRINTVAL("%.2f", s->sum/delta_t); break; case 'b': PRINTVAL("%.2f", s->sum/delta_t * 8.0); break; case 'C': PRINTVAL("%d", s->count.icmp); break; case 'd': PRINTVAL("%.2f", stddev); break; case 'I': PRINTVAL("%d", s->count.ip); break; case 'l': PRINTVAL("%.2f", (peakbandwidth == 0.0)? 1.0 : s->load/peakbandwidth); break; case 'n': PRINTVAL("%d", s->count.packets); break; case 'M': PRINTVAL("%d", s->max_packetsize); break; case 'm': PRINTVAL("%d", s->min_packetsize); break; case 'N': PRINTVAL("%.0f", s->sum); break; case 'p': PRINTVAL("%.2f", (Double)s->count.packets/delta_t); break; case 'S': PRINTVAL("%d", (int) (t_bar + 0.5 - relative_seconds) ); break; case 's': PRINTVAL("%.6f", t_bar - relative_seconds); break; case 'R': PRINTVAL("%d", (int) (t_bar + 0.5 - (relative_seconds + s->global.ts_bigbang) ) ); break; case 'r': PRINTVAL("%.6f", t_bar - (relative_seconds + s->global.ts_bigbang)); break; case 'T': PRINTVAL("%d", s->count.tcp); break; case 'U': PRINTVAL("%d", s->count.udp); break; #ifdef INET6 case 'V': PRINTVAL("%d", s->count.ip6); break; #endif default: /* Check for file descriptor change */ if (isdigit(*f)) { fd_str = my_get_nr(f); #ifndef NO_FILEDESC if (!is_setuid) { filedesc = strtol(fd_str, NULL, 10); if (filedesc>256) filedesc = 1; } #endif /* NO_FILEDESC */ f += strlen(fd_str) - 1; } else PRINTVAL("%%%c", *f); break; } /* switch */ } /* if % */ else if (*f == '\\') { switch (*(++f)) { /* XXX: This could be written better */ case 'a': PRINTVAL("%s", "\a"); break; case 'b': PRINTVAL("%s", "\b"); break; case 'f': PRINTVAL("%s", "\f"); break; case 'n': PRINTVAL("%s", "\n"); break; case 'r': PRINTVAL("%s", "\r"); break; case 't': PRINTVAL("%s", "\t"); break; case 'v': PRINTVAL("%s", "\v"); break; default: PRINTVAL("%c", *f); break; } } else PRINTVAL("%c", *f); f++; } if (flush_stdout) fflush(NULL); } /* * Stores zeros in the given statistics structure */ void reset_counters(statistics *sp) { sp->count.packets = 0; sp->sum = 0.0; sp->sum2 = 0.0; sp->smartb_sum = 0.0; /* Zero all counters */ bzero(&sp->count, sizeof(sp->count)); sp->max_packetsize = 0; sp->min_packetsize = 0; } /* This function updates all internal parameters * (peakbandwidth, load, etc.) and prints intervals * if neccesary */ int do_the_printing(statistics *sp, Double elapsed, Double ts) { statistics zero; Double x, bps; /* if this is a normal interval, i.e. one where the alarm * timer ran up, just take the theoretical interval length. * Otherwise, our best guess is the time elapsed between two * packets. */ if (!print_immediately && interval > 0.0) elapsed = interval; /* Plain Bandwidth */ bps = (sp->sum / elapsed) * 8.0; if (bps > peakbandwidth) peakbandwidth = bps; /* calculate the bandwidth load, if any */ if (sp->load == -1.0) sp->load = bps; sp->load += (bps - sp->load) * (1.0 - exp(-elapsed/60.0)); /* Smart bandwidth, if any */ sp->sum += sp->smartb_sum; bps = (sp->sum / elapsed) * 8.0; if (bps > bandwidth) sp->global.total_time_over_bps += elapsed; /* show interval and reset stats */ if (empty_intervals || sp->count.packets > 0) show_interval(sp, elapsed); sp->ts_interval_begin += elapsed; sp->global.total_time += elapsed; /* Now, pad the output with zeros, if neccesary */ reset_counters(&zero); zero.global.ts_bigbang = sp->global.ts_bigbang; zero.load = sp->load; for (x = sp->ts_interval_begin + interval; xts_interval_begin += interval; sp->global.total_time += interval; zero.load -= zero.load * (1.0 - exp(-interval/60.0)); if (empty_intervals) show_interval(&zero, interval); } sp->load = zero.load; reset_counters(sp); if (smart_bandwidth && action == ACTION_BANDWIDTH && bps > bandwidth) { /* Transfer the rest of the data over to * the next interval. This doesn't work * for the packet count, but that's * OK in bandwidth mode. */ sp->smartb_sum = (bps - bandwidth) * elapsed / 8.0; } /* Reset signal state */ print_immediately = 0; return 0; } /* * This fuction is called by pcap_loop (not really, but OK.) It adds * a particular packet to the total statistical data. */ void my_hook(packet_data *pd, void **args) { statistics *sp; Double ts, elapsed; sp = (statistics *) args[0]; ts = (Double)pd->timestamp.tv_sec + (Double)pd->timestamp.tv_usec/1.0e6; if (sp->ts_interval_begin == 0.0) { /* initialize stats if called for the first time */ reset_counters(sp); sp->ts_interval_begin = ts; sp->global.ts_bigbang = ts; } /* Before we add this packet to the statistics, * we need to check if we are actually done counting * packets. This should only happen (and be useful) * when reading data from a file. */ if (capture_seconds > 0.0 && ts - sp->global.ts_bigbang > capture_seconds) return; /* After that, we need to see if there is an interval waiting * to be printed. */ elapsed = ts - sp->ts_interval_begin; if ( (elapsed > interval && interval != -1.0) || (print_immediately && elapsed > 0.0) ) { /* We got a packet past the boundry of the last interval, * so update stats, and print out the last interval that * has already expired. There might be a packet handed to * this function at this point, but we can't include it in * the current statistic. */ do_the_printing(sp, elapsed, ts); } sp->ts_now = ts; sp->count.packets++; sp->global.total_bytes += (Double)pd->packet_len; sp->sum += (Double)pd->packet_len; sp->sum2 += (Double)pd->packet_len * (Double)pd->packet_len; /* sp->sum2 = sp->sum * sp->sum; */ if (is_ethernetarp_packet(pd)) (sp->count.arp)++; else { if (is_ip_packet(pd)) (sp->count.ip)++; #ifdef INET6 if (is_ip6_packet(pd)) (sp->count.ip6)++; #endif if (is_ip_tcp_packet(pd)) sp->count.tcp++; if (is_ip_udp_packet(pd)) sp->count.udp++; if (is_ip_icmp_packet(pd)) sp->count.icmp++; } if ((int)pd->packet_len > sp->max_packetsize) sp->max_packetsize = pd->packet_len; if ((int)pd->packet_len < sp->min_packetsize || sp->min_packetsize == 0) sp->min_packetsize = pd->packet_len; } /* * process_file() gets the data, and then displays the statistics */ void process_file(char *fname, u_int unused) { void *argv[2]; statistics stats; Double x; signal(SIGUSR1, catch_signal); reset_counters(&stats); stats.ts_interval_begin = 0.0; stats.load = -1.0; stats.global.ts_bigbang = 0.0; stats.global.total_bytes = 0.0; stats.global.total_time = 0.0; stats.global.total_time_over_bps = 0.0; argv[0] = (void *) &stats; /* Main Loop */ if (get_dump_data(fname, filterexpr, get_tcp_flags, capture_seconds, my_hook, argv)) return; /* The last "interval" still needs to be computed. * Most of the work has been done. Now do... */ x = (interval <= 0.0)? stats.ts_now - stats.global.ts_bigbang : interval; stats.global.total_time += x; do_the_printing(&stats, x, stats.ts_now); switch (action) { case ACTION_INTERVAL: /* If capture_seconds specified, do zero * padding. This is only useful when * reading data from a file. */ if (capture_seconds > 0.0) { while (stats.ts_now + x - stats.global.ts_bigbang < capture_seconds) { do_the_printing(&stats, x, stats.ts_now); stats.global.total_time += x; stats.ts_now += x; } } break; case ACTION_BANDWIDTH: printf( "%sTime exceeding %.2f bps:\t%.2f sec.\t(%.2f%% of the time)\n", (smart_bandwidth)? "" : "(Raw) ", bandwidth, stats.global.total_time_over_bps, 100 * stats.global.total_time_over_bps / stats.global.total_time ); printf("Peak Bandwidth: %.2f bps\n", peakbandwidth); break; case ACTION_ACCOUNT: if (stats.global.total_time != 0.0) x = stats.global.total_bytes/stats.global.total_time; else x = stats.global.total_bytes/interval; printf("Bytes/sec\t= %s\n", wr_bytes(x)); printf("Bytes/minute\t= %s\n", wr_bytes(x*60)); printf("Bytes/hour\t= %s\n", wr_bytes(x*60*60)); printf("Bytes/day\t= %s\n", wr_bytes(x*60*60*24)); printf("Bytes/month\t= %s\n", wr_bytes(x*60*60*24*30)); break; default: break; } } #define USAGE \ "usage: %s [-?haeFlp] [-b bps] [-B bps] [-f filter expr] [-i interface] \ \n [-o output] [-R seconds] [-r filename] [-s seconds] [interval] \ \n -?, -h - display this help \ \n -a - accounting mode \ \n -b bps - bandwidth mode, where bps is bits/second \ \n -B bps - dumb bandwidth mode, where bps is bits/second \ \n -e - do not print empty intervals \ \n -F - flush stdout after printing each line \ \n -f filter expr - packet filter expression (like in tcpdump) \ \n -i interface - do live capture on [interface], not from file \ \n -l - include linklayer in packet size calc \ \n -o output - format for the output of stats (see manpage) \ \n -p - non-promiscuous mode when doing live capture \ \n -R seconds - display time relative to [seconds] \ \n -r filename - read data from [filename] \ \n -s seconds - capture only [seconds] long (-1 is infinite) \ \n \ \n interval - time interval (seconds) for taking samples \ \n" int Usage(int r, char *prog) { fprintf(stderr, "%s version %s\n", PACKAGE, VERSION); fprintf(stderr, USAGE, my_basename(prog)); return r; } void error(char *s) { fprintf(stderr, "error: %s\n", s); Usage(-1, "tcpstat"); exit(-1); } int main(int argc, char **argv) { char *filename; int ch; if (getuid() != geteuid()) is_setuid = 1; #ifndef NO_FILEDESC if (is_setuid) fprintf(stderr, SETUID_WARNING); #endif /* NO_FILEDESC */ /* Default promisc, like tcpdump(1) */ interval = 0.0; get_tcp_flags = GET_TCPD_DO_LIVE|GET_TCPD_DO_LIVE_PROMISC; filename = NULL; my_safe_strcpy(&filterexpr, " "); my_safe_strcpy(&outputformat, DEFAULT_FORMAT); while ( (ch = getopt(argc, argv, "h?aeFlp1B:b:f:i:o:R:r:s:")) != -1) { switch(ch) { case 'h': case '?': return Usage(1, argv[0]); break; case 'a': action = ACTION_ACCOUNT; break; case 'l': get_tcp_flags |= GET_TCPD_COUNT_LINKSIZE; break; case 'p': get_tcp_flags &= ~GET_TCPD_DO_LIVE_PROMISC; break; case 'B': case 'b': bandwidth = atof(optarg); if (bandwidth <= 0) return Usage(1, argv[0]); action = ACTION_BANDWIDTH; if (ch == 'b') smart_bandwidth = 1; break; case 'e': empty_intervals = 0; break; case 'F': flush_stdout = 1; break; case 'f': my_safe_strcpy(&filterexpr, optarg); break; case 'i': get_tcp_flags |= GET_TCPD_DO_LIVE; my_safe_strcpy(&filename, optarg); break; case 'o': my_safe_strcpy(&outputformat, optarg); break; case 'R': relative_seconds = atof(optarg); if (relative_seconds < 0) return Usage(1, argv[0]); break; case 'r': get_tcp_flags &= ~GET_TCPD_DO_LIVE; my_safe_strcpy(&filename, optarg); break; case 's': capture_seconds = atof(optarg); if (capture_seconds <= 0 && capture_seconds != -1) return Usage(1, argv[0]); break; case '1': interval = -1.0; break; default: break; } } if (interval == 0.0) { if ((argc - optind) < 1) interval = DEFAULT_INTERVAL; else { interval = atof(argv[optind]); if (interval <= 0 && interval != -1) { fprintf(stderr, "error: Bad interval value\n"); return Usage(1, argv[0]); } } } /* Sanity checks */ if ( ! (get_tcp_flags & (GET_TCPD_DO_LIVE|GET_TCPD_DO_LIVE_PROMISC)) ) error("-p option not compatible with -r"); /* If we are doing a limited capture, make sure that * the interval isn't longer than the time that we * are capturing. */ if (capture_seconds > 0.0 && capture_seconds < interval) interval = -1.0; if (filename == NULL) { /* Default read from interface */ get_tcp_flags |= GET_TCPD_DO_LIVE; my_safe_strcpy(&filename, "auto"); } process_file(filename, 0); if (filename) free(filename); if (filterexpr) free(filterexpr); if (outputformat) free(outputformat); return 0; } tcpstat-1.5/src/Makefile.in0100644000175000000000000002251007614314671015212 0ustar phermanwheel# Makefile.in generated automatically by automake 1.5 from Makefile.am. # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : AMTAR = @AMTAR@ AWK = @AWK@ CC = @CC@ DEPDIR = @DEPDIR@ EXEEXT = @EXEEXT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD_TCPPROF = @LD_TCPPROF@ MATHLIB = @MATHLIB@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ TCPPROF = @TCPPROF@ VERSION = @VERSION@ am__include = @am__include@ am__quote = @am__quote@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = foreign no-dependencies AM_INSTALL_PROGRAM_FLAGS = -m 755 INCLUDES = -I../include bin_PROGRAMS = tcpstat @TCPPROF@ EXTRA_PROGRAMS = tcpprof noinst_PROGRAMS = packetdump catpcap tcpstat_SOURCES = tcpstat.c tcpstat_LDADD = ../lib/libtcpstat.a @MATHLIB@ tcpstat_DEPENDENCIES = ../lib/libtcpstat.a tcpprof_SOURCES = stats.c tcpprof.c tcpprof_LDADD = ../lib/libtcpstat.a @LD_TCPPROF@ tcpprof_DEPENDENCIES = ../lib/libtcpstat.a packetdump_SOURCES = dump.c packetdump_LDADD = ../lib/libtcpstat.a packetdump_DEPENDENCIES = ../lib/libtcpstat.a catpcap_SOURCES = catpcap.c subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = EXTRA_PROGRAMS = tcpprof$(EXEEXT) bin_PROGRAMS = tcpstat$(EXEEXT) @TCPPROF@ noinst_PROGRAMS = packetdump$(EXEEXT) catpcap$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_catpcap_OBJECTS = catpcap.$(OBJEXT) catpcap_OBJECTS = $(am_catpcap_OBJECTS) catpcap_LDADD = $(LDADD) catpcap_DEPENDENCIES = catpcap_LDFLAGS = am_packetdump_OBJECTS = dump.$(OBJEXT) packetdump_OBJECTS = $(am_packetdump_OBJECTS) packetdump_LDFLAGS = am_tcpprof_OBJECTS = stats.$(OBJEXT) tcpprof.$(OBJEXT) tcpprof_OBJECTS = $(am_tcpprof_OBJECTS) tcpprof_LDFLAGS = am_tcpstat_OBJECTS = tcpstat.$(OBJEXT) tcpstat_OBJECTS = $(am_tcpstat_OBJECTS) tcpstat_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(catpcap_SOURCES) $(packetdump_SOURCES) \ $(tcpprof_SOURCES) $(tcpstat_SOURCES) DIST_COMMON = README Makefile.am Makefile.in SOURCES = $(catpcap_SOURCES) $(packetdump_SOURCES) $(tcpprof_SOURCES) $(tcpstat_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && \ CONFIG_HEADERS= CONFIG_LINKS= \ CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) catpcap$(EXEEXT): $(catpcap_OBJECTS) $(catpcap_DEPENDENCIES) @rm -f catpcap$(EXEEXT) $(LINK) $(catpcap_LDFLAGS) $(catpcap_OBJECTS) $(catpcap_LDADD) $(LIBS) packetdump$(EXEEXT): $(packetdump_OBJECTS) $(packetdump_DEPENDENCIES) @rm -f packetdump$(EXEEXT) $(LINK) $(packetdump_LDFLAGS) $(packetdump_OBJECTS) $(packetdump_LDADD) $(LIBS) tcpprof$(EXEEXT): $(tcpprof_OBJECTS) $(tcpprof_DEPENDENCIES) @rm -f tcpprof$(EXEEXT) $(LINK) $(tcpprof_LDFLAGS) $(tcpprof_OBJECTS) $(tcpprof_LDADD) $(LIBS) tcpstat$(EXEEXT): $(tcpstat_OBJECTS) $(tcpstat_DEPENDENCIES) @rm -f tcpstat$(EXEEXT) $(LINK) $(tcpstat_LDFLAGS) $(tcpstat_OBJECTS) $(tcpstat_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `cygpath -w $<` uninstall-info-am: tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP) GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ $(mkinstalldirs) "$(distdir)/$$dir"; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-noinstPROGRAMS distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: tcpstat-1.5/configure0100755000175000000000000043030007614314672014266 0ustar phermanwheel#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} ac_unique_file="src/tcpstat.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat < if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. EOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue cd $ac_subdir # A "../" for each directory in /$ac_subdir. ac_dots=`echo $ac_subdir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` case $srcdir in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_sub_srcdir=$srcdir/$ac_subdir ;; *) # Relative path. ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure.gnu; then echo $SHELL $ac_sub_srcdir/configure.gnu --help=recursive elif test -f $ac_sub_srcdir/configure; then echo $SHELL $ac_sub_srcdir/configure --help=recursive elif test -f $ac_sub_srcdir/configure.ac || test -f $ac_sub_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\EOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 </dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` PATH = $PATH _ASUNAME } >&5 cat >&5 <\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:873: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:884: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:892: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:908: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:912: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:918: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:920: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:922: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:941: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:943: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:963: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:966: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:992: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:1012: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. case $ac_dir/ in / | ./ | .// | /cC/* \ | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ | /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if $as_executable_p "$ac_dir/$ac_prog"; then if test $ac_prog = install && grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:1061: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:1072: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:1096: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:1109: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1115: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= am_backtick='`' { echo "$as_me:1140: WARNING: ${am_backtick}missing' script is too old or missing" >&5 echo "$as_me: WARNING: ${am_backtick}missing' script is too old or missing" >&2;} fi for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1148: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AWK="$ac_prog" echo "$as_me:1163: found $ac_dir/$ac_word" >&5 break done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:1171: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:1174: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:1181: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:1201: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:1205: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null # test to see if srcdir already configured if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:1241: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=tcpstat VERSION=1.5 cat >>confdefs.h <>confdefs.h <>confdefs.h <<\EOF #define NO_FILEDESC 1 EOF fi echo "$as_me:1348: checking to see if I can guess the OS to build for" >&5 echo $ECHO_N "checking to see if I can guess the OS to build for... $ECHO_C" >&6 my_build_os=${build_os:-`uname -s | tr 'A-Z' 'a-z'`} if test "x${my_build_os}" = x then { { echo "$as_me:1352: error: Can't determine OS. Broken uname?" >&5 echo "$as_me: error: Can't determine OS. Broken uname?" >&2;} { (exit 1); exit 1; }; } else echo ${my_build_os} fi case $my_build_os in aix*) cat >>confdefs.h <<\EOF #define AIX_STRANGENESS 1 EOF ;; osf1*) cat >>confdefs.h <<\EOF #define TRU64_STRANGENESS 1 EOF ;; linux*) cat >>confdefs.h <<\EOF #define _BSD_SOURCE 1 EOF ;; bsd/os*) ;; freebsd*) ;; sunos*) ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:1386: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:1401: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1409: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1412: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:1421: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:1436: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1444: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1447: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:1460: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:1475: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1483: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1486: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1495: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" echo "$as_me:1510: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1518: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1521: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1534: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:1554: found $ac_dir/$ac_word" >&5 break done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$ac_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1576: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1579: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:1590: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:1605: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1613: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1616: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1629: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:1644: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1652: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1655: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:1667: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:1672:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:1675: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1678: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1680: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1683: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1685: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1688: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line 1692 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:1708: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:1711: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1714: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1737: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:1743: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1748: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:1754: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1757: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1764: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:1772: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1779: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1781: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1784: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1786: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1789: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:1805: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:1811: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:1817: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1823 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1835: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1838: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1850: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:1857: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1861: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1867 "configure" #include "confdefs.h" int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1882: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1885: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1888: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1891: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:1903: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:1909: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1915 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1927: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1930: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1933: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1936: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:1946: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1973: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1976: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1979: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1982: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line 1994 "configure" #include "confdefs.h" #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2007: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2010: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2013: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2016: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 2026 "configure" #include "confdefs.h" $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2038: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2041: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2044: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2047: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands default-1" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:2082: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include='#' am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote='"' _am_result=BSD fi fi echo "$as_me:2109: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf depcc="$CC" am_compiler_list= echo "$as_me:2115: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:2177: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:2184: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:2199: found $ac_dir/$ac_word" >&5 break done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:2207: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:2210: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:2219: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:2234: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:2243: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:2246: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:2260: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2281 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2286: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2292: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2315 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2319: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2325: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:2362: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 2372 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2377: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2383: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 2406 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2410: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2416: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:2444: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:2455: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2461 "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:2469: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2475: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 2497 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line 2515 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line 2536 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:2562: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2565: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:2567: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2570: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:2583: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo "$as_me:2593: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2599 "configure" #include "confdefs.h" #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2621: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2624: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2627: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2630: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2640: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\EOF #define HAVE_SYS_WAIT_H 1 EOF fi for ac_header in sys/time.h sys/stat.h unistd.h strings.h fcntl.h netinet/ip6.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:2653: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2659 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:2663: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2669: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:2688: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2707 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:2711: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2717: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:2736: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line 2754 "configure" #include "confdefs.h" #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:2803: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2806: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2809: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2812: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:2829: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:2832: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac echo "$as_me:2837: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2843 "configure" #include "confdefs.h" int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2901: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2904: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2907: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2910: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2920: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\EOF #define const EOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:2936: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2942 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2948: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2951: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2954: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2957: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2967: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2983 "configure" #include "confdefs.h" $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2998: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3001: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3004: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3007: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:3017: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3035 "configure" #include "confdefs.h" #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3051: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3054: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3057: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3060: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:3070: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\EOF #define TIME_WITH_SYS_TIME 1 EOF fi for ac_func in strtol strtoul ualarm perror inet_ntop do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:3083: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3089 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3120: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3123: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3126: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3129: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:3139: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3158 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); int main () { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3189: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3192: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3195: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3198: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:3208: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for sqrt in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sqrt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3233 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sqrt (); int main () { sqrt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3252: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3255: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3258: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3261: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sqrt=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_m_sqrt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3272: result: $ac_cv_lib_m_sqrt" >&5 echo "${ECHO_T}$ac_cv_lib_m_sqrt" >&6 if test $ac_cv_lib_m_sqrt = yes; then MATHLIB="-lm" fi echo "$as_me:3278: checking for socket in -lc" >&5 echo $ECHO_N "checking for socket in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3286 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3305: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3308: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3311: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3314: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_socket=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_c_socket=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3325: result: $ac_cv_lib_c_socket" >&5 echo "${ECHO_T}$ac_cv_lib_c_socket" >&6 if test $ac_cv_lib_c_socket = yes; then : else echo "$as_me:3331: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3339 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3358: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3361: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3364: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3367: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3378: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then LIBS="-lsocket ${LIBS}" fi fi echo "$as_me:3388: checking for gethostbyaddr in -lc" >&5 echo $ECHO_N "checking for gethostbyaddr in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_gethostbyaddr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3396 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyaddr (); int main () { gethostbyaddr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3415: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3418: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3421: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3424: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_gethostbyaddr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_c_gethostbyaddr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3435: result: $ac_cv_lib_c_gethostbyaddr" >&5 echo "${ECHO_T}$ac_cv_lib_c_gethostbyaddr" >&6 if test $ac_cv_lib_c_gethostbyaddr = yes; then : else echo "$as_me:3441: checking for gethostbyaddr in -lnsl" >&5 echo $ECHO_N "checking for gethostbyaddr in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyaddr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3449 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyaddr (); int main () { gethostbyaddr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3468: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3471: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3474: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3477: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyaddr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyaddr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3488: result: $ac_cv_lib_nsl_gethostbyaddr" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyaddr" >&6 if test $ac_cv_lib_nsl_gethostbyaddr = yes; then LIBS="-lnsl ${LIBS}" fi fi echo "$as_me:3498: checking for getprotobynumber in -lc" >&5 echo $ECHO_N "checking for getprotobynumber in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_getprotobynumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3506 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getprotobynumber (); int main () { getprotobynumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3525: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3528: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3531: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3534: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_getprotobynumber=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_c_getprotobynumber=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3545: result: $ac_cv_lib_c_getprotobynumber" >&5 echo "${ECHO_T}$ac_cv_lib_c_getprotobynumber" >&6 if test $ac_cv_lib_c_getprotobynumber = yes; then : else echo "$as_me:3551: checking for getprotobynumber in -lnsl" >&5 echo $ECHO_N "checking for getprotobynumber in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_getprotobynumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3559 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getprotobynumber (); int main () { getprotobynumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3578: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3581: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3584: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3587: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_getprotobynumber=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_nsl_getprotobynumber=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3598: result: $ac_cv_lib_nsl_getprotobynumber" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_getprotobynumber" >&6 if test $ac_cv_lib_nsl_getprotobynumber = yes; then LIBS="-lnsl ${LIBS}" fi fi for ac_header in net/bpf.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:3611: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3617 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:3621: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:3627: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:3646: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3665 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:3669: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:3675: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:3694: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 echo "$as_me: error: I couldn't find pcap.h. Please install libpcap. If you already have... then please rerun configure with the option --with-pcap-include=DIR with \"DIR\" being where pcap is found." >&2;} { (exit 1); exit 1; }; } fi done echo "$as_me:3718: checking for pcap_major_version in -lpcap" >&5 echo $ECHO_N "checking for pcap_major_version in -lpcap... $ECHO_C" >&6 if test "${ac_cv_lib_pcap_pcap_major_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3726 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pcap_major_version (); int main () { pcap_major_version (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3745: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3748: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3751: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3754: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pcap_pcap_major_version=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_pcap_pcap_major_version=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3765: result: $ac_cv_lib_pcap_pcap_major_version" >&5 echo "${ECHO_T}$ac_cv_lib_pcap_pcap_major_version" >&6 if test $ac_cv_lib_pcap_pcap_major_version = yes; then LIBS="-lpcap ${LIBS}" else { { echo "$as_me:3771: error: I couldn't find libpcap. Please install libpcap. If you already have... then please rerun configure with the option --with-pcap-lib=DIR with \"DIR\" being where libpcap is found." >&5 echo "$as_me: error: I couldn't find libpcap. Please install libpcap. If you already have... then please rerun configure with the option --with-pcap-lib=DIR with \"DIR\" being where libpcap is found." >&2;} { (exit 1); exit 1; }; } fi TCPPROF="" LD_TCPPROF="" echo "$as_me:3787: checking for dbopen in -lc" >&5 echo $ECHO_N "checking for dbopen in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3795 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3814: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3817: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3820: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3823: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_dbopen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_c_dbopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3834: result: $ac_cv_lib_c_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_c_dbopen" >&6 if test $ac_cv_lib_c_dbopen = yes; then TCPPROF=tcpprof else echo "$as_me:3840: checking for dbopen in -ldb1" >&5 echo $ECHO_N "checking for dbopen in -ldb1... $ECHO_C" >&6 if test "${ac_cv_lib_db1_dbopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb1 $LIBS" cat >conftest.$ac_ext <<_ACEOF #line 3848 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dbopen (); int main () { dbopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:3867: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3870: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:3873: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3876: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_db1_dbopen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_db1_dbopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:3887: result: $ac_cv_lib_db1_dbopen" >&5 echo "${ECHO_T}$ac_cv_lib_db1_dbopen" >&6 if test $ac_cv_lib_db1_dbopen = yes; then TCPPROF=tcpprof LD_TCPPROF="-ldb1" cat >>confdefs.h <<\EOF #define USE_DB1_LIBRARY 1 EOF else { echo "$as_me:3900: WARNING: *** WARNING *** I couldn't locate the Berkeley DB library. The extra utility \"tcpprof\" will not be built. THIS IS OK!!! \"tcpstat\" will continue to be built as if this never happened. If you wish to use the extra \"tcpprof\" program, please install the Berkeley DB library from: ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.tar.gz " >&5 echo "$as_me: WARNING: *** WARNING *** I couldn't locate the Berkeley DB library. The extra utility \"tcpprof\" will not be built. THIS IS OK!!! \"tcpstat\" will continue to be built as if this never happened. If you wish to use the extra \"tcpprof\" program, please install the Berkeley DB library from: ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.tar.gz " >&2;} fi fi ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:4008: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } exec 6>&1 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\EOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:4184: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:4203: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.52, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS > $ac_cs_invocation on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; *) { { echo "$as_me:4254: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } EOF cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@DEPDIR@,$DEPDIR,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@TCPPROF@,$TCPPROF,;t t s,@LD_TCPPROF@,$LD_TCPPROF,;t t s,@MATHLIB@,$MATHLIB,;t t CEOF EOF cat >>$CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" EOF cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi case $srcdir in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_dots$srcdir$ac_dir_suffix ac_top_srcdir=$ac_dots$srcdir ;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_dots$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:4485: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ configure_input="Generated automatically from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:4503: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:4516: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:4577: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:4588: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:4601: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in EOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\EOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end EOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\EOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, EOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\EOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated automatically by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:4718: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } fi rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Run the commands associated with the file. case $ac_file in include/config.h ) # update the timestamp echo timestamp >"include/stamp-h1" ;; esac done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` case $ac_dest in default-1 ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do case "$mf" in Makefile) dirpart=.;; */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;; *) continue;; esac grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`echo "$file" | sed -e 's|/[^/]*$||'` $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1 # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done EOF cat >>$CONFIG_STATUS <<\EOF { (exit 0); exit 0; } EOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi